linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	"Arend van Spriel" <arend@broadcom.com>
Subject: [PATCH 12/15] brcmfmac: obtain iftype for firmware-signal descriptor lookup
Date: Thu, 11 Apr 2013 13:28:57 +0200	[thread overview]
Message-ID: <1365679740-25679-13-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1365679740-25679-1-git-send-email-arend@broadcom.com>

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>
---
 drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c    |   12 +++++++++---
 drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c |    7 +++++++
 drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h |    1 +
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
index b3c608e..f8ee4dc 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
@@ -31,8 +31,11 @@
 #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);
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 6c06d0d..3b3eb94 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -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;
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h
index 3e474c2..0b9263e 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h
@@ -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,
-- 
1.7.10.4



  parent reply	other threads:[~2013-04-11 11:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-11 11:28 [PATCH 00/15] brcmfmac: new device support and fixes Arend van Spriel
2013-04-11 11:28 ` [PATCH 01/15] brcmfmac: support save&restore firmware feature Arend van Spriel
2013-04-11 11:28 ` [PATCH 02/15] brcmfmac: aggregate dongle ram access interface Arend van Spriel
2013-04-11 11:28 ` [PATCH 03/15] brcmfmac: move chip download state code to sdio_chip.c Arend van Spriel
2013-04-11 11:28 ` [PATCH 04/15] brcmutil: add new d11 interface support Arend van Spriel
2013-04-11 11:28 ` [PATCH 05/15] brcmfmac: adopt new d11 interface Arend van Spriel
2013-04-11 11:28 ` [PATCH 06/15] brcmfmac: add support for dongle ARM CR4 core Arend van Spriel
2013-04-11 11:28 ` [PATCH 07/15] brcmfmac: setup SDIO reset behavior Arend van Spriel
2013-04-11 11:28 ` [PATCH 08/15] brcmfmac: add BCM4335 sdio interface support Arend van Spriel
2013-04-11 11:28 ` [PATCH 09/15] brcmfmac: Add 43143 SDIO support Arend van Spriel
2013-04-11 11:28 ` [PATCH 10/15] brcmfmac: Add drive strength programming for SDIO 43143 Arend van Spriel
2013-04-11 11:28 ` [PATCH 11/15] brcmfmac: define and use platform specific data for SDIO Arend van Spriel
2013-04-11 12:06   ` Hauke Mehrtens
2013-04-11 13:09     ` Arend van Spriel
2013-04-11 23:15       ` Hauke Mehrtens
2013-04-12  7:44         ` Arend van Spriel
2013-04-12  8:55   ` [PATCH V2 " Arend van Spriel
2013-04-11 11:28 ` Arend van Spriel [this message]
2013-04-11 15:08   ` [PATCH V2 12/15] brcmfmac: obtain iftype for firmware-signal descriptor lookup Arend van Spriel
2013-04-11 11:28 ` [PATCH 13/15] brcmfmac: pass ifp pointer in brcmf_fws_find_mac_desc() Arend van Spriel
2013-04-11 11:28 ` [PATCH 14/15] brcmfmac: rename brcmf_fws_mac_desc_ready() Arend van Spriel
2013-04-11 15:12   ` [PATCH V2 " Arend van Spriel
2013-04-11 11:29 ` [PATCH 15/15] brcmfmac: remove ifidx variable from brcmf_fws_process_skb() Arend van Spriel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1365679740-25679-13-git-send-email-arend@broadcom.com \
    --to=arend@broadcom.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).