aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlen Lee <glen.lee@atmel.com>2015-10-27 05:27:47 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-28 19:09:21 -0400
commita1332cadbbe5c125ea333be8ab4b5eec2f6b2b73 (patch)
treec67e93e6f9334f4e7dafa66312dc876edf7de7b6
parent886875845a5d9f1d915fba17bd75d7bef38ebd6d (diff)
staging: wilc1000: wilc_wlan_handle_txq: add argument and use wilc
This patch adds argument net_device dev and use netdev private data memeber wilc instead of g_linux_wlan. Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/wilc1000/linux_wlan.c4
-rw-r--r--drivers/staging/wilc1000/wilc_wlan.c11
-rw-r--r--drivers/staging/wilc1000/wilc_wlan.h2
3 files changed, 11 insertions, 6 deletions
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 5897f353430c..d9f1bf1dc0d5 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -476,10 +476,10 @@ static int linux_wlan_txq_task(void *vp)
476 } 476 }
477 PRINT_D(TX_DBG, "txq_task handle the sending packet and let me go to sleep.\n"); 477 PRINT_D(TX_DBG, "txq_task handle the sending packet and let me go to sleep.\n");
478#if !defined USE_TX_BACKOFF_DELAY_IF_NO_BUFFERS 478#if !defined USE_TX_BACKOFF_DELAY_IF_NO_BUFFERS
479 ret = wilc_wlan_handle_txq(&txq_count); 479 ret = wilc_wlan_handle_txq(dev, &txq_count);
480#else 480#else
481 do { 481 do {
482 ret = wilc_wlan_handle_txq(&txq_count); 482 ret = wilc_wlan_handle_txq(dev, &txq_count);
483 if (txq_count < FLOW_CONTROL_LOWER_THRESHOLD /* && netif_queue_stopped(pd->wilc_netdev)*/) { 483 if (txq_count < FLOW_CONTROL_LOWER_THRESHOLD /* && netif_queue_stopped(pd->wilc_netdev)*/) {
484 PRINT_D(TX_DBG, "Waking up queue\n"); 484 PRINT_D(TX_DBG, "Waking up queue\n");
485 /* netif_wake_queue(pd->wilc_netdev); */ 485 /* netif_wake_queue(pd->wilc_netdev); */
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 4fa956a79f06..907da93d1c63 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -814,7 +814,7 @@ void chip_sleep_manually(u32 u32SleepTime)
814 * Tx, Rx queue handle functions 814 * Tx, Rx queue handle functions
815 * 815 *
816 ********************************************/ 816 ********************************************/
817int wilc_wlan_handle_txq(u32 *pu32TxqCount) 817int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
818{ 818{
819 wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan; 819 wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
820 int i, entries = 0; 820 int i, entries = 0;
@@ -828,13 +828,18 @@ int wilc_wlan_handle_txq(u32 *pu32TxqCount)
828 int counter; 828 int counter;
829 int timeout; 829 int timeout;
830 u32 vmm_table[WILC_VMM_TBL_SIZE]; 830 u32 vmm_table[WILC_VMM_TBL_SIZE];
831 perInterface_wlan_t *nic;
832 struct wilc *wilc;
833
834 nic = netdev_priv(dev);
835 wilc = nic->wilc;
831 836
832 p->txq_exit = 0; 837 p->txq_exit = 0;
833 do { 838 do {
834 if (p->quit) 839 if (p->quit)
835 break; 840 break;
836 841
837 linux_wlan_lock_timeout(&g_linux_wlan->txq_add_to_head_cs, 842 linux_wlan_lock_timeout(&wilc->txq_add_to_head_cs,
838 CFG_PKTS_TIMEOUT); 843 CFG_PKTS_TIMEOUT);
839#ifdef TCP_ACK_FILTER 844#ifdef TCP_ACK_FILTER
840 wilc_wlan_txq_filter_dup_tcp_ack(); 845 wilc_wlan_txq_filter_dup_tcp_ack();
@@ -1098,7 +1103,7 @@ _end_:
1098 if (ret != 1) 1103 if (ret != 1)
1099 break; 1104 break;
1100 } while (0); 1105 } while (0);
1101 up(&g_linux_wlan->txq_add_to_head_cs); 1106 up(&wilc->txq_add_to_head_cs);
1102 1107
1103 p->txq_exit = 1; 1108 p->txq_exit = 1;
1104 PRINT_D(TX_DBG, "THREAD: Exiting txq\n"); 1109 PRINT_D(TX_DBG, "THREAD: Exiting txq\n");
diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h
index a07375ba38d7..79b35e670c52 100644
--- a/drivers/staging/wilc1000/wilc_wlan.h
+++ b/drivers/staging/wilc1000/wilc_wlan.h
@@ -300,7 +300,7 @@ int wilc_wlan_start(void);
300int wilc_wlan_stop(void); 300int wilc_wlan_stop(void);
301int wilc_wlan_txq_add_net_pkt(void *priv, u8 *buffer, u32 buffer_size, 301int wilc_wlan_txq_add_net_pkt(void *priv, u8 *buffer, u32 buffer_size,
302 wilc_tx_complete_func_t func); 302 wilc_tx_complete_func_t func);
303int wilc_wlan_handle_txq(u32 *pu32TxqCount); 303int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount);
304void wilc_handle_isr(void *wilc); 304void wilc_handle_isr(void *wilc);
305void wilc_wlan_cleanup(void); 305void wilc_wlan_cleanup(void);
306int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size, 306int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size,