All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan
@ 2015-10-14 11:46 Tony Cho
  2015-10-14 11:46 ` [PATCH 02/16] staging: wilc1000: remove typedef from the linux_wlan_t Tony Cho
                   ` (14 more replies)
  0 siblings, 15 replies; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

This patch removes extern declaration of g_linux_wlan from the
followings because it is declared as extern in the wilc_wfi_netdevice.h
file.

- linux_mon.c
- linux_wlan_sdio.c
- wilc_wfi_cfgoperations.c

Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/linux_mon.c              | 2 --
 drivers/staging/wilc1000/linux_wlan_sdio.c        | 1 -
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 --
 3 files changed, 5 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index bde4095..450af1b 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -24,8 +24,6 @@ struct wilc_wfi_radiotap_cb_hdr {
 	u16 tx_flags;
 } __attribute__((packed));
 
-extern linux_wlan_t *g_linux_wlan;
-
 static struct net_device *wilc_wfi_mon; /* global monitor netdev */
 
 extern int  mac_xmit(struct sk_buff *skb, struct net_device *dev);
diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c
index b1c6b6f..ebacd29 100644
--- a/drivers/staging/wilc1000/linux_wlan_sdio.c
+++ b/drivers/staging/wilc1000/linux_wlan_sdio.c
@@ -23,7 +23,6 @@
 
 
 struct sdio_func *local_sdio_func;
-extern linux_wlan_t *g_linux_wlan;
 extern int wilc_netdev_init(void);
 extern void wilc_handle_isr(void);
 
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 706912b..a950b04 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -35,7 +35,6 @@ static u8 op_ifcs;
 extern u8 u8ConnectedSSID[6];
 
 u8 g_wilc_initialized = 1;
-extern linux_wlan_t *g_linux_wlan;
 extern bool g_obtainingIP;
 
 #define CHAN2G(_channel, _freq, _flags) {	 \
@@ -2192,7 +2191,6 @@ void WILC_WFI_add_wilcvendorspec(u8 *buff)
  *  @date	01 JUL 2012
  *  @version
  */
-extern linux_wlan_t *g_linux_wlan;
 extern bool bEnablePS;
 static int mgmt_tx(struct wiphy *wiphy,
 		   struct wireless_dev *wdev,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 02/16] staging: wilc1000: remove typedef from the linux_wlan_t
  2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
@ 2015-10-14 11:46 ` Tony Cho
  2015-10-14 11:46 ` [PATCH 03/16] staging: wilc1000: rename g_linux_wlan to wl Tony Cho
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

This patch removes typedef from the struct linux_wlan_t and renames it
to the wilc. In addition, all of linux_wlan_t is replaced with struct wilc
and memory allocation style is changed with preferred form as well like the
following:
	p = kmalloc(sizeof(*p), ...) where "struct wilc" is used

Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/linux_wlan.c             | 38 +++++++++++------------
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  2 +-
 drivers/staging/wilc1000/wilc_wfi_netdevice.h     |  8 ++---
 3 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index ccab89f..b879b8b 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -49,7 +49,7 @@ extern bool g_obtainingIP;
 extern u16 Set_machw_change_vir_if(bool bValue);
 extern void resolve_disconnect_aberration(void *drvHandler);
 extern u8 gau8MulticastMacAddrList[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN];
-void wilc1000_wlan_deinit(linux_wlan_t *nic);
+void wilc1000_wlan_deinit(struct wilc *nic);
 extern struct timer_list hDuringIpTimer;
 
 static int linux_wlan_device_power(int on_off)
@@ -96,8 +96,8 @@ static struct notifier_block g_dev_notifier = {
  */
 static struct semaphore close_exit_sync;
 
-static int wlan_deinit_locks(linux_wlan_t *nic);
-static void wlan_deinitialize_threads(linux_wlan_t *nic);
+static int wlan_deinit_locks(struct wilc *nic);
+static void wlan_deinitialize_threads(struct wilc *nic);
 extern void WILC_WFI_monitor_rx(u8 *buff, u32 size);
 extern void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, u32 size);
 
@@ -114,7 +114,7 @@ static void wilc_set_multicast_list(struct net_device *dev);
  * for now - in frmw_to_linux there should be private data to be passed to it
  * and this data should be pointer to net device
  */
