From: Glen Lee
Use netdev private data member wilc instead of global variable g_linux_wlan.
Signed-off-by: Glen Lee
Signed-off-by: Tony Cho
---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 85 ---
1 file changed, 45 insertions(+), 40 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 264fcb9..422d462 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -2534,9 +2534,11 @@ static int change_virtual_intf(struct wiphy *wiphy,
struct net_device *dev,
u8 interface_type;
u16 TID = 0;
u8 i;
+ struct wilc *wl;
nic = netdev_priv(dev);
priv = wiphy_priv(wiphy);
+ wl = nic->wilc;
PRINT_D(HOSTAPD_DBG, "In Change virtual interface function\n");
PRINT_D(HOSTAPD_DBG, "Wireless interface name =%s\n", dev->name);
@@ -2571,30 +2573,31 @@ static int change_virtual_intf(struct wiphy *wiphy,
struct net_device *dev,
interface_type = nic->iftype;
nic->iftype = STATION_MODE;
- if (g_linux_wlan->initialized) {
- host_int_del_All_Rx_BASession(priv->hWILCWFIDrv,
g_linux_wlan->vif[0].bssid, TID);
+ if (wl->initialized) {
+ host_int_del_All_Rx_BASession(priv->hWILCWFIDrv,
+ wl->vif[0].bssid, 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->vif[0].hif_drv);
- host_int_set_MacAddress(g_linux_wlan->vif[0].hif_drv,
- g_linux_wlan->vif[0].src_addr);
+ 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(g_linux_wlan->vif[0].hif_drv,
+ host_int_set_WEPDefaultKeyID(wl->vif[0].hif_drv,
g_key_wep_params.key_idx);
-
host_int_add_wep_key_bss_sta(g_linux_wlan->vif[0].hif_drv,
+ 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);
@@ -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->vif[0].ndev->ieee80211_ptr->wiphy,
- g_linux_wlan->vif[0].ndev,
+ 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(g_linux_wlan->vif[0].ndev->ieee80211_ptr->wiphy,
- g_linux_wlan->vif[0].ndev,
+ 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,
(struct key_params
*)(&g