4 * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
5 * Copyright (c) 2013 Intel Corporation. All rights reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
27 typedef void (*TcoreHalReceiveCallback)(TcoreHal *hal,
28 guint data_len, const void *data, void *user_data);
30 typedef TcoreHookReturn (*TcoreHalSendHook)(TcoreHal *hal,
31 guint data_len, void *data, void *user_data);
33 typedef void (*TcoreHalSetupNetifCallback)(CoreObject *co,
34 gint result, const gchar* devname, void *user_data);
37 TCORE_HAL_RECV_INDICATION,
38 TCORE_HAL_RECV_RESPONSE,
39 TCORE_HAL_RECV_NOTIFICATION,
40 TCORE_HAL_RECV_UNKNOWN
41 } TcoreHalRecvDataType;
44 TCORE_HAL_MODE_UNKNOWN,
46 TCORE_HAL_MODE_CUSTOM,
47 TCORE_HAL_MODE_TRANSPARENT
51 TelReturn (*power)(TcoreHal *hal, gboolean flag);
52 TelReturn (*send)(TcoreHal *hal, guint data_len, void *data);
53 TelReturn (*setup_netif)(CoreObject *co,
54 TcoreHalSetupNetifCallback func, void *user_data,
55 guint cid, gboolean enable);
58 TcoreHal *tcore_hal_new(TcorePlugin *plugin, const gchar *name,
59 TcoreHalOperations *hops, TcoreHalMode mode);
60 void tcore_hal_free(TcoreHal *hal);
62 TelReturn tcore_hal_set_name(TcoreHal *hal, const gchar *name);
63 gchar *tcore_hal_get_name(TcoreHal *hal);
65 TcoreAT *tcore_hal_get_at(TcoreHal *hal);
66 TcoreHalMode tcore_hal_get_mode(TcoreHal *hal);
67 TelReturn tcore_hal_set_mode(TcoreHal *hal, TcoreHalMode mode);
69 TelReturn tcore_hal_set_power(TcoreHal *hal, gboolean flag);
71 TelReturn tcore_hal_link_user_data(TcoreHal *hal, void *user_data);
72 void *tcore_hal_ref_user_data(TcoreHal *hal);
74 TelReturn tcore_hal_send_data(TcoreHal *hal, guint data_len, void *data);
75 TelReturn tcore_hal_send_request(TcoreHal *hal, TcorePending *pending);
76 TelReturn tcore_hal_send_force(TcoreHal *hal);
78 TelReturn tcore_hal_dispatch_response_data(TcoreHal *hal, guint id,
79 guint data_len, const void *data);
81 TelReturn tcore_hal_add_recv_callback(TcoreHal *hal,
82 TcoreHalReceiveCallback func, void *user_data);
83 TelReturn tcore_hal_remove_recv_callback(TcoreHal *hal,
84 TcoreHalReceiveCallback func);
85 TelReturn tcore_hal_emit_recv_callback(TcoreHal *hal,
86 guint data_len, const void *data);
87 TelReturn tcore_hal_add_send_hook(TcoreHal *hal,
88 TcoreHalSendHook func, void *user_data);
89 TelReturn tcore_hal_remove_send_hook(TcoreHal *hal,
90 TcoreHalSendHook func);
92 TelReturn tcore_hal_set_power_state(TcoreHal *hal, gboolean flag);
93 gboolean tcore_hal_get_power_state(TcoreHal *hal);
95 TcoreQueue *tcore_hal_ref_queue(TcoreHal *hal);
96 TcorePlugin *tcore_hal_ref_plugin(TcoreHal *hal);
98 TelReturn tcore_hal_setup_netif(TcoreHal *hal, CoreObject *co,
99 TcoreHalSetupNetifCallback func, void *user_data,
100 guint cid, gboolean enable);
106 #endif /* __HAL_H__ */