staging: wilc1000: wilc_wlan_handle_txq: add argument and use wilc
authorGlen Lee <glen.lee@atmel.com>
Tue, 27 Oct 2015 09:27:47 +0000 (18:27 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Oct 2015 23:09:21 +0000 (08:09 +0900)
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>
drivers/staging/wilc1000/linux_wlan.c
drivers/staging/wilc1000/wilc_wlan.c
drivers/staging/wilc1000/wilc_wlan.h

index 5897f353430c397216d89c511a33e3c3cd4add81..d9f1bf1dc0d5316de80498d77bb295fad7710237 100644 (file)
@@ -476,10 +476,10 @@ static int linux_wlan_txq_task(void *vp)
                }
                PRINT_D(TX_DBG, "txq_task handle the sending packet and let me go to sleep.\n");
 #if !defined USE_TX_BACKOFF_DELAY_IF_NO_BUFFERS
-               ret = wilc_wlan_handle_txq(&txq_count);
+               ret = wilc_wlan_handle_txq(dev, &txq_count);
 #else
                do {
-                       ret = wilc_wlan_handle_txq(&txq_count);
+                       ret = wilc_wlan_handle_txq(dev, &txq_count);
                        if (txq_count < FLOW_CONTROL_LOWER_THRESHOLD /* && netif_queue_stopped(pd->wilc_netdev)*/) {
                                PRINT_D(TX_DBG, "Waking up queue\n");
                                /* netif_wake_queue(pd->wilc_netdev); */
index 4fa956a79f06a19d8ba2ccfd8dc4218bf8e06cf2..907da93d1c63b5ca3f86ebdc9e6dcd8fbbc0af88 100644 (file)
@@ -814,7 +814,7 @@ void chip_sleep_manually(u32 u32SleepTime)
  *      Tx, Rx queue handle functions
  *
  ********************************************/
-int wilc_wlan_handle_txq(u32 *pu32TxqCount)
+int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
 {
        wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
        int i, entries = 0;
@@ -828,13 +828,18 @@ int wilc_wlan_handle_txq(u32 *pu32TxqCount)
        int counter;
        int timeout;
        u32 vmm_table[WILC_VMM_TBL_SIZE];
+       perInterface_wlan_t *nic;
+       struct wilc *wilc;
+
+       nic = netdev_priv(dev);
+       wilc = nic->wilc;
 
        p->txq_exit = 0;
        do {
                if (p->quit)
                        break;
 
-               linux_wlan_lock_timeout(&g_linux_wlan->txq_add_to_head_cs,
+               linux_wlan_lock_timeout(&wilc->txq_add_to_head_cs,
                                        CFG_PKTS_TIMEOUT);
 #ifdef TCP_ACK_FILTER
                wilc_wlan_txq_filter_dup_tcp_ack();
@@ -1098,7 +1103,7 @@ _end_:
                if (ret != 1)
                        break;
        } while (0);
-       up(&g_linux_wlan->txq_add_to_head_cs);
+       up(&wilc->txq_add_to_head_cs);
 
        p->txq_exit = 1;
        PRINT_D(TX_DBG, "THREAD: Exiting txq\n");
index a07375ba38d7d3b66a0ec01d1ffa66d9229c05a6..79b35e670c52f0bd39b9dedb164042de0bfecba3 100644 (file)
@@ -300,7 +300,7 @@ int wilc_wlan_start(void);
 int wilc_wlan_stop(void);
 int wilc_wlan_txq_add_net_pkt(void *priv, u8 *buffer, u32 buffer_size,
                              wilc_tx_complete_func_t func);
-int wilc_wlan_handle_txq(u32 *pu32TxqCount);
+int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount);
 void wilc_handle_isr(void *wilc);
 void wilc_wlan_cleanup(void);
 int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size,