Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wlcore: support scan reports during periodic scan

FW API changed and now PERIODIC_SCAN_REPORT_EVENT is sent
in case results were found at the end of each sched scan
cycle. Previous FW was missing that and broke sched scan.

This API change is available from 18xx FW 8.5.0.0.27

[Arik - move changes to 18xx specific files, align FW structures to
latest for scan command]

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>

authored by

Eyal Shapira and committed by
Luciano Coelho
0b70078c c80daad6

+39 -20
+7 -3
drivers/net/wireless/ti/wl12xx/event.c
··· 64 64 wl12xx_scan_completed(wl, wl->scan_wlvif); 65 65 } 66 66 67 - if (vector & PERIODIC_SCAN_REPORT_EVENT_ID) 68 - wlcore_event_sched_scan_report(wl, 69 - mbox->scheduled_scan_status); 67 + if (vector & PERIODIC_SCAN_REPORT_EVENT_ID) { 68 + wl1271_debug(DEBUG_EVENT, 69 + "PERIODIC_SCAN_REPORT_EVENT (status 0x%0x)", 70 + mbox->scheduled_scan_status); 71 + 72 + wlcore_scan_sched_scan_results(wl); 73 + } 70 74 71 75 if (vector & PERIODIC_SCAN_COMPLETE_EVENT_ID) 72 76 wlcore_event_sched_scan_completed(wl,
+8
drivers/net/wireless/ti/wl18xx/event.c
··· 61 61 wl18xx_scan_completed(wl, wl->scan_wlvif); 62 62 } 63 63 64 + if (vector & PERIODIC_SCAN_REPORT_EVENT_ID) { 65 + wl1271_debug(DEBUG_EVENT, 66 + "PERIODIC_SCAN_REPORT_EVENT (results %d)", 67 + mbox->number_of_sched_scan_results); 68 + 69 + wlcore_scan_sched_scan_results(wl); 70 + } 71 + 64 72 if (vector & PERIODIC_SCAN_COMPLETE_EVENT_ID) 65 73 wlcore_event_sched_scan_completed(wl, 1); 66 74
+1
drivers/net/wireless/ti/wl18xx/event.h
··· 37 37 BA_SESSION_RX_CONSTRAINT_EVENT_ID = BIT(17), 38 38 REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID = BIT(18), 39 39 DFS_CHANNELS_CONFIG_COMPLETE_EVENT = BIT(19), 40 + PERIODIC_SCAN_REPORT_EVENT_ID = BIT(20), 40 41 }; 41 42 42 43 struct wl18xx_event_mailbox {
+1
drivers/net/wireless/ti/wl18xx/main.c
··· 890 890 SCAN_COMPLETE_EVENT_ID | 891 891 RSSI_SNR_TRIGGER_0_EVENT_ID | 892 892 PERIODIC_SCAN_COMPLETE_EVENT_ID | 893 + PERIODIC_SCAN_REPORT_EVENT_ID | 893 894 DUMMY_PACKET_EVENT_ID | 894 895 PEER_REMOVE_COMPLETE_EVENT_ID | 895 896 BA_SESSION_RX_CONSTRAINT_EVENT_ID |
+4
drivers/net/wireless/ti/wl18xx/scan.c
··· 227 227 228 228 cmd->tag = WL1271_SCAN_DEFAULT_TAG; 229 229 230 + /* create a PERIODIC_SCAN_REPORT_EVENT whenever we've got a match */ 231 + cmd->report_threshold = 1; 232 + cmd->terminate_on_report = 0; 233 + 230 234 if (cmd->active[0]) { 231 235 u8 band = IEEE80211_BAND_2GHZ; 232 236 ret = wl12xx_cmd_build_probe_req(wl, wlvif,
+15 -3
drivers/net/wireless/ti/wl18xx/scan.h
··· 78 78 __le16 long_cycles_sec; 79 79 u8 short_cycles_count; 80 80 u8 total_cycles; /* 0 - infinite */ 81 - u8 rate; 82 - u8 padding[1]; 81 + u8 padding[2]; 83 82 84 83 union { 85 84 struct { ··· 92 93 u8 ssid[IEEE80211_MAX_SSID_LEN]; 93 94 u8 ssid_len; /* For SCAN_SSID_FILTER_SPECIFIC */ 94 95 u8 tag; 95 - u8 padding1[2]; 96 + u8 rate; 97 + 98 + /* send SCAN_REPORT_EVENT in periodic scans after each cycle 99 + * if number of results >= report_threshold. Must be 0 for 100 + * non periodic scans 101 + */ 102 + u8 report_threshold; 103 + 104 + /* Should periodic scan stop after a report event was created. 105 + * Must be 0 for non periodic scans. 106 + */ 107 + u8 terminate_on_report; 108 + 109 + u8 padding1[3]; 96 110 } __packed; 97 111 98 112 struct wl18xx_cmd_scan_stop {
-10
drivers/net/wireless/ti/wlcore/event.c
··· 94 94 } 95 95 EXPORT_SYMBOL_GPL(wlcore_event_soft_gemini_sense); 96 96 97 - void wlcore_event_sched_scan_report(struct wl1271 *wl, 98 - u8 status) 99 - { 100 - wl1271_debug(DEBUG_EVENT, "PERIODIC_SCAN_REPORT_EVENT (status 0x%0x)", 101 - status); 102 - 103 - wl1271_scan_sched_scan_results(wl); 104 - } 105 - EXPORT_SYMBOL_GPL(wlcore_event_sched_scan_report); 106 - 107 97 void wlcore_event_sched_scan_completed(struct wl1271 *wl, 108 98 u8 status) 109 99 {
-2
drivers/net/wireless/ti/wlcore/event.h
··· 70 70 int wl1271_event_handle(struct wl1271 *wl, u8 mbox); 71 71 72 72 void wlcore_event_soft_gemini_sense(struct wl1271 *wl, u8 enable); 73 - void wlcore_event_sched_scan_report(struct wl1271 *wl, 74 - u8 status); 75 73 void wlcore_event_sched_scan_completed(struct wl1271 *wl, 76 74 u8 status); 77 75 void wlcore_event_ba_rx_constraint(struct wl1271 *wl,
+2 -1
drivers/net/wireless/ti/wlcore/scan.c
··· 460 460 } 461 461 EXPORT_SYMBOL_GPL(wlcore_scan_sched_scan_ssid_list); 462 462 463 - void wl1271_scan_sched_scan_results(struct wl1271 *wl) 463 + void wlcore_scan_sched_scan_results(struct wl1271 *wl) 464 464 { 465 465 wl1271_debug(DEBUG_SCAN, "got periodic scan results"); 466 466 467 467 ieee80211_sched_scan_results(wl->hw); 468 468 } 469 + EXPORT_SYMBOL_GPL(wlcore_scan_sched_scan_results);
+1 -1
drivers/net/wireless/ti/wlcore/scan.h
··· 39 39 struct cfg80211_sched_scan_request *req, 40 40 struct ieee80211_sched_scan_ies *ies); 41 41 int wl1271_scan_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif); 42 - void wl1271_scan_sched_scan_results(struct wl1271 *wl); 42 + void wlcore_scan_sched_scan_results(struct wl1271 *wl); 43 43 44 44 #define WL1271_SCAN_MAX_CHANNELS 24 45 45 #define WL1271_SCAN_DEFAULT_TAG 1