typedef void (*TcoreHalReceiveCallback)(TcoreHal *hal, unsigned int data_len, const void *data, void *user_data);
typedef enum tcore_hook_return (*TcoreHalSendHook)(TcoreHal *hal, unsigned int data_len, void *data, void *user_data);
+typedef void (*TcoreHalSetupNetifCallback)(CoreObject *co, const char* devname, void *user_data);
enum tcore_hal_recv_data_type {
TCORE_HAL_RECV_INDICATION,
struct tcore_hal_operations {
TReturn (*power)(TcoreHal *hal, gboolean flag);
TReturn (*send)(TcoreHal *hal, unsigned int data_len, void *data);
+ TReturn (*setup_netif)(CoreObject *co,
+ TcoreHalSetupNetifCallback func,
+ void *user_data, unsigned int cid,
+ gboolean enable);
};
TcoreHal* tcore_hal_new(TcorePlugin *plugin, const char *name,
TcoreQueue* tcore_hal_ref_queue(TcoreHal *hal);
TcorePlugin* tcore_hal_ref_plugin(TcoreHal *hal);
+TReturn tcore_hal_setup_netif(TcoreHal *hal, CoreObject *co,
+ TcoreHalSetupNetifCallback func,
+ void *user_data, unsigned int cid,
+ gboolean enable);
+
+
__END_DECLS
#endif
return hal->ops->power(hal, flag);
}
+
+TReturn tcore_hal_setup_netif(TcoreHal *hal, CoreObject *co,
+ TcoreHalSetupNetifCallback func,
+ void *user_data, unsigned int cid,
+ gboolean enable)
+{
+ if (!hal || !hal->ops || !hal->ops->setup_netif)
+ return TCORE_RETURN_EINVAL;
+
+ return hal->ops->setup_netif(co, func, user_data, cid, enable);
+}
return TCORE_RETURN_SUCCESS;
}
+static TReturn tcore_cmux_hal_setup_netif(CoreObject *co,
+ TcoreHalSetupNetifCallback func,
+ void *user_data, unsigned int cid,
+ gboolean enable)
+{
+ TcoreHal *hal = g_mux_obj_ptr->phy_hal;
+
+ if (hal == NULL)
+ return TCORE_RETURN_EINVAL;
+
+ return tcore_hal_setup_netif(hal, co, func, user_data, cid, enable);
+}
+
/* CMUX supported HAL (Logical HAL) operations */
static struct tcore_hal_operations mux_hops = {
.power = tcore_cmux_hal_power,
.send = tcore_cmux_hal_send,
+ .setup_netif = tcore_cmux_hal_setup_netif,
};
static TReturn tcore_cmux_send_data(int data_len, unsigned char *data)