Skip to contentSkip to conversation

brcmfmac: handle IF event for P2P_DEVICE interface

PATCH In review Arend van Spriel 2 participants 5 messages Sep 23, 2014 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 brcmfmac: handle IF event for P2P_DEVICE interface

upstream: 87c4790330810fe5caf0172d9320cf24ef19cebe

The firmware notifies about interface changes through the IF event which has a NO_IF flag that means host can ignore the event. This behaviour was introduced in the driver by:

commit 2ee8382fc6c763c76396a6aaff77a27089eed3aa
Author: Arend van Spriel <[email protected]>
Date: Sat Aug 10 12:27:24 2013 +0200

brcmfmac: ignore IF event if firmware indicates it

It turns out that the IF event for the P2P_DEVICE also has this flag set, but the event should not be ignored in this scenario. The mentioned commit caused a regression in 3.12 kernel in creation of the P2P_DEVICE interface.

---
 drivers/net/wireless/brcm80211/brcmfmac/fweh.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/fweh.c +9 -3
index fad77dd..3f9cb89 100644
@@ -185,7 +185,13 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,
 		  ifevent->action, ifevent->ifidx, ifevent->bssidx,
 		  ifevent->flags, ifevent->role);
 
-	if (ifevent->flags & BRCMF_E_IF_FLAG_NOIF) {
+	/* The P2P Device interface event must not be ignored
+	 * contrary to what firmware tells us. The only way to
+	 * distinguish the P2P Device is by looking at the ifidx
+	 * and bssidx received.
+	 */
+	if (!(ifevent->ifidx == 0 && ifevent->bssidx == 1) &&
+	    (ifevent->flags & BRCMF_E_IF_FLAG_NOIF)) {
 		brcmf_dbg(EVENT, "event can be ignored\n");
 		return;
 	}
@@ -210,12 +216,12 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,
 				return;
 	}
 
-	if (ifevent->action == BRCMF_E_IF_CHANGE)
+	if (ifp && ifevent->action == BRCMF_E_IF_CHANGE)
 		brcmf_fws_reset_interface(ifp);
 
 	err = brcmf_fweh_call_event_handler(ifp, emsg->event_code, emsg, data);
 
-	if (ifevent->action == BRCMF_E_IF_DEL) {
+	if (ifp && ifevent->action == BRCMF_E_IF_DEL) {
 		brcmf_fws_del_interface(ifp);
 		brcmf_del_if(drvr, ifevent->bssidx);
 	}
Signature · 1 line
1.9.1
#1 lore raw
Quoted 1 line · Arend van Spriel

upstream: 87c4790330810fe5caf0172d9320cf24ef19cebe

That commit id doesn't match anything in Linus's tree :(

#2 lore raw
Quoted 5 lines · Greg KH
Quoted 1 line · Arend van Spriel

upstream: 87c4790330810fe5caf0172d9320cf24ef19cebe

That commit id doesn't match anything in Linus's tree :(

Hmmm, that is weird:

[arend@lb-bun-235 ~/scm/brcm80211-next]

$ git remote show torvalds
* remote torvalds
  Fetch URL: 
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  Push  URL: 
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  HEAD branch: master
  Remote branch:
    master tracked
[arend@lb-bun-235 ~/scm/brcm80211-next]
$ git log torvalds/master --oneline -8 -- drivers/net/wireless/brcm80211
*87c4790 brcmfmac: handle IF event for P2P_DEVICE interface*
8f2b459 brcmfmac: obtain ifp through wdev structure
f1d5603 brcmfmac: conditionally compile firmware protocol source code
fac7d2a brcmfmac: Fix memory leak and missing assignment.
2d116b88 brcmfmac: fix memory leakage in msgbuf
ebcc2f5 brcmfmac: fix curly brace mistake in brcmf_pcie_handle_mb_data()
aef4f5b Merge tag 'master-2014-07-31' of git://git.kernel.org/pub/scm/linux/kern
70b7d94 brcmfmac: Add TDLS support to msgbuf.
#3 lore raw
Quoted 22 lines · Arend van Spriel
Quoted 5 lines · Greg KH
Quoted 1 line · Arend van Spriel

upstream: 87c4790330810fe5caf0172d9320cf24ef19cebe

That commit id doesn't match anything in Linus's tree :(

Hmmm, that is weird:

[arend@lb-bun-235 ~/scm/brcm80211-next]

$ git remote show torvalds
* remote torvalds
  Fetch URL:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  Push  URL:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  HEAD branch: master
  Remote branch:
    master tracked
[arend@lb-bun-235 ~/scm/brcm80211-next]
$ git log torvalds/master --oneline -8 -- drivers/net/wireless/brcm80211
*87c4790 brcmfmac: handle IF event for P2P_DEVICE interface*
Quoted 8 lines
8f2b459 brcmfmac: obtain ifp through wdev structure
f1d5603 brcmfmac: conditionally compile firmware protocol source code
fac7d2a brcmfmac: Fix memory leak and missing assignment.
2d116b88 brcmfmac: fix memory leakage in msgbuf
ebcc2f5 brcmfmac: fix curly brace mistake in brcmf_pcie_handle_mb_data()
aef4f5b Merge tag 'master-2014-07-31' of
git://git.kernel.org/pub/scm/linux/kern
70b7d94 brcmfmac: Add TDLS support to msgbuf.

Ah, it just went in, sorry for the noise.

But it _just_ went in, why are you emailing this? We have to wait for a -rc release to come out with the patch before being able to add it to the tree.

thanks,

greg k-h

#4 lore raw
Quoted 32 lines · Greg KH
Quoted 22 lines · Arend van Spriel
Quoted 5 lines · Greg KH
Quoted 1 line · Arend van Spriel

upstream: 87c4790330810fe5caf0172d9320cf24ef19cebe

That commit id doesn't match anything in Linus's tree :(

Hmmm, that is weird:

[arend@lb-bun-235 ~/scm/brcm80211-next]

$ git remote show torvalds
* remote torvalds
   Fetch URL:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
   Push  URL:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
   HEAD branch: master
   Remote branch:
     master tracked
[arend@lb-bun-235 ~/scm/brcm80211-next]
$ git log torvalds/master --oneline -8 -- drivers/net/wireless/brcm80211
*87c4790 brcmfmac: handle IF event for P2P_DEVICE interface*
Quoted 8 lines
8f2b459 brcmfmac: obtain ifp through wdev structure
f1d5603 brcmfmac: conditionally compile firmware protocol source code
fac7d2a brcmfmac: Fix memory leak and missing assignment.
2d116b88 brcmfmac: fix memory leakage in msgbuf
ebcc2f5 brcmfmac: fix curly brace mistake in brcmf_pcie_handle_mb_data()
aef4f5b Merge tag 'master-2014-07-31' of
git://git.kernel.org/pub/scm/linux/kern
70b7d94 brcmfmac: Add TDLS support to msgbuf.
Quoted 5 lines

Ah, it just went in, sorry for the noise.

But it _just_ went in, why are you emailing this? We have to wait for a -rc release to come out with the patch before being able to add it to the tree.

Noted. Did not find that nitty gritty detail in stable_kernel_rules.txt, but I just might create a patch for that if I can beat my writers block ;-)

Gr. AvS

Quoted 3 lines

thanks,

greg k-h