From 84f6330b0052abd245a007d76a4f6fb4ac79f620 Mon Sep 17 00:00:00 2001
From: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
Date: Tue, 16 Nov 2021 11:26:52 +0000
Subject: [PATCH] brcm63xx: mac80211.sh: abort scan after reboot

Issue reproduced on DISC on wl0 when:
 - set country GB channel 149
 - 149 is non-DFS so scan should work while no CAC

After reboot scan on wl0 failed.
I suspect early (before we set country/channel) driver
start on DFS channel and run CAC and for some reason
stuck in that state.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
---
 .../base-files/lib/netifd/wireless/mac80211.sh                | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/iopsys-brcm63xx-arm/base-files/lib/netifd/wireless/mac80211.sh b/iopsys-brcm63xx-arm/base-files/lib/netifd/wireless/mac80211.sh
index a147c153c..146d65339 100755
--- a/iopsys-brcm63xx-arm/base-files/lib/netifd/wireless/mac80211.sh
+++ b/iopsys-brcm63xx-arm/base-files/lib/netifd/wireless/mac80211.sh
@@ -1566,6 +1566,10 @@ drv_mac80211_setup() {
 				logger -t mac80211 "different chanspec after fresh start $orig_chanspec vs $cur_chanspec - set chanspec again"
 				bcm_set_chanspec "$phyiface" "$channel" "$htmode" "$hwmode"
 			}
+
+			# After reboot could be driver stuck in CAC - which base on scan internaly ...
+			# Then any scan will fail. Simple abort scan after reboot.
+			wl -i "$phyiface" scanabort
 		}
 	}
 
-- 
GitLab