-linux_wlan_t *g_linux_wlan;
+struct wilc *g_linux_wlan;
 bool bEnablePS = true;
 
 static const struct net_device_ops wilc_netdev_ops = {
@@ -243,9 +243,9 @@ static irqreturn_t isr_uh_routine(int irq, void *user_data)
 
 irqreturn_t isr_bh_routine(int irq, void *userdata)
 {
-	linux_wlan_t *nic;
+	struct wilc *nic;
 
-	nic = (linux_wlan_t *)userdata;
+	nic = (struct wilc *)userdata;
 
 	/*While mac is closing cacncel the handling of any interrupts received*/
 	if (g_linux_wlan->close) {
@@ -260,10 +260,10 @@ irqreturn_t isr_bh_routine(int irq, void *userdata)
 }
 
 #if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
-static int init_irq(linux_wlan_t *p_nic)
+static int init_irq(struct wilc *p_nic)
 {
 	int ret = 0;
-	linux_wlan_t *nic = p_nic;
+	struct wilc *nic = p_nic;
 
 	/*initialize GPIO and register IRQ num*/
 	/*GPIO request*/
@@ -299,7 +299,7 @@ static int init_irq(linux_wlan_t *p_nic)
 }
 #endif
 
-static void deinit_irq(linux_wlan_t *nic)
+static void deinit_irq(struct wilc *nic)
 {
 #if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
 	/* Deintialize IRQ */
@@ -336,7 +336,7 @@ void linux_wlan_mac_indicate(int flag)
 	/*I have to do it that way becuase there is no mean to encapsulate device pointer
 	 * as a parameter
 	 */
-	linux_wlan_t *pd = g_linux_wlan;
+	struct wilc *pd = g_linux_wlan;
 	int status;
 
 	if (flag == WILC_MAC_INDICATE_STATUS) {
@@ -594,7 +594,7 @@ static int linux_wlan_start_firmware(perInterface_wlan_t *nic)
 _fail_:
 	return ret;
 }
-static int linux_wlan_firmware_download(linux_wlan_t *p_nic)
+static int linux_wlan_firmware_download(struct wilc *p_nic)
 {
 
 	int ret = 0;
@@ -626,7 +626,7 @@ _FAIL_:
 }
 
 /* startup configuration - could be changed later using iconfig*/
-static int linux_wlan_init_test_config(struct net_device *dev, linux_wlan_t *p_nic)
+static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_nic)
 {
 
 	unsigned char c_val[64];
@@ -882,7 +882,7 @@ _fail_:
 }
 
 /**************************/
-void wilc1000_wlan_deinit(linux_wlan_t *nic)
+void wilc1000_wlan_deinit(struct wilc *nic)
 {
 
 	if (g_linux_wlan->wilc1000_initialized)	{
@@ -944,7 +944,7 @@ void wilc1000_wlan_deinit(linux_wlan_t *nic)
 	}
 }
 
-int wlan_init_locks(linux_wlan_t *p_nic)
+int wlan_init_locks(struct wilc *p_nic)
 {
 
 	PRINT_D(INIT_DBG, "Initializing Locks ...\n");
@@ -965,7 +965,7 @@ int wlan_init_locks(linux_wlan_t *p_nic)
 	return 0;
 }
 
-static int wlan_deinit_locks(linux_wlan_t *nic)
+static int wlan_deinit_locks(struct wilc *nic)
 {
 	PRINT_D(INIT_DBG, "De-Initializing Locks\n");
 
@@ -977,7 +977,7 @@ static int wlan_deinit_locks(linux_wlan_t *nic)
 
 	return 0;
 }
-void linux_to_wlan(wilc_wlan_inp_t *nwi, linux_wlan_t *nic)
+void linux_to_wlan(wilc_wlan_inp_t *nwi, struct wilc *nic)
 {
 
 	PRINT_D(INIT_DBG, "Linux to Wlan services ...\n");
@@ -1031,7 +1031,7 @@ _fail_2:
 	return ret;
 }
 
-static void wlan_deinitialize_threads(linux_wlan_t *nic)
+static void wlan_deinitialize_threads(struct wilc *nic)
 {
 
 	g_linux_wlan->close = 1;
@@ -1053,7 +1053,7 @@ extern u8 core_11b_ready(void);
 
 #define READY_CHECK_THRESHOLD		30
 extern void wilc_wlan_global_reset(void);
-u8 wilc1000_prepare_11b_core(wilc_wlan_inp_t *nwi, linux_wlan_t *nic)
+u8 wilc1000_prepare_11b_core(wilc_wlan_inp_t *nwi, struct wilc *nic)
 {
 	u8 trials = 0;
 
@@ -1714,7 +1714,7 @@ int wilc_netdev_init(void)
 	sema_init(&close_exit_sync, 0);
 
 	/*create the common structure*/
-	g_linux_wlan = kzalloc(sizeof(linux_wlan_t), GFP_KERNEL);
+	g_linux_wlan = kzalloc(sizeof(*g_linux_wlan), GFP_KERNEL);
 	if (!g_linux_wlan)
 		return -ENOMEM;
 
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index a950b04..08ba5ba 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -2523,7 +2523,7 @@ static int set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
  *  @date	01 MAR 2012
  *  @version	1.0
  */
-void wilc1000_wlan_deinit(linux_wlan_t *nic);
+void wilc1000_wlan_deinit(struct wilc *nic);
 int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic);
 
 static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 8bcfcc2..373959b 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -154,7 +154,8 @@ typedef struct {
 	struct host_if_drv *drvHandler;
 	struct net_device *wilc_netdev;
 } tstrInterfaceInfo;
-typedef struct {
+
+struct wilc {
 	int mac_status;
 	int wilc1000_initialized;
 	#if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO)
@@ -188,8 +189,7 @@ typedef struct {
 #else
 	struct spi_device *wilc_spidev;
 #endif
-
-} linux_wlan_t;
+};
 
 typedef struct {
 	u8 u8IfIdx;
@@ -206,7 +206,7 @@ struct WILC_WFI_mon_priv {
 	struct net_device *real_ndev;
 };
 
-extern linux_wlan_t *g_linux_wlan;
+extern struct wilc *g_linux_wlan;
 extern struct net_device *WILC_WFI_devs[];
 void frmw_to_linux(u8 *buff, u32 size, u32 pkt_offset);
 void linux_wlan_mac_indicate(int flag);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 03/16] staging: wilc1000: rename g_linux_wlan to wl
  2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
  2015-10-14 11:46 ` [PATCH 02/16] staging: wilc1000: remove typedef from the linux_wlan_t Tony Cho
@ 2015-10-14 11:46 ` Tony Cho
  2015-10-17  4:33   ` Greg KH
  2015-10-14 11:46 ` [PATCH 04/16] staging: wilc1000: remove typedef from the tstrInterfaceInfo Tony Cho
                   ` (12 subsequent siblings)
  14 siblings, 1 reply; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

This patch renames g_linux_wlan to wl.

Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/linux_wlan.c             | 289 +++++++++++-----------
 drivers/staging/wilc1000/linux_wlan_sdio.c        |   4 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 114 ++++-----
 drivers/staging/wilc1000/wilc_wfi_netdevice.h     |   2 +-
 drivers/staging/wilc1000/wilc_wlan.c              |  72 +++---
 5 files changed, 237 insertions(+), 244 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index b879b8b..6a98660 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -114,7 +114,7 @@ static void wilc_set_multicast_list(struct net_device *dev);
  * for now - in frmw_to_linux there should be private data to be passed to it
  * and this data should be pointer to net device
  */
-struct wilc *g_linux_wlan;
+struct wilc *wl;
 bool bEnablePS = true;
 
 static const struct net_device_ops wilc_netdev_ops = {
@@ -233,7 +233,7 @@ static irqreturn_t isr_uh_routine(int irq, void *user_data)
 	PRINT_D(INT_DBG, "Interrupt received UH\n");
 
 	/*While mac is closing cacncel the handling of any interrupts received*/
-	if (g_linux_wlan->close) {
+	if (wl->close) {
 		PRINT_ER("Driver is CLOSING: Can't handle UH interrupt\n");
 		return IRQ_HANDLED;
 	}
@@ -248,7 +248,7 @@ irqreturn_t isr_bh_routine(int irq, void *userdata)
 	nic = (struct wilc *)userdata;
 
 	/*While mac is closing cacncel the handling of any interrupts received*/
-	if (g_linux_wlan->close) {
+	if (wl->close) {
 		PRINT_ER("Driver is CLOSING: Can't handle BH interrupt\n");
 		return IRQ_HANDLED;
 	}
@@ -304,7 +304,7 @@ static void deinit_irq(struct wilc *nic)
 #if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
 	/* Deintialize IRQ */
 	if (&nic->dev_irq_num != 0) {
-		free_irq(nic->dev_irq_num, g_linux_wlan);
+		free_irq(nic->dev_irq_num, wl);
 
 		gpio_free(GPIO_NUM);
 	}
@@ -336,7 +336,7 @@ void linux_wlan_mac_indicate(int flag)
 	/*I have to do it that way becuase there is no mean to encapsulate device pointer
 	 * as a parameter
 	 */
-	struct wilc *pd = g_linux_wlan;
+	struct wilc *pd = wl;
 	int status;
 
 	if (flag == WILC_MAC_INDICATE_STATUS) {
@@ -366,24 +366,21 @@ struct net_device *GetIfHandler(u8 *pMacHeader)
 	Bssid  = pMacHeader + 10;
 	Bssid1 = pMacHeader + 4;
 
-	for (i = 0; i < g_linux_wlan->u8NoIfcs; i++) {
-		if (!memcmp(Bssid1, g_linux_wlan->strInterfaceInfo[i].aBSSID, ETH_ALEN) ||
-		    !memcmp(Bssid, g_linux_wlan->strInterfaceInfo[i].aBSSID, ETH_ALEN))	{
-			return g_linux_wlan->strInterfaceInfo[i].wilc_netdev;
-		}
-	}
+	for (i = 0; i < wl->u8NoIfcs; i++)
+		if (!memcmp(Bssid1, wl->strInterfaceInfo[i].aBSSID, ETH_ALEN) ||
+		    !memcmp(Bssid, wl->strInterfaceInfo[i].aBSSID, ETH_ALEN))
+			return wl->strInterfaceInfo[i].wilc_netdev;
+
 	PRINT_INFO(INIT_DBG, "Invalide handle\n");
 	for (i = 0; i < 25; i++)
 		PRINT_D(INIT_DBG, "%02x ", pMacHeader[i]);
 	Bssid  = pMacHeader + 18;
 	Bssid1 = pMacHeader + 12;
-	for (i = 0; i < g_linux_wlan->u8NoIfcs; i++) {
-		if (!memcmp(Bssid1, g_linux_wlan->strInterfaceInfo[i].aBSSID, ETH_ALEN) ||
-		    !memcmp(Bssid, g_linux_wlan->strInterfaceInfo[i].aBSSID, ETH_ALEN))	{
-			PRINT_D(INIT_DBG, "Ctx [%p]\n", g_linux_wlan->strInterfaceInfo[i].wilc_netdev);
-			return g_linux_wlan->strInterfaceInfo[i].wilc_netdev;
-		}
-	}
+	for (i = 0; i < wl->u8NoIfcs; i++)
+		if (!memcmp(Bssid1, wl->strInterfaceInfo[i].aBSSID, ETH_ALEN) ||
+		    !memcmp(Bssid, wl->strInterfaceInfo[i].aBSSID, ETH_ALEN))
+			return wl->strInterfaceInfo[i].wilc_netdev;
+
 	PRINT_INFO(INIT_DBG, "\n");
 	return NULL;
 }
@@ -394,14 +391,13 @@ int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID)
 	int ret = -1;
 
 	PRINT_D(INIT_DBG, "set bssid on[%p]\n", wilc_netdev);
-	for (i = 0; i < g_linux_wlan->u8NoIfcs; i++) {
-		if (g_linux_wlan->strInterfaceInfo[i].wilc_netdev == wilc_netdev) {
-			PRINT_D(INIT_DBG, "set bssid [%x][%x][%x]\n", pBSSID[0], pBSSID[1], pBSSID[2]);
-			memcpy(g_linux_wlan->strInterfaceInfo[i].aBSSID, pBSSID, 6);
+	for (i = 0; i < wl->u8NoIfcs; i++)
+		if (wl->strInterfaceInfo[i].wilc_netdev == wilc_netdev) {
+			memcpy(wl->strInterfaceInfo[i].aBSSID, pBSSID, 6);
 			ret = 0;
 			break;
 		}
-	}
+
 	return ret;
 }
 
@@ -412,10 +408,10 @@ int linux_wlan_get_num_conn_ifcs(void)
 	u8 null_bssid[6] = {0};
 	u8 ret_val = 0;
 
-	for (i = 0; i < g_linux_wlan->u8NoIfcs; i++) {
-		if (memcmp(g_linux_wlan->strInterfaceInfo[i].aBSSID, null_bssid, 6))
+	for (i = 0; i < wl->u8NoIfcs; i++)
+		if (memcmp(wl->strInterfaceInfo[i].aBSSID, null_bssid, 6))
 			ret_val++;
-	}
+
 	return ret_val;
 }
 
@@ -435,17 +431,17 @@ static int linux_wlan_txq_task(void *vp)
 #endif
 
 	/* inform wilc1000_wlan_init that TXQ task is started. */
-	up(&g_linux_wlan->txq_thread_started);
+	up(&wl->txq_thread_started);
 	while (1) {
 
 		PRINT_D(TX_DBG, "txq_task Taking a nap :)\n");
-		down(&g_linux_wlan->txq_event);
+		down(&wl->txq_event);
 		/* wait_for_completion(&pd->txq_event); */
 		PRINT_D(TX_DBG, "txq_task Who waked me up :$\n");
 
-		if (g_linux_wlan->close) {
+		if (wl->close) {
 			/*Unlock the mutex in the mac_close function to indicate the exiting of the TX thread */
-			up(&g_linux_wlan->txq_thread_started);
+			up(&wl->txq_thread_started);
 
 			while (!kthread_should_stop())
 				schedule();
@@ -462,10 +458,10 @@ static int linux_wlan_txq_task(void *vp)
 			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); */
-				if (netif_queue_stopped(g_linux_wlan->strInterfaceInfo[0].wilc_netdev))
-					netif_wake_queue(g_linux_wlan->strInterfaceInfo[0].wilc_netdev);
-				if (netif_queue_stopped(g_linux_wlan->strInterfaceInfo[1].wilc_netdev))
-					netif_wake_queue(g_linux_wlan->strInterfaceInfo[1].wilc_netdev);
+				if (netif_queue_stopped(wl->strInterfaceInfo[0].wilc_netdev))
+					netif_wake_queue(wl->strInterfaceInfo[0].wilc_netdev);
+				if (netif_queue_stopped(wl->strInterfaceInfo[1].wilc_netdev))
+					netif_wake_queue(wl->strInterfaceInfo[1].wilc_netdev);
 			}
 
 			if (ret == WILC_TX_ERR_NO_BUF) { /* failed to allocate buffers in chip. */
@@ -487,7 +483,7 @@ static int linux_wlan_txq_task(void *vp)
 				}
 			}
 			/*TODO: drop packets after a certain time/number of retry count. */
-		} while (ret == WILC_TX_ERR_NO_BUF && !g_linux_wlan->close); /* retry sending packets if no more buffers in chip. */
+		} while (ret == WILC_TX_ERR_NO_BUF && !wl->close); /* retry sending packets if no more buffers in chip. */
 #endif
 	}
 	return 0;
@@ -530,19 +526,19 @@ int linux_wlan_get_firmware(perInterface_wlan_t *p_nic)
 	 *      root file system with the name specified above */
 
 #ifdef WILC_SDIO
-	if (request_firmware(&wilc_firmware, firmware, &g_linux_wlan->wilc_sdio_func->dev) != 0) {
+	if (request_firmware(&wilc_firmware, firmware, &wl->wilc_sdio_func->dev) != 0) {
 		PRINT_ER("%s - firmare not available\n", firmware);
 		ret = -1;
 		goto _fail_;
 	}
 #else
-	if (request_firmware(&wilc_firmware, firmware, &g_linux_wlan->wilc_spidev->dev) != 0) {
+	if (request_firmware(&wilc_firmware, firmware, &wl->wilc_spidev->dev) != 0) {
 		PRINT_ER("%s - firmare not available\n", firmware);
 		ret = -1;
 		goto _fail_;
 	}
 #endif
-	g_linux_wlan->wilc_firmware = wilc_firmware;
+	wl->wilc_firmware = wilc_firmware;
 
 _fail_:
 
@@ -568,7 +564,7 @@ static int linux_wlan_start_firmware(perInterface_wlan_t *nic)
 
 	/* wait for mac ready */
 	PRINT_D(INIT_DBG, "Waiting for Firmware to get ready ...\n");
-	ret = linux_wlan_lock_timeout(&g_linux_wlan->sync_event, 5000);
+	ret = linux_wlan_lock_timeout(&wl->sync_event, 5000);
 	if (ret) {
 #ifdef COMPLEMENT_BOOT
 		static int timeout = 5;
@@ -599,7 +595,7 @@ static int linux_wlan_firmware_download(struct wilc *p_nic)
 
 	int ret = 0;
 
-	if (g_linux_wlan->wilc_firmware == NULL) {
+	if (!wl->wilc_firmware) {
 		PRINT_ER("Firmware buffer is NULL\n");
 		ret = -ENOBUFS;
 		goto _FAIL_;
@@ -608,16 +604,16 @@ static int linux_wlan_firmware_download(struct wilc *p_nic)
 	 *      do the firmware download
 	 **/
 	PRINT_D(INIT_DBG, "Downloading Firmware ...\n");
-	ret = wilc_wlan_firmware_download(g_linux_wlan->wilc_firmware->data,
-					  g_linux_wlan->wilc_firmware->size);
+	ret = wilc_wlan_firmware_download(wl->wilc_firmware->data,
+					  wl->wilc_firmware->size);
 	if (ret < 0)
 		goto _FAIL_;
 
 	/* Freeing FW buffer */
 	PRINT_D(INIT_DBG, "Freeing FW buffer ...\n");
 	PRINT_D(INIT_DBG, "Releasing firmware\n");
-	release_firmware(g_linux_wlan->wilc_firmware);
-	g_linux_wlan->wilc_firmware = NULL;
+	release_firmware(wl->wilc_firmware);
+	wl->wilc_firmware = NULL;
 
 	PRINT_D(INIT_DBG, "Download Succeeded\n");
 
@@ -885,7 +881,7 @@ _fail_:
 void wilc1000_wlan_deinit(struct wilc *nic)
 {
 
-	if (g_linux_wlan->wilc1000_initialized)	{
+	if (wl->wilc1000_initialized) {
 
 		printk("Deinitializing wilc1000  ...\n");
 
@@ -903,18 +899,18 @@ void wilc1000_wlan_deinit(struct wilc *nic)
 
 		PRINT_D(INIT_DBG, "Disabling IRQ\n");
 #ifdef WILC_SDIO
-		mutex_lock(&g_linux_wlan->hif_cs);
+		mutex_lock(&wl->hif_cs);
 		disable_sdio_interrupt();
-		mutex_unlock(&g_linux_wlan->hif_cs);
+		mutex_unlock(&wl->hif_cs);
 #endif
-		if (&g_linux_wlan->txq_event != NULL)
-			up(&g_linux_wlan->txq_event);
+		if (&wl->txq_event)
+			up(&wl->txq_event);
 
 		PRINT_D(INIT_DBG, "Deinitializing Threads\n");
 		wlan_deinitialize_threads(nic);
 
 		PRINT_D(INIT_DBG, "Deinitializing IRQ\n");
-		deinit_irq(g_linux_wlan);
+		deinit_irq(wl);
 
 		wilc_wlan_stop();
 
@@ -924,18 +920,18 @@ void wilc1000_wlan_deinit(struct wilc *nic)
   #if defined(PLAT_ALLWINNER_A20) || defined(PLAT_ALLWINNER_A23) || defined(PLAT_ALLWINNER_A31)
 		PRINT_D(INIT_DBG, "Disabling IRQ 2\n");
 
-		mutex_lock(&g_linux_wlan->hif_cs);
+		mutex_lock(&wl->hif_cs);
 		disable_sdio_interrupt();
-		mutex_unlock(&g_linux_wlan->hif_cs);
+		mutex_unlock(&wl->hif_cs);
   #endif
 #endif
 
 		/*De-Initialize locks*/
 		PRINT_D(INIT_DBG, "Deinitializing Locks\n");
-		wlan_deinit_locks(g_linux_wlan);
+		wlan_deinit_locks(wl);
 
 		/* announce that wilc1000 is not initialized */
-		g_linux_wlan->wilc1000_initialized = 0;
+		wl->wilc1000_initialized = 0;
 
 		PRINT_D(INIT_DBG, "wilc1000 deinitialization Done\n");
 
@@ -949,18 +945,16 @@ int wlan_init_locks(struct wilc *p_nic)
 
 	PRINT_D(INIT_DBG, "Initializing Locks ...\n");
 
-	mutex_init(&g_linux_wlan->hif_cs);
-	mutex_init(&g_linux_wlan->rxq_cs);
-
-	spin_lock_init(&g_linux_wlan->txq_spinlock);
-	sema_init(&g_linux_wlan->txq_add_to_head_cs, 1);
+	mutex_init(&wl->hif_cs);
+	mutex_init(&wl->rxq_cs);
 
-	sema_init(&g_linux_wlan->txq_event, 0);
+	spin_lock_init(&wl->txq_spinlock);
 
-	sema_init(&g_linux_wlan->cfg_event, 0);
-	sema_init(&g_linux_wlan->sync_event, 0);
-
-	sema_init(&g_linux_wlan->txq_thread_started, 0);
+	sema_init(&wl->txq_add_to_head_cs, 1);
+	sema_init(&wl->txq_event, 0);
+	sema_init(&wl->cfg_event, 0);
+	sema_init(&wl->sync_event, 0);
+	sema_init(&wl->txq_thread_started, 0);
 
 	return 0;
 }
@@ -969,11 +963,11 @@ static int wlan_deinit_locks(struct wilc *nic)
 {
 	PRINT_D(INIT_DBG, "De-Initializing Locks\n");
 
-	if (&g_linux_wlan->hif_cs != NULL)
-		mutex_destroy(&g_linux_wlan->hif_cs);
+	if (&wl->hif_cs)
+		mutex_destroy(&wl->hif_cs);
 
-	if (&g_linux_wlan->rxq_cs != NULL)
-		mutex_destroy(&g_linux_wlan->rxq_cs);
+	if (&wl->rxq_cs)
+		mutex_destroy(&wl->rxq_cs);
 
 	return 0;
 }
@@ -1012,37 +1006,37 @@ int wlan_initialize_threads(perInterface_wlan_t *nic)
 
 	/* create tx task */
 	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");
-	if (g_linux_wlan->txq_thread == NULL) {
+	wl->txq_thread = kthread_run(linux_wlan_txq_task, (void *)wl, "K_TXQ_TASK");
+	if (!wl->txq_thread) {
 		PRINT_ER("couldn't create TXQ thread\n");
 		ret = -ENOBUFS;
 		goto _fail_2;
 	}
 	/* wait for TXQ task to start. */
-	down(&g_linux_wlan->txq_thread_started);
+	down(&wl->txq_thread_started);
 
 	return 0;
 
 _fail_2:
 	/*De-Initialize 2nd thread*/
-	g_linux_wlan->close = 1;
+	wl->close = 1;
 
-	g_linux_wlan->close = 0;
+	wl->close = 0;
 	return ret;
 }
 
 static void wlan_deinitialize_threads(struct wilc *nic)
 {
 
-	g_linux_wlan->close = 1;
+	wl->close = 1;
 	PRINT_D(INIT_DBG, "Deinitializing Threads\n");
 
-	if (&g_linux_wlan->txq_event != NULL)
-		up(&g_linux_wlan->txq_event);
+	if (&wl->txq_event)
+		up(&wl->txq_event);
 
-	if (g_linux_wlan->txq_thread != NULL) {
-		kthread_stop(g_linux_wlan->txq_thread);
-		g_linux_wlan->txq_thread = NULL;
+	if (wl->txq_thread) {
+		kthread_stop(wl->txq_thread);
+		wl->txq_thread = NULL;
 	}
 }
 
@@ -1074,7 +1068,7 @@ u8 wilc1000_prepare_11b_core(wilc_wlan_inp_t *nwi, struct wilc *nic)
 		while (!probe)
 			msleep(100);
 		probe = 0;
-		g_linux_wlan->wilc_sdio_func = local_sdio_func;
+		wl->wilc_sdio_func = local_sdio_func;
 		linux_to_wlan(nwi, nic);
 		wilc_wlan_init(nwi);
 	}
@@ -1107,11 +1101,11 @@ int repeat_power_cycle(perInterface_wlan_t *nic)
 	while (!probe)
 		msleep(100);
 	probe = 0;
-	g_linux_wlan->wilc_sdio_func = local_sdio_func;
-	linux_to_wlan(&nwi, g_linux_wlan);
+	wl->wilc_sdio_func = local_sdio_func;
+	linux_to_wlan(&nwi, wl);
 	ret = wilc_wlan_init(&nwi);
 
-	g_linux_wlan->mac_status = WILC_MAC_STATUS_INIT;
+	wl->mac_status = WILC_MAC_STATUS_INIT;
 	#if (defined WILC_SDIO) && (!defined WILC_SDIO_IRQ_GPIO)
 	enable_sdio_interrupt();
 	#endif
@@ -1123,7 +1117,7 @@ int repeat_power_cycle(perInterface_wlan_t *nic)
 	}
 
 	/*Download firmware*/
-	ret = linux_wlan_firmware_download(g_linux_wlan);
+	ret = linux_wlan_firmware_download(wl);
 	if (ret < 0) {
 		PRINT_ER("Failed to download firmware\n");
 		goto __fail__;
@@ -1143,14 +1137,14 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
 	perInterface_wlan_t *nic = p_nic;
 	int ret = 0;
 
-	if (!g_linux_wlan->wilc1000_initialized) {
-		g_linux_wlan->mac_status = WILC_MAC_STATUS_INIT;
-		g_linux_wlan->close = 0;
-		g_linux_wlan->wilc1000_initialized = 0;
+	if (!wl->wilc1000_initialized) {
+		wl->mac_status = WILC_MAC_STATUS_INIT;
+		wl->close = 0;
+		wl->wilc1000_initialized = 0;
 
-		wlan_init_locks(g_linux_wlan);
+		wlan_init_locks(wl);
 
-		linux_to_wlan(&nwi, g_linux_wlan);
+		linux_to_wlan(&nwi, wl);
 
 		ret = wilc_wlan_init(&nwi);
 		if (ret < 0) {
@@ -1167,7 +1161,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
 		}
 
 #if (defined WILC_SDIO) && (defined COMPLEMENT_BOOT)
-		if (wilc1000_prepare_11b_core(&nwi, g_linux_wlan)) {
+		if (wilc1000_prepare_11b_core(&nwi, wl)) {
 			PRINT_ER("11b Core is not ready\n");
 			ret = -EIO;
 			goto _fail_threads_;
@@ -1175,7 +1169,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
 #endif
 
 #if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO)
-		if (init_irq(g_linux_wlan)) {
+		if (init_irq(wl)) {
 			PRINT_ER("couldn't initialize IRQ\n");
 			ret = -EIO;
 			goto _fail_threads_;
@@ -1197,7 +1191,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
 		}
 
 		/*Download firmware*/
-		ret = linux_wlan_firmware_download(g_linux_wlan);
+		ret = linux_wlan_firmware_download(wl);
 		if (ret < 0) {
 			PRINT_ER("Failed to download firmware\n");
 			ret = -EIO;
@@ -1225,7 +1219,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
 			PRINT_D(INIT_DBG, "***** Firmware Ver = %s  *******\n", Firmware_ver);
 		}
 		/* Initialize firmware with default configuration */
-		ret = linux_wlan_init_test_config(dev, g_linux_wlan);
+		ret = linux_wlan_init_test_config(dev, wl);
 
 		if (ret < 0) {
 			PRINT_ER("Failed to configure firmware\n");
@@ -1233,7 +1227,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
 			goto _fail_fw_start_;
 		}
 
-		g_linux_wlan->wilc1000_initialized = 1;
+		wl->wilc1000_initialized = 1;
 		return 0; /*success*/
 
 _fail_fw_start_:
@@ -1245,15 +1239,15 @@ _fail_irq_enable_:
 _fail_irq_init_:
 #endif
 #if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO)
-		deinit_irq(g_linux_wlan);
+		deinit_irq(wl);
 
 #endif
 _fail_threads_:
-		wlan_deinitialize_threads(g_linux_wlan);
+		wlan_deinitialize_threads(wl);
 _fail_wilc_wlan_:
 		wilc_wlan_cleanup();
 _fail_locks_:
-		wlan_deinit_locks(g_linux_wlan);
+		wlan_deinit_locks(wl);
 		PRINT_ER("WLAN Iinitialization FAILED\n");
 	} else {
 		PRINT_D(INIT_DBG, "wilc1000 already initialized\n");
@@ -1288,7 +1282,7 @@ int mac_open(struct net_device *ndev)
 	struct wilc_priv *priv;
 
 #ifdef WILC_SPI
-	if (!g_linux_wlan || !g_linux_wlan->wilc_spidev) {
+	if (!wl || !wl->wilc_spidev) {
 		netdev_err(ndev, "wilc1000: SPI device not ready\n");
 		return -ENODEV;
 	}
@@ -1319,16 +1313,15 @@ int mac_open(struct net_device *ndev)
 	PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add);
 
 	/* loop through the NUM of supported devices and set the MAC address */
-	for (i = 0; i < g_linux_wlan->u8NoIfcs; i++) {
-		if (ndev == g_linux_wlan->strInterfaceInfo[i].wilc_netdev) {
-			memcpy(g_linux_wlan->strInterfaceInfo[i].aSrcAddress, mac_add, ETH_ALEN);
-			g_linux_wlan->strInterfaceInfo[i].drvHandler = priv->hWILCWFIDrv;
+	for (i = 0; i < wl->u8NoIfcs; i++)
+		if (ndev == wl->strInterfaceInfo[i].wilc_netdev) {
+			memcpy(wl->strInterfaceInfo[i].aSrcAddress, mac_add, ETH_ALEN);
+			wl->strInterfaceInfo[i].drvHandler = priv->hWILCWFIDrv;
 			break;
 		}
-	}
 
 	/* TODO: get MAC address whenever the source is EPROM - hardcoded and copy it to ndev*/
-	memcpy(ndev->dev_addr, g_linux_wlan->strInterfaceInfo[i].aSrcAddress, ETH_ALEN);
+	memcpy(ndev->dev_addr, wl->strInterfaceInfo[i].aSrcAddress, ETH_ALEN);
 
 	if (!is_valid_ether_addr(ndev->dev_addr)) {
 		PRINT_ER("Error: Wrong MAC address\n");
@@ -1341,13 +1334,13 @@ int mac_open(struct net_device *ndev)
 	wilc_mgmt_frame_register(nic->wilc_netdev->ieee80211_ptr->wiphy, nic->wilc_netdev->ieee80211_ptr,
 				 nic->g_struct_frame_reg[1].frame_type, nic->g_struct_frame_reg[1].reg);
 	netif_wake_queue(ndev);
-	g_linux_wlan->open_ifcs++;
+	wl->open_ifcs++;
 	nic->mac_opened = 1;
 	return 0;
 
 _err_:
 	wilc_deinit_host_int(ndev);
-	wilc1000_wlan_deinit(g_linux_wlan);
+	wilc1000_wlan_deinit(wl);
 	return ret;
 }
 
@@ -1480,14 +1473,14 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
 	PRINT_D(TX_DBG, "Adding tx packet to TX Queue\n");
 	nic->netstats.tx_packets++;
 	nic->netstats.tx_bytes += tx_data->size;
-	tx_data->pBssid = g_linux_wlan->strInterfaceInfo[nic->u8IfIdx].aBSSID;
+	tx_data->pBssid = wl->strInterfaceInfo[nic->u8IfIdx].aBSSID;
 	QueueCount = wilc_wlan_txq_add_net_pkt((void *)tx_data, tx_data->buff,
 					       tx_data->size,
 					       linux_wlan_tx_complete);
 
 	if (QueueCount > FLOW_CONTROL_UPPER_THRESHOLD) {
-		netif_stop_queue(g_linux_wlan->strInterfaceInfo[0].wilc_netdev);
-		netif_stop_queue(g_linux_wlan->strInterfaceInfo[1].wilc_netdev);
+		netif_stop_queue(wl->strInterfaceInfo[0].wilc_netdev);
+		netif_stop_queue(wl->strInterfaceInfo[1].wilc_netdev);
 	}
 
 	return 0;
@@ -1517,8 +1510,8 @@ int mac_close(struct net_device *ndev)
 
 	PRINT_D(GENERIC_DBG, "Mac close\n");
 
-	if (g_linux_wlan == NULL) {
-		PRINT_ER("g_linux_wlan = NULL\n");
+	if (wl == NULL) {
+		PRINT_ER("wl = NULL\n");
 		return 0;
 	}
 
@@ -1527,8 +1520,8 @@ int mac_close(struct net_device *ndev)
 		return 0;
 	}
 
-	if ((g_linux_wlan->open_ifcs) > 0) {
-		g_linux_wlan->open_ifcs--;
+	if ((wl->open_ifcs) > 0) {
+		wl->open_ifcs--;
 	} else {
 		PRINT_ER("ERROR: MAC close called while number of opened interfaces is zero\n");
 		return 0;
@@ -1541,10 +1534,10 @@ int mac_close(struct net_device *ndev)
 		wilc_deinit_host_int(nic->wilc_netdev);
 	}
 
-	if (g_linux_wlan->open_ifcs == 0) {
+	if (wl->open_ifcs == 0) {
 		PRINT_D(GENERIC_DBG, "Deinitializing wilc1000\n");
-		g_linux_wlan->close = 1;
-		wilc1000_wlan_deinit(g_linux_wlan);
+		wl->close = 1;
+		wilc1000_wlan_deinit(wl);
 		WILC_WFI_deinit_mon_interface();
 	}
 
@@ -1567,7 +1560,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
 	/* struct iwreq *wrq = (struct iwreq *) req;	// tony moved to case SIOCSIWPRIV */
 	nic = netdev_priv(ndev);
 
-	if (!g_linux_wlan->wilc1000_initialized)
+	if (!wl->wilc1000_initialized)
 		return 0;
 
 	switch (cmd) {
@@ -1651,8 +1644,8 @@ void frmw_to_linux(u8 *buff, u32 size, u32 pkt_offset)
 			return;
 		}
 
-		if (g_linux_wlan == NULL || wilc_netdev == NULL)
-			PRINT_ER("wilc_netdev in g_linux_wlan is NULL");
+		if (!wl || !wilc_netdev)
+			PRINT_ER("wilc_netdev in wl is NULL");
 		skb->dev = wilc_netdev;
 
 		if (skb->dev == NULL)
@@ -1690,18 +1683,18 @@ void WILC_WFI_mgmt_rx(u8 *buff, u32 size)
 
 	/*Pass the frame on the monitor interface, if any.*/
 	/*Otherwise, pass it on p2p0 netdev, if registered on it*/
-	for (i = 0; i < g_linux_wlan->u8NoIfcs; i++) {
-		nic = netdev_priv(g_linux_wlan->strInterfaceInfo[i].wilc_netdev);
+	for (i = 0; i < wl->u8NoIfcs; i++) {
+		nic = netdev_priv(wl->strInterfaceInfo[i].wilc_netdev);
 		if (nic->monitor_flag) {
 			WILC_WFI_monitor_rx(buff, size);
 			return;
 		}
 	}
 
-	nic = netdev_priv(g_linux_wlan->strInterfaceInfo[1].wilc_netdev); /* p2p0 */
+	nic = netdev_priv(wl->strInterfaceInfo[1].wilc_netdev); /* p2p0 */
 	if ((buff[0] == nic->g_struct_frame_reg[0].frame_type && nic->g_struct_frame_reg[0].reg) ||
 	    (buff[0] == nic->g_struct_frame_reg[1].frame_type && nic->g_struct_frame_reg[1].reg))
-		WILC_WFI_p2p_rx(g_linux_wlan->strInterfaceInfo[1].wilc_netdev, buff, size);
+		WILC_WFI_p2p_rx(wl->strInterfaceInfo[1].wilc_netdev, buff, size);
 }
 
 int wilc_netdev_init(void)
@@ -1714,8 +1707,8 @@ int wilc_netdev_init(void)
 	sema_init(&close_exit_sync, 0);
 
 	/*create the common structure*/
-	g_linux_wlan = kzalloc(sizeof(*g_linux_wlan), GFP_KERNEL);
-	if (!g_linux_wlan)
+	wl = kzalloc(sizeof(*wl), GFP_KERNEL);
+	if (!wl)
 		return -ENOMEM;
 
 	register_inetaddr_notifier(&g_dev_notifier);
@@ -1743,10 +1736,10 @@ int wilc_netdev_init(void)
 		} else
 			strcpy(ndev->name, "p2p%d");
 
-		nic->u8IfIdx = g_linux_wlan->u8NoIfcs;
+		nic->u8IfIdx = wl->u8NoIfcs;
 		nic->wilc_netdev = ndev;
-		g_linux_wlan->strInterfaceInfo[g_linux_wlan->u8NoIfcs].wilc_netdev = ndev;
-		g_linux_wlan->u8NoIfcs++;
+		wl->strInterfaceInfo[wl->u8NoIfcs].wilc_netdev = ndev;
+		wl->u8NoIfcs++;
 		ndev->netdev_ops = &wilc_netdev_ops;
 
 		{
@@ -1786,13 +1779,13 @@ int wilc_netdev_init(void)
 	}
 
 	#ifndef WILC_SDIO
-	if (!linux_spi_init(&g_linux_wlan->wilc_spidev)) {
+	if (!linux_spi_init(&wl->wilc_spidev)) {
 		PRINT_ER("Can't initialize SPI\n");
 		return -1; /* ERROR */
 	}
-	g_linux_wlan->wilc_spidev = wilc_spi_dev;
+	wl->wilc_spidev = wilc_spi_dev;
 	#else
-	g_linux_wlan->wilc_sdio_func = local_sdio_func;
+	wl->wilc_sdio_func = local_sdio_func;
 	#endif
 
 	return 0;
@@ -1840,21 +1833,21 @@ static void __exit exit_wilc_driver(void)
 	perInterface_wlan_t *nic[NUM_CONCURRENT_IFC] = {NULL,};
 	#define CLOSE_TIMEOUT (12 * 1000)
 
-	if ((g_linux_wlan != NULL) && (((g_linux_wlan->strInterfaceInfo[0].wilc_netdev) != NULL)
-				       || ((g_linux_wlan->strInterfaceInfo[1].wilc_netdev) != NULL))) {
+	if (wl && (wl->strInterfaceInfo[0].wilc_netdev ||
+	    wl->strInterfaceInfo[1].wilc_netdev)) {
 		unregister_inetaddr_notifier(&g_dev_notifier);
 
 		for (i = 0; i < NUM_CONCURRENT_IFC; i++)
-			nic[i] = netdev_priv(g_linux_wlan->strInterfaceInfo[i].wilc_netdev);
+			nic[i] = netdev_priv(wl->strInterfaceInfo[i].wilc_netdev);
 	}
 
-	if ((g_linux_wlan != NULL) && g_linux_wlan->wilc_firmware != NULL) {
-		release_firmware(g_linux_wlan->wilc_firmware);
-		g_linux_wlan->wilc_firmware = NULL;
+	if (wl && wl->wilc_firmware) {
+		release_firmware(wl->wilc_firmware);
+		wl->wilc_firmware = NULL;
 	}
 
-	if ((g_linux_wlan != NULL) && (((g_linux_wlan->strInterfaceInfo[0].wilc_netdev) != NULL)
-				       || ((g_linux_wlan->strInterfaceInfo[1].wilc_netdev) != NULL))) {
+	if (wl && (wl->strInterfaceInfo[0].wilc_netdev ||
+	    wl->strInterfaceInfo[1].wilc_netdev)) {
 		PRINT_D(INIT_DBG, "Waiting for mac_close ....\n");
 
 		if (linux_wlan_lock_timeout(&close_exit_sync, CLOSE_TIMEOUT) < 0)
@@ -1864,18 +1857,18 @@ static void __exit exit_wilc_driver(void)
 
 		for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
 			/* close all opened interfaces */
-			if (g_linux_wlan->strInterfaceInfo[i].wilc_netdev != NULL) {
+			if (wl->strInterfaceInfo[i].wilc_netdev) {
 				if (nic[i]->mac_opened)
-					mac_close(g_linux_wlan->strInterfaceInfo[i].wilc_netdev);
+					mac_close(wl->strInterfaceInfo[i].wilc_netdev);
 			}
 		}
 		for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
-			PRINT_D(INIT_DBG, "Unregistering netdev %p\n", g_linux_wlan->strInterfaceInfo[i].wilc_netdev);
-			unregister_netdev(g_linux_wlan->strInterfaceInfo[i].wilc_netdev);
+			PRINT_D(INIT_DBG, "Unregistering netdev %p\n", wl->strInterfaceInfo[i].wilc_netdev);
+			unregister_netdev(wl->strInterfaceInfo[i].wilc_netdev);
 			PRINT_D(INIT_DBG, "Freeing Wiphy...\n");
-			wilc_free_wiphy(g_linux_wlan->strInterfaceInfo[i].wilc_netdev);
+			wilc_free_wiphy(wl->strInterfaceInfo[i].wilc_netdev);
 			PRINT_D(INIT_DBG, "Freeing netdev...\n");
-			free_netdev(g_linux_wlan->strInterfaceInfo[i].wilc_netdev);
+			free_netdev(wl->strInterfaceInfo[i].wilc_netdev);
 		}
 	}
 
@@ -1886,9 +1879,7 @@ static void __exit exit_wilc_driver(void)
 	PRINT_D(INIT_DBG, "SDIO unregsiter...\n");
 	sdio_unregister_driver(&wilc_bus);
 #endif
-
-	kfree(g_linux_wlan);
-	g_linux_wlan = NULL;
+	kfree(wl);
 	printk("Module_exit Done.\n");
 
 #if defined(WILC_DEBUGFS)
diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c
index ebacd29..0dd4b19 100644
--- a/drivers/staging/wilc1000/linux_wlan_sdio.c
+++ b/drivers/staging/wilc1000/linux_wlan_sdio.c
@@ -49,7 +49,7 @@ static void wilc_sdio_interrupt(struct sdio_func *func)
 
 int linux_sdio_cmd52(sdio_cmd52_t *cmd)
 {
-	struct sdio_func *func = g_linux_wlan->wilc_sdio_func;
+	struct sdio_func *func = wl->wilc_sdio_func;
 	int ret;
 	u8 data;
 
@@ -81,7 +81,7 @@ int linux_sdio_cmd52(sdio_cmd52_t *cmd)
 
 int linux_sdio_cmd53(sdio_cmd53_t *cmd)
 {
-	struct sdio_func *func = g_linux_wlan->wilc_sdio_func;
+	struct sdio_func *func = wl->wilc_sdio_func;
 	int size, ret;
 
 	sdio_claim_host(func);
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 08ba5ba..9696839 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -624,14 +624,13 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent,
 			u8WLANChannel = INVALID_CHANNEL;
 		/*Incase "P2P CLIENT Connected" send deauthentication reason by 3 to force the WPA_SUPPLICANT to directly change
 		 *      virtual interface to station*/
-		if ((pstrWFIDrv->IFC_UP) && (dev == g_linux_wlan->strInterfaceInfo[1].wilc_netdev)) {
+		if (pstrWFIDrv->IFC_UP &&
+		   (dev == wl->strInterfaceInfo[1].wilc_netdev))
 			pstrDisconnectNotifInfo->u16reason = 3;
-		}
-		/*Incase "P2P CLIENT during connection(not connected)" send deauthentication reason by 1 to force the WPA_SUPPLICANT
-		 *      to scan again and retry the connection*/
-		else if ((!pstrWFIDrv->IFC_UP) && (dev == g_linux_wlan->strInterfaceInfo[1].wilc_netdev)) {
+		else if (!pstrWFIDrv->IFC_UP &&
+			(dev == wl->strInterfaceInfo[1].wilc_netdev))
 			pstrDisconnectNotifInfo->u16reason = 1;
-		}
+
 		cfg80211_disconnected(dev, pstrDisconnectNotifInfo->u16reason, pstrDisconnectNotifInfo->ie,
 				      pstrDisconnectNotifInfo->ie_len, false,
 				      GFP_KERNEL);
@@ -1255,7 +1254,8 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
 				}
 
 				/*save keys only on interface 0 (wifi interface)*/
-				if (!g_gtk_keys_saved && netdev == g_linux_wlan->strInterfaceInfo[0].wilc_netdev) {
+				if (!g_gtk_keys_saved &&
+				    netdev == wl->strInterfaceInfo[0].wilc_netdev) {
 					g_add_gtk_key_params.key_idx = key_index;
 					g_add_gtk_key_params.pairwise = pairwise;
 					if (!mac_addr) {
@@ -1291,7 +1291,8 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
 				}
 
 				/*save keys only on interface 0 (wifi interface)*/
-				if (!g_ptk_keys_saved && netdev == g_linux_wlan->strInterfaceInfo[0].wilc_netdev) {
+				if (!g_ptk_keys_saved &&
+				    netdev == wl->strInterfaceInfo[0].wilc_netdev) {
 					g_add_ptk_key_params.key_idx = key_index;
 					g_add_ptk_key_params.pairwise = pairwise;
 					if (!mac_addr) {
@@ -1356,7 +1357,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
 	priv = wiphy_priv(wiphy);
 
 	/*delete saved keys, if any*/
-	if (netdev == g_linux_wlan->strInterfaceInfo[0].wilc_netdev) {
+	if (netdev == wl->strInterfaceInfo[0].wilc_netdev) {
 		g_ptk_keys_saved = false;
 		g_gtk_keys_saved = false;
 		g_wep_keys_saved = false;
@@ -2418,7 +2419,7 @@ void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev,
 
 	}
 	/*If mac is closed, then return*/
-	if (!g_linux_wlan->wilc1000_initialized) {
+	if (!wl->wilc1000_initialized) {
 		PRINT_D(GENERIC_DBG, "Return since mac is closed\n");
 		return;
 	}
@@ -2571,30 +2572,32 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 		interface_type = nic->iftype;
 		nic->iftype = STATION_MODE;
 
-		if (g_linux_wlan->wilc1000_initialized)	{
-			host_int_del_All_Rx_BASession(priv->hWILCWFIDrv, g_linux_wlan->strInterfaceInfo[0].aBSSID, TID);
+		if (wl->wilc1000_initialized) {
+			host_int_del_All_Rx_BASession(priv->hWILCWFIDrv,
+						      wl->strInterfaceInfo[0].aBSSID,
+						      TID);
 			/* ensure that the message Q is empty */
 			host_int_wait_msg_queue_idle();
 
 			/*Eliminate host interface blocking state*/
-			up(&g_linux_wlan->cfg_event);
+			up(&wl->cfg_event);
 
-			wilc1000_wlan_deinit(g_linux_wlan);
+			wilc1000_wlan_deinit(wl);
 			wilc1000_wlan_init(dev, nic);
 			g_wilc_initialized = 1;
 			nic->iftype = interface_type;
 
 			/*Setting interface 1 drv handler and mac address in newly downloaded FW*/
-			host_int_set_wfi_drv_handler(g_linux_wlan->strInterfaceInfo[0].drvHandler);
-			host_int_set_MacAddress(g_linux_wlan->strInterfaceInfo[0].drvHandler,
-						g_linux_wlan->strInterfaceInfo[0].aSrcAddress);
+			host_int_set_wfi_drv_handler(wl->strInterfaceInfo[0].drvHandler);
+			host_int_set_MacAddress(wl->strInterfaceInfo[0].drvHandler,
+						wl->strInterfaceInfo[0].aSrcAddress);
 			host_int_set_operation_mode(priv->hWILCWFIDrv, STATION_MODE);
 
 			/*Add saved WEP keys, if any*/
 			if (g_wep_keys_saved) {
-				host_int_set_WEPDefaultKeyID(g_linux_wlan->strInterfaceInfo[0].drvHandler,
+				host_int_set_WEPDefaultKeyID(wl->strInterfaceInfo[0].drvHandler,
 							     g_key_wep_params.key_idx);
-				host_int_add_wep_key_bss_sta(g_linux_wlan->strInterfaceInfo[0].drvHandler,
+				host_int_add_wep_key_bss_sta(wl->strInterfaceInfo[0].drvHandler,
 							     g_key_wep_params.key,
 							     g_key_wep_params.key_len,
 							     g_key_wep_params.key_idx);
@@ -2612,22 +2615,22 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 				PRINT_D(CFG80211_DBG, "gtk %x %x %x\n", g_key_gtk_params.key[0],
 					g_key_gtk_params.key[1],
 					g_key_gtk_params.key[2]);
-				add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
-					g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
+				add_key(wl->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
+					wl->strInterfaceInfo[0].wilc_netdev,
 					g_add_ptk_key_params.key_idx,
 					g_add_ptk_key_params.pairwise,
 					g_add_ptk_key_params.mac_addr,
 					(struct key_params *)(&g_key_ptk_params));
 
-				add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
-					g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
+				add_key(wl->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
+					wl->strInterfaceInfo[0].wilc_netdev,
 					g_add_gtk_key_params.key_idx,
 					g_add_gtk_key_params.pairwise,
 					g_add_gtk_key_params.mac_addr,
 					(struct key_params *)(&g_key_gtk_params));
 			}
 
-			if (g_linux_wlan->wilc1000_initialized)	{
+			if (wl->wilc1000_initialized)
 				for (i = 0; i < num_reg_frame; i++) {
 					PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", nic->g_struct_frame_reg[i].frame_type,
 						nic->g_struct_frame_reg[i].reg);
@@ -2635,7 +2638,6 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 								nic->g_struct_frame_reg[i].frame_type,
 								nic->g_struct_frame_reg[i].reg);
 				}
-			}
 
 			bEnablePS = true;
 			host_int_set_power_mgmt(priv->hWILCWFIDrv, 1, 0);
@@ -2648,7 +2650,8 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 		connecting = 0;
 		PRINT_D(HOSTAPD_DBG, "Interface type = NL80211_IFTYPE_P2P_CLIENT\n");
 
-		host_int_del_All_Rx_BASession(priv->hWILCWFIDrv, g_linux_wlan->strInterfaceInfo[0].aBSSID, TID);
+		host_int_del_All_Rx_BASession(priv->hWILCWFIDrv,
+					      wl->strInterfaceInfo[0].aBSSID, TID);
 
 		dev->ieee80211_ptr->iftype = type;
 		priv->wdev->iftype = type;
@@ -2657,25 +2660,24 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 		PRINT_D(HOSTAPD_DBG, "Downloading P2P_CONCURRENCY_FIRMWARE\n");
 		nic->iftype = CLIENT_MODE;
 
-
-		if (g_linux_wlan->wilc1000_initialized)	{
+		if (wl->wilc1000_initialized) {
 			/* ensure that the message Q is empty */
 			host_int_wait_msg_queue_idle();
 
-			wilc1000_wlan_deinit(g_linux_wlan);
+			wilc1000_wlan_deinit(wl);
 			wilc1000_wlan_init(dev, nic);
 			g_wilc_initialized = 1;
 
-			host_int_set_wfi_drv_handler(g_linux_wlan->strInterfaceInfo[0].drvHandler);
-			host_int_set_MacAddress(g_linux_wlan->strInterfaceInfo[0].drvHandler,
-						g_linux_wlan->strInterfaceInfo[0].aSrcAddress);
+			host_int_set_wfi_drv_handler(wl->strInterfaceInfo[0].drvHandler);
+			host_int_set_MacAddress(wl->strInterfaceInfo[0].drvHandler,
+						wl->strInterfaceInfo[0].aSrcAddress);
 			host_int_set_operation_mode(priv->hWILCWFIDrv, STATION_MODE);
 
 			/*Add saved WEP keys, if any*/
 			if (g_wep_keys_saved) {
-				host_int_set_WEPDefaultKeyID(g_linux_wlan->strInterfaceInfo[0].drvHandler,
+				host_int_set_WEPDefaultKeyID(wl->strInterfaceInfo[0].drvHandler,
 							     g_key_wep_params.key_idx);
-				host_int_add_wep_key_bss_sta(g_linux_wlan->strInterfaceInfo[0].drvHandler,
+				host_int_add_wep_key_bss_sta(wl->strInterfaceInfo[0].drvHandler,
 							     g_key_wep_params.key,
 							     g_key_wep_params.key_len,
 							     g_key_wep_params.key_idx);
@@ -2693,15 +2695,15 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 				PRINT_D(CFG80211_DBG, "gtk %x %x %x\n", g_key_gtk_params.key[0],
 					g_key_gtk_params.key[1],
 					g_key_gtk_params.key[2]);
-				add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
-					g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
+				add_key(wl->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
+					wl->strInterfaceInfo[0].wilc_netdev,
 					g_add_ptk_key_params.key_idx,
 					g_add_ptk_key_params.pairwise,
 					g_add_ptk_key_params.mac_addr,
 					(struct key_params *)(&g_key_ptk_params));
 
-				add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
-					g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
+				add_key(wl->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
+					wl->strInterfaceInfo[0].wilc_netdev,
 					g_add_gtk_key_params.key_idx,
 					g_add_gtk_key_params.pairwise,
 					g_add_gtk_key_params.mac_addr,
@@ -2712,7 +2714,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 			refresh_scan(priv, 1, true);
 			Set_machw_change_vir_if(false);
 
-			if (g_linux_wlan->wilc1000_initialized)	{
+			if (wl->wilc1000_initialized)
 				for (i = 0; i < num_reg_frame; i++) {
 					PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", nic->g_struct_frame_reg[i].frame_type,
 						nic->g_struct_frame_reg[i].reg);
@@ -2720,7 +2722,6 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 								nic->g_struct_frame_reg[i].frame_type,
 								nic->g_struct_frame_reg[i].reg);
 				}
-			}
 		}
 		break;
 
@@ -2735,9 +2736,9 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 		PRINT_D(HOSTAPD_DBG, "Downloading AP firmware\n");
 		linux_wlan_get_firmware(nic);
 		/*If wilc is running, then close-open to actually get new firmware running (serves P2P)*/
-		if (g_linux_wlan->wilc1000_initialized)	{
+		if (wl->wilc1000_initialized) {
 			nic->iftype = AP_MODE;
-			g_linux_wlan->wilc1000_initialized = 1;
+			wl->wilc1000_initialized = 1;
 			mac_close(dev);
 			mac_open(dev);
 
@@ -2761,7 +2762,9 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 		/*sent before downloading new FW. This is because it blocks on*/
 		/*hWaitResponse semaphore, which allows previous config*/
 		/*packets to actually take action on old FW*/
-		host_int_del_All_Rx_BASession(priv->hWILCWFIDrv, g_linux_wlan->strInterfaceInfo[0].aBSSID, TID);
+		host_int_del_All_Rx_BASession(priv->hWILCWFIDrv,
+					      wl->strInterfaceInfo[0].aBSSID,
+					      TID);
 		bEnablePS = false;
 		PRINT_D(HOSTAPD_DBG, "Interface type = NL80211_IFTYPE_GO\n");
 		dev->ieee80211_ptr->iftype = type;
@@ -2776,22 +2779,22 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 
 		/* ensure that the message Q is empty */
 		host_int_wait_msg_queue_idle();
-		wilc1000_wlan_deinit(g_linux_wlan);
+		wilc1000_wlan_deinit(wl);
 		wilc1000_wlan_init(dev, nic);
 		g_wilc_initialized = 1;
 
 
 		/*Setting interface 1 drv handler and mac address in newly downloaded FW*/
-		host_int_set_wfi_drv_handler(g_linux_wlan->strInterfaceInfo[0].drvHandler);
-		host_int_set_MacAddress(g_linux_wlan->strInterfaceInfo[0].drvHandler,
-					g_linux_wlan->strInterfaceInfo[0].aSrcAddress);
+		host_int_set_wfi_drv_handler(wl->strInterfaceInfo[0].drvHandler);
+		host_int_set_MacAddress(wl->strInterfaceInfo[0].drvHandler,
+					wl->strInterfaceInfo[0].aSrcAddress);
 		host_int_set_operation_mode(priv->hWILCWFIDrv, AP_MODE);
 
 		/*Add saved WEP keys, if any*/
 		if (g_wep_keys_saved) {
-			host_int_set_WEPDefaultKeyID(g_linux_wlan->strInterfaceInfo[0].drvHandler,
+			host_int_set_WEPDefaultKeyID(wl->strInterfaceInfo[0].drvHandler,
 						     g_key_wep_params.key_idx);
-			host_int_add_wep_key_bss_sta(g_linux_wlan->strInterfaceInfo[0].drvHandler,
+			host_int_add_wep_key_bss_sta(wl->strInterfaceInfo[0].drvHandler,
 						     g_key_wep_params.key,
 						     g_key_wep_params.key_len,
 						     g_key_wep_params.key_idx);
@@ -2811,22 +2814,22 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 				g_key_gtk_params.key[1],
 				g_key_gtk_params.key[2],
 				g_key_gtk_params.cipher);
-			add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
-				g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
+			add_key(wl->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
+				wl->strInterfaceInfo[0].wilc_netdev,
 				g_add_ptk_key_params.key_idx,
 				g_add_ptk_key_params.pairwise,
 				g_add_ptk_key_params.mac_addr,
 				(struct key_params *)(&g_key_ptk_params));
 
-			add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
-				g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
+			add_key(wl->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
+				wl->strInterfaceInfo[0].wilc_netdev,
 				g_add_gtk_key_params.key_idx,
 				g_add_gtk_key_params.pairwise,
 				g_add_gtk_key_params.mac_addr,
 				(struct key_params *)(&g_key_gtk_params));
 		}
 
-		if (g_linux_wlan->wilc1000_initialized)	{
+		if (wl->wilc1000_initialized)
 			for (i = 0; i < num_reg_frame; i++) {
 				PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", nic->g_struct_frame_reg[i].frame_type,
 					nic->g_struct_frame_reg[i].reg);
@@ -2834,7 +2837,6 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 							nic->g_struct_frame_reg[i].frame_type,
 							nic->g_struct_frame_reg[i].reg);
 			}
-		}
 		break;
 
 	default:
@@ -2889,7 +2891,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev,
 	if (s32Error != 0)
 		PRINT_ER("Error in setting channel\n");
 
-	linux_wlan_set_bssid(dev, g_linux_wlan->strInterfaceInfo[0].aSrcAddress);
+	linux_wlan_set_bssid(dev, wl->strInterfaceInfo[0].aSrcAddress);
 
 	s32Error = host_int_add_beacon(priv->hWILCWFIDrv,
 					settings->beacon_interval,
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 373959b..2fe0ef0 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -206,7 +206,7 @@ struct WILC_WFI_mon_priv {
 	struct net_device *real_ndev;
 };
 
-extern struct wilc *g_linux_wlan;
+extern struct wilc *wl;
 extern struct net_device *WILC_WFI_devs[];
 void frmw_to_linux(u8 *buff, u32 size, u32 pkt_offset);
 void linux_wlan_mac_indicate(int flag);
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index c731641..317b645 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -114,7 +114,7 @@ static CHIP_PS_STATE_T genuChipPSstate = CHIP_WAKEDUP;
 static inline void acquire_bus(BUS_ACQUIRE_T acquire)
 {
 
-	mutex_lock(&g_linux_wlan->hif_cs);
+	mutex_lock(&wl->hif_cs);
 	#ifndef WILC_OPTIMIZE_SLEEP_INT
 	if (genuChipPSstate != CHIP_WAKEDUP)
 	#endif
@@ -130,7 +130,7 @@ static inline void release_bus(BUS_RELEASE_T release)
 	if (release == RELEASE_ALLOW_SLEEP)
 		chip_allow_sleep();
 	#endif
-	mutex_unlock(&g_linux_wlan->hif_cs);
+	mutex_unlock(&wl->hif_cs);
 }
 /********************************************
  *
@@ -167,7 +167,7 @@ static struct txq_entry_t *wilc_wlan_txq_remove_from_head(void)
 	wilc_wlan_dev_t *p = &g_wlan;
 	unsigned long flags;
 
-	spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags);
+	spin_lock_irqsave(&wl->txq_spinlock, flags);
 	if (p->txq_head) {
 		tqe = p->txq_head;
 		p->txq_head = tqe->next;
@@ -182,7 +182,7 @@ static struct txq_entry_t *wilc_wlan_txq_remove_from_head(void)
 	} else {
 		tqe = NULL;
 	}
-	spin_unlock_irqrestore(&g_linux_wlan->txq_spinlock, flags);
+	spin_unlock_irqrestore(&wl->txq_spinlock, flags);
 	return tqe;
 }
 
@@ -190,7 +190,7 @@ static void wilc_wlan_txq_add_to_tail(struct txq_entry_t *tqe)
 {
 	wilc_wlan_dev_t *p = &g_wlan;
 	unsigned long flags;
-	spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags);
+	spin_lock_irqsave(&wl->txq_spinlock, flags);
 
 	if (p->txq_head == NULL) {
 		tqe->next = NULL;
@@ -206,25 +206,25 @@ static void wilc_wlan_txq_add_to_tail(struct txq_entry_t *tqe)
 	p->txq_entries += 1;
 	PRINT_D(TX_DBG, "Number of entries in TxQ = %d\n", p->txq_entries);
 
-	spin_unlock_irqrestore(&g_linux_wlan->txq_spinlock, flags);
+	spin_unlock_irqrestore(&wl->txq_spinlock, flags);
 
 	/**
 	 *      wake up TX queue
 	 **/
 	PRINT_D(TX_DBG, "Wake the txq_handling\n");
 
-	up(&g_linux_wlan->txq_event);
+	up(&wl->txq_event);
 }
 
 static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe)
 {
 	wilc_wlan_dev_t *p = &g_wlan;
 	unsigned long flags;
-	if (linux_wlan_lock_timeout(&g_linux_wlan->txq_add_to_head_cs,
+	if (linux_wlan_lock_timeout(&wl->txq_add_to_head_cs,
 				    CFG_PKTS_TIMEOUT))
 		return -1;
 
-	spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags);
+	spin_lock_irqsave(&wl->txq_spinlock, flags);
 
 	if (p->txq_head == NULL) {
 		tqe->next = NULL;
@@ -240,14 +240,14 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe)
 	p->txq_entries += 1;
 	PRINT_D(TX_DBG, "Number of entries in TxQ = %d\n", p->txq_entries);
 
-	spin_unlock_irqrestore(&g_linux_wlan->txq_spinlock, flags);
-	up(&g_linux_wlan->txq_add_to_head_cs);
+	spin_unlock_irqrestore(&wl->txq_spinlock, flags);
+	up(&wl->txq_add_to_head_cs);
 
 
 	/**
 	 *      wake up TX queue
 	 **/
-	up(&g_linux_wlan->txq_event);
+	up(&wl->txq_event);
 	PRINT_D(TX_DBG, "Wake up the txq_handler\n");
 
 	return 0;
@@ -337,9 +337,9 @@ static inline int remove_TCP_related(void)
 	wilc_wlan_dev_t *p = &g_wlan;
 	unsigned long flags;
 
-	spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags);
+	spin_lock_irqsave(&wl->txq_spinlock, flags);
 
-	spin_unlock_irqrestore(&g_linux_wlan->txq_spinlock, flags);
+	spin_unlock_irqrestore(&wl->txq_spinlock, flags);
 	return 0;
 }
 
@@ -353,7 +353,7 @@ static inline int tcp_process(struct txq_entry_t *tqe)
 	wilc_wlan_dev_t *p = &g_wlan;
 	unsigned long flags;
 
-	spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags);
+	spin_lock_irqsave(&wl->txq_spinlock, flags);
 
 	eth_hdr_ptr = &buffer[0];
 	h_proto = ntohs(*((unsigned short *)&eth_hdr_ptr[12]));
@@ -401,7 +401,7 @@ static inline int tcp_process(struct txq_entry_t *tqe)
 	} else {
 		ret = 0;
 	}
-	spin_unlock_irqrestore(&g_linux_wlan->txq_spinlock, flags);
+	spin_unlock_irqrestore(&wl->txq_spinlock, flags);
 	return ret;
 }
 
@@ -413,7 +413,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(void)
 	u32 Dropped = 0;
 	wilc_wlan_dev_t *p = &g_wlan;
 
-	spin_lock_irqsave(&g_linux_wlan->txq_spinlock, p->txq_spinlock_flags);
+	spin_lock_irqsave(&wl->txq_spinlock, p->txq_spinlock_flags);
 	for (i = PendingAcks_arrBase; i < (PendingAcks_arrBase + Pending_Acks); i++) {
 		if (Pending_Acks_info[i].ack_num < Acks_keep_track_info[Pending_Acks_info[i].Session_index].Bigger_Ack_num) {
 			struct txq_entry_t *tqe;
@@ -440,12 +440,12 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(void)
 		PendingAcks_arrBase = 0;
 
 
-	spin_unlock_irqrestore(&g_linux_wlan->txq_spinlock,
+	spin_unlock_irqrestore(&wl->txq_spinlock,
 			       p->txq_spinlock_flags);
 
 	while (Dropped > 0) {
 		/*consume the semaphore count of the removed packet*/
-		linux_wlan_lock_timeout(&g_linux_wlan->txq_event, 1);
+		linux_wlan_lock_timeout(&wl->txq_event, 1);
 		Dropped--;
 	}
 
@@ -473,7 +473,7 @@ static int wilc_wlan_txq_add_cfg_pkt(u8 *buffer, u32 buffer_size)
 	PRINT_D(TX_DBG, "Adding config packet ...\n");
 	if (p->quit) {
 		PRINT_D(TX_DBG, "Return due to clear function\n");
-		up(&g_linux_wlan->cfg_event);
+		up(&wl->cfg_event);
 		return 0;
 	}
 
@@ -563,11 +563,11 @@ static struct txq_entry_t *wilc_wlan_txq_get_first(void)
 	struct txq_entry_t *tqe;
 	unsigned long flags;
 
-	spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags);
+	spin_lock_irqsave(&wl->txq_spinlock, flags);
 
 	tqe = p->txq_head;
 
-	spin_unlock_irqrestore(&g_linux_wlan->txq_spinlock, flags);
+	spin_unlock_irqrestore(&wl->txq_spinlock, flags);
 
 
 	return tqe;
@@ -576,10 +576,10 @@ static struct txq_entry_t *wilc_wlan_txq_get_first(void)
 static struct txq_entry_t *wilc_wlan_txq_get_next(struct txq_entry_t *tqe)
 {
 	unsigned long flags;
-	spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags);
+	spin_lock_irqsave(&wl->txq_spinlock, flags);
 
 	tqe = tqe->next;
-	spin_unlock_irqrestore(&g_linux_wlan->txq_spinlock, flags);
+	spin_unlock_irqrestore(&wl->txq_spinlock, flags);
 
 
 	return tqe;
@@ -592,7 +592,7 @@ static int wilc_wlan_rxq_add(struct rxq_entry_t *rqe)
 	if (p->quit)
 		return 0;
 
-	mutex_lock(&g_linux_wlan->rxq_cs);
+	mutex_lock(&wl->rxq_cs);
 	if (p->rxq_head == NULL) {
 		PRINT_D(RX_DBG, "Add to Queue head\n");
 		rqe->next = NULL;
@@ -606,7 +606,7 @@ static int wilc_wlan_rxq_add(struct rxq_entry_t *rqe)
 	}
 	p->rxq_entries += 1;
 	PRINT_D(RX_DBG, "Number of queue entries: %d\n", p->rxq_entries);
-	mutex_unlock(&g_linux_wlan->rxq_cs);
+	mutex_unlock(&wl->rxq_cs);
 	return p->rxq_entries;
 }
 
@@ -618,12 +618,12 @@ static struct rxq_entry_t *wilc_wlan_rxq_remove(void)
 	if (p->rxq_head) {
 		struct rxq_entry_t *rqe;
 
-		mutex_lock(&g_linux_wlan->rxq_cs);
+		mutex_lock(&wl->rxq_cs);
 		rqe = p->rxq_head;
 		p->rxq_head = p->rxq_head->next;
 		p->rxq_entries -= 1;
 		PRINT_D(RX_DBG, "RXQ entries decreased\n");
-		mutex_unlock(&g_linux_wlan->rxq_cs);
+		mutex_unlock(&wl->rxq_cs);
 		return rqe;
 	}
 	PRINT_D(RX_DBG, "Nothing to get from Q\n");
@@ -834,7 +834,7 @@ int wilc_wlan_handle_txq(u32 *pu32TxqCount)
 		if (p->quit)
 			break;
 
-		linux_wlan_lock_timeout(&g_linux_wlan->txq_add_to_head_cs,
+		linux_wlan_lock_timeout(&wl->txq_add_to_head_cs,
 					CFG_PKTS_TIMEOUT);
 #ifdef	TCP_ACK_FILTER
 		wilc_wlan_txq_filter_dup_tcp_ack();
@@ -1098,7 +1098,7 @@ _end_:
 		if (ret != 1)
 			break;
 	} while (0);
-	up(&g_linux_wlan->txq_add_to_head_cs);
+	up(&wl->txq_add_to_head_cs);
 
 	p->txq_exit = 1;
 	PRINT_D(TX_DBG, "THREAD: Exiting txq\n");
@@ -1122,7 +1122,7 @@ static void wilc_wlan_handle_rxq(void)
 	do {
 		if (p->quit) {
 			PRINT_D(RX_DBG, "exit 1st do-while due to Clean_UP function\n");
-			up(&g_linux_wlan->cfg_event);
+			up(&wl->cfg_event);
 			break;
 		}
 		rqe = wilc_wlan_rxq_remove();
@@ -1194,7 +1194,7 @@ static void wilc_wlan_handle_rxq(void)
 						 **/
 						PRINT_D(RX_DBG, "p->cfg_seq_no = %d - rsp.seq_no = %d\n", p->cfg_seq_no, rsp.seq_no);
 						if (p->cfg_seq_no == rsp.seq_no)
-							up(&g_linux_wlan->cfg_event);
+							up(&wl->cfg_event);
 					} else if (rsp.type == WILC_CFG_RSP_STATUS) {
 						/**
 						 *      Call back to indicate status...
@@ -1764,7 +1764,7 @@ int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size,
 		if (wilc_wlan_cfg_commit(WILC_CFG_SET, drvHandler))
 			ret_size = 0;
 
-		if (linux_wlan_lock_timeout(&g_linux_wlan->cfg_event,
+		if (linux_wlan_lock_timeout(&wl->cfg_event,
 					    CFG_PKTS_TIMEOUT)) {
 			PRINT_D(TX_DBG, "Set Timed Out\n");
 			ret_size = 0;
@@ -1802,7 +1802,7 @@ int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler)
 			ret_size = 0;
 
 
-		if (linux_wlan_lock_timeout(&g_linux_wlan->cfg_event,
+		if (linux_wlan_lock_timeout(&wl->cfg_event,
 					    CFG_PKTS_TIMEOUT)) {
 			PRINT_D(TX_DBG, "Get Timed Out\n");
 			ret_size = 0;
@@ -2044,7 +2044,7 @@ u16 Set_machw_change_vir_if(bool bValue)
 	u32 reg;
 
 	/*Reset WILC_CHANGING_VIR_IF register to allow adding futrue keys to CE H/W*/
-	mutex_lock(&g_linux_wlan->hif_cs);
+	mutex_lock(&wl->hif_cs);
 	ret = (&g_wlan)->hif_func.hif_read_reg(WILC_CHANGING_VIR_IF, &reg);
 	if (!ret)
 		PRINT_ER("Error while Reading reg WILC_CHANGING_VIR_IF\n");
@@ -2059,7 +2059,7 @@ u16 Set_machw_change_vir_if(bool bValue)
 	if (!ret)
 		PRINT_ER("Error while writing reg WILC_CHANGING_VIR_IF\n");
 
-	mutex_unlock(&g_linux_wlan->hif_cs);
+	mutex_unlock(&wl->hif_cs);
 
 	return ret;
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 04/16] staging: wilc1000: remove typedef from the tstrInterfaceInfo
  2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
  2015-10-14 11:46 ` [PATCH 02/16] staging: wilc1000: remove typedef from the linux_wlan_t Tony Cho
  2015-10-14 11:46 ` [PATCH 03/16] staging: wilc1000: rename g_linux_wlan to wl Tony Cho
@ 2015-10-14 11:46 ` Tony Cho
  2015-10-14 11:46 ` [PATCH 05/16] staging: wilc1000: change the type of wilc1000_initialized Tony Cho
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

This patch removes typedef from the tstrInterfaceInfo and renames it to
the wilc_vif.

Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/wilc_wfi_netdevice.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 2fe0ef0..ca14fd6 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -148,12 +148,12 @@ typedef struct {
 
 } struct_frame_reg;
 
-typedef struct {
+struct wilc_vif {
 	u8 aSrcAddress[ETH_ALEN];
 	u8 aBSSID[ETH_ALEN];
 	struct host_if_drv *drvHandler;
 	struct net_device *wilc_netdev;
-} tstrInterfaceInfo;
+};
 
 struct wilc {
 	int mac_status;
@@ -163,7 +163,7 @@ struct wilc {
 	#endif
 	int close;
 	u8 u8NoIfcs;
-	tstrInterfaceInfo strInterfaceInfo[NUM_CONCURRENT_IFC];
+	struct wilc_vif strInterfaceInfo[NUM_CONCURRENT_IFC];
 	u8 open_ifcs;
 
 	struct semaphore txq_add_to_head_cs;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 05/16] staging: wilc1000: change the type of wilc1000_initialized
  2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
                   ` (2 preceding siblings ...)
  2015-10-14 11:46 ` [PATCH 04/16] staging: wilc1000: remove typedef from the tstrInterfaceInfo Tony Cho
@ 2015-10-14 11:46 ` Tony Cho
  2015-10-17  4:35   ` Greg KH
  2015-10-14 11:46 ` [PATCH 06/16] staging: wilc1000: rename u8NoIfcs in the struct wilc Tony Cho
                   ` (10 subsequent siblings)
  14 siblings, 1 reply; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

This patch changes the type of wilc1000_initialized in the struct wilc from
int to bool and renames it to the initialized. In addition, the unncessary
wilc1000_initialized codes are removed in this patch.

Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/linux_wlan.c             | 13 +++++--------
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 15 +++++++--------
 drivers/staging/wilc1000/wilc_wfi_netdevice.h     |  2 +-
 3 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 6a98660..c75dfc4 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -880,9 +880,7 @@ _fail_:
 /**************************/
 void wilc1000_wlan_deinit(struct wilc *nic)
 {
-
-	if (wl->wilc1000_initialized) {
-
+	if (wl->initialized) {
 		printk("Deinitializing wilc1000  ...\n");
 
 		if (nic == NULL) {
@@ -931,7 +929,7 @@ void wilc1000_wlan_deinit(struct wilc *nic)
 		wlan_deinit_locks(wl);
 
 		/* announce that wilc1000 is not initialized */
-		wl->wilc1000_initialized = 0;
+		wl->initialized = false;
 
 		PRINT_D(INIT_DBG, "wilc1000 deinitialization Done\n");
 
@@ -1137,10 +1135,9 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
 	perInterface_wlan_t *nic = p_nic;
 	int ret = 0;
 
-	if (!wl->wilc1000_initialized) {
+	if (!wl->initialized) {
 		wl->mac_status = WILC_MAC_STATUS_INIT;
 		wl->close = 0;
-		wl->wilc1000_initialized = 0;
 
 		wlan_init_locks(wl);
 
@@ -1227,7 +1224,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
 			goto _fail_fw_start_;
 		}
 
-		wl->wilc1000_initialized = 1;
+		wl->initialized = true;
 		return 0; /*success*/
 
 _fail_fw_start_:
@@ -1560,7 +1557,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
 	/* struct iwreq *wrq = (struct iwreq *) req;	// tony moved to case SIOCSIWPRIV */
 	nic = netdev_priv(ndev);
 
-	if (!wl->wilc1000_initialized)
+	if (!wl->initialized)
 		return 0;
 
 	switch (cmd) {
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 9696839..b26caa8 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -2419,7 +2419,7 @@ void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev,
 
 	}
 	/*If mac is closed, then return*/
-	if (!wl->wilc1000_initialized) {
+	if (!wl->initialized) {
 		PRINT_D(GENERIC_DBG, "Return since mac is closed\n");
 		return;
 	}
@@ -2572,7 +2572,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 		interface_type = nic->iftype;
 		nic->iftype = STATION_MODE;
 
-		if (wl->wilc1000_initialized) {
+		if (wl->initialized) {
 			host_int_del_All_Rx_BASession(priv->hWILCWFIDrv,
 						      wl->strInterfaceInfo[0].aBSSID,
 						      TID);
@@ -2630,7 +2630,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 					(struct key_params *)(&g_key_gtk_params));
 			}
 
-			if (wl->wilc1000_initialized)
+			if (wl->initialized)
 				for (i = 0; i < num_reg_frame; i++) {
 					PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", nic->g_struct_frame_reg[i].frame_type,
 						nic->g_struct_frame_reg[i].reg);
@@ -2660,7 +2660,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 		PRINT_D(HOSTAPD_DBG, "Downloading P2P_CONCURRENCY_FIRMWARE\n");
 		nic->iftype = CLIENT_MODE;
 
-		if (wl->wilc1000_initialized) {
+		if (wl->initialized) {
 			/* ensure that the message Q is empty */
 			host_int_wait_msg_queue_idle();
 
@@ -2714,7 +2714,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 			refresh_scan(priv, 1, true);
 			Set_machw_change_vir_if(false);
 
-			if (wl->wilc1000_initialized)
+			if (wl->initialized)
 				for (i = 0; i < num_reg_frame; i++) {
 					PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", nic->g_struct_frame_reg[i].frame_type,
 						nic->g_struct_frame_reg[i].reg);
@@ -2736,9 +2736,8 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 		PRINT_D(HOSTAPD_DBG, "Downloading AP firmware\n");
 		linux_wlan_get_firmware(nic);
 		/*If wilc is running, then close-open to actually get new firmware running (serves P2P)*/
-		if (wl->wilc1000_initialized) {
+		if (wl->initialized) {
 			nic->iftype = AP_MODE;
-			wl->wilc1000_initialized = 1;
 			mac_close(dev);
 			mac_open(dev);
 
@@ -2829,7 +2828,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 				(struct key_params *)(&g_key_gtk_params));
 		}
 
-		if (wl->wilc1000_initialized)
+		if (wl->initialized)
 			for (i = 0; i < num_reg_frame; i++) {
 				PRINT_D(INIT_DBG, "Frame registering Type: %x - Reg: %d\n", nic->g_struct_frame_reg[i].frame_type,
 					nic->g_struct_frame_reg[i].reg);
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index ca14fd6..15ce2e8 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -157,7 +157,7 @@ struct wilc_vif {
 
 struct wilc {
 	int mac_status;
-	int wilc1000_initialized;
+	bool initialized;
 	#if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO)
 	unsigned short dev_irq_num;
 	#endif
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 06/16] staging: wilc1000: rename u8NoIfcs in the struct wilc
  2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
                   ` (3 preceding siblings ...)
  2015-10-14 11:46 ` [PATCH 05/16] staging: wilc1000: change the type of wilc1000_initialized Tony Cho
@ 2015-10-14 11:46 ` Tony Cho
  2015-10-14 11:46 ` [PATCH 07/16] staging: wilc1000: rename strInterfaceInfo " Tony Cho
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

This patch renames u8NoIfcs of the struct wilc to the vif_num to avoid
CamelCase naming convention.

Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/linux_wlan.c         | 18 +++++++++---------
 drivers/staging/wilc1000/wilc_wfi_netdevice.h |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index c75dfc4..51c21dd 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -366,7 +366,7 @@ struct net_device *GetIfHandler(u8 *pMacHeader)
 	Bssid  = pMacHeader + 10;
 	Bssid1 = pMacHeader + 4;
 
-	for (i = 0; i < wl->u8NoIfcs; i++)
+	for (i = 0; i < wl->vif_num; i++)
 		if (!memcmp(Bssid1, wl->strInterfaceInfo[i].aBSSID, ETH_ALEN) ||
 		    !memcmp(Bssid, wl->strInterfaceInfo[i].aBSSID, ETH_ALEN))
 			return wl->strInterfaceInfo[i].wilc_netdev;
@@ -376,7 +376,7 @@ struct net_device *GetIfHandler(u8 *pMacHeader)
 		PRINT_D(INIT_DBG, "%02x ", pMacHeader[i]);
 	Bssid  = pMacHeader + 18;
 	Bssid1 = pMacHeader + 12;
-	for (i = 0; i < wl->u8NoIfcs; i++)
+	for (i = 0; i < wl->vif_num; i++)
 		if (!memcmp(Bssid1, wl->strInterfaceInfo[i].aBSSID, ETH_ALEN) ||
 		    !memcmp(Bssid, wl->strInterfaceInfo[i].aBSSID, ETH_ALEN))
 			return wl->strInterfaceInfo[i].wilc_netdev;
@@ -391,7 +391,7 @@ int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID)
 	int ret = -1;
 
 	PRINT_D(INIT_DBG, "set bssid on[%p]\n", wilc_netdev);
-	for (i = 0; i < wl->u8NoIfcs; i++)
+	for (i = 0; i < wl->vif_num; i++)
 		if (wl->strInterfaceInfo[i].wilc_netdev == wilc_netdev) {
 			memcpy(wl->strInterfaceInfo[i].aBSSID, pBSSID, 6);
 			ret = 0;
@@ -408,7 +408,7 @@ int linux_wlan_get_num_conn_ifcs(void)
 	u8 null_bssid[6] = {0};
 	u8 ret_val = 0;
 
-	for (i = 0; i < wl->u8NoIfcs; i++)
+	for (i = 0; i < wl->vif_num; i++)
 		if (memcmp(wl->strInterfaceInfo[i].aBSSID, null_bssid, 6))
 			ret_val++;
 
@@ -1310,7 +1310,7 @@ int mac_open(struct net_device *ndev)
 	PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add);
 
 	/* loop through the NUM of supported devices and set the MAC address */
-	for (i = 0; i < wl->u8NoIfcs; i++)
+	for (i = 0; i < wl->vif_num; i++)
 		if (ndev == wl->strInterfaceInfo[i].wilc_netdev) {
 			memcpy(wl->strInterfaceInfo[i].aSrcAddress, mac_add, ETH_ALEN);
 			wl->strInterfaceInfo[i].drvHandler = priv->hWILCWFIDrv;
@@ -1680,7 +1680,7 @@ void WILC_WFI_mgmt_rx(u8 *buff, u32 size)
 
 	/*Pass the frame on the monitor interface, if any.*/
 	/*Otherwise, pass it on p2p0 netdev, if registered on it*/
-	for (i = 0; i < wl->u8NoIfcs; i++) {
+	for (i = 0; i < wl->vif_num; i++) {
 		nic = netdev_priv(wl->strInterfaceInfo[i].wilc_netdev);
 		if (nic->monitor_flag) {
 			WILC_WFI_monitor_rx(buff, size);
@@ -1733,10 +1733,10 @@ int wilc_netdev_init(void)
 		} else
 			strcpy(ndev->name, "p2p%d");
 
-		nic->u8IfIdx = wl->u8NoIfcs;
+		nic->u8IfIdx = wl->vif_num;
 		nic->wilc_netdev = ndev;
-		wl->strInterfaceInfo[wl->u8NoIfcs].wilc_netdev = ndev;
-		wl->u8NoIfcs++;
+		wl->strInterfaceInfo[wl->vif_num].wilc_netdev = ndev;
+		wl->vif_num++;
 		ndev->netdev_ops = &wilc_netdev_ops;
 
 		{
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 15ce2e8..bd82d78 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -162,7 +162,7 @@ struct wilc {
 	unsigned short dev_irq_num;
 	#endif
 	int close;
-	u8 u8NoIfcs;
+	u8 vif_num;
 	struct wilc_vif strInterfaceInfo[NUM_CONCURRENT_IFC];
 	u8 open_ifcs;
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 07/16] staging: wilc1000: rename strInterfaceInfo in the struct wilc
  2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
                   ` (4 preceding siblings ...)
  2015-10-14 11:46 ` [PATCH 06/16] staging: wilc1000: rename u8NoIfcs in the struct wilc Tony Cho
@ 2015-10-14 11:46 ` Tony Cho
  2015-10-14 11:46 ` [PATCH 08/16] staging: wilc1000: rename aSrcAddress in the struct wilc_vif Tony Cho
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

This patch renames strInterfaceInfo in the struct wilc to the vif.

Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/linux_wlan.c             | 74 +++++++++++------------
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 74 +++++++++++------------
 drivers/staging/wilc1000/wilc_wfi_netdevice.h     |  2 +-
 3 files changed, 72 insertions(+), 78 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 51c21dd..43c3763 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -367,9 +367,9 @@ struct net_device *GetIfHandler(u8 *pMacHeader)
 	Bssid1 = pMacHeader + 4;
 
 	for (i = 0; i < wl->vif_num; i++)
-		if (!memcmp(Bssid1, wl->strInterfaceInfo[i].aBSSID, ETH_ALEN) ||
-		    !memcmp(Bssid, wl->strInterfaceInfo[i].aBSSID, ETH_ALEN))
-			return wl->strInterfaceInfo[i].wilc_netdev;
+		if (!memcmp(Bssid1, wl->vif[i].aBSSID, ETH_ALEN) ||
+		    !memcmp(Bssid, wl->vif[i].aBSSID, ETH_ALEN))
+			return wl->vif[i].wilc_netdev;
 
 	PRINT_INFO(INIT_DBG, "Invalide handle\n");
 	for (i = 0; i < 25; i++)
@@ -377,9 +377,9 @@ struct net_device *GetIfHandler(u8 *pMacHeader)
 	Bssid  = pMacHeader + 18;
 	Bssid1 = pMacHeader + 12;
 	for (i = 0; i < wl->vif_num; i++)
-		if (!memcmp(Bssid1, wl->strInterfaceInfo[i].aBSSID, ETH_ALEN) ||
-		    !memcmp(Bssid, wl->strInterfaceInfo[i].aBSSID, ETH_ALEN))
-			return wl->strInterfaceInfo[i].wilc_netdev;
+		if (!memcmp(Bssid1, wl->vif[i].aBSSID, ETH_ALEN) ||
+		    !memcmp(Bssid, wl->vif[i].aBSSID, ETH_ALEN))
+			return wl->vif[i].wilc_netdev;
 
 	PRINT_INFO(INIT_DBG, "\n");
 	return NULL;
@@ -392,8 +392,8 @@ int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID)
 
 	PRINT_D(INIT_DBG, "set bssid on[%p]\n", wilc_netdev);
 	for (i = 0; i < wl->vif_num; i++)
-		if (wl->strInterfaceInfo[i].wilc_netdev == wilc_netdev) {
-			memcpy(wl->strInterfaceInfo[i].aBSSID, pBSSID, 6);
+		if (wl->vif[i].wilc_netdev == wilc_netdev) {
+			memcpy(wl->vif[i].aBSSID, pBSSID, 6);
 			ret = 0;
 			break;
 		}
@@ -409,7 +409,7 @@ int linux_wlan_get_num_conn_ifcs(void)
 	u8 ret_val = 0;
 
 	for (i = 0; i < wl->vif_num; i++)
-		if (memcmp(wl->strInterfaceInfo[i].aBSSID, null_bssid, 6))
+		if (memcmp(wl->vif[i].aBSSID, null_bssid, 6))
 			ret_val++;
 
 	return ret_val;
@@ -458,10 +458,10 @@ static int linux_wlan_txq_task(void *vp)
 			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); */
-				if (netif_queue_stopped(wl->strInterfaceInfo[0].wilc_netdev))
-					netif_wake_queue(wl->strInterfaceInfo[0].wilc_netdev);
-				if (netif_queue_stopped(wl->strInterfaceInfo[1].wilc_netdev))
-					netif_wake_queue(wl->strInterfaceInfo[1].wilc_netdev);
+				if (netif_queue_stopped(wl->vif[0].wilc_netdev))
+					netif_wake_queue(wl->vif[0].wilc_netdev);
+				if (netif_queue_stopped(wl->vif[1].wilc_netdev))
+					netif_wake_queue(wl->vif[1].wilc_netdev);
 			}
 
 			if (ret == WILC_TX_ERR_NO_BUF) { /* failed to allocate buffers in chip. */
@@ -1311,14 +1311,14 @@ int mac_open(struct net_device *ndev)
 
 	/* loop through the NUM of supported devices and set the MAC address */
 	for (i = 0; i < wl->vif_num; i++)
-		if (ndev == wl->strInterfaceInfo[i].wilc_netdev) {
-			memcpy(wl->strInterfaceInfo[i].aSrcAddress, mac_add, ETH_ALEN);
-			wl->strInterfaceInfo[i].drvHandler = priv->hWILCWFIDrv;
+		if (ndev == wl->vif[i].wilc_netdev) {
+			memcpy(wl->vif[i].aSrcAddress, mac_add, ETH_ALEN);
+			wl->vif[i].drvHandler = priv->hWILCWFIDrv;
 			break;
 		}
 
 	/* TODO: get MAC address whenever the source is EPROM - hardcoded and copy it to ndev*/
-	memcpy(ndev->dev_addr, wl->strInterfaceInfo[i].aSrcAddress, ETH_ALEN);
+	memcpy(ndev->dev_addr, wl->vif[i].aSrcAddress, ETH_ALEN);
 
 	if (!is_valid_ether_addr(ndev->dev_addr)) {
 		PRINT_ER("Error: Wrong MAC address\n");
@@ -1470,14 +1470,14 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
 	PRINT_D(TX_DBG, "Adding tx packet to TX Queue\n");
 	nic->netstats.tx_packets++;
 	nic->netstats.tx_bytes += tx_data->size;
-	tx_data->pBssid = wl->strInterfaceInfo[nic->u8IfIdx].aBSSID;
+	tx_data->pBssid = wl->vif[nic->u8IfIdx].aBSSID;
 	QueueCount = wilc_wlan_txq_add_net_pkt((void *)tx_data, tx_data->buff,
 					       tx_data->size,
 					       linux_wlan_tx_complete);
 
 	if (QueueCount > FLOW_CONTROL_UPPER_THRESHOLD) {
-		netif_stop_queue(wl->strInterfaceInfo[0].wilc_netdev);
-		netif_stop_queue(wl->strInterfaceInfo[1].wilc_netdev);
+		netif_stop_queue(wl->vif[0].wilc_netdev);
+		netif_stop_queue(wl->vif[1].wilc_netdev);
 	}
 
 	return 0;
@@ -1681,17 +1681,17 @@ void WILC_WFI_mgmt_rx(u8 *buff, u32 size)
 	/*Pass the frame on the monitor interface, if any.*/
 	/*Otherwise, pass it on p2p0 netdev, if registered on it*/
 	for (i = 0; i < wl->vif_num; i++) {
-		nic = netdev_priv(wl->strInterfaceInfo[i].wilc_netdev);
+		nic = netdev_priv(wl->vif[i].wilc_netdev);
 		if (nic->monitor_flag) {
 			WILC_WFI_monitor_rx(buff, size);
 			return;
 		}
 	}
 
-	nic = netdev_priv(wl->strInterfaceInfo[1].wilc_netdev); /* p2p0 */
+	nic = netdev_priv(wl->vif[1].wilc_netdev); /* p2p0 */
 	if ((buff[0] == nic->g_struct_frame_reg[0].frame_type && nic->g_struct_frame_reg[0].reg) ||
 	    (buff[0] == nic->g_struct_frame_reg[1].frame_type && nic->g_struct_frame_reg[1].reg))
-		WILC_WFI_p2p_rx(wl->strInterfaceInfo[1].wilc_netdev, buff, size);
+		WILC_WFI_p2p_rx(wl->vif[1].wilc_netdev, buff, size);
 }
 
 int wilc_netdev_init(void)
@@ -1735,7 +1735,7 @@ int wilc_netdev_init(void)
 
 		nic->u8IfIdx = wl->vif_num;
 		nic->wilc_netdev = ndev;
-		wl->strInterfaceInfo[wl->vif_num].wilc_netdev = ndev;
+		wl->vif[wl->vif_num].wilc_netdev = ndev;
 		wl->vif_num++;
 		ndev->netdev_ops = &wilc_netdev_ops;
 
@@ -1830,12 +1830,11 @@ static void __exit exit_wilc_driver(void)
 	perInterface_wlan_t *nic[NUM_CONCURRENT_IFC] = {NULL,};
 	#define CLOSE_TIMEOUT (12 * 1000)
 
-	if (wl && (wl->strInterfaceInfo[0].wilc_netdev ||
-	    wl->strInterfaceInfo[1].wilc_netdev)) {
+	if (wl && (wl->vif[0].wilc_netdev || wl->vif[1].wilc_netdev)) {
 		unregister_inetaddr_notifier(&g_dev_notifier);
 
 		for (i = 0; i < NUM_CONCURRENT_IFC; i++)
-			nic[i] = netdev_priv(wl->strInterfaceInfo[i].wilc_netdev);
+			nic[i] = netdev_priv(wl->vif[i].wilc_netdev);
 	}
 
 	if (wl && wl->wilc_firmware) {
@@ -1843,8 +1842,7 @@ static void __exit exit_wilc_driver(void)
 		wl->wilc_firmware = NULL;
 	}
 
-	if (wl && (wl->strInterfaceInfo[0].wilc_netdev ||
-	    wl->strInterfaceInfo[1].wilc_netdev)) {
+	if (wl && (wl->vif[0].wilc_netdev || wl->vif[1].wilc_netdev)) {
 		PRINT_D(INIT_DBG, "Waiting for mac_close ....\n");
 
 		if (linux_wlan_lock_timeout(&close_exit_sync, CLOSE_TIMEOUT) < 0)
@@ -1852,20 +1850,18 @@ static void __exit exit_wilc_driver(void)
 		else
 			PRINT_D(INIT_DBG, "mac_closed\n");
 
-		for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
-			/* close all opened interfaces */
-			if (wl->strInterfaceInfo[i].wilc_netdev) {
+		for (i = 0; i < NUM_CONCURRENT_IFC; i++)
+			if (wl->vif[i].wilc_netdev)
 				if (nic[i]->mac_opened)
-					mac_close(wl->strInterfaceInfo[i].wilc_netdev);
-			}
-		}
+					mac_close(wl->vif[i].wilc_netdev);
+
 		for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
-			PRINT_D(INIT_DBG, "Unregistering netdev %p\n", wl->strInterfaceInfo[i].wilc_netdev);
-			unregister_netdev(wl->strInterfaceInfo[i].wilc_netdev);
+			PRINT_D(INIT_DBG, "Unregistering netdev %p\n", wl->vif[i].wilc_netdev);
+			unregister_netdev(wl->vif[i].wilc_netdev);
 			PRINT_D(INIT_DBG, "Freeing Wiphy...\n");
-			wilc_free_wiphy(wl->strInterfaceInfo[i].wilc_netdev);
+			wilc_free_wiphy(wl->vif[i].wilc_netdev);
 			PRINT_D(INIT_DBG, "Freeing netdev...\n");
-			free_netdev(wl->strInterfaceInfo[i].wilc_netdev);
+			free_netdev(wl->vif[i].wilc_netdev);
 		}
 	}
 
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index b26caa8..b1267e9 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -624,11 +624,9 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent,
 			u8WLANChannel = INVALID_CHANNEL;
 		/*Incase "P2P CLIENT Connected" send deauthentication reason by 3 to force the WPA_SUPPLICANT to directly change
 		 *      virtual interface to station*/
-		if (pstrWFIDrv->IFC_UP &&
-		   (dev == wl->strInterfaceInfo[1].wilc_netdev))
+		if (pstrWFIDrv->IFC_UP && (dev == wl->vif[1].wilc_netdev))
 			pstrDisconnectNotifInfo->u16reason = 3;
-		else if (!pstrWFIDrv->IFC_UP &&
-			(dev == wl->strInterfaceInfo[1].wilc_netdev))
+		else if (!pstrWFIDrv->IFC_UP && (dev == wl->vif[1].wilc_netdev))
 			pstrDisconnectNotifInfo->u16reason = 1;
 
 		cfg80211_disconnected(dev, pstrDisconnectNotifInfo->u16reason, pstrDisconnectNotifInfo->ie,
@@ -1255,7 +1253,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
 
 				/*save keys only on interface 0 (wifi interface)*/
 				if (!g_gtk_keys_saved &&
-				    netdev == wl->strInterfaceInfo[0].wilc_netdev) {
+				    netdev == wl->vif[0].wilc_netdev) {
 					g_add_gtk_key_params.key_idx = key_index;
 					g_add_gtk_key_params.pairwise = pairwise;
 					if (!mac_addr) {
@@ -1292,7 +1290,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
 
 				/*save keys only on interface 0 (wifi interface)*/
 				if (!g_ptk_keys_saved &&
-				    netdev == wl->strInterfaceInfo[0].wilc_netdev) {
+				    netdev == wl->vif[0].wilc_netdev) {
 					g_add_ptk_key_params.key_idx = key_index;
 					g_add_ptk_key_params.pairwise = pairwise;
 					if (!mac_addr) {
@@ -1357,7 +1355,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
 	priv = wiphy_priv(wiphy);
 
 	/*delete saved keys, if any*/
-	if (netdev == wl->strInterfaceInfo[0].wilc_netdev) {
+	if (netdev == wl->vif[0].wilc_netdev) {
 		g_ptk_keys_saved = false;
 		g_gtk_keys_saved = false;
 		g_wep_keys_saved = false;
@@ -2574,7 +2572,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 
 		if (wl->initialized) {
 			host_int_del_All_Rx_BASession(priv->hWILCWFIDrv,
-						      wl->strInterfaceInfo[0].aBSSID,
+						      wl->vif[0].aBSSID,
 						      TID);
 			/* ensure that the message Q is empty */
 			host_int_wait_msg_queue_idle();
@@ -2588,16 +2586,16 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 			nic->iftype = interface_type;
 
 			/*Setting interface 1 drv handler and mac address in newly downloaded FW*/
-			host_int_set_wfi_drv_handler(wl->strInterfaceInfo[0].drvHandler);
-			host_int_set_MacAddress(wl->strInterfaceInfo[0].drvHandler,
-						wl->strInterfaceInfo[0].aSrcAddress);
+			host_int_set_wfi_drv_handler(wl->vif[0].drvHandler);
+			host_int_set_MacAddress(wl->vif[0].drvHandler,
+						wl->vif[0].aSrcAddress);
 			host_int_set_operation_mode(priv->hWILCWFIDrv, STATION_MODE);
 
 			/*Add saved WEP keys, if any*/
 			if (g_wep_keys_saved) {
-				host_int_set_WEPDefaultKeyID(wl->strInterfaceInfo[0].drvHandler,
+				host_int_set_WEPDefaultKeyID(wl->vif[0].drvHandler,
 							     g_key_wep_params.key_idx);
-				host_int_add_wep_key_bss_sta(wl->strInterfaceInfo[0].drvHandler,
+				host_int_add_wep_key_bss_sta(wl->vif[0].drvHandler,
 							     g_key_wep_params.key,
 							     g_key_wep_params.key_len,
 							     g_key_wep_params.key_idx);
@@ -2615,15 +2613,15 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 				PRINT_D(CFG80211_DBG, "gtk %x %x %x\n", g_key_gtk_params.key[0],
 					g_key_gtk_params.key[1],
 					g_key_gtk_params.key[2]);
-				add_key(wl->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
-					wl->strInterfaceInfo[0].wilc_netdev,
+				add_key(wl->vif[0].wilc_netdev->ieee80211_ptr->wiphy,
+					wl->vif[0].wilc_netdev,
 					g_add_ptk_key_params.key_idx,
 					g_add_ptk_key_params.pairwise,
 					g_add_ptk_key_params.mac_addr,
 					(struct key_params *)(&g_key_ptk_params));
 
-				add_key(wl->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
-					wl->strInterfaceInfo[0].wilc_netdev,
+				add_key(wl->vif[0].wilc_netdev->ieee80211_ptr->wiphy,
+					wl->vif[0].wilc_netdev,
 					g_add_gtk_key_params.key_idx,
 					g_add_gtk_key_params.pairwise,
 					g_add_gtk_key_params.mac_addr,
@@ -2651,7 +2649,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 		PRINT_D(HOSTAPD_DBG, "Interface type = NL80211_IFTYPE_P2P_CLIENT\n");
 
 		host_int_del_All_Rx_BASession(priv->hWILCWFIDrv,
-					      wl->strInterfaceInfo[0].aBSSID, TID);
+					      wl->vif[0].aBSSID, TID);
 
 		dev->ieee80211_ptr->iftype = type;
 		priv->wdev->iftype = type;
@@ -2668,16 +2666,16 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 			wilc1000_wlan_init(dev, nic);
 			g_wilc_initialized = 1;
 
-			host_int_set_wfi_drv_handler(wl->strInterfaceInfo[0].drvHandler);
-			host_int_set_MacAddress(wl->strInterfaceInfo[0].drvHandler,
-						wl->strInterfaceInfo[0].aSrcAddress);
+			host_int_set_wfi_drv_handler(wl->vif[0].drvHandler);
+			host_int_set_MacAddress(wl->vif[0].drvHandler,
+						wl->vif[0].aSrcAddress);
 			host_int_set_operation_mode(priv->hWILCWFIDrv, STATION_MODE);
 
 			/*Add saved WEP keys, if any*/
 			if (g_wep_keys_saved) {
-				host_int_set_WEPDefaultKeyID(wl->strInterfaceInfo[0].drvHandler,
+				host_int_set_WEPDefaultKeyID(wl->vif[0].drvHandler,
 							     g_key_wep_params.key_idx);
-				host_int_add_wep_key_bss_sta(wl->strInterfaceInfo[0].drvHandler,
+				host_int_add_wep_key_bss_sta(wl->vif[0].drvHandler,
 							     g_key_wep_params.key,
 							     g_key_wep_params.key_len,
 							     g_key_wep_params.key_idx);
@@ -2695,15 +2693,15 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 				PRINT_D(CFG80211_DBG, "gtk %x %x %x\n", g_key_gtk_params.key[0],
 					g_key_gtk_params.key[1],
 					g_key_gtk_params.key[2]);
-				add_key(wl->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
-					wl->strInterfaceInfo[0].wilc_netdev,
+				add_key(wl->vif[0].wilc_netdev->ieee80211_ptr->wiphy,
+					wl->vif[0].wilc_netdev,
 					g_add_ptk_key_params.key_idx,
 					g_add_ptk_key_params.pairwise,
 					g_add_ptk_key_params.mac_addr,
 					(struct key_params *)(&g_key_ptk_params));
 
-				add_key(wl->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
-					wl->strInterfaceInfo[0].wilc_netdev,
+				add_key(wl->vif[0].wilc_netdev->ieee80211_ptr->wiphy,
+					wl->vif[0].wilc_netdev,
 					g_add_gtk_key_params.key_idx,
 					g_add_gtk_key_params.pairwise,
 					g_add_gtk_key_params.mac_addr,
@@ -2762,7 +2760,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 		/*hWaitResponse semaphore, which allows previous config*/
 		/*packets to actually take action on old FW*/
 		host_int_del_All_Rx_BASession(priv->hWILCWFIDrv,
-					      wl->strInterfaceInfo[0].aBSSID,
+					      wl->vif[0].aBSSID,
 					      TID);
 		bEnablePS = false;
 		PRINT_D(HOSTAPD_DBG, "Interface type = NL80211_IFTYPE_GO\n");
@@ -2784,16 +2782,16 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 
 
 		/*Setting interface 1 drv handler and mac address in newly downloaded FW*/
-		host_int_set_wfi_drv_handler(wl->strInterfaceInfo[0].drvHandler);
-		host_int_set_MacAddress(wl->strInterfaceInfo[0].drvHandler,
-					wl->strInterfaceInfo[0].aSrcAddress);
+		host_int_set_wfi_drv_handler(wl->vif[0].drvHandler);
+		host_int_set_MacAddress(wl->vif[0].drvHandler,
+					wl->vif[0].aSrcAddress);
 		host_int_set_operation_mode(priv->hWILCWFIDrv, AP_MODE);
 
 		/*Add saved WEP keys, if any*/
 		if (g_wep_keys_saved) {
-			host_int_set_WEPDefaultKeyID(wl->strInterfaceInfo[0].drvHandler,
+			host_int_set_WEPDefaultKeyID(wl->vif[0].drvHandler,
 						     g_key_wep_params.key_idx);
-			host_int_add_wep_key_bss_sta(wl->strInterfaceInfo[0].drvHandler,
+			host_int_add_wep_key_bss_sta(wl->vif[0].drvHandler,
 						     g_key_wep_params.key,
 						     g_key_wep_params.key_len,
 						     g_key_wep_params.key_idx);
@@ -2813,15 +2811,15 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 				g_key_gtk_params.key[1],
 				g_key_gtk_params.key[2],
 				g_key_gtk_params.cipher);
-			add_key(wl->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
-				wl->strInterfaceInfo[0].wilc_netdev,
+			add_key(wl->vif[0].wilc_netdev->ieee80211_ptr->wiphy,
+				wl->vif[0].wilc_netdev,
 				g_add_ptk_key_params.key_idx,
 				g_add_ptk_key_params.pairwise,
 				g_add_ptk_key_params.mac_addr,
 				(struct key_params *)(&g_key_ptk_params));
 
-			add_key(wl->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
-				wl->strInterfaceInfo[0].wilc_netdev,
+			add_key(wl->vif[0].wilc_netdev->ieee80211_ptr->wiphy,
+				wl->vif[0].wilc_netdev,
 				g_add_gtk_key_params.key_idx,
 				g_add_gtk_key_params.pairwise,
 				g_add_gtk_key_params.mac_addr,
@@ -2890,7 +2888,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev,
 	if (s32Error != 0)
 		PRINT_ER("Error in setting channel\n");
 
-	linux_wlan_set_bssid(dev, wl->strInterfaceInfo[0].aSrcAddress);
+	linux_wlan_set_bssid(dev, wl->vif[0].aSrcAddress);
 
 	s32Error = host_int_add_beacon(priv->hWILCWFIDrv,
 					settings->beacon_interval,
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index bd82d78..c903664 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -163,7 +163,7 @@ struct wilc {
 	#endif
 	int close;
 	u8 vif_num;
-	struct wilc_vif strInterfaceInfo[NUM_CONCURRENT_IFC];
+	struct wilc_vif vif[NUM_CONCURRENT_IFC];
 	u8 open_ifcs;
 
 	struct semaphore txq_add_to_head_cs;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 08/16] staging: wilc1000: rename aSrcAddress in the struct wilc_vif
  2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
                   ` (5 preceding siblings ...)
  2015-10-14 11:46 ` [PATCH 07/16] staging: wilc1000: rename strInterfaceInfo " Tony Cho
@ 2015-10-14 11:46 ` Tony Cho
  2015-10-14 11:46 ` [PATCH 09/16] staging: wilc1000: rename aBSSID " Tony Cho
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

This patch renames aSrcAddress in the struct wilc_vif to the src_addr.

Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/linux_wlan.c             | 4 ++--
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 ++++----
 drivers/staging/wilc1000/wilc_wfi_netdevice.h     | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 43c3763..ed21ba8 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1312,13 +1312,13 @@ int mac_open(struct net_device *ndev)
 	/* loop through the NUM of supported devices and set the MAC address */
 	for (i = 0; i < wl->vif_num; i++)
 		if (ndev == wl->vif[i].wilc_netdev) {
-			memcpy(wl->vif[i].aSrcAddress, mac_add, ETH_ALEN);
+			memcpy(wl->vif[i].src_addr, mac_add, ETH_ALEN);
 			wl->vif[i].drvHandler = priv->hWILCWFIDrv;
 			break;
 		}
 
 	/* TODO: get MAC address whenever the source is EPROM - hardcoded and copy it to ndev*/
-	memcpy(ndev->dev_addr, wl->vif[i].aSrcAddress, ETH_ALEN);
+	memcpy(ndev->dev_addr, wl->vif[i].src_addr, ETH_ALEN);
 
 	if (!is_valid_ether_addr(ndev->dev_addr)) {
 		PRINT_ER("Error: Wrong MAC address\n");
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index b1267e9..19bca5d 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -2588,7 +2588,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 			/*Setting interface 1 drv handler and mac address in newly downloaded FW*/
 			host_int_set_wfi_drv_handler(wl->vif[0].drvHandler);
 			host_int_set_MacAddress(wl->vif[0].drvHandler,
-						wl->vif[0].aSrcAddress);
+						wl->vif[0].src_addr);
 			host_int_set_operation_mode(priv->hWILCWFIDrv, STATION_MODE);
 
 			/*Add saved WEP keys, if any*/
@@ -2668,7 +2668,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 
 			host_int_set_wfi_drv_handler(wl->vif[0].drvHandler);
 			host_int_set_MacAddress(wl->vif[0].drvHandler,
-						wl->vif[0].aSrcAddress);
+						wl->vif[0].src_addr);
 			host_int_set_operation_mode(priv->hWILCWFIDrv, STATION_MODE);
 
 			/*Add saved WEP keys, if any*/
@@ -2784,7 +2784,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 		/*Setting interface 1 drv handler and mac address in newly downloaded FW*/
 		host_int_set_wfi_drv_handler(wl->vif[0].drvHandler);
 		host_int_set_MacAddress(wl->vif[0].drvHandler,
-					wl->vif[0].aSrcAddress);
+					wl->vif[0].src_addr);
 		host_int_set_operation_mode(priv->hWILCWFIDrv, AP_MODE);
 
 		/*Add saved WEP keys, if any*/
@@ -2888,7 +2888,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev,
 	if (s32Error != 0)
 		PRINT_ER("Error in setting channel\n");
 
-	linux_wlan_set_bssid(dev, wl->vif[0].aSrcAddress);
+	linux_wlan_set_bssid(dev, wl->vif[0].src_addr);
 
 	s32Error = host_int_add_beacon(priv->hWILCWFIDrv,
 					settings->beacon_interval,
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index c903664..32efa2b 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -149,7 +149,7 @@ typedef struct {
 } struct_frame_reg;
 
 struct wilc_vif {
-	u8 aSrcAddress[ETH_ALEN];
+	u8 src_addr[ETH_ALEN];
 	u8 aBSSID[ETH_ALEN];
 	struct host_if_drv *drvHandler;
 	struct net_device *wilc_netdev;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 09/16] staging: wilc1000: rename aBSSID in the struct wilc_vif
  2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
                   ` (6 preceding siblings ...)
  2015-10-14 11:46 ` [PATCH 08/16] staging: wilc1000: rename aSrcAddress in the struct wilc_vif Tony Cho
@ 2015-10-14 11:46 ` Tony Cho
  2015-10-14 11:46 ` [PATCH 10/16] staging: wilc1000: rename drvHandler " Tony Cho
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

This patch renames aBSSID in the struct wilc_vif to the bssid.

Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/linux_wlan.c             | 14 +++++++-------
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  6 +++---
 drivers/staging/wilc1000/wilc_wfi_netdevice.h     |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index ed21ba8..6478f6e 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -367,8 +367,8 @@ struct net_device *GetIfHandler(u8 *pMacHeader)
 	Bssid1 = pMacHeader + 4;
 
 	for (i = 0; i < wl->vif_num; i++)
-		if (!memcmp(Bssid1, wl->vif[i].aBSSID, ETH_ALEN) ||
-		    !memcmp(Bssid, wl->vif[i].aBSSID, ETH_ALEN))
+		if (!memcmp(Bssid1, wl->vif[i].bssid, ETH_ALEN) ||
+		    !memcmp(Bssid, wl->vif[i].bssid, ETH_ALEN))
 			return wl->vif[i].wilc_netdev;
 
 	PRINT_INFO(INIT_DBG, "Invalide handle\n");
@@ -377,8 +377,8 @@ struct net_device *GetIfHandler(u8 *pMacHeader)
 	Bssid  = pMacHeader + 18;
 	Bssid1 = pMacHeader + 12;
 	for (i = 0; i < wl->vif_num; i++)
-		if (!memcmp(Bssid1, wl->vif[i].aBSSID, ETH_ALEN) ||
-		    !memcmp(Bssid, wl->vif[i].aBSSID, ETH_ALEN))
+		if (!memcmp(Bssid1, wl->vif[i].bssid, ETH_ALEN) ||
+		    !memcmp(Bssid, wl->vif[i].bssid, ETH_ALEN))
 			return wl->vif[i].wilc_netdev;
 
 	PRINT_INFO(INIT_DBG, "\n");
@@ -393,7 +393,7 @@ int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID)
 	PRINT_D(INIT_DBG, "set bssid on[%p]\n", wilc_netdev);
 	for (i = 0; i < wl->vif_num; i++)
 		if (wl->vif[i].wilc_netdev == wilc_netdev) {
-			memcpy(wl->vif[i].aBSSID, pBSSID, 6);
+			memcpy(wl->vif[i].bssid, pBSSID, 6);
 			ret = 0;
 			break;
 		}
@@ -409,7 +409,7 @@ int linux_wlan_get_num_conn_ifcs(void)
 	u8 ret_val = 0;
 
 	for (i = 0; i < wl->vif_num; i++)
-		if (memcmp(wl->vif[i].aBSSID, null_bssid, 6))
+		if (memcmp(wl->vif[i].bssid, null_bssid, 6))
 			ret_val++;
 
 	return ret_val;
@@ -1470,7 +1470,7 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
 	PRINT_D(TX_DBG, "Adding tx packet to TX Queue\n");
 	nic->netstats.tx_packets++;
 	nic->netstats.tx_bytes += tx_data->size;
-	tx_data->pBssid = wl->vif[nic->u8IfIdx].aBSSID;
+	tx_data->pBssid = wl->vif[nic->u8IfIdx].bssid;
 	QueueCount = wilc_wlan_txq_add_net_pkt((void *)tx_data, tx_data->buff,
 					       tx_data->size,
 					       linux_wlan_tx_complete);
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 19bca5d..150397a 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -2572,7 +2572,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 
 		if (wl->initialized) {
 			host_int_del_All_Rx_BASession(priv->hWILCWFIDrv,
-						      wl->vif[0].aBSSID,
+						      wl->vif[0].bssid,
 						      TID);
 			/* ensure that the message Q is empty */
 			host_int_wait_msg_queue_idle();
@@ -2649,7 +2649,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 		PRINT_D(HOSTAPD_DBG, "Interface type = NL80211_IFTYPE_P2P_CLIENT\n");
 
 		host_int_del_All_Rx_BASession(priv->hWILCWFIDrv,
-					      wl->vif[0].aBSSID, TID);
+					      wl->vif[0].bssid, TID);
 
 		dev->ieee80211_ptr->iftype = type;
 		priv->wdev->iftype = type;
@@ -2760,7 +2760,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 		/*hWaitResponse semaphore, which allows previous config*/
 		/*packets to actually take action on old FW*/
 		host_int_del_All_Rx_BASession(priv->hWILCWFIDrv,
-					      wl->vif[0].aBSSID,
+					      wl->vif[0].bssid,
 					      TID);
 		bEnablePS = false;
 		PRINT_D(HOSTAPD_DBG, "Interface type = NL80211_IFTYPE_GO\n");
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 32efa2b..14bfd05 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -150,7 +150,7 @@ typedef struct {
 
 struct wilc_vif {
 	u8 src_addr[ETH_ALEN];
-	u8 aBSSID[ETH_ALEN];
+	u8 bssid[ETH_ALEN];
 	struct host_if_drv *drvHandler;
 	struct net_device *wilc_netdev;
 };
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 10/16] staging: wilc1000: rename drvHandler in the struct wilc_vif
  2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
                   ` (7 preceding siblings ...)
  2015-10-14 11:46 ` [PATCH 09/16] staging: wilc1000: rename aBSSID " Tony Cho
@ 2015-10-14 11:46 ` Tony Cho
  2015-10-14 11:46 ` [PATCH 11/16] staging: wilc1000: rename wilc_netdev " Tony Cho
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

This patch renames drvHandler in the struct wilc_vif to the hif_drv.

Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/linux_wlan.c             |  2 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 24 +++++++++++------------
 drivers/staging/wilc1000/wilc_wfi_netdevice.h     |  2 +-
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 6478f6e..6e21825 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1313,7 +1313,7 @@ int mac_open(struct net_device *ndev)
 	for (i = 0; i < wl->vif_num; i++)
 		if (ndev == wl->vif[i].wilc_netdev) {
 			memcpy(wl->vif[i].src_addr, mac_add, ETH_ALEN);
-			wl->vif[i].drvHandler = priv->hWILCWFIDrv;
+			wl->vif[i].hif_drv = priv->hWILCWFIDrv;
 			break;
 		}
 
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 150397a..d7c9279 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -2586,16 +2586,16 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 			nic->iftype = interface_type;
 
 			/*Setting interface 1 drv handler and mac address in newly downloaded FW*/
-			host_int_set_wfi_drv_handler(wl->vif[0].drvHandler);
-			host_int_set_MacAddress(wl->vif[0].drvHandler,
+			host_int_set_wfi_drv_handler(wl->vif[0].hif_drv);
+			host_int_set_MacAddress(wl->vif[0].hif_drv,
 						wl->vif[0].src_addr);
 			host_int_set_operation_mode(priv->hWILCWFIDrv, STATION_MODE);
 
 			/*Add saved WEP keys, if any*/
 			if (g_wep_keys_saved) {
-				host_int_set_WEPDefaultKeyID(wl->vif[0].drvHandler,
+				host_int_set_WEPDefaultKeyID(wl->vif[0].hif_drv,
 							     g_key_wep_params.key_idx);
-				host_int_add_wep_key_bss_sta(wl->vif[0].drvHandler,
+				host_int_add_wep_key_bss_sta(wl->vif[0].hif_drv,
 							     g_key_wep_params.key,
 							     g_key_wep_params.key_len,
 							     g_key_wep_params.key_idx);
@@ -2666,16 +2666,16 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 			wilc1000_wlan_init(dev, nic);
 			g_wilc_initialized = 1;
 
-			host_int_set_wfi_drv_handler(wl->vif[0].drvHandler);
-			host_int_set_MacAddress(wl->vif[0].drvHandler,
+			host_int_set_wfi_drv_handler(wl->vif[0].hif_drv);
+			host_int_set_MacAddress(wl->vif[0].hif_drv,
 						wl->vif[0].src_addr);
 			host_int_set_operation_mode(priv->hWILCWFIDrv, STATION_MODE);
 
 			/*Add saved WEP keys, if any*/
 			if (g_wep_keys_saved) {
-				host_int_set_WEPDefaultKeyID(wl->vif[0].drvHandler,
+				host_int_set_WEPDefaultKeyID(wl->vif[0].hif_drv,
 							     g_key_wep_params.key_idx);
-				host_int_add_wep_key_bss_sta(wl->vif[0].drvHandler,
+				host_int_add_wep_key_bss_sta(wl->vif[0].hif_drv,
 							     g_key_wep_params.key,
 							     g_key_wep_params.key_len,
 							     g_key_wep_params.key_idx);
@@ -2782,16 +2782,16 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 
 
 		/*Setting interface 1 drv handler and mac address in newly downloaded FW*/
-		host_int_set_wfi_drv_handler(wl->vif[0].drvHandler);
-		host_int_set_MacAddress(wl->vif[0].drvHandler,
+		host_int_set_wfi_drv_handler(wl->vif[0].hif_drv);
+		host_int_set_MacAddress(wl->vif[0].hif_drv,
 					wl->vif[0].src_addr);
 		host_int_set_operation_mode(priv->hWILCWFIDrv, AP_MODE);
 
 		/*Add saved WEP keys, if any*/
 		if (g_wep_keys_saved) {
-			host_int_set_WEPDefaultKeyID(wl->vif[0].drvHandler,
+			host_int_set_WEPDefaultKeyID(wl->vif[0].hif_drv,
 						     g_key_wep_params.key_idx);
-			host_int_add_wep_key_bss_sta(wl->vif[0].drvHandler,
+			host_int_add_wep_key_bss_sta(wl->vif[0].hif_drv,
 						     g_key_wep_params.key,
 						     g_key_wep_params.key_len,
 						     g_key_wep_params.key_idx);
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 14bfd05..64b931b 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -151,7 +151,7 @@ typedef struct {
 struct wilc_vif {
 	u8 src_addr[ETH_ALEN];
 	u8 bssid[ETH_ALEN];
-	struct host_if_drv *drvHandler;
+	struct host_if_drv *hif_drv;
 	struct net_device *wilc_netdev;
 };
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 11/16] staging: wilc1000: rename wilc_netdev in the struct wilc_vif
  2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
                   ` (8 preceding siblings ...)
  2015-10-14 11:46 ` [PATCH 10/16] staging: wilc1000: rename drvHandler " Tony Cho
@ 2015-10-14 11:46 ` Tony Cho
  2015-10-14 11:46 ` [PATCH 12/16] staging: wilc1000: move clean up codes into wl_wlan_cleanup function Tony Cho
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

This patch renames wilc_netdev in the struct wilc_vif to the ndev.

Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/linux_wlan.c             | 45 +++++++++++------------
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 34 ++++++++---------
 drivers/staging/wilc1000/wilc_wfi_netdevice.h     |  2 +-
 3 files changed, 40 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 6e21825..3d02ae7 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -369,7 +369,7 @@ struct net_device *GetIfHandler(u8 *pMacHeader)
 	for (i = 0; i < wl->vif_num; i++)
 		if (!memcmp(Bssid1, wl->vif[i].bssid, ETH_ALEN) ||
 		    !memcmp(Bssid, wl->vif[i].bssid, ETH_ALEN))
-			return wl->vif[i].wilc_netdev;
+			return wl->vif[i].ndev;
 
 	PRINT_INFO(INIT_DBG, "Invalide handle\n");
 	for (i = 0; i < 25; i++)
@@ -379,7 +379,7 @@ struct net_device *GetIfHandler(u8 *pMacHeader)
 	for (i = 0; i < wl->vif_num; i++)
 		if (!memcmp(Bssid1, wl->vif[i].bssid, ETH_ALEN) ||
 		    !memcmp(Bssid, wl->vif[i].bssid, ETH_ALEN))
-			return wl->vif[i].wilc_netdev;
+			return wl->vif[i].ndev;
 
 	PRINT_INFO(INIT_DBG, "\n");
 	return NULL;
@@ -392,7 +392,7 @@ int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID)
 
 	PRINT_D(INIT_DBG, "set bssid on[%p]\n", wilc_netdev);
 	for (i = 0; i < wl->vif_num; i++)
-		if (wl->vif[i].wilc_netdev == wilc_netdev) {
+		if (wl->vif[i].ndev == wilc_netdev) {
 			memcpy(wl->vif[i].bssid, pBSSID, 6);
 			ret = 0;
 			break;
@@ -458,10 +458,10 @@ static int linux_wlan_txq_task(void *vp)
 			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); */
-				if (netif_queue_stopped(wl->vif[0].wilc_netdev))
-					netif_wake_queue(wl->vif[0].wilc_netdev);
-				if (netif_queue_stopped(wl->vif[1].wilc_netdev))
-					netif_wake_queue(wl->vif[1].wilc_netdev);
+				if (netif_queue_stopped(wl->vif[0].ndev))
+					netif_wake_queue(wl->vif[0].ndev);
+				if (netif_queue_stopped(wl->vif[1].ndev))
+					netif_wake_queue(wl->vif[1].ndev);
 			}
 
 			if (ret == WILC_TX_ERR_NO_BUF) { /* failed to allocate buffers in chip. */
@@ -1311,7 +1311,7 @@ int mac_open(struct net_device *ndev)
 
 	/* loop through the NUM of supported devices and set the MAC address */
 	for (i = 0; i < wl->vif_num; i++)
-		if (ndev == wl->vif[i].wilc_netdev) {
+		if (ndev == wl->vif[i].ndev) {
 			memcpy(wl->vif[i].src_addr, mac_add, ETH_ALEN);
 			wl->vif[i].hif_drv = priv->hWILCWFIDrv;
 			break;
@@ -1476,8 +1476,8 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
 					       linux_wlan_tx_complete);
 
 	if (QueueCount > FLOW_CONTROL_UPPER_THRESHOLD) {
-		netif_stop_queue(wl->vif[0].wilc_netdev);
-		netif_stop_queue(wl->vif[1].wilc_netdev);
+		netif_stop_queue(wl->vif[0].ndev);
+		netif_stop_queue(wl->vif[1].ndev);
 	}
 
 	return 0;
@@ -1681,17 +1681,17 @@ void WILC_WFI_mgmt_rx(u8 *buff, u32 size)
 	/*Pass the frame on the monitor interface, if any.*/
 	/*Otherwise, pass it on p2p0 netdev, if registered on it*/
 	for (i = 0; i < wl->vif_num; i++) {
-		nic = netdev_priv(wl->vif[i].wilc_netdev);
+		nic = netdev_priv(wl->vif[i].ndev);
 		if (nic->monitor_flag) {
 			WILC_WFI_monitor_rx(buff, size);
 			return;
 		}
 	}
 
-	nic = netdev_priv(wl->vif[1].wilc_netdev); /* p2p0 */
+	nic = netdev_priv(wl->vif[1].ndev); /* p2p0 */
 	if ((buff[0] == nic->g_struct_frame_reg[0].frame_type && nic->g_struct_frame_reg[0].reg) ||
 	    (buff[0] == nic->g_struct_frame_reg[1].frame_type && nic->g_struct_frame_reg[1].reg))
-		WILC_WFI_p2p_rx(wl->vif[1].wilc_netdev, buff, size);
+		WILC_WFI_p2p_rx(wl->vif[1].ndev, buff, size);
 }
 
 int wilc_netdev_init(void)
@@ -1735,7 +1735,7 @@ int wilc_netdev_init(void)
 
 		nic->u8IfIdx = wl->vif_num;
 		nic->wilc_netdev = ndev;
-		wl->vif[wl->vif_num].wilc_netdev = ndev;
+		wl->vif[wl->vif_num].ndev = ndev;
 		wl->vif_num++;
 		ndev->netdev_ops = &wilc_netdev_ops;
 
@@ -1830,11 +1830,11 @@ static void __exit exit_wilc_driver(void)
 	perInterface_wlan_t *nic[NUM_CONCURRENT_IFC] = {NULL,};
 	#define CLOSE_TIMEOUT (12 * 1000)
 
-	if (wl && (wl->vif[0].wilc_netdev || wl->vif[1].wilc_netdev)) {
+	if (wl && (wl->vif[0].ndev || wl->vif[1].ndev)) {
 		unregister_inetaddr_notifier(&g_dev_notifier);
 
 		for (i = 0; i < NUM_CONCURRENT_IFC; i++)
-			nic[i] = netdev_priv(wl->vif[i].wilc_netdev);
+			nic[i] = netdev_priv(wl->vif[i].ndev);
 	}
 
 	if (wl && wl->wilc_firmware) {
@@ -1842,7 +1842,7 @@ static void __exit exit_wilc_driver(void)
 		wl->wilc_firmware = NULL;
 	}
 
-	if (wl && (wl->vif[0].wilc_netdev || wl->vif[1].wilc_netdev)) {
+	if (wl && (wl->vif[0].ndev || wl->vif[1].ndev)) {
 		PRINT_D(INIT_DBG, "Waiting for mac_close ....\n");
 
 		if (linux_wlan_lock_timeout(&close_exit_sync, CLOSE_TIMEOUT) < 0)
@@ -1851,17 +1851,16 @@ static void __exit exit_wilc_driver(void)
 			PRINT_D(INIT_DBG, "mac_closed\n");
 
 		for (i = 0; i < NUM_CONCURRENT_IFC; i++)
-			if (wl->vif[i].wilc_netdev)
+			if (wl->vif[i].ndev)
 				if (nic[i]->mac_opened)
-					mac_close(wl->vif[i].wilc_netdev);
+					mac_close(wl->vif[i].ndev);
 
 		for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
-			PRINT_D(INIT_DBG, "Unregistering netdev %p\n", wl->vif[i].wilc_netdev);
-			unregister_netdev(wl->vif[i].wilc_netdev);
+			unregister_netdev(wl->vif[i].ndev);
 			PRINT_D(INIT_DBG, "Freeing Wiphy...\n");
-			wilc_free_wiphy(wl->vif[i].wilc_netdev);
+			wilc_free_wiphy(wl->vif[i].ndev);
 			PRINT_D(INIT_DBG, "Freeing netdev...\n");
-			free_netdev(wl->vif[i].wilc_netdev);
+			free_netdev(wl->vif[i].ndev);
 		}
 	}
 
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index d7c9279..ebba9d4 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -624,9 +624,9 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent,
 			u8WLANChannel = INVALID_CHANNEL;
 		/*Incase "P2P CLIENT Connected" send deauthentication reason by 3 to force the WPA_SUPPLICANT to directly change
 		 *      virtual interface to station*/
-		if (pstrWFIDrv->IFC_UP && (dev == wl->vif[1].wilc_netdev))
+		if (pstrWFIDrv->IFC_UP && (dev == wl->vif[1].ndev))
 			pstrDisconnectNotifInfo->u16reason = 3;
-		else if (!pstrWFIDrv->IFC_UP && (dev == wl->vif[1].wilc_netdev))
+		else if (!pstrWFIDrv->IFC_UP && (dev == wl->vif[1].ndev))
 			pstrDisconnectNotifInfo->u16reason = 1;
 
 		cfg80211_disconnected(dev, pstrDisconnectNotifInfo->u16reason, pstrDisconnectNotifInfo->ie,
@@ -1253,7 +1253,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
 
 				/*save keys only on interface 0 (wifi interface)*/
 				if (!g_gtk_keys_saved &&
-				    netdev == wl->vif[0].wilc_netdev) {
+				    netdev == wl->vif[0].ndev) {
 					g_add_gtk_key_params.key_idx = key_index;
 					g_add_gtk_key_params.pairwise = pairwise;
 					if (!mac_addr) {
@@ -1290,7 +1290,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
 
 				/*save keys only on interface 0 (wifi interface)*/
 				if (!g_ptk_keys_saved &&
-				    netdev == wl->vif[0].wilc_netdev) {
+				    netdev == wl->vif[0].ndev) {
 					g_add_ptk_key_params.key_idx = key_index;
 					g_add_ptk_key_params.pairwise = pairwise;
 					if (!mac_addr) {
@@ -1355,7 +1355,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
 	priv = wiphy_priv(wiphy);
 
 	/*delete saved keys, if any*/
-	if (netdev == wl->vif[0].wilc_netdev) {
+	if (netdev == wl->vif[0].ndev) {
 		g_ptk_keys_saved = false;
 		g_gtk_keys_saved = false;
 		g_wep_keys_saved = false;
@@ -2613,15 +2613,15 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 				PRINT_D(CFG80211_DBG, "gtk %x %x %x\n", g_key_gtk_params.key[0],
 					g_key_gtk_params.key[1],
 					g_key_gtk_params.key[2]);
-				add_key(wl->vif[0].wilc_netdev->ieee80211_ptr->wiphy,
-					wl->vif[0].wilc_netdev,
+				add_key(wl->vif[0].ndev->ieee80211_ptr->wiphy,
+					wl->vif[0].ndev,
 					g_add_ptk_key_params.key_idx,
 					g_add_ptk_key_params.pairwise,
 					g_add_ptk_key_params.mac_addr,
 					(struct key_params *)(&g_key_ptk_params));
 
-				add_key(wl->vif[0].wilc_netdev->ieee80211_ptr->wiphy,
-					wl->vif[0].wilc_netdev,
+				add_key(wl->vif[0].ndev->ieee80211_ptr->wiphy,
+					wl->vif[0].ndev,
 					g_add_gtk_key_params.key_idx,
 					g_add_gtk_key_params.pairwise,
 					g_add_gtk_key_params.mac_addr,
@@ -2693,15 +2693,15 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 				PRINT_D(CFG80211_DBG, "gtk %x %x %x\n", g_key_gtk_params.key[0],
 					g_key_gtk_params.key[1],
 					g_key_gtk_params.key[2]);
-				add_key(wl->vif[0].wilc_netdev->ieee80211_ptr->wiphy,
-					wl->vif[0].wilc_netdev,
+				add_key(wl->vif[0].ndev->ieee80211_ptr->wiphy,
+					wl->vif[0].ndev,
 					g_add_ptk_key_params.key_idx,
 					g_add_ptk_key_params.pairwise,
 					g_add_ptk_key_params.mac_addr,
 					(struct key_params *)(&g_key_ptk_params));
 
-				add_key(wl->vif[0].wilc_netdev->ieee80211_ptr->wiphy,
-					wl->vif[0].wilc_netdev,
+				add_key(wl->vif[0].ndev->ieee80211_ptr->wiphy,
+					wl->vif[0].ndev,
 					g_add_gtk_key_params.key_idx,
 					g_add_gtk_key_params.pairwise,
 					g_add_gtk_key_params.mac_addr,
@@ -2811,15 +2811,15 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 				g_key_gtk_params.key[1],
 				g_key_gtk_params.key[2],
 				g_key_gtk_params.cipher);
-			add_key(wl->vif[0].wilc_netdev->ieee80211_ptr->wiphy,
-				wl->vif[0].wilc_netdev,
+			add_key(wl->vif[0].ndev->ieee80211_ptr->wiphy,
+				wl->vif[0].ndev,
 				g_add_ptk_key_params.key_idx,
 				g_add_ptk_key_params.pairwise,
 				g_add_ptk_key_params.mac_addr,
 				(struct key_params *)(&g_key_ptk_params));
 
-			add_key(wl->vif[0].wilc_netdev->ieee80211_ptr->wiphy,
-				wl->vif[0].wilc_netdev,
+			add_key(wl->vif[0].ndev->ieee80211_ptr->wiphy,
+				wl->vif[0].ndev,
 				g_add_gtk_key_params.key_idx,
 				g_add_gtk_key_params.pairwise,
 				g_add_gtk_key_params.mac_addr,
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 64b931b..54b6039 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -152,7 +152,7 @@ struct wilc_vif {
 	u8 src_addr[ETH_ALEN];
 	u8 bssid[ETH_ALEN];
 	struct host_if_drv *hif_drv;
-	struct net_device *wilc_netdev;
+	struct net_device *ndev;
 };
 
 struct wilc {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 12/16] staging: wilc1000: move clean up codes into wl_wlan_cleanup function
  2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
                   ` (9 preceding siblings ...)
  2015-10-14 11:46 ` [PATCH 11/16] staging: wilc1000: rename wilc_netdev " Tony Cho
@ 2015-10-14 11:46 ` Tony Cho
  2015-10-14 11:46 ` [PATCH 13/16] staging: wilc1000: rename wilc_firmware in the struct wilc Tony Cho
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

From: Glen Lee <glen.lee@atmel.com>

This patch moves clean up codes from exit_wilc_driver into the wl_wlan_cleanup
newly introduced in this patch. In addition, it is called by linux_sdio_remove
function.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/linux_wlan.c         | 87 ++++++++++++---------------
 drivers/staging/wilc1000/linux_wlan_sdio.c    |  5 +-
 drivers/staging/wilc1000/wilc_wfi_netdevice.h |  2 +-
 3 files changed, 42 insertions(+), 52 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 3d02ae7..e22d164 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1694,6 +1694,46 @@ void WILC_WFI_mgmt_rx(u8 *buff, u32 size)
 		WILC_WFI_p2p_rx(wl->vif[1].ndev, buff, size);
 }
 
+void wl_wlan_cleanup(void)
+{
+	int i = 0;
+	perInterface_wlan_t *nic[NUM_CONCURRENT_IFC];
+
+	if (wl && (wl->vif[0].ndev || wl->vif[1].ndev)) {
+		unregister_inetaddr_notifier(&g_dev_notifier);
+
+		for (i = 0; i < NUM_CONCURRENT_IFC; i++)
+			nic[i] = netdev_priv(wl->vif[i].ndev);
+	}
+
+	if (wl && wl->wilc_firmware)
+		release_firmware(wl->wilc_firmware);
+
+	if (wl && (wl->vif[0].ndev || wl->vif[1].ndev)) {
+		linux_wlan_lock_timeout(&close_exit_sync, 12 * 1000);
+
+		for (i = 0; i < NUM_CONCURRENT_IFC; i++)
+			if (wl->vif[i].ndev)
+				if (nic[i]->mac_opened)
+					mac_close(wl->vif[i].ndev);
+
+		for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
+			unregister_netdev(wl->vif[i].ndev);
+			wilc_free_wiphy(wl->vif[i].ndev);
+			free_netdev(wl->vif[i].ndev);
+		}
+	}
+
+	if (wl)
+		kfree(wl);
+
+#if defined(WILC_DEBUGFS)
+	wilc_debugfs_remove();
+#endif
+	linux_wlan_device_detection(0);
+	linux_wlan_device_power(0);
+}
+
 int wilc_netdev_init(void)
 {
 
@@ -1826,44 +1866,6 @@ late_initcall(init_wilc_driver);
 
 static void __exit exit_wilc_driver(void)
 {
-	int i = 0;
-	perInterface_wlan_t *nic[NUM_CONCURRENT_IFC] = {NULL,};
-	#define CLOSE_TIMEOUT (12 * 1000)
-
-	if (wl && (wl->vif[0].ndev || wl->vif[1].ndev)) {
-		unregister_inetaddr_notifier(&g_dev_notifier);
-
-		for (i = 0; i < NUM_CONCURRENT_IFC; i++)
-			nic[i] = netdev_priv(wl->vif[i].ndev);
-	}
-
-	if (wl && wl->wilc_firmware) {
-		release_firmware(wl->wilc_firmware);
-		wl->wilc_firmware = NULL;
-	}
-
-	if (wl && (wl->vif[0].ndev || wl->vif[1].ndev)) {
-		PRINT_D(INIT_DBG, "Waiting for mac_close ....\n");
-
-		if (linux_wlan_lock_timeout(&close_exit_sync, CLOSE_TIMEOUT) < 0)
-			PRINT_D(INIT_DBG, "Closed TimedOUT\n");
-		else
-			PRINT_D(INIT_DBG, "mac_closed\n");
-
-		for (i = 0; i < NUM_CONCURRENT_IFC; i++)
-			if (wl->vif[i].ndev)
-				if (nic[i]->mac_opened)
-					mac_close(wl->vif[i].ndev);
-
-		for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
-			unregister_netdev(wl->vif[i].ndev);
-			PRINT_D(INIT_DBG, "Freeing Wiphy...\n");
-			wilc_free_wiphy(wl->vif[i].ndev);
-			PRINT_D(INIT_DBG, "Freeing netdev...\n");
-			free_netdev(wl->vif[i].ndev);
-		}
-	}
-
 #ifndef WILC_SDIO
 	PRINT_D(INIT_DBG, "SPI unregsiter...\n");
 	spi_unregister_driver(&wilc_bus);
@@ -1871,15 +1873,6 @@ static void __exit exit_wilc_driver(void)
 	PRINT_D(INIT_DBG, "SDIO unregsiter...\n");
 	sdio_unregister_driver(&wilc_bus);
 #endif
-	kfree(wl);
-	printk("Module_exit Done.\n");
-
-#if defined(WILC_DEBUGFS)
-	wilc_debugfs_remove();
-#endif
-
-	linux_wlan_device_detection(0);
-	linux_wlan_device_power(0);
 }
 module_exit(exit_wilc_driver);
 
diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c
index 0dd4b19..c78f3a5 100644
--- a/drivers/staging/wilc1000/linux_wlan_sdio.c
+++ b/drivers/staging/wilc1000/linux_wlan_sdio.c
@@ -136,10 +136,7 @@ static int linux_sdio_probe(struct sdio_func *func, const struct sdio_device_id
 
 static void linux_sdio_remove(struct sdio_func *func)
 {
-	/**
-	 *      TODO
-	 **/
-
+	wl_wlan_cleanup();
 }
 
 struct sdio_driver wilc_bus = {
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 54b6039..4f7c600 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -213,5 +213,5 @@ void linux_wlan_mac_indicate(int flag);
 void linux_wlan_rx_complete(void);
 void linux_wlan_dbg(u8 *buff);
 int linux_wlan_lock_timeout(void *vp, u32 timeout);
-
+void wl_wlan_cleanup(void);
 #endif
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 13/16] staging: wilc1000: rename wilc_firmware in the struct wilc
  2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
                   ` (10 preceding siblings ...)
  2015-10-14 11:46 ` [PATCH 12/16] staging: wilc1000: move clean up codes into wl_wlan_cleanup function Tony Cho
@ 2015-10-14 11:46 ` Tony Cho
  2015-10-14 11:46 ` [PATCH 14/16] staging: wilc1000: remove COMPLEMENT_BOOT Tony Cho
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

This patch renames wilc_firmware in the struct wilc to the firmware. In
addition, null assignments to the wl->firmware after release_firmware are
removed because it is not necessary.

Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/linux_wlan.c         | 15 +++++++--------
 drivers/staging/wilc1000/wilc_wfi_netdevice.h |  2 +-
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index e22d164..e8fe780 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -538,7 +538,7 @@ int linux_wlan_get_firmware(perInterface_wlan_t *p_nic)
 		goto _fail_;
 	}
 #endif
-	wl->wilc_firmware = wilc_firmware;
+	wl->firmware = wilc_firmware;
 
 _fail_:
 
@@ -595,7 +595,7 @@ static int linux_wlan_firmware_download(struct wilc *p_nic)
 
 	int ret = 0;
 
-	if (!wl->wilc_firmware) {
+	if (!wl->firmware) {
 		PRINT_ER("Firmware buffer is NULL\n");
 		ret = -ENOBUFS;
 		goto _FAIL_;
@@ -604,16 +604,15 @@ static int linux_wlan_firmware_download(struct wilc *p_nic)
 	 *      do the firmware download
 	 **/
 	PRINT_D(INIT_DBG, "Downloading Firmware ...\n");
-	ret = wilc_wlan_firmware_download(wl->wilc_firmware->data,
-					  wl->wilc_firmware->size);
+	ret = wilc_wlan_firmware_download(wl->firmware->data,
+					  wl->firmware->size);
 	if (ret < 0)
 		goto _FAIL_;
 
 	/* Freeing FW buffer */
 	PRINT_D(INIT_DBG, "Freeing FW buffer ...\n");
 	PRINT_D(INIT_DBG, "Releasing firmware\n");
-	release_firmware(wl->wilc_firmware);
-	wl->wilc_firmware = NULL;
+	release_firmware(wl->firmware);
 
 	PRINT_D(INIT_DBG, "Download Succeeded\n");
 
@@ -1706,8 +1705,8 @@ void wl_wlan_cleanup(void)
 			nic[i] = netdev_priv(wl->vif[i].ndev);
 	}
 
-	if (wl && wl->wilc_firmware)
-		release_firmware(wl->wilc_firmware);
+	if (wl && wl->firmware)
+		release_firmware(wl->firmware);
 
 	if (wl && (wl->vif[0].ndev || wl->vif[1].ndev)) {
 		linux_wlan_lock_timeout(&close_exit_sync, 12 * 1000);
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 4f7c600..a6b948a 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -182,7 +182,7 @@ struct wilc {
 
 	unsigned char eth_src_address[NUM_CONCURRENT_IFC][6];
 
-	const struct firmware *wilc_firmware;
+	const struct firmware *firmware;
 
 #ifdef WILC_SDIO
 	struct sdio_func *wilc_sdio_func;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 14/16] staging: wilc1000: remove COMPLEMENT_BOOT
  2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
                   ` (11 preceding siblings ...)
  2015-10-14 11:46 ` [PATCH 13/16] staging: wilc1000: rename wilc_firmware in the struct wilc Tony Cho
@ 2015-10-14 11:46 ` Tony Cho
  2015-10-14 11:46 ` [PATCH 15/16] staging: wilc1000: introduce struct wilc_sdio for sdio data Tony Cho
  2015-10-14 11:46 ` [PATCH 16/16] staging: wilc1000: assign pointer of wl to sdio device data Tony Cho
  14 siblings, 0 replies; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

This patch removes a preprocessor definition, COMPLEMENT_BOOT which is
not used anymore. This is just workaround to avoid weird issue, which is
that 11b core is not ready after the power is givin to the chip. However, this
issue happened only in the unstable hardware and no more seen. In addition,
this patch removes _fail_threads_ statement to avoid the build warning
after removing COMPLEMENT_BOOT conditionals.

Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/linux_wlan.c      | 131 ++---------------------------
 drivers/staging/wilc1000/linux_wlan_sdio.c |   9 --
 drivers/staging/wilc1000/wilc_wlan.c       |  18 ----
 3 files changed, 7 insertions(+), 151 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index e8fe780..4708d44 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -546,10 +546,6 @@ _fail_:
 
 }
 
-#ifdef COMPLEMENT_BOOT
-int repeat_power_cycle(perInterface_wlan_t *nic);
-#endif
-
 static int linux_wlan_start_firmware(perInterface_wlan_t *nic)
 {
 
@@ -566,18 +562,6 @@ static int linux_wlan_start_firmware(perInterface_wlan_t *nic)
 	PRINT_D(INIT_DBG, "Waiting for Firmware to get ready ...\n");
 	ret = linux_wlan_lock_timeout(&wl->sync_event, 5000);
 	if (ret) {
-#ifdef COMPLEMENT_BOOT
-		static int timeout = 5;
-
-		if (timeout--) {
-			PRINT_D(INIT_DBG, "repeat power cycle[%d]", timeout);
-			ret = repeat_power_cycle(nic);
-		} else {
-			timeout = 5;
-			ret = -1;
-			goto _fail_;
-		}
-#endif
 		PRINT_D(INIT_DBG, "Firmware start timed out");
 		goto _fail_;
 	}
@@ -1037,97 +1021,6 @@ static void wlan_deinitialize_threads(struct wilc *nic)
 	}
 }
 
-#ifdef COMPLEMENT_BOOT
-
-extern volatile int probe;
-extern u8 core_11b_ready(void);
-
-#define READY_CHECK_THRESHOLD		30
-extern void wilc_wlan_global_reset(void);
-u8 wilc1000_prepare_11b_core(wilc_wlan_inp_t *nwi, struct wilc *nic)
-{
-	u8 trials = 0;
-
-	while ((core_11b_ready() && (READY_CHECK_THRESHOLD > (trials++)))) {
-		PRINT_D(INIT_DBG, "11b core not ready yet: %u\n", trials);
-		wilc_wlan_cleanup();
-		wilc_wlan_global_reset();
-		sdio_unregister_driver(&wilc_bus);
-
-		linux_wlan_device_detection(0);
-
-		mdelay(100);
-
-		linux_wlan_device_detection(1);
-
-		sdio_register_driver(&wilc_bus);
-
-		while (!probe)
-			msleep(100);
-		probe = 0;
-		wl->wilc_sdio_func = local_sdio_func;
-		linux_to_wlan(nwi, nic);
-		wilc_wlan_init(nwi);
-	}
-
-	if (READY_CHECK_THRESHOLD <= trials)
-		return 1;
-	else
-		return 0;
-
-}
-
-int repeat_power_cycle(perInterface_wlan_t *nic)
-{
-	int ret = 0;
-	wilc_wlan_inp_t nwi;
-
-	sdio_unregister_driver(&wilc_bus);
-
-	linux_wlan_device_detection(0);
-	linux_wlan_device_power(0);
-	msleep(100);
-	linux_wlan_device_power(1);
-	msleep(80);
-	linux_wlan_device_detection(1);
-	msleep(20);
-
-	sdio_register_driver(&wilc_bus);
-
-	/* msleep(1000); */
-	while (!probe)
-		msleep(100);
-	probe = 0;
-	wl->wilc_sdio_func = local_sdio_func;
-	linux_to_wlan(&nwi, wl);
-	ret = wilc_wlan_init(&nwi);
-
-	wl->mac_status = WILC_MAC_STATUS_INIT;
-	#if (defined WILC_SDIO) && (!defined WILC_SDIO_IRQ_GPIO)
-	enable_sdio_interrupt();
-	#endif
-
-	if (linux_wlan_get_firmware(nic)) {
-		PRINT_ER("Can't get firmware\n");
-		ret = -1;
-		goto __fail__;
-	}
-
-	/*Download firmware*/
-	ret = linux_wlan_firmware_download(wl);
-	if (ret < 0) {
-		PRINT_ER("Failed to download firmware\n");
-		goto __fail__;
-	}
-	/* Start firmware*/
-	ret = linux_wlan_start_firmware(nic);
-	if (ret < 0)
-		PRINT_ER("Failed to start firmware\n");
-__fail__:
-	return ret;
-}
-#endif
-
 int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
 {
 	wilc_wlan_inp_t nwi;
@@ -1149,28 +1042,19 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
 			goto _fail_locks_;
 		}
 
-		ret = wlan_initialize_threads(nic);
-		if (ret < 0) {
-			PRINT_ER("Initializing Threads FAILED\n");
-			ret = -EIO;
-			goto _fail_wilc_wlan_;
-		}
-
-#if (defined WILC_SDIO) && (defined COMPLEMENT_BOOT)
-		if (wilc1000_prepare_11b_core(&nwi, wl)) {
-			PRINT_ER("11b Core is not ready\n");
-			ret = -EIO;
-			goto _fail_threads_;
-		}
-#endif
-
 #if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO)
 		if (init_irq(wl)) {
 			PRINT_ER("couldn't initialize IRQ\n");
 			ret = -EIO;
-			goto _fail_threads_;
+			goto _fail_locks_;
 		}
 #endif
+		ret = wlan_initialize_threads(nic);
+		if (ret < 0) {
+			PRINT_ER("Initializing Threads FAILED\n");
+			ret = -EIO;
+			goto _fail_wilc_wlan_;
+		}
 
 #if (defined WILC_SDIO) && (!defined WILC_SDIO_IRQ_GPIO)
 		if (enable_sdio_interrupt()) {
@@ -1238,7 +1122,6 @@ _fail_irq_init_:
 		deinit_irq(wl);
 
 #endif
-_fail_threads_:
 		wlan_deinitialize_threads(wl);
 _fail_wilc_wlan_:
 		wilc_wlan_cleanup();
diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c
index c78f3a5..5578ab2 100644
--- a/drivers/staging/wilc1000/linux_wlan_sdio.c
+++ b/drivers/staging/wilc1000/linux_wlan_sdio.c
@@ -110,19 +110,10 @@ int linux_sdio_cmd53(sdio_cmd53_t *cmd)
 	return 1;
 }
 
-volatile int probe; /* COMPLEMENT_BOOT */
 static int linux_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
 {
 	PRINT_D(INIT_DBG, "probe function\n");
 
-#ifdef COMPLEMENT_BOOT
-	if (local_sdio_func != NULL) {
-		local_sdio_func = func;
-		probe = 1;
-		PRINT_D(INIT_DBG, "local_sdio_func isn't NULL\n");
-		return 0;
-	}
-#endif
 	PRINT_D(INIT_DBG, "Initializing netdev\n");
 	local_sdio_func = func;
 	if (wilc_netdev_init()) {
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 317b645..67f18fe 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1919,24 +1919,6 @@ _fail_:
 	return chipid;
 }
 
-#ifdef COMPLEMENT_BOOT
-u8 core_11b_ready(void)
-{
-	u32 reg_val;
-
-	acquire_bus(ACQUIRE_ONLY);
-	g_wlan.hif_func.hif_write_reg(0x16082c, 1);
-	g_wlan.hif_func.hif_write_reg(0x161600, 0x90);
-	g_wlan.hif_func.hif_read_reg(0x161600, &reg_val);
-	release_bus(RELEASE_ONLY);
-
-	if (reg_val == 0x90)
-		return 0;
-	else
-		return 1;
-}
-#endif
-
 int wilc_wlan_init(wilc_wlan_inp_t *inp)
 {
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 15/16] staging: wilc1000: introduce struct wilc_sdio for sdio data
  2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
                   ` (12 preceding siblings ...)
  2015-10-14 11:46 ` [PATCH 14/16] staging: wilc1000: remove COMPLEMENT_BOOT Tony Cho
@ 2015-10-14 11:46 ` Tony Cho
  2015-10-14 11:46 ` [PATCH 16/16] staging: wilc1000: assign pointer of wl to sdio device data Tony Cho
  14 siblings, 0 replies; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

From: Glen Lee <glen.lee@atmel.com>

This patch introduces struct wilc_sdio for sdio driver data. The wilc_sdio is
allocated and set as driver data when the sdio is probed and deallocated when
the sdio is removed.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/linux_wlan_sdio.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c
index 5578ab2..7fd53be 100644
--- a/drivers/staging/wilc1000/linux_wlan_sdio.c
+++ b/drivers/staging/wilc1000/linux_wlan_sdio.c
@@ -21,6 +21,10 @@
  #define MAX_SPEED (6 * 1000000) /* Max 50M */
 #endif
 
+struct wilc_sdio {
+	struct sdio_func *func;
+	struct wilc *wilc;
+};
 
 struct sdio_func *local_sdio_func;
 extern int wilc_netdev_init(void);
@@ -112,14 +116,22 @@ int linux_sdio_cmd53(sdio_cmd53_t *cmd)
 
 static int linux_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
 {
+	struct wilc_sdio *wl_sdio;
+
 	PRINT_D(INIT_DBG, "probe function\n");
+	wl_sdio = kzalloc(sizeof(struct wilc_sdio), GFP_KERNEL);
+	if (!wl_sdio)
+		return -ENOMEM;
 
 	PRINT_D(INIT_DBG, "Initializing netdev\n");
 	local_sdio_func = func;
 	if (wilc_netdev_init()) {
 		PRINT_ER("Couldn't initialize netdev\n");
+		kfree(wl_sdio);
 		return -1;
 	}
+	wl_sdio->func = func;
+	sdio_set_drvdata(func, wl_sdio);
 
 	printk("Driver Initializing success\n");
 	return 0;
@@ -127,7 +139,11 @@ static int linux_sdio_probe(struct sdio_func *func, const struct sdio_device_id
 
 static void linux_sdio_remove(struct sdio_func *func)
 {
+	struct wilc_sdio *wl_sdio;
+
+	wl_sdio = sdio_get_drvdata(func);
 	wl_wlan_cleanup();
+	kfree(wl_sdio);
 }
 
 struct sdio_driver wilc_bus = {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 16/16] staging: wilc1000: assign pointer of wl to sdio device data
  2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
                   ` (13 preceding siblings ...)
  2015-10-14 11:46 ` [PATCH 15/16] staging: wilc1000: introduce struct wilc_sdio for sdio data Tony Cho
@ 2015-10-14 11:46 ` Tony Cho
  2015-10-17  8:21   ` kbuild test robot
  14 siblings, 1 reply; 20+ messages in thread
From: Tony Cho @ 2015-10-14 11:46 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
	tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
	adham.abozaeid, Nicolas.FERRE

From: Glen Lee <glen.lee@atmel.com>

This patch assigns wl pointer to sdio device data. The global variable wl will
be removed finally.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/linux_wlan.c         | 3 ++-
 drivers/staging/wilc1000/linux_wlan_sdio.c    | 5 +++--
 drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 +
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 4708d44..3cc4861 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1616,7 +1616,7 @@ void wl_wlan_cleanup(void)
 	linux_wlan_device_power(0);
 }
 
-int wilc_netdev_init(void)
+int wilc_netdev_init(struct wilc **wilc)
 {
 
 	int i;
@@ -1629,6 +1629,7 @@ int wilc_netdev_init(void)
 	wl = kzalloc(sizeof(*wl), GFP_KERNEL);
 	if (!wl)
 		return -ENOMEM;
+	*wilc = wl;
 
 	register_inetaddr_notifier(&g_dev_notifier);
 
diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c
index 7fd53be..45342e8 100644
--- a/drivers/staging/wilc1000/linux_wlan_sdio.c
+++ b/drivers/staging/wilc1000/linux_wlan_sdio.c
@@ -27,7 +27,6 @@ struct wilc_sdio {
 };
 
 struct sdio_func *local_sdio_func;
-extern int wilc_netdev_init(void);
 extern void wilc_handle_isr(void);
 
 static unsigned int sdio_default_speed;
@@ -117,6 +116,7 @@ int linux_sdio_cmd53(sdio_cmd53_t *cmd)
 static int linux_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
 {
 	struct wilc_sdio *wl_sdio;
+	struct wilc *wilc;
 
 	PRINT_D(INIT_DBG, "probe function\n");
 	wl_sdio = kzalloc(sizeof(struct wilc_sdio), GFP_KERNEL);
@@ -125,12 +125,13 @@ static int linux_sdio_probe(struct sdio_func *func, const struct sdio_device_id
 
 	PRINT_D(INIT_DBG, "Initializing netdev\n");
 	local_sdio_func = func;
-	if (wilc_netdev_init()) {
+	if (wilc_netdev_init(&wilc)) {
 		PRINT_ER("Couldn't initialize netdev\n");
 		kfree(wl_sdio);
 		return -1;
 	}
 	wl_sdio->func = func;
+	wl_sdio->wilc = wilc;
 	sdio_set_drvdata(func, wl_sdio);
 
 	printk("Driver Initializing success\n");
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index a6b948a..9a9e082 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -214,4 +214,5 @@ void linux_wlan_rx_complete(void);
 void linux_wlan_dbg(u8 *buff);
 int linux_wlan_lock_timeout(void *vp, u32 timeout);
 void wl_wlan_cleanup(void);
+int wilc_netdev_init(struct wilc **wilc);
 #endif
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH 03/16] staging: wilc1000: rename g_linux_wlan to wl
  2015-10-14 11:46 ` [PATCH 03/16] staging: wilc1000: rename g_linux_wlan to wl Tony Cho
@ 2015-10-17  4:33   ` Greg KH
  2015-10-19  2:19     ` Tony Cho
  0 siblings, 1 reply; 20+ messages in thread
From: Greg KH @ 2015-10-17  4:33 UTC (permalink / raw)
  To: Tony Cho
  Cc: devel, rachel.kim, chris.park, austin.shin, linux-wireless,
	johnny.kim, Nicolas.FERRE, adel.noureldin, leo.kim,
	adham.abozaeid

On Wed, Oct 14, 2015 at 08:46:31PM +0900, Tony Cho wrote:
> This patch renames g_linux_wlan to wl.

Why?  What's wrong with g_linux_wlan?  You will need to delete this
entire variable soon anyway, might as well leave it alone until then.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 05/16] staging: wilc1000: change the type of wilc1000_initialized
  2015-10-14 11:46 ` [PATCH 05/16] staging: wilc1000: change the type of wilc1000_initialized Tony Cho
@ 2015-10-17  4:35   ` Greg KH
  0 siblings, 0 replies; 20+ messages in thread
From: Greg KH @ 2015-10-17  4:35 UTC (permalink / raw)
  To: Tony Cho
  Cc: devel, rachel.kim, chris.park, austin.shin, linux-wireless,
	johnny.kim, Nicolas.FERRE, adel.noureldin, leo.kim,
	adham.abozaeid

On Wed, Oct 14, 2015 at 08:46:33PM +0900, Tony Cho wrote:
> This patch changes the type of wilc1000_initialized in the struct wilc from
> int to bool and renames it to the initialized. In addition, the unncessary
> wilc1000_initialized codes are removed in this patch.

because I didn't take the rename patch, this one didn't apply, so I've
stopped here in the patch series.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 16/16] staging: wilc1000: assign pointer of wl to sdio device data
  2015-10-14 11:46 ` [PATCH 16/16] staging: wilc1000: assign pointer of wl to sdio device data Tony Cho
@ 2015-10-17  8:21   ` kbuild test robot
  0 siblings, 0 replies; 20+ messages in thread
From: kbuild test robot @ 2015-10-17  8:21 UTC (permalink / raw)
  To: Tony Cho
  Cc: kbuild-all, gregkh, devel, linux-wireless, johnny.kim,
	chris.park, rachel.kim, tony.cho, glen.lee, leo.kim, austin.shin,
	adel.noureldin, adham.abozaeid, Nicolas.FERRE

[-- Attachment #1: Type: text/plain, Size: 1926 bytes --]

Hi Glen,

[auto build test ERROR 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/Tony-Cho/staging-wilc1000-remove-extern-declarations-of-g_linux_wlan/20151014-195239
config: i386-randconfig-c0-10171523 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/staging/wilc1000/linux_wlan.c: In function 'init_wilc_driver':
>> drivers/staging/wilc1000/linux_wlan.c:1743:6: error: too few arguments to function 'wilc_netdev_init'
     if (wilc_netdev_init())
         ^
   drivers/staging/wilc1000/linux_wlan.c:1619:5: note: declared here
    int wilc_netdev_init(struct wilc **wilc)
        ^

vim +/wilc_netdev_init +1743 drivers/staging/wilc1000/linux_wlan.c

c5c77ba1 Johnny Kim 2015-05-11  1737  			PRINT_D(INIT_DBG, "init_wilc_driver: Failed register sdio driver\n");
c5c77ba1 Johnny Kim 2015-05-11  1738  
c5c77ba1 Johnny Kim 2015-05-11  1739  		return ret;
c5c77ba1 Johnny Kim 2015-05-11  1740  	}
c5c77ba1 Johnny Kim 2015-05-11  1741  #else
c5c77ba1 Johnny Kim 2015-05-11  1742  	PRINT_D(INIT_DBG, "Initializing netdev\n");
fc4b95d6 Kim, Leo   2015-07-28 @1743  	if (wilc_netdev_init())
c5c77ba1 Johnny Kim 2015-05-11  1744  		PRINT_ER("Couldn't initialize netdev\n");
c5c77ba1 Johnny Kim 2015-05-11  1745  	return 0;
c5c77ba1 Johnny Kim 2015-05-11  1746  #endif

:::::: The code at line 1743 was first introduced by commit
:::::: fc4b95d69c603668331d1edb92e3fb0dbcb1d959 staging: wilc1000: remove braces {} for single statement blocks

:::::: TO: Kim, Leo <leo.kim@atmel.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 31382 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 03/16] staging: wilc1000: rename g_linux_wlan to wl
  2015-10-17  4:33   ` Greg KH
@ 2015-10-19  2:19     ` Tony Cho
  0 siblings, 0 replies; 20+ messages in thread
From: Tony Cho @ 2015-10-19  2:19 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, rachel.kim, chris.park, austin.shin, linux-wireless,
	johnny.kim, Nicolas.FERRE, adel.noureldin, leo.kim,
	adham.abozaeid



On 2015년 10월 17일 13:33, Greg KH wrote:
> On Wed, Oct 14, 2015 at 08:46:31PM +0900, Tony Cho wrote:
>> This patch renames g_linux_wlan to wl.
> Why?  What's wrong with g_linux_wlan?  You will need to delete this
> entire variable soon anyway, might as well leave it alone until then.

The reason why I rename it to the "wl" is that there first is 80 ending line over issue due to its length where I want to modify
and also we will take our representative structure as "wl" in the future. As you expected, finally g_linux_wlan global variable will
all be deleted by referring it from the private structure as it is introduced in another 13 series of patch.

However, as you guided, I will leave it until all of patch is done.

Thanks,

Tony.

> thanks,
>
> greg k-h


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2015-10-19  2:19 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-14 11:46 [PATCH 01/16] staging: wilc1000: remove extern declarations of g_linux_wlan Tony Cho
2015-10-14 11:46 ` [PATCH 02/16] staging: wilc1000: remove typedef from the linux_wlan_t Tony Cho
2015-10-14 11:46 ` [PATCH 03/16] staging: wilc1000: rename g_linux_wlan to wl Tony Cho
2015-10-17  4:33   ` Greg KH
2015-10-19  2:19     ` Tony Cho
2015-10-14 11:46 ` [PATCH 04/16] staging: wilc1000: remove typedef from the tstrInterfaceInfo Tony Cho
2015-10-14 11:46 ` [PATCH 05/16] staging: wilc1000: change the type of wilc1000_initialized Tony Cho
2015-10-17  4:35   ` Greg KH
2015-10-14 11:46 ` [PATCH 06/16] staging: wilc1000: rename u8NoIfcs in the struct wilc Tony Cho
2015-10-14 11:46 ` [PATCH 07/16] staging: wilc1000: rename strInterfaceInfo " Tony Cho
2015-10-14 11:46 ` [PATCH 08/16] staging: wilc1000: rename aSrcAddress in the struct wilc_vif Tony Cho
2015-10-14 11:46 ` [PATCH 09/16] staging: wilc1000: rename aBSSID " Tony Cho
2015-10-14 11:46 ` [PATCH 10/16] staging: wilc1000: rename drvHandler " Tony Cho
2015-10-14 11:46 ` [PATCH 11/16] staging: wilc1000: rename wilc_netdev " Tony Cho
2015-10-14 11:46 ` [PATCH 12/16] staging: wilc1000: move clean up codes into wl_wlan_cleanup function Tony Cho
2015-10-14 11:46 ` [PATCH 13/16] staging: wilc1000: rename wilc_firmware in the struct wilc Tony Cho
2015-10-14 11:46 ` [PATCH 14/16] staging: wilc1000: remove COMPLEMENT_BOOT Tony Cho
2015-10-14 11:46 ` [PATCH 15/16] staging: wilc1000: introduce struct wilc_sdio for sdio data Tony Cho
2015-10-14 11:46 ` [PATCH 16/16] staging: wilc1000: assign pointer of wl to sdio device data Tony Cho
2015-10-17  8:21   ` kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.