]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
brcmfmac: obtain iftype for firmware-signal descriptor lookup
authorArend van Spriel <arend@broadcom.com>
Thu, 11 Apr 2013 15:08:37 +0000 (17:08 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 12 Apr 2013 18:27:56 +0000 (14:27 -0400)
The function brcmf_fws_find_mac_desc() determines the descriptor
associated with a sk_buff for firmware-signalling. It needs the
interface type to do that. For this a helper function is added in
wl_cfg80211.c.

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
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h

index b3c608ee37cf1620c1277f950b25eca2dfec8514..19d6952e5f4a57aca64f2897e62e523a78fa9df2 100644 (file)
 #include "dhd_dbg.h"
 #include "dhd_bus.h"
 #include "fwil.h"
+#include "fwil_types.h"
 #include "fweh.h"
 #include "fwsignal.h"
+#include "p2p.h"
+#include "wl_cfg80211.h"
 
 /**
  * DOC: Firmware Signalling
@@ -683,7 +686,7 @@ brcmf_fws_find_mac_desc(struct brcmf_fws_info *fws, int ifidx, 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);
@@ -691,15 +694,18 @@ brcmf_fws_find_mac_desc(struct brcmf_fws_info *fws, int ifidx, u8 *da)
        if (WARN_ON(!ifp))
                goto done;
 
+       iftype = brcmf_cfg80211_get_iftype(ifp);
+
        /* Multicast destination and P2P clients get the interface entry.
         * STA gets the interface entry if there is no exact match. For
         * example, TDLS destinations have their own entry.
         */
        entry = NULL;
-       if (multicast && ifp->fws_desc)
+       if ((multicast || iftype == NL80211_IFTYPE_STATION ||
+            iftype == NL80211_IFTYPE_P2P_CLIENT) && ifp->fws_desc)
                entry = ifp->fws_desc;
 
-       if (entry != NULL && multicast)
+       if (entry != NULL && iftype != NL80211_IFTYPE_STATION)
                goto done;
 
        entry = brcmf_fws_mac_descriptor_lookup(fws, da);
index 6c06d0d3eb05ce0a1447dad01190813c6063c60c..3b3eb94b547246a14309263c1c20b1114ae10fa6 100644 (file)
@@ -5237,6 +5237,13 @@ s32 brcmf_cfg80211_down(struct net_device *ndev)
        return err;
 }
 
+enum nl80211_iftype brcmf_cfg80211_get_iftype(struct brcmf_if *ifp)
+{
+       struct wireless_dev *wdev = &ifp->vif->wdev;
+
+       return wdev->iftype;
+}
+
 u32 wl_get_vif_state_all(struct brcmf_cfg80211_info *cfg, unsigned long state)
 {
        struct brcmf_cfg80211_vif *vif;
index 3e474c26e617746bbc1055a561b1952ae67f1601..0b9263e7dca4f92bb404743296aa9dee16a914f2 100644 (file)
@@ -478,6 +478,7 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
 void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg);
 s32 brcmf_cfg80211_up(struct net_device *ndev);
 s32 brcmf_cfg80211_down(struct net_device *ndev);
+enum nl80211_iftype brcmf_cfg80211_get_iftype(struct brcmf_if *ifp);
 
 struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg,
                                           enum nl80211_iftype type,