diff mbox

[V2,11/27] staging: wilc1000: wilc_wlan_handle_txq: add argument and use wilc

Message ID 1445938083-20445-11-git-send-email-glen.lee@atmel.com (mailing list archive)
State Not Applicable
Delegated to: Kalle Valo
Headers show

Commit Message

Glen Lee Oct. 27, 2015, 9:27 a.m. UTC
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>
---
 drivers/staging/wilc1000/linux_wlan.c |  4 ++--
 drivers/staging/wilc1000/wilc_wlan.c  | 11 ++++++++---
 drivers/staging/wilc1000/wilc_wlan.h  |  2 +-
 3 files changed, 11 insertions(+), 6 deletions(-)

Comments

kernel test robot Oct. 27, 2015, 11:45 a.m. UTC | #1
Hi Glen,

[auto build test WARNING on staging/staging-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url:    https://github.com/0day-ci/linux/commits/Glen-Lee/staging-wicl1000-isr_uh_routine-use-netdev-private-wilc/20151027-173115
config: i386-allyesconfig (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from drivers/staging/wilc1000/coreconfigurator.c:13:0:
>> drivers/staging/wilc1000/wilc_wlan.h:303:33: warning: 'struct net_device' declared inside parameter list
    int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount);
                                    ^
>> drivers/staging/wilc1000/wilc_wlan.h:303:33: warning: its scope is only this definition or declaration, which is probably not what you want

vim +303 drivers/staging/wilc1000/wilc_wlan.h

   287	} wilc_cfg_frame_t;
   288	
   289	typedef struct {
   290		int (*wlan_tx)(u8 *, u32, wilc_tx_complete_func_t);
   291	} wilc_wlan_cfg_func_t;
   292	
   293	typedef struct {
   294		int type;
   295		u32 seq_no;
   296	} wilc_cfg_rsp_t;
   297	
   298	int wilc_wlan_firmware_download(const u8 *buffer, u32 buffer_size);
   299	int wilc_wlan_start(void);
   300	int wilc_wlan_stop(void);
   301	int wilc_wlan_txq_add_net_pkt(void *priv, u8 *buffer, u32 buffer_size,
   302				      wilc_tx_complete_func_t func);
 > 303	int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount);
   304	void wilc_handle_isr(void *wilc);
   305	void wilc_wlan_cleanup(void);
   306	int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size,
   307			      int commit, u32 drvHandler);
   308	int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler);
   309	int wilc_wlan_cfg_get_val(u32 wid, u8 *buffer, u32 buffer_size);
   310	int wilc_wlan_txq_add_mgmt_pkt(void *priv, u8 *buffer, u32 buffer_size,
   311				       wilc_tx_complete_func_t func);

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 5897f35..d9f1bf1 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)
 		}
 		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); */
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 4fa956a..907da93 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)
  *      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");
diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h
index a07375b..79b35e6 100644
--- a/drivers/staging/wilc1000/wilc_wlan.h
+++ b/drivers/staging/wilc1000/wilc_wlan.h
@@ -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,