staging: wilc1000: wilc_set_wfi_drv_handler: pass vif index
Pass index of vif instead of hif_drv. wilc_get_vif_idx is used to get correct
index of vif.
In the handler function handle_set_wfi_drv_handler, use vif instead of hif_drv,
and use hif_drv_handler->handler instead of hif_drv when deinitialize wilc
device.
Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index da4c4ad..53fb2d4 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -628,7 +628,7 @@
priv->u32RcvdChCount = 0;
- wilc_set_wfi_drv_handler(vif, priv->hWILCWFIDrv);
+ wilc_set_wfi_drv_handler(vif, wilc_get_vif_idx(vif));
reset_shadow_found();
priv->bCfgScanning = true;
@@ -709,7 +709,7 @@
vif = netdev_priv(priv->dev);
pstrWFIDrv = (struct host_if_drv *)(priv->hWILCWFIDrv);
- wilc_set_wfi_drv_handler(vif, priv->hWILCWFIDrv);
+ wilc_set_wfi_drv_handler(vif, wilc_get_vif_idx(vif));
PRINT_D(CFG80211_DBG, "Connecting to SSID [%s] on netdev [%p] host if [%p]\n", sme->ssid, dev, priv->hWILCWFIDrv);
if (!(strncmp(sme->ssid, "DIRECT-", 7))) {
@@ -2142,7 +2142,8 @@
wilc_initialized = 1;
vif->iftype = interface_type;
- wilc_set_wfi_drv_handler(vif, wl->vif[0]->hif_drv);
+ wilc_set_wfi_drv_handler(vif,
+ wilc_get_vif_idx(wl->vif[0]));
wilc_set_mac_address(wl->vif[0], wl->vif[0]->src_addr);
wilc_set_operation_mode(vif, STATION_MODE);
@@ -2217,7 +2218,8 @@
wilc1000_wlan_init(dev, vif);
wilc_initialized = 1;
- wilc_set_wfi_drv_handler(vif, wl->vif[0]->hif_drv);
+ wilc_set_wfi_drv_handler(vif,
+ wilc_get_vif_idx(wl->vif[0]));
wilc_set_mac_address(wl->vif[0], wl->vif[0]->src_addr);
wilc_set_operation_mode(vif, STATION_MODE);
@@ -2320,7 +2322,7 @@
wilc1000_wlan_init(dev, vif);
wilc_initialized = 1;
- wilc_set_wfi_drv_handler(vif, wl->vif[0]->hif_drv);
+ wilc_set_wfi_drv_handler(vif, wilc_get_vif_idx(wl->vif[0]));
wilc_set_mac_address(wl->vif[0], wl->vif[0]->src_addr);
wilc_set_operation_mode(vif, AP_MODE);