brcmfmac: pass ifp pointer in brcmf_fws_find_mac_desc()
authorArend van Spriel <arend@broadcom.com>
Thu, 11 Apr 2013 11:28:58 +0000 (13:28 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 12 Apr 2013 18:27:56 +0000 (14:27 -0400)
Instead of passing the ifidx and lookup the ifp inside the
function brcmf_fws_find_mac_desc() simply pass the ifp as
parameter.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c

index 19d6952e5f4a57aca64f2897e62e523a78fa9df2..d9572fb74356e085387e93c6af24869846933caa 100644 (file)
@@ -681,19 +681,16 @@ brcmf_fws_mac_descriptor_lookup(struct brcmf_fws_info *fws, u8 *ea)
 }
 
 static struct brcmf_fws_mac_descriptor*
-brcmf_fws_find_mac_desc(struct brcmf_fws_info *fws, int ifidx, u8 *da)
+brcmf_fws_find_mac_desc(struct brcmf_fws_info *fws, struct brcmf_if *ifp,
+                       u8 *da)
 {
        struct brcmf_fws_mac_descriptor *entry = &fws->desc.other;
-       struct brcmf_if *ifp;
        bool multicast;
        enum nl80211_iftype iftype;
-       brcmf_dbg(TRACE, "enter: ifidx=%d\n", ifidx);
 
-       multicast = is_multicast_ether_addr(da);
-       ifp = fws->drvr->iflist[ifidx ? ifidx + 1 : 0];
-       if (WARN_ON(!ifp))
-               goto done;
+       brcmf_dbg(TRACE, "enter: idx=%d\n", ifp->bssidx);
 
+       multicast = is_multicast_ether_addr(da);
        iftype = brcmf_cfg80211_get_iftype(ifp);
 
        /* Multicast destination and P2P clients get the interface entry.
@@ -1750,7 +1747,7 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
 
        /* set control buffer information */
        skcb->if_flags = 0;
-       skcb->mac = brcmf_fws_find_mac_desc(drvr->fws, ifidx, eh->h_dest);
+       skcb->mac = brcmf_fws_find_mac_desc(drvr->fws, ifp, eh->h_dest);
        skcb->state = BRCMF_FWS_SKBSTATE_NEW;
        brcmf_skb_if_flags_set_field(skb, INDEX, ifidx);
        if (!multicast)