Commit b002e20d authored by Glen Lee's avatar Glen Lee Committed by Greg Kroah-Hartman

staging: wilc1000: remove function pointer os_wait

This patch removes function pointer os_wait which is pointer of
linux_wlan_lock_timeout and just call the real name function directly.
Remove also static from linux_wlan_lock_timeout declaration.
As os_wait is deleted, structure wilc_wlan_os_func_t is useless. Delete
wilc_wlan_os_func_t, os_func and it's related codes.
Signed-off-by: default avatarGlen Lee <glen.lee@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d2bfac00
...@@ -381,7 +381,7 @@ void linux_wlan_dbg(u8 *buff) ...@@ -381,7 +381,7 @@ void linux_wlan_dbg(u8 *buff)
PRINT_D(INIT_DBG, "%d\n", *buff); 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; int error = -1;
...@@ -1052,7 +1052,6 @@ void linux_to_wlan(wilc_wlan_inp_t *nwi, linux_wlan_t *nic) ...@@ -1052,7 +1052,6 @@ void linux_to_wlan(wilc_wlan_inp_t *nwi, linux_wlan_t *nic)
PRINT_D(INIT_DBG, "Linux to Wlan services ...\n"); PRINT_D(INIT_DBG, "Linux to Wlan services ...\n");
nwi->os_context.os_private = (void *)nic; nwi->os_context.os_private = (void *)nic;
nwi->os_func.os_wait = linux_wlan_lock_timeout;
#ifdef WILC_SDIO #ifdef WILC_SDIO
nwi->io_func.io_type = HIF_SDIO; nwi->io_func.io_type = HIF_SDIO;
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
typedef struct { typedef struct {
void *os_context; void *os_context;
wilc_wlan_os_func_t os_func;
u32 block_size; u32 block_size;
int (*sdio_cmd52)(sdio_cmd52_t *); int (*sdio_cmd52)(sdio_cmd52_t *);
int (*sdio_cmd53)(sdio_cmd53_t *); int (*sdio_cmd53)(sdio_cmd53_t *);
...@@ -586,7 +585,6 @@ static int sdio_init(wilc_wlan_inp_t *inp, wilc_debug_func func) ...@@ -586,7 +585,6 @@ static int sdio_init(wilc_wlan_inp_t *inp, wilc_debug_func func)
g_sdio.dPrint = func; g_sdio.dPrint = func;
g_sdio.os_context = inp->os_context.os_private; 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) {
if (!inp->io_func.io_init(g_sdio.os_context)) { if (!inp->io_func.io_init(g_sdio.os_context)) {
......
...@@ -220,5 +220,6 @@ void frmw_to_linux(u8 *buff, u32 size, u32 pkt_offset); ...@@ -220,5 +220,6 @@ void frmw_to_linux(u8 *buff, u32 size, u32 pkt_offset);
void linux_wlan_mac_indicate(int flag); void linux_wlan_mac_indicate(int flag);
void linux_wlan_rx_complete(void); void linux_wlan_rx_complete(void);
void linux_wlan_dbg(u8 *buff); void linux_wlan_dbg(u8 *buff);
int linux_wlan_lock_timeout(void *vp, u32 timeout);
#endif #endif
...@@ -30,7 +30,6 @@ typedef struct { ...@@ -30,7 +30,6 @@ typedef struct {
/** /**
* input interface functions * input interface functions
**/ **/
wilc_wlan_os_func_t os_func;
wilc_wlan_io_func_t io_func; wilc_wlan_io_func_t io_func;
/** /**
...@@ -223,7 +222,7 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe) ...@@ -223,7 +222,7 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe)
{ {
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan; wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
unsigned long flags; unsigned long flags;
if (p->os_func.os_wait(&g_linux_wlan->txq_add_to_head_cs, if (linux_wlan_lock_timeout(&g_linux_wlan->txq_add_to_head_cs,
CFG_PKTS_TIMEOUT)) CFG_PKTS_TIMEOUT))
return -1; return -1;
...@@ -452,7 +451,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(void) ...@@ -452,7 +451,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(void)
while (Dropped > 0) { while (Dropped > 0) {
/*consume the semaphore count of the removed packet*/ /*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--; Dropped--;
} }
...@@ -839,7 +838,7 @@ static int wilc_wlan_handle_txq(u32 *pu32TxqCount) ...@@ -839,7 +838,7 @@ static int wilc_wlan_handle_txq(u32 *pu32TxqCount)
if (p->quit) if (p->quit)
break; break;
p->os_func.os_wait(&g_linux_wlan->txq_add_to_head_cs, linux_wlan_lock_timeout(&g_linux_wlan->txq_add_to_head_cs,
CFG_PKTS_TIMEOUT); CFG_PKTS_TIMEOUT);
#ifdef TCP_ACK_FILTER #ifdef TCP_ACK_FILTER
wilc_wlan_txq_filter_dup_tcp_ack(); wilc_wlan_txq_filter_dup_tcp_ack();
...@@ -1777,7 +1776,7 @@ static int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size, in ...@@ -1777,7 +1776,7 @@ static int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size, in
if (wilc_wlan_cfg_commit(WILC_CFG_SET, drvHandler)) if (wilc_wlan_cfg_commit(WILC_CFG_SET, drvHandler))
ret_size = 0; ret_size = 0;
if (p->os_func.os_wait(&g_linux_wlan->cfg_event, if (linux_wlan_lock_timeout(&g_linux_wlan->cfg_event,
CFG_PKTS_TIMEOUT)) { CFG_PKTS_TIMEOUT)) {
PRINT_D(TX_DBG, "Set Timed Out\n"); PRINT_D(TX_DBG, "Set Timed Out\n");
ret_size = 0; ret_size = 0;
...@@ -1815,7 +1814,7 @@ static int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler) ...@@ -1815,7 +1814,7 @@ static int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler)
ret_size = 0; ret_size = 0;
if (p->os_func.os_wait(&g_linux_wlan->cfg_event, if (linux_wlan_lock_timeout(&g_linux_wlan->cfg_event,
CFG_PKTS_TIMEOUT)) { CFG_PKTS_TIMEOUT)) {
PRINT_D(TX_DBG, "Get Timed Out\n"); PRINT_D(TX_DBG, "Get Timed Out\n");
ret_size = 0; ret_size = 0;
...@@ -1963,7 +1962,6 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup) ...@@ -1963,7 +1962,6 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup)
/** /**
* store the input * 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)); memcpy((void *)&g_wlan.io_func, (void *)&inp->io_func, sizeof(wilc_wlan_io_func_t));
/*** /***
* host interface init * host interface init
......
...@@ -74,10 +74,6 @@ typedef struct { ...@@ -74,10 +74,6 @@ typedef struct {
u32 block_size; u32 block_size;
} sdio_cmd53_t; } sdio_cmd53_t;
typedef struct {
int (*os_wait)(void *, u32);
} wilc_wlan_os_func_t;
typedef struct { typedef struct {
int io_type; int io_type;
int (*io_init)(void *); int (*io_init)(void *);
...@@ -111,7 +107,6 @@ typedef struct { ...@@ -111,7 +107,6 @@ typedef struct {
typedef struct { typedef struct {
wilc_wlan_os_context_t os_context; wilc_wlan_os_context_t os_context;
wilc_wlan_os_func_t os_func;
wilc_wlan_io_func_t io_func; wilc_wlan_io_func_t io_func;
} wilc_wlan_inp_t; } wilc_wlan_inp_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment