Commit 65c8adcf authored by Glen Lee's avatar Glen Lee Committed by Greg Kroah-Hartman

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: default avatarGlen Lee <glen.lee@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ae6f772d
...@@ -517,14 +517,17 @@ void linux_wlan_rx_complete(void) ...@@ -517,14 +517,17 @@ void linux_wlan_rx_complete(void)
PRINT_D(RX_DBG, "RX completed\n"); 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;
perInterface_wlan_t *nic = p_nic; struct wilc *wilc;
int ret = 0; int ret = 0;
const struct firmware *wilc_firmware; const struct firmware *wilc_firmware;
char *firmware; char *firmware;
nic = netdev_priv(dev);
wilc = nic->wilc;
if (nic->iftype == AP_MODE) if (nic->iftype == AP_MODE)
firmware = AP_FIRMWARE; firmware = AP_FIRMWARE;
else if (nic->iftype == STATION_MODE) else if (nic->iftype == STATION_MODE)
...@@ -549,19 +552,19 @@ int linux_wlan_get_firmware(perInterface_wlan_t *p_nic) ...@@ -549,19 +552,19 @@ int linux_wlan_get_firmware(perInterface_wlan_t *p_nic)
* root file system with the name specified above */ * root file system with the name specified above */
#ifdef WILC_SDIO #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); PRINT_ER("%s - firmare not available\n", firmware);
ret = -1; ret = -1;
goto _fail_; goto _fail_;
} }
#else #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); PRINT_ER("%s - firmare not available\n", firmware);
ret = -1; ret = -1;
goto _fail_; goto _fail_;
} }
#endif #endif
g_linux_wlan->firmware = wilc_firmware; wilc->firmware = wilc_firmware;
_fail_: _fail_:
...@@ -1125,7 +1128,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic) ...@@ -1125,7 +1128,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
} }
#endif #endif
if (linux_wlan_get_firmware(nic)) { if (linux_wlan_get_firmware(dev)) {
PRINT_ER("Can't get firmware\n"); PRINT_ER("Can't get firmware\n");
ret = -EIO; ret = -EIO;
goto _fail_irq_enable_; goto _fail_irq_enable_;
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
#define IS_MGMT_STATUS_SUCCES 0x040 #define IS_MGMT_STATUS_SUCCES 0x040
#define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff) #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_open(struct net_device *ndev);
extern int mac_close(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, ...@@ -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(CORECONFIG_DBG, "priv->hWILCWFIDrv[%p]\n", priv->hWILCWFIDrv);
PRINT_D(HOSTAPD_DBG, "Downloading AP firmware\n"); 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 wilc is running, then close-open to actually get new firmware running (serves P2P)*/
if (wl->initialized) { if (wl->initialized) {
nic->iftype = AP_MODE; nic->iftype = AP_MODE;
......
...@@ -218,4 +218,5 @@ int wilc_netdev_init(struct wilc **wilc); ...@@ -218,4 +218,5 @@ 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);
u16 Set_machw_change_vir_if(struct net_device *dev, bool bValue); u16 Set_machw_change_vir_if(struct net_device *dev, bool bValue);
int linux_wlan_get_firmware(struct net_device *dev);
#endif #endif
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