Commit 90b984c8 authored by Glen Lee's avatar Glen Lee Committed by Greg Kroah-Hartman

staging: wilc1000: wl_wlan_cleanup: add argument struct wilc

This patch adds new argument struct wilc and use it instead of g_linux_wlan.
Signed-off-by: default avatarGlen Lee <glen.lee@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 65c8adcf
...@@ -1651,39 +1651,39 @@ void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size) ...@@ -1651,39 +1651,39 @@ void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size)
WILC_WFI_p2p_rx(wilc->vif[1].ndev, buff, size); WILC_WFI_p2p_rx(wilc->vif[1].ndev, buff, size);
} }
void wl_wlan_cleanup(void) void wl_wlan_cleanup(struct wilc *wilc)
{ {
int i = 0; int i = 0;
perInterface_wlan_t *nic[NUM_CONCURRENT_IFC]; perInterface_wlan_t *nic[NUM_CONCURRENT_IFC];
if (g_linux_wlan && if (wilc &&
(g_linux_wlan->vif[0].ndev || g_linux_wlan->vif[1].ndev)) { (wilc->vif[0].ndev || wilc->vif[1].ndev)) {
unregister_inetaddr_notifier(&g_dev_notifier); unregister_inetaddr_notifier(&g_dev_notifier);
for (i = 0; i < NUM_CONCURRENT_IFC; i++) for (i = 0; i < NUM_CONCURRENT_IFC; i++)
nic[i] = netdev_priv(g_linux_wlan->vif[i].ndev); nic[i] = netdev_priv(wilc->vif[i].ndev);
} }
if (g_linux_wlan && g_linux_wlan->firmware) if (wilc && wilc->firmware)
release_firmware(g_linux_wlan->firmware); release_firmware(wilc->firmware);
if (g_linux_wlan && if (wilc&&
(g_linux_wlan->vif[0].ndev || g_linux_wlan->vif[1].ndev)) { (wilc->vif[0].ndev || wilc->vif[1].ndev)) {
linux_wlan_lock_timeout(&close_exit_sync, 12 * 1000); linux_wlan_lock_timeout(&close_exit_sync, 12 * 1000);
for (i = 0; i < NUM_CONCURRENT_IFC; i++) for (i = 0; i < NUM_CONCURRENT_IFC; i++)
if (g_linux_wlan->vif[i].ndev) if (wilc->vif[i].ndev)
if (nic[i]->mac_opened) if (nic[i]->mac_opened)
mac_close(g_linux_wlan->vif[i].ndev); mac_close(wilc->vif[i].ndev);
for (i = 0; i < NUM_CONCURRENT_IFC; i++) { for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
unregister_netdev(g_linux_wlan->vif[i].ndev); unregister_netdev(wilc->vif[i].ndev);
wilc_free_wiphy(g_linux_wlan->vif[i].ndev); wilc_free_wiphy(wilc->vif[i].ndev);
free_netdev(g_linux_wlan->vif[i].ndev); free_netdev(wilc->vif[i].ndev);
} }
} }
kfree(g_linux_wlan); kfree(wilc);
#if defined(WILC_DEBUGFS) #if defined(WILC_DEBUGFS)
wilc_debugfs_remove(); wilc_debugfs_remove();
......
...@@ -146,7 +146,7 @@ static void linux_sdio_remove(struct sdio_func *func) ...@@ -146,7 +146,7 @@ static void linux_sdio_remove(struct sdio_func *func)
struct wilc_sdio *wl_sdio; struct wilc_sdio *wl_sdio;
wl_sdio = sdio_get_drvdata(func); wl_sdio = sdio_get_drvdata(func);
wl_wlan_cleanup(); wl_wlan_cleanup(wl_sdio->wilc);
kfree(wl_sdio); kfree(wl_sdio);
} }
......
...@@ -213,7 +213,7 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag); ...@@ -213,7 +213,7 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag);
void linux_wlan_rx_complete(void); void linux_wlan_rx_complete(void);
void linux_wlan_dbg(u8 *buff); void linux_wlan_dbg(u8 *buff);
int linux_wlan_lock_timeout(void *vp, u32 timeout); int linux_wlan_lock_timeout(void *vp, u32 timeout);
void wl_wlan_cleanup(void); void wl_wlan_cleanup(struct wilc *wilc);
int wilc_netdev_init(struct wilc **wilc); int wilc_netdev_init(struct wilc **wilc);
void wilc1000_wlan_deinit(struct net_device *dev); void wilc1000_wlan_deinit(struct net_device *dev);
void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size); void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment