diff mbox series

[1/3] qtnfmac: handle channel switch events for connected stations only

Message ID 20190409073500.16402-2-sergey.matyukevich.os@quantenna.com (mailing list archive)
State Accepted
Commit 4f87d486faf194ba58efaef8192a71e9ffec852e
Delegated to: Kalle Valo
Headers show
Series qtnfmac: debugfs update and other misc fixes | expand

Commit Message

Sergey Matyukevich April 9, 2019, 7:35 a.m. UTC
Channel switch events from firmware should be processed only when STA
is already connected to BSS. On connect this notification is not needed
since full BSS info will be supplied by cfg80211_connect_result.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
---
 drivers/net/wireless/quantenna/qtnfmac/event.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

Comments

Kalle Valo April 26, 2019, 11:53 a.m. UTC | #1
Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> wrote:

> Channel switch events from firmware should be processed only when STA
> is already connected to BSS. On connect this notification is not needed
> since full BSS info will be supplied by cfg80211_connect_result.
> 
> Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>

3 patches applied to wireless-drivers-next.git, thanks.

4f87d486faf1 qtnfmac: handle channel switch events for connected stations only
888f1564a272 qtnfmac: allow to control DFS slave radar detection
0b68fe10b8e8 qtnfmac: modify debugfs to support multiple cards
diff mbox series

Patch

diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c
index 6c1b886339ac..b57c8c18a8d0 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/event.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/event.c
@@ -493,14 +493,20 @@  qtnf_event_handle_freq_change(struct qtnf_wmac *mac,
 
 	for (i = 0; i < QTNF_MAX_INTF; i++) {
 		vif = &mac->iflist[i];
+
 		if (vif->wdev.iftype == NL80211_IFTYPE_UNSPECIFIED)
 			continue;
 
-		if (vif->netdev) {
-			mutex_lock(&vif->wdev.mtx);
-			cfg80211_ch_switch_notify(vif->netdev, &chandef);
-			mutex_unlock(&vif->wdev.mtx);
-		}
+		if (vif->wdev.iftype == NL80211_IFTYPE_STATION &&
+		    !vif->wdev.current_bss)
+			continue;
+
+		if (!vif->netdev)
+			continue;
+
+		mutex_lock(&vif->wdev.mtx);
+		cfg80211_ch_switch_notify(vif->netdev, &chandef);
+		mutex_unlock(&vif->wdev.mtx);
 	}
 
 	return 0;