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

staging: wilc1000: wlan_initialize_threads: change argument with net_device

This patch changes function argument with net_device and use netdev private
data member wilc instead of g_linux_wlan. And there are assignment code with
different value continuously. Take last code.
Signed-off-by: default avatarGlen Lee <glen.lee@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 472791a9
...@@ -1011,31 +1011,34 @@ void linux_to_wlan(wilc_wlan_inp_t *nwi, struct wilc *nic) ...@@ -1011,31 +1011,34 @@ void linux_to_wlan(wilc_wlan_inp_t *nwi, struct wilc *nic)
#endif #endif
} }
int wlan_initialize_threads(perInterface_wlan_t *nic) int wlan_initialize_threads(struct net_device *dev)
{ {
perInterface_wlan_t *nic;
struct wilc *wilc;
int ret = 0; int ret = 0;
nic = netdev_priv(dev);
wilc = nic->wilc;
PRINT_D(INIT_DBG, "Initializing Threads ...\n"); PRINT_D(INIT_DBG, "Initializing Threads ...\n");
/* create tx task */ /* create tx task */
PRINT_D(INIT_DBG, "Creating kthread for transmission\n"); PRINT_D(INIT_DBG, "Creating kthread for transmission\n");
g_linux_wlan->txq_thread = kthread_run(linux_wlan_txq_task, (void *)g_linux_wlan, "K_TXQ_TASK"); wilc->txq_thread = kthread_run(linux_wlan_txq_task, (void *)wilc,
if (g_linux_wlan->txq_thread == NULL) { "K_TXQ_TASK");
if (!wilc->txq_thread) {
PRINT_ER("couldn't create TXQ thread\n"); PRINT_ER("couldn't create TXQ thread\n");
ret = -ENOBUFS; ret = -ENOBUFS;
goto _fail_2; goto _fail_2;
} }
/* wait for TXQ task to start. */ /* wait for TXQ task to start. */
down(&g_linux_wlan->txq_thread_started); down(&wilc->txq_thread_started);
return 0; return 0;
_fail_2: _fail_2:
/*De-Initialize 2nd thread*/ /*De-Initialize 2nd thread*/
g_linux_wlan->close = 1; wilc->close = 0;
g_linux_wlan->close = 0;
return ret; return ret;
} }
...@@ -1084,7 +1087,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic) ...@@ -1084,7 +1087,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
} }
#endif #endif
ret = wlan_initialize_threads(nic); ret = wlan_initialize_threads(dev);
if (ret < 0) { if (ret < 0) {
PRINT_ER("Initializing Threads FAILED\n"); PRINT_ER("Initializing Threads FAILED\n");
ret = -EIO; ret = -EIO;
......
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