From 65c8adcfd8740976eb471272741278989e4441fd Mon Sep 17 00:00:00 2001 From: Glen Lee Date: Thu, 29 Oct 2015 12:18:49 +0900 Subject: [PATCH] staging: wilc1000: linux_wlan_get_firmware: change argument p_nic with dev This patch changes argument perInterface_wlan_t *p_nic with struct net_device *dev and use netdev private data nic and it's member wilc instead of g_linux_wlan. Signed-off-by: Glen Lee Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wilc1000/linux_wlan.c | 17 ++++++++++------- .../staging/wilc1000/wilc_wfi_cfgoperations.c | 4 +--- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 + 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index fee8c61385b2..2103e8c0d6f9 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -517,14 +517,17 @@ void linux_wlan_rx_complete(void) PRINT_D(RX_DBG, "RX completed\n"); } -int linux_wlan_get_firmware(perInterface_wlan_t *p_nic) +int linux_wlan_get_firmware(struct net_device *dev) { - - perInterface_wlan_t *nic = p_nic; + perInterface_wlan_t *nic; + struct wilc *wilc; int ret = 0; const struct firmware *wilc_firmware; char *firmware; + nic = netdev_priv(dev); + wilc = nic->wilc; + if (nic->iftype == AP_MODE) firmware = AP_FIRMWARE; else if (nic->iftype == STATION_MODE) @@ -549,19 +552,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, &wilc->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, &wilc->wilc_spidev->dev) != 0) { PRINT_ER("%s - firmare not available\n", firmware); ret = -1; goto _fail_; } #endif - g_linux_wlan->firmware = wilc_firmware; + wilc->firmware = wilc_firmware; _fail_: @@ -1125,7 +1128,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic) } #endif - if (linux_wlan_get_firmware(nic)) { + if (linux_wlan_get_firmware(dev)) { PRINT_ER("Can't get firmware\n"); ret = -EIO; goto _fail_irq_enable_; diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index cdcf134c314a..32b93d3f806d 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -21,8 +21,6 @@ #define IS_MGMT_STATUS_SUCCES 0x040 #define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff) -extern int linux_wlan_get_firmware(perInterface_wlan_t *p_nic); - extern int mac_open(struct net_device *ndev); extern int mac_close(struct net_device *ndev); @@ -2737,7 +2735,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, PRINT_D(CORECONFIG_DBG, "priv->hWILCWFIDrv[%p]\n", priv->hWILCWFIDrv); PRINT_D(HOSTAPD_DBG, "Downloading AP firmware\n"); - linux_wlan_get_firmware(nic); + linux_wlan_get_firmware(dev); /*If wilc is running, then close-open to actually get new firmware running (serves P2P)*/ if (wl->initialized) { nic->iftype = AP_MODE; diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 0bfe7626ad2d..0435cb571227 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -218,4 +218,5 @@ int wilc_netdev_init(struct wilc **wilc); void wilc1000_wlan_deinit(struct net_device *dev); void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size); u16 Set_machw_change_vir_if(struct net_device *dev, bool bValue); +int linux_wlan_get_firmware(struct net_device *dev); #endif -- 2.30.2