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 16/16] brcmfmac: only use ifidx from BDC header in brcmf_rx_frames()
Date: Fri, 5 Apr 2013 10:57:54 +0200	[thread overview]
Message-ID: <1365152274-4252-17-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1365152274-4252-1-git-send-email-arend@broadcom.com>

In brcmf_rx_frames() the call to brcmf_fweh_process_skb() could
change the ifidx using information in the event data. This is
only different to the BDC ifidx for IF ADD event. However, the
creation of the new interface is deferred to event worker so
it does not exist. After brcmf_fweh_process_skb() it is only
used to set statistics.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c |    9 ++-------
 drivers/net/wireless/brcm80211/brcmfmac/fweh.c      |    6 ++----
 drivers/net/wireless/brcm80211/brcmfmac/fweh.h      |    6 +++---
 3 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
index e68500b..763a84e 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
@@ -323,13 +323,8 @@ void brcmf_rx_frames(struct device *dev, struct sk_buff_head *skb_list)
 		/* Strip header, count, deliver upward */
 		skb_pull(skb, ETH_HLEN);
 
-		/* Process special event packets and then discard them */
-		brcmf_fweh_process_skb(drvr, skb, &ifidx);
-
-		if (drvr->iflist[ifidx]) {
-			ifp = drvr->iflist[ifidx];
-			ifp->ndev->last_rx = jiffies;
-		}
+		/* Process special event packets */
+		brcmf_fweh_process_skb(drvr, skb);
 
 		if (!(ifp->ndev->flags & IFF_UP)) {
 			brcmu_pkt_buf_free_skb(skb);
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
index 51ba13d..5a64280 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
@@ -407,13 +407,12 @@ int brcmf_fweh_activate_events(struct brcmf_if *ifp)
  *
  * @drvr: driver information object.
  * @event_packet: event packet to process.
- * @ifidx: index of the firmware interface (may change).
  *
  * If the packet buffer contains a firmware event message it will
  * dispatch the event to a registered handler (using worker).
  */
 void brcmf_fweh_process_event(struct brcmf_pub *drvr,
-			      struct brcmf_event *event_packet, u8 *ifidx)
+			      struct brcmf_event *event_packet)
 {
 	enum brcmf_fweh_event_code code;
 	struct brcmf_fweh_info *fweh = &drvr->fweh;
@@ -425,7 +424,6 @@ void brcmf_fweh_process_event(struct brcmf_pub *drvr,
 	/* get event info */
 	code = get_unaligned_be32(&event_packet->msg.event_type);
 	datalen = get_unaligned_be32(&event_packet->msg.datalen);
-	*ifidx = event_packet->msg.ifidx;
 	data = &event_packet[1];
 
 	if (code >= BRCMF_E_LAST)
@@ -442,7 +440,7 @@ void brcmf_fweh_process_event(struct brcmf_pub *drvr,
 		return;
 
 	event->code = code;
-	event->ifidx = *ifidx;
+	event->ifidx = event_packet->msg.ifidx;
 
 	/* use memcpy to get aligned event message */
 	memcpy(&event->emsg, &event_packet->msg, sizeof(event->emsg));
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h
index 8c39b51..6ec5db9 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h
@@ -187,10 +187,10 @@ void brcmf_fweh_unregister(struct brcmf_pub *drvr,
 			   enum brcmf_fweh_event_code code);
 int brcmf_fweh_activate_events(struct brcmf_if *ifp);
 void brcmf_fweh_process_event(struct brcmf_pub *drvr,
-			      struct brcmf_event *event_packet, u8 *ifidx);
+			      struct brcmf_event *event_packet);
 
 static inline void brcmf_fweh_process_skb(struct brcmf_pub *drvr,
-					  struct sk_buff *skb, u8 *ifidx)
+					  struct sk_buff *skb)
 {
 	struct brcmf_event *event_packet;
 	u8 *data;
@@ -213,7 +213,7 @@ static inline void brcmf_fweh_process_skb(struct brcmf_pub *drvr,
 	if (usr_stype != BCMILCP_BCM_SUBTYPE_EVENT)
 		return;
 
-	brcmf_fweh_process_event(drvr, event_packet, ifidx);
+	brcmf_fweh_process_event(drvr, event_packet);
 }
 
 #endif /* FWEH_H_ */
-- 
1.7.10.4



      parent reply	other threads:[~2013-04-05  8:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05  8:57 [PATCH 00/16] brcm80211: patches providing new functionality Arend van Spriel
2013-04-05  8:57 ` [PATCH 01/16] brcmfmac: fix unaligned access in TXSTATUS signal handling Arend van Spriel
2013-04-05  8:57 ` [PATCH 02/16] brcmfmac: handle firmware signalling destination entry state Arend van Spriel
2013-04-05  8:57 ` [PATCH 03/16] brcmfmac: handle firmware signals requesting for packets Arend van Spriel
2013-04-05  8:57 ` [PATCH 04/16] brcmfmac: read firmware console without trap indication Arend van Spriel
2013-04-05  8:57 ` [PATCH 05/16] brcmfmac: firmware shared data version fix Arend van Spriel
2013-04-05  8:57 ` [PATCH 06/16] brcmfmac: add hexadecimal trace of message payload Arend van Spriel
2013-04-05  8:57 ` [PATCH 07/16] brcmfmac: add role attribute to struct brcmf_if_event definition Arend van Spriel
2013-04-05  8:57 ` [PATCH 08/16] brcmfmac: remove condition for calling event handler Arend van Spriel
2013-04-05  8:57 ` [PATCH 09/16] brcmfmac: remove use of unconditional access of struct wireless_dev::netdev Arend van Spriel
2013-04-05  8:57 ` [PATCH 10/16] brcmfmac: use struct brcmf_if instance as parameter in brcmf_set_mpc() Arend van Spriel
2013-04-05  8:57 ` [PATCH 11/16] brcmfmac: use struct brcmf_if instance iso netdevice in escan functions Arend van Spriel
2013-04-05  8:57 ` [PATCH 12/16] brcmfmac: support creation of P2P_DEVICE through user-space Arend van Spriel
2013-04-05  8:57 ` [PATCH 13/16] brcmfmac: wait for firmware event when creating P2P_DEVICE interface Arend van Spriel
2013-04-05  8:57 ` [PATCH 14/16] brcmfmac: fix reception of P2P probe requests on " Arend van Spriel
2013-04-05  8:57 ` [PATCH 15/16] brcmfmac: obtain wdev using vif object in action frame rx Arend van Spriel
2013-04-05  8:57 ` Arend van Spriel [this message]

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=1365152274-4252-17-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).