staging: wilc1000: GetIfHandler: add argument struct wilc and use it
authorGlen Lee <glen.lee@atmel.com>
Tue, 27 Oct 2015 09:27:57 +0000 (18:27 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Oct 2015 23:11:23 +0000 (08:11 +0900)
This patch adds new argument struct wilc and use it instead of
g_linux_wlan. And also pass wilc to the function.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/linux_wlan.c

index 6293410ec67c3557a67278ec72e79c22a8cec268..1f5c8f3467cf98e604d90f54dd0a8053619a84ce 100644 (file)
@@ -374,7 +374,7 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)
 
 }
 
-struct net_device *GetIfHandler(u8 *pMacHeader)
+struct net_device *GetIfHandler(struct wilc *wilc, u8 *pMacHeader)
 {
        u8 *Bssid, *Bssid1;
        int i = 0;
@@ -382,20 +382,20 @@ struct net_device *GetIfHandler(u8 *pMacHeader)
        Bssid  = pMacHeader + 10;
        Bssid1 = pMacHeader + 4;
 
-       for (i = 0; i < g_linux_wlan->vif_num; i++)
-               if (!memcmp(Bssid1, g_linux_wlan->vif[i].bssid, ETH_ALEN) ||
-                   !memcmp(Bssid, g_linux_wlan->vif[i].bssid, ETH_ALEN))
-                       return g_linux_wlan->vif[i].ndev;
+       for (i = 0; i < wilc->vif_num; i++)
+               if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
+                   !memcmp(Bssid, wilc->vif[i].bssid, ETH_ALEN))
+                       return wilc->vif[i].ndev;
 
        PRINT_INFO(INIT_DBG, "Invalide handle\n");
        for (i = 0; i < 25; i++)
                PRINT_D(INIT_DBG, "%02x ", pMacHeader[i]);
        Bssid  = pMacHeader + 18;
        Bssid1 = pMacHeader + 12;
-       for (i = 0; i < g_linux_wlan->vif_num; i++)
-               if (!memcmp(Bssid1, g_linux_wlan->vif[i].bssid, ETH_ALEN) ||
-                   !memcmp(Bssid, g_linux_wlan->vif[i].bssid, ETH_ALEN))
-                       return g_linux_wlan->vif[i].ndev;
+       for (i = 0; i < wilc->vif_num; i++)
+               if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
+                   !memcmp(Bssid, wilc->vif[i].bssid, ETH_ALEN))
+                       return wilc->vif[i].ndev;
 
        PRINT_INFO(INIT_DBG, "\n");
        return NULL;
@@ -1567,7 +1567,7 @@ void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)
        struct net_device *wilc_netdev;
        perInterface_wlan_t *nic;
 
-       wilc_netdev = GetIfHandler(buff);
+       wilc_netdev = GetIfHandler(wilc, buff);
        if (wilc_netdev == NULL)
                return;
 
This page took 0.028572 seconds and 5 git commands to generate.