hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h
....@@ -8,7 +8,7 @@
88 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
99 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
1010 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11
- * Copyright(c) 2018 Intel Corporation
11
+ * Copyright(c) 2018 - 2020 Intel Corporation
1212 *
1313 * This program is free software; you can redistribute it and/or modify
1414 * it under the terms of version 2 of the GNU General Public License as
....@@ -31,7 +31,7 @@
3131 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
3232 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
3333 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
34
- * Copyright(c) 2018 Intel Corporation
34
+ * Copyright(c) 2018 - 2020 Intel Corporation
3535 * All rights reserved.
3636 *
3737 * Redistribution and use in source and binary forms, with or without
....@@ -70,6 +70,9 @@
7070 /* Max number of IEs for direct SSID scans in a command */
7171 #define PROBE_OPTION_MAX 20
7272
73
+#define SCAN_SHORT_SSID_MAX_SIZE 8
74
+#define SCAN_BSSID_MAX_SIZE 16
75
+
7376 /**
7477 * struct iwl_ssid_ie - directed scan network information element
7578 *
....@@ -92,7 +95,10 @@
9295 #define IWL_SCAN_MAX_BLACKLIST_LEN 64
9396 #define IWL_SCAN_SHORT_BLACKLIST_LEN 16
9497 #define IWL_SCAN_MAX_PROFILES 11
98
+#define IWL_SCAN_MAX_PROFILES_V2 8
9599 #define SCAN_OFFLOAD_PROBE_REQ_SIZE 512
100
+#define SCAN_NUM_BAND_PROBE_DATA_V_1 2
101
+#define SCAN_NUM_BAND_PROBE_DATA_V_2 3
96102
97103 /* Default watchdog (in MS) for scheduled scan iteration */
98104 #define IWL_SCHED_SCAN_WATCHDOG cpu_to_le16(15000)
....@@ -111,12 +117,12 @@
111117 };
112118
113119 /**
114
- * struct iwl_scan_offload_blacklist - SCAN_OFFLOAD_BLACKLIST_S
120
+ * struct iwl_scan_offload_blocklist - SCAN_OFFLOAD_BLACKLIST_S
115121 * @ssid: MAC address to filter out
116122 * @reported_rssi: AP rssi reported to the host
117123 * @client_bitmap: clients ignore this entry - enum scan_framework_client
118124 */
119
-struct iwl_scan_offload_blacklist {
125
+struct iwl_scan_offload_blocklist {
120126 u8 ssid[ETH_ALEN];
121127 u8 reported_rssi;
122128 u8 client_bitmap;
....@@ -155,9 +161,8 @@
155161 } __packed;
156162
157163 /**
158
- * struct iwl_scan_offload_profile_cfg - SCAN_OFFLOAD_PROFILES_CFG_API_S_VER_1
159
- * @profiles: profiles to search for match
160
- * @blacklist_len: length of blacklist
164
+ * struct iwl_scan_offload_profile_cfg_data
165
+ * @blocklist_len: length of blocklist
161166 * @num_profiles: num of profiles in the list
162167 * @match_notify: clients waiting for match found notification
163168 * @pass_match: clients waiting for the results
....@@ -165,9 +170,8 @@
165170 * @any_beacon_notify: clients waiting for match notification without match
166171 * @reserved: reserved
167172 */
168
-struct iwl_scan_offload_profile_cfg {
169
- struct iwl_scan_offload_profile profiles[IWL_SCAN_MAX_PROFILES];
170
- u8 blacklist_len;
173
+struct iwl_scan_offload_profile_cfg_data {
174
+ u8 blocklist_len;
171175 u8 num_profiles;
172176 u8 match_notify;
173177 u8 pass_match;
....@@ -175,6 +179,26 @@
175179 u8 any_beacon_notify;
176180 u8 reserved[2];
177181 } __packed;
182
+
183
+/**
184
+ * struct iwl_scan_offload_profile_cfg
185
+ * @profiles: profiles to search for match
186
+ * @data: the rest of the data for profile_cfg
187
+ */
188
+struct iwl_scan_offload_profile_cfg_v1 {
189
+ struct iwl_scan_offload_profile profiles[IWL_SCAN_MAX_PROFILES];
190
+ struct iwl_scan_offload_profile_cfg_data data;
191
+} __packed; /* SCAN_OFFLOAD_PROFILES_CFG_API_S_VER_1-2*/
192
+
193
+/**
194
+ * struct iwl_scan_offload_profile_cfg
195
+ * @profiles: profiles to search for match
196
+ * @data: the rest of the data for profile_cfg
197
+ */
198
+struct iwl_scan_offload_profile_cfg {
199
+ struct iwl_scan_offload_profile profiles[IWL_SCAN_MAX_PROFILES_V2];
200
+ struct iwl_scan_offload_profile_cfg_data data;
201
+} __packed; /* SCAN_OFFLOAD_PROFILES_CFG_API_S_VER_3*/
178202
179203 /**
180204 * struct iwl_scan_schedule_lmac - schedule of scan offload
....@@ -251,9 +275,22 @@
251275 * @common_data: last (and common) part of the probe
252276 * @buf: raw data block
253277 */
278
+struct iwl_scan_probe_req_v1 {
279
+ struct iwl_scan_probe_segment mac_header;
280
+ struct iwl_scan_probe_segment band_data[SCAN_NUM_BAND_PROBE_DATA_V_1];
281
+ struct iwl_scan_probe_segment common_data;
282
+ u8 buf[SCAN_OFFLOAD_PROBE_REQ_SIZE];
283
+} __packed;
284
+
285
+/* iwl_scan_probe_req - PROBE_REQUEST_FRAME_API_S_VER_v2
286
+ * @mac_header: first (and common) part of the probe
287
+ * @band_data: band specific data
288
+ * @common_data: last (and common) part of the probe
289
+ * @buf: raw data block
290
+ */
254291 struct iwl_scan_probe_req {
255292 struct iwl_scan_probe_segment mac_header;
256
- struct iwl_scan_probe_segment band_data[2];
293
+ struct iwl_scan_probe_segment band_data[SCAN_NUM_BAND_PROBE_DATA_V_2];
257294 struct iwl_scan_probe_segment common_data;
258295 u8 buf[SCAN_OFFLOAD_PROBE_REQ_SIZE];
259296 } __packed;
....@@ -262,6 +299,10 @@
262299 IWL_SCAN_CHANNEL_FLAG_EBS = BIT(0),
263300 IWL_SCAN_CHANNEL_FLAG_EBS_ACCURATE = BIT(1),
264301 IWL_SCAN_CHANNEL_FLAG_CACHE_ADD = BIT(2),
302
+ IWL_SCAN_CHANNEL_FLAG_EBS_FRAG = BIT(3),
303
+ IWL_SCAN_CHANNEL_FLAG_FORCE_EBS = BIT(4),
304
+ IWL_SCAN_CHANNEL_FLAG_ENABLE_CHAN_ORDER = BIT(5),
305
+ IWL_SCAN_CHANNEL_FLAG_6G_PSC_NO_FILTER = BIT(6),
265306 };
266307
267308 /* struct iwl_scan_channel_opt - CHANNEL_OPTIMIZATION_API_S
....@@ -433,7 +474,7 @@
433474 /* The maximum of either of these cannot exceed 8, because we use an
434475 * 8-bit mask (see IWL_MVM_SCAN_MASK in mvm.h).
435476 */
436
-#define IWL_MVM_MAX_UMAC_SCANS 8
477
+#define IWL_MVM_MAX_UMAC_SCANS 4
437478 #define IWL_MVM_MAX_LMAC_SCANS 1
438479
439480 enum scan_config_flags {
....@@ -504,7 +545,7 @@
504545 } __packed;
505546
506547 /**
507
- * struct iwl_scan_config
548
+ * struct iwl_scan_config_v1
508549 * @flags: enum scan_config_flags
509550 * @tx_chains: valid_tx antenna - ANT_* definitions
510551 * @rx_chains: valid_rx antenna - ANT_* definitions
....@@ -536,7 +577,7 @@
536577 #define SCAN_LB_LMAC_IDX 0
537578 #define SCAN_HB_LMAC_IDX 1
538579
539
-struct iwl_scan_config {
580
+struct iwl_scan_config_v2 {
540581 __le32 flags;
541582 __le32 tx_chains;
542583 __le32 rx_chains;
....@@ -548,6 +589,24 @@
548589 u8 bcast_sta_id;
549590 u8 channel_flags;
550591 u8 channel_array[];
592
+} __packed; /* SCAN_CONFIG_DB_CMD_API_S_2 */
593
+
594
+/**
595
+ * struct iwl_scan_config
596
+ * @enable_cam_mode: whether to enable CAM mode.
597
+ * @enable_promiscouos_mode: whether to enable promiscouos mode
598
+ * @bcast_sta_id: the index of the station in the fw
599
+ * @reserved: reserved
600
+ * @tx_chains: valid_tx antenna - ANT_* definitions
601
+ * @rx_chains: valid_rx antenna - ANT_* definitions
602
+ */
603
+struct iwl_scan_config {
604
+ u8 enable_cam_mode;
605
+ u8 enable_promiscouos_mode;
606
+ u8 bcast_sta_id;
607
+ u8 reserved;
608
+ __le32 tx_chains;
609
+ __le32 rx_chains;
551610 } __packed; /* SCAN_CONFIG_DB_CMD_API_S_3 */
552611
553612 /**
....@@ -595,24 +654,85 @@
595654 * enum iwl_umac_scan_general_flags2 - UMAC scan general flags #2
596655 * @IWL_UMAC_SCAN_GEN_FLAGS2_NOTIF_PER_CHNL: Whether to send a complete
597656 * notification per channel or not.
657
+ * @IWL_UMAC_SCAN_GEN_FLAGS2_ALLOW_CHNL_REORDER: Whether to allow channel
658
+ * reorder optimization or not.
598659 */
599660 enum iwl_umac_scan_general_flags2 {
600
- IWL_UMAC_SCAN_GEN_FLAGS2_NOTIF_PER_CHNL = BIT(0),
661
+ IWL_UMAC_SCAN_GEN_FLAGS2_NOTIF_PER_CHNL = BIT(0),
662
+ IWL_UMAC_SCAN_GEN_FLAGS2_ALLOW_CHNL_REORDER = BIT(1),
663
+};
664
+
665
+/**
666
+ * enum iwl_umac_scan_general_flags_v2 - UMAC scan general flags version 2
667
+ *
668
+ * The FW flags were reordered and hence the driver introduce version 2
669
+ *
670
+ * @IWL_UMAC_SCAN_GEN_FLAGS_V2_PERIODIC: periodic or scheduled
671
+ * @IWL_UMAC_SCAN_GEN_FLAGS_V2_PASS_ALL: pass all probe responses and beacons
672
+ * during scan iterations
673
+ * @IWL_UMAC_SCAN_GEN_FLAGS_V2_NTFY_ITER_COMPLETE: send complete notification
674
+ * on every iteration instead of only once after the last iteration
675
+ * @IWL_UMAC_SCAN_GEN_FLAGS_V2_FRAGMENTED_LMAC1: fragmented scan LMAC1
676
+ * @IWL_UMAC_SCAN_GEN_FLAGS_V2_FRAGMENTED_LMAC2: fragmented scan LMAC2
677
+ * @IWL_UMAC_SCAN_GEN_FLAGS_V2_MATCH: does this scan check for profile matching
678
+ * @IWL_UMAC_SCAN_GEN_FLAGS_V2_USE_ALL_RX_CHAINS: use all valid chains for RX
679
+ * @IWL_UMAC_SCAN_GEN_FLAGS_V2_ADAPTIVE_DWELL: works with adaptive dwell
680
+ * for active channel
681
+ * @IWL_UMAC_SCAN_GEN_FLAGS_V2_PREEMPTIVE: can be preempted by other requests
682
+ * @IWL_UMAC_SCAN_GEN_FLAGS_V2_NTF_START: send notification of scan start
683
+ * @IWL_UMAC_SCAN_GEN_FLAGS_V2_MULTI_SSID: matching on multiple SSIDs
684
+ * @IWL_UMAC_SCAN_GEN_FLAGS_V2_FORCE_PASSIVE: all the channels scanned
685
+ * as passive
686
+ * @IWL_UMAC_SCAN_GEN_FLAGS_V2_TRIGGER_UHB_SCAN: at the end of 2.4GHz and
687
+ * 5.2Ghz bands scan, trigger scan on 6GHz band to discover
688
+ * the reported collocated APs
689
+ */
690
+enum iwl_umac_scan_general_flags_v2 {
691
+ IWL_UMAC_SCAN_GEN_FLAGS_V2_PERIODIC = BIT(0),
692
+ IWL_UMAC_SCAN_GEN_FLAGS_V2_PASS_ALL = BIT(1),
693
+ IWL_UMAC_SCAN_GEN_FLAGS_V2_NTFY_ITER_COMPLETE = BIT(2),
694
+ IWL_UMAC_SCAN_GEN_FLAGS_V2_FRAGMENTED_LMAC1 = BIT(3),
695
+ IWL_UMAC_SCAN_GEN_FLAGS_V2_FRAGMENTED_LMAC2 = BIT(4),
696
+ IWL_UMAC_SCAN_GEN_FLAGS_V2_MATCH = BIT(5),
697
+ IWL_UMAC_SCAN_GEN_FLAGS_V2_USE_ALL_RX_CHAINS = BIT(6),
698
+ IWL_UMAC_SCAN_GEN_FLAGS_V2_ADAPTIVE_DWELL = BIT(7),
699
+ IWL_UMAC_SCAN_GEN_FLAGS_V2_PREEMPTIVE = BIT(8),
700
+ IWL_UMAC_SCAN_GEN_FLAGS_V2_NTF_START = BIT(9),
701
+ IWL_UMAC_SCAN_GEN_FLAGS_V2_MULTI_SSID = BIT(10),
702
+ IWL_UMAC_SCAN_GEN_FLAGS_V2_FORCE_PASSIVE = BIT(11),
703
+ IWL_UMAC_SCAN_GEN_FLAGS_V2_TRIGGER_UHB_SCAN = BIT(12),
601704 };
602705
603706 /**
604707 * struct iwl_scan_channel_cfg_umac
605708 * @flags: bitmap - 0-19: directed scan to i'th ssid.
606709 * @channel_num: channel number 1-13 etc.
710
+ * @band: band of channel: 0 for 2GHz, 1 for 5GHz
607711 * @iter_count: repetition count for the channel.
608712 * @iter_interval: interval between two scan iterations on one channel.
609713 */
610
-struct iwl_scan_channel_cfg_umac {
714
+struct iwl_scan_channel_cfg_umac {
611715 __le32 flags;
612
- u8 channel_num;
613
- u8 iter_count;
614
- __le16 iter_interval;
615
-} __packed; /* SCAN_CHANNEL_CFG_S_VER2 */
716
+ /* Both versions are of the same size, so use a union without adjusting
717
+ * the command size later
718
+ */
719
+ union {
720
+ struct {
721
+ u8 channel_num;
722
+ u8 iter_count;
723
+ __le16 iter_interval;
724
+ } v1; /* SCAN_CHANNEL_CONFIG_API_S_VER_1 */
725
+ struct {
726
+ u8 channel_num;
727
+ u8 band;
728
+ u8 iter_count;
729
+ u8 iter_interval;
730
+ } v2; /* SCAN_CHANNEL_CONFIG_API_S_VER_2
731
+ * SCAN_CHANNEL_CONFIG_API_S_VER_3
732
+ * SCAN_CHANNEL_CONFIG_API_S_VER_4
733
+ */
734
+ };
735
+} __packed;
616736
617737 /**
618738 * struct iwl_scan_umac_schedule
....@@ -626,6 +746,16 @@
626746 u8 reserved;
627747 } __packed; /* SCAN_SCHED_PARAM_API_S_VER_1 */
628748
749
+struct iwl_scan_req_umac_tail_v1 {
750
+ /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */
751
+ struct iwl_scan_umac_schedule schedule[IWL_MAX_SCHED_SCAN_PLANS];
752
+ __le16 delay;
753
+ __le16 reserved;
754
+ /* SCAN_PROBE_PARAMS_API_S_VER_1 */
755
+ struct iwl_scan_probe_req_v1 preq;
756
+ struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
757
+} __packed;
758
+
629759 /**
630760 * struct iwl_scan_req_umac_tail - the rest of the UMAC scan request command
631761 * parameters following channels configuration array.
....@@ -635,12 +765,12 @@
635765 * @preq: probe request with IEs blocks
636766 * @direct_scan: list of SSIDs for directed active scan
637767 */
638
-struct iwl_scan_req_umac_tail {
768
+struct iwl_scan_req_umac_tail_v2 {
639769 /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */
640770 struct iwl_scan_umac_schedule schedule[IWL_MAX_SCHED_SCAN_PLANS];
641771 __le16 delay;
642772 __le16 reserved;
643
- /* SCAN_PROBE_PARAMS_API_S_VER_1 */
773
+ /* SCAN_PROBE_PARAMS_API_S_VER_2 */
644774 struct iwl_scan_probe_req preq;
645775 struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
646776 } __packed;
....@@ -746,6 +876,21 @@
746876 struct iwl_scan_umac_chan_param channel;
747877 u8 data[];
748878 } v8; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_8 */
879
+ struct {
880
+ u8 active_dwell[SCAN_TWO_LMACS];
881
+ u8 adwell_default_hb_n_aps;
882
+ u8 adwell_default_lb_n_aps;
883
+ u8 adwell_default_n_aps_social;
884
+ u8 general_flags2;
885
+ __le16 adwell_max_budget;
886
+ __le32 max_out_time[SCAN_TWO_LMACS];
887
+ __le32 suspend_time[SCAN_TWO_LMACS];
888
+ __le32 scan_priority;
889
+ u8 passive_dwell[SCAN_TWO_LMACS];
890
+ u8 num_of_fragments[SCAN_TWO_LMACS];
891
+ struct iwl_scan_umac_chan_param channel;
892
+ u8 data[];
893
+ } v9; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_9 */
749894 };
750895 } __packed;
751896
....@@ -753,6 +898,195 @@
753898 #define IWL_SCAN_REQ_UMAC_SIZE_V7 48
754899 #define IWL_SCAN_REQ_UMAC_SIZE_V6 44
755900 #define IWL_SCAN_REQ_UMAC_SIZE_V1 36
901
+
902
+/**
903
+ * struct iwl_scan_probe_params_v3
904
+ * @preq: scan probe request params
905
+ * @ssid_num: number of valid SSIDs in direct scan array
906
+ * @short_ssid_num: number of valid short SSIDs in short ssid array
907
+ * @bssid_num: number of valid bssid in bssids array
908
+ * @reserved: reserved
909
+ * @direct_scan: list of ssids
910
+ * @short_ssid: array of short ssids
911
+ * @bssid_array: array of bssids
912
+ */
913
+struct iwl_scan_probe_params_v3 {
914
+ struct iwl_scan_probe_req preq;
915
+ u8 ssid_num;
916
+ u8 short_ssid_num;
917
+ u8 bssid_num;
918
+ u8 reserved;
919
+ struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
920
+ __le32 short_ssid[SCAN_SHORT_SSID_MAX_SIZE];
921
+ u8 bssid_array[ETH_ALEN][SCAN_BSSID_MAX_SIZE];
922
+} __packed; /* SCAN_PROBE_PARAMS_API_S_VER_3 */
923
+
924
+/**
925
+ * struct iwl_scan_probe_params_v4
926
+ * @preq: scan probe request params
927
+ * @short_ssid_num: number of valid short SSIDs in short ssid array
928
+ * @bssid_num: number of valid bssid in bssids array
929
+ * @reserved: reserved
930
+ * @direct_scan: list of ssids
931
+ * @short_ssid: array of short ssids
932
+ * @bssid_array: array of bssids
933
+ */
934
+struct iwl_scan_probe_params_v4 {
935
+ struct iwl_scan_probe_req preq;
936
+ u8 short_ssid_num;
937
+ u8 bssid_num;
938
+ __le16 reserved;
939
+ struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
940
+ __le32 short_ssid[SCAN_SHORT_SSID_MAX_SIZE];
941
+ u8 bssid_array[ETH_ALEN][SCAN_BSSID_MAX_SIZE];
942
+} __packed; /* SCAN_PROBE_PARAMS_API_S_VER_4 */
943
+
944
+#define SCAN_MAX_NUM_CHANS_V3 67
945
+
946
+/**
947
+ * struct iwl_scan_channel_params_v4
948
+ * @flags: channel flags &enum iwl_scan_channel_flags
949
+ * @count: num of channels in scan request
950
+ * @num_of_aps_override: override the number of APs the FW uses to calculate
951
+ * dwell time when adaptive dwell is used
952
+ * @reserved: for future use and alignment
953
+ * @channel_config: array of explicit channel configurations
954
+ * for 2.4Ghz and 5.2Ghz bands
955
+ * @adwell_ch_override_bitmap: when using adaptive dwell, override the number
956
+ * of APs value with &num_of_aps_override for the channel.
957
+ * To cast channel to index, use &iwl_mvm_scan_ch_and_band_to_idx
958
+ */
959
+struct iwl_scan_channel_params_v4 {
960
+ u8 flags;
961
+ u8 count;
962
+ u8 num_of_aps_override;
963
+ u8 reserved;
964
+ struct iwl_scan_channel_cfg_umac channel_config[SCAN_MAX_NUM_CHANS_V3];
965
+ u8 adwell_ch_override_bitmap[16];
966
+} __packed; /* SCAN_CHANNEL_PARAMS_API_S_VER_4 also
967
+ SCAN_CHANNEL_PARAMS_API_S_VER_5 */
968
+
969
+/**
970
+ * struct iwl_scan_channel_params_v6
971
+ * @flags: channel flags &enum iwl_scan_channel_flags
972
+ * @count: num of channels in scan request
973
+ * @n_aps_override: override the number of APs the FW uses to calculate dwell
974
+ * time when adaptive dwell is used.
975
+ * Channel k will use n_aps_override[i] when BIT(20 + i) is set in
976
+ * channel_config[k].flags
977
+ * @channel_config: array of explicit channel configurations
978
+ * for 2.4Ghz and 5.2Ghz bands
979
+ */
980
+struct iwl_scan_channel_params_v6 {
981
+ u8 flags;
982
+ u8 count;
983
+ u8 n_aps_override[2];
984
+ struct iwl_scan_channel_cfg_umac channel_config[SCAN_MAX_NUM_CHANS_V3];
985
+} __packed; /* SCAN_CHANNEL_PARAMS_API_S_VER_6 */
986
+
987
+/**
988
+ * struct iwl_scan_general_params_v10
989
+ * @flags: &enum iwl_umac_scan_flags
990
+ * @reserved: reserved for future
991
+ * @scan_start_mac_id: report the scan start TSF time according to this mac TSF
992
+ * @active_dwell: dwell time for active scan per LMAC
993
+ * @adwell_default_2g: adaptive dwell default number of APs
994
+ * for 2.4GHz channel
995
+ * @adwell_default_5g: adaptive dwell default number of APs
996
+ * for 5GHz channels
997
+ * @adwell_default_social_chn: adaptive dwell default number of
998
+ * APs per social channel
999
+ * @reserved1: reserved for future
1000
+ * @adwell_max_budget: the maximal number of TUs that adaptive dwell
1001
+ * can add to the total scan time
1002
+ * @max_out_of_time: max out of serving channel time, per LMAC
1003
+ * @suspend_time: max suspend time, per LMAC
1004
+ * @scan_priority: priority of the request
1005
+ * @passive_dwell: continues dwell time for passive channel
1006
+ * (without adaptive dwell)
1007
+ * @num_of_fragments: number of fragments needed for full fragmented
1008
+ * scan coverage.
1009
+ */
1010
+struct iwl_scan_general_params_v10 {
1011
+ __le16 flags;
1012
+ u8 reserved;
1013
+ u8 scan_start_mac_id;
1014
+ u8 active_dwell[SCAN_TWO_LMACS];
1015
+ u8 adwell_default_2g;
1016
+ u8 adwell_default_5g;
1017
+ u8 adwell_default_social_chn;
1018
+ u8 reserved1;
1019
+ __le16 adwell_max_budget;
1020
+ __le32 max_out_of_time[SCAN_TWO_LMACS];
1021
+ __le32 suspend_time[SCAN_TWO_LMACS];
1022
+ __le32 scan_priority;
1023
+ u8 passive_dwell[SCAN_TWO_LMACS];
1024
+ u8 num_of_fragments[SCAN_TWO_LMACS];
1025
+} __packed; /* SCAN_GENERAL_PARAMS_API_S_VER_10 */
1026
+
1027
+/**
1028
+ * struct iwl_scan_periodic_parms_v1
1029
+ * @schedule: can scheduling parameter
1030
+ * @delay: initial delay of the periodic scan in seconds
1031
+ * @reserved: reserved for future
1032
+ */
1033
+struct iwl_scan_periodic_parms_v1 {
1034
+ struct iwl_scan_umac_schedule schedule[IWL_MAX_SCHED_SCAN_PLANS];
1035
+ __le16 delay;
1036
+ __le16 reserved;
1037
+} __packed; /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */
1038
+
1039
+/**
1040
+ * struct iwl_scan_req_params_v12
1041
+ * @general_params: &struct iwl_scan_general_params_v10
1042
+ * @channel_params: &struct iwl_scan_channel_params_v4
1043
+ * @periodic_params: &struct iwl_scan_periodic_parms_v1
1044
+ * @probe_params: &struct iwl_scan_probe_params_v3
1045
+ */
1046
+struct iwl_scan_req_params_v12 {
1047
+ struct iwl_scan_general_params_v10 general_params;
1048
+ struct iwl_scan_channel_params_v4 channel_params;
1049
+ struct iwl_scan_periodic_parms_v1 periodic_params;
1050
+ struct iwl_scan_probe_params_v3 probe_params;
1051
+} __packed; /* SCAN_REQUEST_PARAMS_API_S_VER_12 */
1052
+
1053
+/**
1054
+ * struct iwl_scan_req_params_v14
1055
+ * @general_params: &struct iwl_scan_general_params_v10
1056
+ * @channel_params: &struct iwl_scan_channel_params_v6
1057
+ * @periodic_params: &struct iwl_scan_periodic_parms_v1
1058
+ * @probe_params: &struct iwl_scan_probe_params_v4
1059
+ */
1060
+struct iwl_scan_req_params_v14 {
1061
+ struct iwl_scan_general_params_v10 general_params;
1062
+ struct iwl_scan_channel_params_v6 channel_params;
1063
+ struct iwl_scan_periodic_parms_v1 periodic_params;
1064
+ struct iwl_scan_probe_params_v4 probe_params;
1065
+} __packed; /* SCAN_REQUEST_PARAMS_API_S_VER_14 */
1066
+
1067
+/**
1068
+ * struct iwl_scan_req_umac_v12
1069
+ * @uid: scan id, &enum iwl_umac_scan_uid_offsets
1070
+ * @ooc_priority: out of channel priority - &enum iwl_scan_priority
1071
+ * @scan_params: scan parameters
1072
+ */
1073
+struct iwl_scan_req_umac_v12 {
1074
+ __le32 uid;
1075
+ __le32 ooc_priority;
1076
+ struct iwl_scan_req_params_v12 scan_params;
1077
+} __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_12 */
1078
+
1079
+/**
1080
+ * struct iwl_scan_req_umac_v14
1081
+ * @uid: scan id, &enum iwl_umac_scan_uid_offsets
1082
+ * @ooc_priority: out of channel priority - &enum iwl_scan_priority
1083
+ * @scan_params: scan parameters
1084
+ */
1085
+struct iwl_scan_req_umac_v14 {
1086
+ __le32 uid;
1087
+ __le32 ooc_priority;
1088
+ struct iwl_scan_req_params_v14 scan_params;
1089
+} __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_14 */
7561090
7571091 /**
7581092 * struct iwl_umac_scan_abort
....@@ -784,7 +1118,53 @@
7841118 __le32 reserved;
7851119 } __packed; /* SCAN_COMPLETE_NTF_UMAC_API_S_VER_1 */
7861120
787
-#define SCAN_OFFLOAD_MATCHING_CHANNELS_LEN 5
1121
+#define SCAN_OFFLOAD_MATCHING_CHANNELS_LEN_V1 5
1122
+#define SCAN_OFFLOAD_MATCHING_CHANNELS_LEN 7
1123
+
1124
+/**
1125
+ * struct iwl_scan_offload_profile_match_v1 - match information
1126
+ * @bssid: matched bssid
1127
+ * @reserved: reserved
1128
+ * @channel: channel where the match occurred
1129
+ * @energy: energy
1130
+ * @matching_feature: feature matches
1131
+ * @matching_channels: bitmap of channels that matched, referencing
1132
+ * the channels passed in the scan offload request.
1133
+ */
1134
+struct iwl_scan_offload_profile_match_v1 {
1135
+ u8 bssid[ETH_ALEN];
1136
+ __le16 reserved;
1137
+ u8 channel;
1138
+ u8 energy;
1139
+ u8 matching_feature;
1140
+ u8 matching_channels[SCAN_OFFLOAD_MATCHING_CHANNELS_LEN_V1];
1141
+} __packed; /* SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S_VER_1 */
1142
+
1143
+/**
1144
+ * struct iwl_scan_offload_profiles_query_v1 - match results query response
1145
+ * @matched_profiles: bitmap of matched profiles, referencing the
1146
+ * matches passed in the scan offload request
1147
+ * @last_scan_age: age of the last offloaded scan
1148
+ * @n_scans_done: number of offloaded scans done
1149
+ * @gp2_d0u: GP2 when D0U occurred
1150
+ * @gp2_invoked: GP2 when scan offload was invoked
1151
+ * @resume_while_scanning: not used
1152
+ * @self_recovery: obsolete
1153
+ * @reserved: reserved
1154
+ * @matches: array of match information, one for each match
1155
+ */
1156
+struct iwl_scan_offload_profiles_query_v1 {
1157
+ __le32 matched_profiles;
1158
+ __le32 last_scan_age;
1159
+ __le32 n_scans_done;
1160
+ __le32 gp2_d0u;
1161
+ __le32 gp2_invoked;
1162
+ u8 resume_while_scanning;
1163
+ u8 self_recovery;
1164
+ __le16 reserved;
1165
+ struct iwl_scan_offload_profile_match_v1 matches[0];
1166
+} __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_2 */
1167
+
7881168 /**
7891169 * struct iwl_scan_offload_profile_match - match information
7901170 * @bssid: matched bssid
....@@ -793,7 +1173,7 @@
7931173 * @energy: energy
7941174 * @matching_feature: feature matches
7951175 * @matching_channels: bitmap of channels that matched, referencing
796
- * the channels passed in tue scan offload request
1176
+ * the channels passed in the scan offload request.
7971177 */
7981178 struct iwl_scan_offload_profile_match {
7991179 u8 bssid[ETH_ALEN];
....@@ -802,7 +1182,7 @@
8021182 u8 energy;
8031183 u8 matching_feature;
8041184 u8 matching_channels[SCAN_OFFLOAD_MATCHING_CHANNELS_LEN];
805
-} __packed; /* SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S_VER_1 */
1185
+} __packed; /* SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S_VER_2 */
8061186
8071187 /**
8081188 * struct iwl_scan_offload_profiles_query - match results query response
....@@ -826,8 +1206,8 @@
8261206 u8 resume_while_scanning;
8271207 u8 self_recovery;
8281208 __le16 reserved;
829
- struct iwl_scan_offload_profile_match matches[IWL_SCAN_MAX_PROFILES];
830
-} __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_2 */
1209
+ struct iwl_scan_offload_profile_match matches[0];
1210
+} __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_3 */
8311211
8321212 /**
8331213 * struct iwl_umac_scan_iter_complete_notif - notifies end of scanning iteration