Hi @Loic,
We are working on a custom board based on Linaro-18.01 and facing issue regarding connecting hidden SSID. We have used WCN3660B WiFi chip on our board.
- Earlier we were only able to scan 2.4 GHZ with Linaro -18.01 release with the offload scan.
- Then, we have changed the code as below to enable SW scan and that is why we can see 2.4 GHz and 5GHZ both channels.
-- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -652,7 +652,7 @@ static int wcn36xx_hw_scan(struct ieee80211_hw *hw, mutex_unlock(&wcn->scan_lock); - if (!get_feat_caps(wcn->fw_feat_caps, SCAN_OFFLOAD)) { + if (get_feat_caps(wcn->fw_feat_caps, SCAN_OFFLOAD)) { /* legacy manual/sw scan */ schedule_work(&wcn->scan_work); return 0; --
In 1) we are able to connect to 2.4 GHz hidden SSID but in 2) we are not able to connect to 2.4/5GHZ hidden SSID.
Now, we have changed code as below in Linaro-18.01 , so that we are able to see both 2.4 (with HW scan) and 5 GHZ (with SW scan) and also able to connect to hidden SSID of both (still testing more times and with more APs).
@@ -649,6 +650,8 @@ static int wcn36xx_hw_scan(struct ieee80211_hw *hw,
struct ieee80211_scan_request *hw_req)
{
struct wcn36xx *wcn = hw->priv;
+ int ret = 0, i;
+
mutex_lock(&wcn->scan_lock);
if (wcn->scan_req) {
mutex_unlock(&wcn->scan_lock);
@@ -660,13 +663,22 @@ static int wcn36xx_hw_scan(struct ieee80211_hw *hw,
mutex_unlock(&wcn->scan_lock);
- if (get_feat_caps(wcn->fw_feat_caps, SCAN_OFFLOAD)) {
- /* legacy manual/sw scan */
- schedule_work(&wcn->scan_work);
- return 0;
+ ret = wcn36xx_smd_start_hw_scan(wcn, vif, &hw_req->req);
+ printk("%s: HW scan called\n", __func__);
+
+ /* For unknown reason, the hardware offloaded scan only works with
+ * 2.4Ghz channels, fallback to software scan in other cases.
+ */
+ for (i = 0; i < hw_req->req.n_channels; i++) {
+ if (hw_req->req.channels[i]->band != NL80211_BAND_2GHZ) {
+ /* legacy manual/sw scan */
+ schedule_work(&wcn->scan_work);
+ printk("%s: scheduled for SW scan - 5 GHz\n", __func__);
+ return 0;
+ }
}
- return wcn36xx_smd_start_hw_scan(wcn, vif, &hw_req->req);
+ return ret;
Here while doing scan we are facing below warning from the driver.
root@linaro-alip:~# wpa_cli scan
Selected interface ‘wlan0’
OK
[ 3492.428055] wcn36xx_hw_scan: HW scan called
[ 3492.428080] wcn36xx_hw_scan: scheduled for SW scan - 5 GHz
root@linaro-alip:~#
root@linaro-alip:~# [ 3494.120000] wcn36xx_hw_scan_worker: ieee80211_scan_completed CALLED -----
[ 3494.120237] __ieee80211_scan_completed: --------- aborted = 0, scanning = 2
[ 3494.125896] __ieee80211_scan_completed: WARN ON finished
[ 3494.133125] __ieee80211_scan_completed: After scan IF condition
[ 3497.422454] __ieee80211_scan_completed: --------- aborted = 0, scanning = 0
[ 3497.422711] ------------[ cut here ]------------
[ 3497.429070] WARNING: CPU: 0 PID: 2693 at …/net/mac80211/scan.c:347 __ieee80211_scan_completed+0x4c/0x208 [mac80211]
[ 3497.433195] Modules linked in: ccm aes_neon_blk rfcomm bnep arc4 wcn36xx btqcomsmd mac80211 btqca bluetooth ecdh_generic cfg80211 venus_enc venus_dec videobuf2_dma_sg videobuf2_memops crc32_ce qcom_wcs
[ 3497.453505] CPU: 0 PID: 2693 Comm: kworker/u8:1 Tainted: G W 4.14.0-qcomlt-arm64 #90
[ 3497.475730] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
[ 3497.484935] Workqueue: phy0 ieee80211_scan_work [mac80211]
[ 3497.491264] task: ffff8000292b8000 task.stack: ffff000009b40000
[ 3497.497012] PC is at __ieee80211_scan_completed+0x4c/0x208 [mac80211]
[ 3497.502831] LR is at __ieee80211_scan_completed+0x40/0x208 [mac80211]
[ 3497.508977] pc : [] lr : [] pstate: 40000145
[ 3497.515395] sp : ffff000009b43d20
[ 3497.522854] x29: ffff000009b43d20 x28: 0000000000000000
[ 3497.526070] x27: ffff80003b42bfb8 x26: ffff80003d4047a0
[ 3497.531451] x25: ffff0000080e1318 x24: 0000000000000002
[ 3497.536747] x23: 0000000000000000 x22: ffff000000ded550
[ 3497.542042] x21: ffff000000d99818 x20: 0000000000000000
[ 3497.547337] x19: ffff80003d4047a0 x18: 0000000000000000
[ 3497.552633] x17: ffff000008ac07c8 x16: 0000000000000052
[ 3497.557927] x15: 0000000000000010 x14: ffffffffffffffff
[ 3497.563222] x13: ffff0000894b255f x12: ffff0000094b2567
[ 3497.568517] x11: 6261202d2d2d2d2d x10: 0000000000000004
[ 3497.573813] x9 : 0000000000000051 x8 : 000000000000000d
[ 3497.579107] x7 : ffff000009b43acc x6 : 00000000000010f0
[ 3497.584403] x5 : 0000000000000000 x4 : 0000000000000000
[ 3497.589698] x3 : 0000000000000000 x2 : ffff8000292b8000
[ 3497.594993] x1 : ffff8000292b8000 x0 : 0000000000000000
[ 3497.600287] Call trace:
[ 3497.605587] Exception stack(0xffff000009b43be0 to 0xffff000009b43d20)
[ 3497.607770] 3be0: 0000000000000000 ffff8000292b8000 ffff8000292b8000 0000000000000000
[ 3497.614368] 3c00: 0000000000000000 0000000000000000 00000000000010f0 ffff000009b43acc
[ 3497.622179] 3c20: 000000000000000d 0000000000000051 0000000000000004 6261202d2d2d2d2d
[ 3497.629995] 3c40: ffff0000094b2567 ffff0000894b255f ffffffffffffffff 0000000000000010
[ 3497.637806] 3c60: 0000000000000052 ffff000008ac07c8 0000000000000000 ffff80003d4047a0
[ 3497.645618] 3c80: 0000000000000000 ffff000000d99818 ffff000000ded550 0000000000000000
[ 3497.653432] 3ca0: 0000000000000002 ffff0000080e1318 ffff80003d4047a0 ffff80003b42bfb8
[ 3497.661243] 3cc0: 0000000000000000 ffff000009b43d20 ffff000000d983e0 ffff000009b43d20
[ 3497.669054] 3ce0: ffff000000d983ec 0000000040000145 0000000000000000 0000000000000000
[ 3497.676869] 3d00: ffffffffffffffff 0000000000000000 ffff000009b43d20 ffff000000d983ec
[ 3497.685131] [] __ieee80211_scan_completed+0x4c/0x208 [mac80211]
[ 3497.692916] [] ieee80211_scan_work+0x1e8/0x4b8 [mac80211]
[ 3497.699965] [] process_one_work+0x1c8/0x328
[ 3497.706727] [] worker_thread+0x44/0x450
[ 3497.712625] [] kthread+0x128/0x130
[ 3497.718012] [] ret_from_fork+0x10/0x18
[ 3497.723035] —[ end trace a01f2291381f9cad ]—
[ 3497.728548] __ieee80211_scan_completed: WARN ON finished
[ 3497.733016] ------------[ cut here ]------------
[ 3497.738304] WARNING: CPU: 0 PID: 2693 at …/net/mac80211/scan.c:351 __ieee80211_scan_completed+0x68/0x208 [mac80211]
[ 3497.742817] Modules linked in: ccm aes_neon_blk rfcomm bnep arc4 wcn36xx btqcomsmd mac80211 btqca bluetooth ecdh_generic cfg80211 venus_enc venus_dec videobuf2_dma_sg videobuf2_memops crc32_ce qcom_wcs
[ 3497.763119] CPU: 0 PID: 2693 Comm: kworker/u8:1 Tainted: G W 4.14.0-qcomlt-arm64 #90
[ 3497.785350] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
[ 3497.794201] Workqueue: phy0 ieee80211_scan_work [mac80211]
[ 3497.800884] task: ffff8000292b8000 task.stack: ffff000009b40000
[ 3497.806257] PC is at __ieee80211_scan_completed+0x68/0x208 [mac80211]
[ 3497.812073] LR is at __ieee80211_scan_completed+0x60/0x208 [mac80211]
[ 3497.818595] pc : [] lr : [] pstate: 40000145
[ 3497.825017] sp : ffff000009b43d20
[ 3497.832478] x29: ffff000009b43d20 x28: 0000000000000000
[ 3497.835693] x27: ffff80003b42bfb8 x26: ffff80003d4047a0
[ 3497.841074] x25: ffff0000080e1318 x24: 0000000000000002
[ 3497.846370] x23: 0000000000000000 x22: ffff000000ded550
[ 3497.851664] x21: ffff000000d99818 x20: 0000000000000001
[ 3497.856960] x19: ffff80003d4047a0 x18: 0000000000000000
[ 3497.862255] x17: ffff000008ac07c8 x16: 0000000000000052
[ 3497.867550] x15: 0000000000000010 x14: ffffffffffffffff
[ 3497.872844] x13: ffff0000894b255f x12: ffff0000094b2567
[ 3497.878140] x11: ffff000009334000 x10: 0000000000000004
[ 3497.883435] x9 : 000000000000003d x8 : 000000000000000d
[ 3497.888730] x7 : ffff000009b43acc x6 : 000000000000111e
[ 3497.894025] x5 : 0000000000000000 x4 : 0000000000000000
[ 3497.899320] x3 : 0000000000000000 x2 : ffff8000292b8000
[ 3497.904617] x1 : ffff8000292b8000 x0 : 0000000000000000
[ 3497.909912] Call trace:
[ 3497.915204] Exception stack(0xffff000009b43be0 to 0xffff000009b43d20)
[ 3497.917381] 3be0: 0000000000000000 ffff8000292b8000 ffff8000292b8000 0000000000000000
[ 3497.923979] 3c00: 0000000000000000 0000000000000000 000000000000111e ffff000009b43acc
[ 3497.931792] 3c20: 000000000000000d 000000000000003d 0000000000000004 ffff000009334000
[ 3497.939604] 3c40: ffff0000094b2567 ffff0000894b255f ffffffffffffffff 0000000000000010
[ 3497.947417] 3c60: 0000000000000052 ffff000008ac07c8 0000000000000000 ffff80003d4047a0
[ 3497.955229] 3c80: 0000000000000001 ffff000000d99818 ffff000000ded550 0000000000000000
[ 3497.963041] 3ca0: 0000000000000002 ffff0000080e1318 ffff80003d4047a0 ffff80003b42bfb8
[ 3497.970855] 3cc0: 0000000000000000 ffff000009b43d20 ffff000000d98400 ffff000009b43d20
[ 3497.978667] 3ce0: ffff000000d98408 0000000040000145 ffff8000292b8000 0000000000000000
[ 3497.986479] 3d00: ffffffffffffffff 0000000000000000 ffff000009b43d20 ffff000000d98408
[ 3497.994367] [] __ieee80211_scan_completed+0x68/0x208 [mac80211]
[ 3498.002175] [] ieee80211_scan_work+0x1e8/0x4b8 [mac80211]
[ 3498.009571] [] process_one_work+0x1c8/0x328
[ 3498.016338] [] worker_thread+0x44/0x450
[ 3498.022240] [] kthread+0x128/0x130
[ 3498.027622] [] ret_from_fork+0x10/0x18
[ 3498.032656] —[ end trace a01f2291381f9cae ]—
Can you please suggest how we can resolve this?
Regards,
Parth Y Shah