PRINT_D(INIT_DBG, "%d\n", *buff);
}
-static int linux_wlan_lock_timeout(void *vp, u32 timeout)
+int linux_wlan_lock_timeout(void *vp, u32 timeout)
{
int error = -1;
PRINT_D(INIT_DBG, "Linux to Wlan services ...\n");
nwi->os_context.os_private = (void *)nic;
- nwi->os_func.os_wait = linux_wlan_lock_timeout;
#ifdef WILC_SDIO
nwi->io_func.io_type = HIF_SDIO;
typedef struct {
void *os_context;
- wilc_wlan_os_func_t os_func;
u32 block_size;
int (*sdio_cmd52)(sdio_cmd52_t *);
int (*sdio_cmd53)(sdio_cmd53_t *);
g_sdio.dPrint = func;
g_sdio.os_context = inp->os_context.os_private;
- memcpy((void *)&g_sdio.os_func, (void *)&inp->os_func, sizeof(wilc_wlan_os_func_t));
if (inp->io_func.io_init) {
if (!inp->io_func.io_init(g_sdio.os_context)) {
/**
* input interface functions
**/
- wilc_wlan_os_func_t os_func;
wilc_wlan_io_func_t io_func;
/**
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
unsigned long flags;
- if (p->os_func.os_wait(&g_linux_wlan->txq_add_to_head_cs,
- CFG_PKTS_TIMEOUT))
+ if (linux_wlan_lock_timeout(&g_linux_wlan->txq_add_to_head_cs,
+ CFG_PKTS_TIMEOUT))
return -1;
spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags);
while (Dropped > 0) {
/*consume the semaphore count of the removed packet*/
- p->os_func.os_wait(&g_linux_wlan->txq_event, 1);
+ linux_wlan_lock_timeout(&g_linux_wlan->txq_event, 1);
Dropped--;
}
if (p->quit)
break;
- p->os_func.os_wait(&g_linux_wlan->txq_add_to_head_cs,
- CFG_PKTS_TIMEOUT);
+ linux_wlan_lock_timeout(&g_linux_wlan->txq_add_to_head_cs,
+ CFG_PKTS_TIMEOUT);
#ifdef TCP_ACK_FILTER
wilc_wlan_txq_filter_dup_tcp_ack();
#endif
if (wilc_wlan_cfg_commit(WILC_CFG_SET, drvHandler))
ret_size = 0;
- if (p->os_func.os_wait(&g_linux_wlan->cfg_event,
- CFG_PKTS_TIMEOUT)) {
+ if (linux_wlan_lock_timeout(&g_linux_wlan->cfg_event,
+ CFG_PKTS_TIMEOUT)) {
PRINT_D(TX_DBG, "Set Timed Out\n");
ret_size = 0;
}
ret_size = 0;
- if (p->os_func.os_wait(&g_linux_wlan->cfg_event,
- CFG_PKTS_TIMEOUT)) {
+ if (linux_wlan_lock_timeout(&g_linux_wlan->cfg_event,
+ CFG_PKTS_TIMEOUT)) {
PRINT_D(TX_DBG, "Get Timed Out\n");
ret_size = 0;
}
/**
* store the input
**/
- memcpy((void *)&g_wlan.os_func, (void *)&inp->os_func, sizeof(wilc_wlan_os_func_t));
memcpy((void *)&g_wlan.io_func, (void *)&inp->io_func, sizeof(wilc_wlan_io_func_t));
/***
* host interface init