Assign QCA vendor attributes for set retry configuration
[mech_eap.git] / src / common / qca-vendor.h
1 /*
2  * Qualcomm Atheros OUI and vendor specific assignments
3  * Copyright (c) 2014-2015, Qualcomm Atheros, Inc.
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8
9 #ifndef QCA_VENDOR_H
10 #define QCA_VENDOR_H
11
12 /*
13  * This file is a registry of identifier assignments from the Qualcomm Atheros
14  * OUI 00:13:74 for purposes other than MAC address assignment. New identifiers
15  * can be assigned through normal review process for changes to the upstream
16  * hostap.git repository.
17  */
18
19 #define OUI_QCA 0x001374
20
21 /**
22  * enum qca_radiotap_vendor_ids - QCA radiotap vendor namespace IDs
23  */
24 enum qca_radiotap_vendor_ids {
25         QCA_RADIOTAP_VID_WLANTEST = 0,
26 };
27
28 /**
29  * enum qca_nl80211_vendor_subcmds - QCA nl80211 vendor command identifiers
30  *
31  * @QCA_NL80211_VENDOR_SUBCMD_UNSPEC: Reserved value 0
32  *
33  * @QCA_NL80211_VENDOR_SUBCMD_TEST: Test command/event
34  *
35  * @QCA_NL80211_VENDOR_SUBCMD_ROAMING: Set roaming policy for drivers that use
36  *      internal BSS-selection. This command uses
37  *      @QCA_WLAN_VENDOR_ATTR_ROAMING_POLICY to specify the new roaming policy
38  *      for the current connection (i.e., changes policy set by the nl80211
39  *      Connect command). @QCA_WLAN_VENDOR_ATTR_MAC_ADDR may optionally be
40  *      included to indicate which BSS to use in case roaming is disabled.
41  *
42  * @QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY: Recommendation of frequency
43  *      ranges to avoid to reduce issues due to interference or internal
44  *      co-existence information in the driver. The event data structure is
45  *      defined in struct qca_avoid_freq_list.
46  *
47  * @QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY: Command to check driver support
48  *      for DFS offloading.
49  *
50  * @QCA_NL80211_VENDOR_SUBCMD_NAN: NAN command/event which is used to pass
51  *      NAN Request/Response and NAN Indication messages. These messages are
52  *      interpreted between the framework and the firmware component.
53  *
54  * @QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_SET_KEY: Set key operation that can be
55  *      used to configure PMK to the driver even when not connected. This can
56  *      be used to request offloading of key management operations. Only used
57  *      if device supports QCA_WLAN_VENDOR_FEATURE_KEY_MGMT_OFFLOAD.
58  *
59  * @QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH: An extended version of
60  *      NL80211_CMD_ROAM event with optional attributes including information
61  *      from offloaded key management operation. Uses
62  *      enum qca_wlan_vendor_attr_roam_auth attributes. Only used
63  *      if device supports QCA_WLAN_VENDOR_FEATURE_KEY_MGMT_OFFLOAD.
64  *
65  * @QCA_NL80211_VENDOR_SUBCMD_DO_ACS: ACS command/event which is used to
66  *      invoke the ACS function in device and pass selected channels to
67  *      hostapd.
68  *
69  * @QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES: Command to get the features
70  *      supported by the driver. enum qca_wlan_vendor_features defines
71  *      the possible features.
72  *
73  * @QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_STARTED: Event used by driver,
74  *      which supports DFS offloading, to indicate a channel availability check
75  *      start.
76  *
77  * @QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_FINISHED: Event used by driver,
78  *      which supports DFS offloading, to indicate a channel availability check
79  *      completion.
80  *
81  * @QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_ABORTED: Event used by driver,
82  *      which supports DFS offloading, to indicate that the channel availability
83  *      check aborted, no change to the channel status.
84  *
85  * @QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_NOP_FINISHED: Event used by
86  *      driver, which supports DFS offloading, to indicate that the
87  *      Non-Occupancy Period for this channel is over, channel becomes usable.
88  *
89  * @QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_RADAR_DETECTED: Event used by driver,
90  *      which supports DFS offloading, to indicate a radar pattern has been
91  *      detected. The channel is now unusable.
92  *
93  * @QCA_NL80211_VENDOR_SUBCMD_P2P_LISTEN_OFFLOAD_START: Command used to
94  *      start the P2P Listen offload function in device and pass the listen
95  *      channel, period, interval, count, device types, and vendor specific
96  *      information elements to the device driver and firmware.
97  *      Uses the attributes defines in
98  *      enum qca_wlan_vendor_attr_p2p_listen_offload.
99  *
100  * @QCA_NL80211_VENDOR_SUBCMD_P2P_LISTEN_OFFLOAD_STOP: Command/event used to
101  *      indicate stop request/response of the P2P Listen offload function in
102  *      device. As an event, it indicates either the feature stopped after it
103  *      was already running or feature has actually failed to start. Uses the
104  *      attributes defines in enum qca_wlan_vendor_attr_p2p_listen_offload.
105  *
106  * @QCA_NL80211_VENDOR_SUBCMD_SAP_CONDITIONAL_CHAN_SWITCH: After AP starts
107  *      beaconing, this sub command provides the driver, the frequencies on the
108  *      5 GHz band to check for any radar activity. Driver selects one channel
109  *      from this priority list provided through
110  *      @QCA_WLAN_VENDOR_ATTR_SAP_CONDITIONAL_CHAN_SWITCH_FREQ_LIST and starts
111  *      to check for radar activity on it. If no radar activity is detected
112  *      during the channel availability check period, driver internally switches
113  *      to the selected frequency of operation. If the frequency is zero, driver
114  *      internally selects a channel. The status of this conditional switch is
115  *      indicated through an event using the same sub command through
116  *      @QCA_WLAN_VENDOR_ATTR_SAP_CONDITIONAL_CHAN_SWITCH_STATUS. Attributes are
117  *      listed in qca_wlan_vendor_attr_sap_conditional_chan_switch.
118  */
119 enum qca_nl80211_vendor_subcmds {
120         QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0,
121         QCA_NL80211_VENDOR_SUBCMD_TEST = 1,
122         /* subcmds 2..8 not yet allocated */
123         QCA_NL80211_VENDOR_SUBCMD_ROAMING = 9,
124         QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY = 10,
125         QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY =  11,
126         QCA_NL80211_VENDOR_SUBCMD_NAN =  12,
127         QCA_NL80211_VENDOR_SUBMCD_STATS_EXT = 13,
128         QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET = 14,
129         QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET = 15,
130         QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR = 16,
131         QCA_NL80211_VENDOR_SUBCMD_LL_STATS_RADIO_RESULTS = 17,
132         QCA_NL80211_VENDOR_SUBCMD_LL_STATS_IFACE_RESULTS = 18,
133         QCA_NL80211_VENDOR_SUBCMD_LL_STATS_PEERS_RESULTS = 19,
134         QCA_NL80211_VENDOR_SUBCMD_GSCAN_START = 20,
135         QCA_NL80211_VENDOR_SUBCMD_GSCAN_STOP = 21,
136         QCA_NL80211_VENDOR_SUBCMD_GSCAN_GET_VALID_CHANNELS = 22,
137         QCA_NL80211_VENDOR_SUBCMD_GSCAN_GET_CAPABILITIES = 23,
138         QCA_NL80211_VENDOR_SUBCMD_GSCAN_GET_CACHED_RESULTS = 24,
139         QCA_NL80211_VENDOR_SUBCMD_GSCAN_SCAN_RESULTS_AVAILABLE = 25,
140         QCA_NL80211_VENDOR_SUBCMD_GSCAN_FULL_SCAN_RESULT = 26,
141         QCA_NL80211_VENDOR_SUBCMD_GSCAN_SCAN_EVENT = 27,
142         QCA_NL80211_VENDOR_SUBCMD_GSCAN_HOTLIST_AP_FOUND = 28,
143         QCA_NL80211_VENDOR_SUBCMD_GSCAN_SET_BSSID_HOTLIST = 29,
144         QCA_NL80211_VENDOR_SUBCMD_GSCAN_RESET_BSSID_HOTLIST = 30,
145         QCA_NL80211_VENDOR_SUBCMD_GSCAN_SIGNIFICANT_CHANGE = 31,
146         QCA_NL80211_VENDOR_SUBCMD_GSCAN_SET_SIGNIFICANT_CHANGE = 32,
147         QCA_NL80211_VENDOR_SUBCMD_GSCAN_RESET_SIGNIFICANT_CHANGE = 33,
148         QCA_NL80211_VENDOR_SUBCMD_TDLS_ENABLE = 34,
149         QCA_NL80211_VENDOR_SUBCMD_TDLS_DISABLE = 35,
150         QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_STATUS = 36,
151         QCA_NL80211_VENDOR_SUBCMD_TDLS_STATE = 37,
152         QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_FEATURES = 38,
153         QCA_NL80211_VENDOR_SUBCMD_SCANNING_MAC_OUI = 39,
154         QCA_NL80211_VENDOR_SUBCMD_NO_DFS_FLAG = 40,
155         QCA_NL80211_VENDOR_SUBCMD_GSCAN_HOTLIST_AP_LOST = 41,
156         QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX = 42,
157         /* 43..49 - reserved for QCA */
158         QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_SET_KEY = 50,
159         QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH = 51,
160         QCA_NL80211_VENDOR_SUBCMD_APFIND = 52,
161         /* 53 - reserved - was used by QCA, but not in use anymore */
162         QCA_NL80211_VENDOR_SUBCMD_DO_ACS = 54,
163         QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES = 55,
164         QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_STARTED = 56,
165         QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_FINISHED = 57,
166         QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_ABORTED = 58,
167         QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_NOP_FINISHED = 59,
168         QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_RADAR_DETECTED = 60,
169         /* 61-73 - reserved for QCA */
170         /* Wi-Fi configuration subcommands */
171         QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION = 74,
172         QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_CONFIGURATION = 75,
173         /* 76-90 - reserved for QCA */
174         QCA_NL80211_VENDOR_SUBCMD_DATA_OFFLOAD = 91,
175         QCA_NL80211_VENDOR_SUBCMD_OCB_SET_CONFIG = 92,
176         QCA_NL80211_VENDOR_SUBCMD_OCB_SET_UTC_TIME = 93,
177         QCA_NL80211_VENDOR_SUBCMD_OCB_START_TIMING_ADVERT = 94,
178         QCA_NL80211_VENDOR_SUBCMD_OCB_STOP_TIMING_ADVERT = 95,
179         QCA_NL80211_VENDOR_SUBCMD_OCB_GET_TSF_TIMER = 96,
180         QCA_NL80211_VENDOR_SUBCMD_DCC_GET_STATS = 97,
181         QCA_NL80211_VENDOR_SUBCMD_DCC_CLEAR_STATS = 98,
182         QCA_NL80211_VENDOR_SUBCMD_DCC_UPDATE_NDL = 99,
183         QCA_NL80211_VENDOR_SUBCMD_DCC_STATS_EVENT = 100,
184         QCA_NL80211_VENDOR_SUBCMD_LINK_PROPERTIES = 101,
185         QCA_NL80211_VENDOR_SUBCMD_GW_PARAM_CONFIG = 102,
186         QCA_NL80211_VENDOR_SUBCMD_GET_PREFERRED_FREQ_LIST = 103,
187         QCA_NL80211_VENDOR_SUBCMD_SET_PROBABLE_OPER_CHANNEL = 104,
188         QCA_NL80211_VENDOR_SUBCMD_SETBAND = 105,
189         QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN = 106,
190         QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE = 107,
191         QCA_NL80211_VENDOR_SUBCMD_OTA_TEST = 108,
192         QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_SCALE = 109,
193         /* 110..114 - reserved for QCA */
194         QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_DECR_DB = 115,
195         /* 116..117 - reserved for QCA */
196         QCA_NL80211_VENDOR_SUBCMD_SET_SAP_CONFIG = 118,
197         QCA_NL80211_VENDOR_SUBCMD_TSF = 119,
198         QCA_NL80211_VENDOR_SUBCMD_WISA = 120,
199         /* 121 - reserved for QCA */
200         QCA_NL80211_VENDOR_SUBCMD_P2P_LISTEN_OFFLOAD_START = 122,
201         QCA_NL80211_VENDOR_SUBCMD_P2P_LISTEN_OFFLOAD_STOP = 123,
202         QCA_NL80211_VENDOR_SUBCMD_SAP_CONDITIONAL_CHAN_SWITCH = 124,
203 };
204
205
206 enum qca_wlan_vendor_attr {
207         QCA_WLAN_VENDOR_ATTR_INVALID = 0,
208         /* used by QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY */
209         QCA_WLAN_VENDOR_ATTR_DFS     = 1,
210         /* used by QCA_NL80211_VENDOR_SUBCMD_NAN */
211         QCA_WLAN_VENDOR_ATTR_NAN     = 2,
212         /* used by QCA_NL80211_VENDOR_SUBCMD_STATS_EXT */
213         QCA_WLAN_VENDOR_ATTR_STATS_EXT     = 3,
214         /* used by QCA_NL80211_VENDOR_SUBCMD_STATS_EXT */
215         QCA_WLAN_VENDOR_ATTR_IFINDEX     = 4,
216         /* used by QCA_NL80211_VENDOR_SUBCMD_ROAMING, u32 with values defined
217          * by enum qca_roaming_policy. */
218         QCA_WLAN_VENDOR_ATTR_ROAMING_POLICY = 5,
219         QCA_WLAN_VENDOR_ATTR_MAC_ADDR = 6,
220         /* used by QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES */
221         QCA_WLAN_VENDOR_ATTR_FEATURE_FLAGS = 7,
222         QCA_WLAN_VENDOR_ATTR_TEST = 8,
223         /* used by QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES */
224         /* Unsigned 32-bit value. */
225         QCA_WLAN_VENDOR_ATTR_CONCURRENCY_CAPA = 9,
226         /* Unsigned 32-bit value */
227         QCA_WLAN_VENDOR_ATTR_MAX_CONCURRENT_CHANNELS_2_4_BAND = 10,
228         /* Unsigned 32-bit value */
229         QCA_WLAN_VENDOR_ATTR_MAX_CONCURRENT_CHANNELS_5_0_BAND = 11,
230         /* Unsigned 32-bit value from enum qca_set_band. */
231         QCA_WLAN_VENDOR_ATTR_SETBAND_VALUE = 12,
232         /* keep last */
233         QCA_WLAN_VENDOR_ATTR_AFTER_LAST,
234         QCA_WLAN_VENDOR_ATTR_MAX        = QCA_WLAN_VENDOR_ATTR_AFTER_LAST - 1,
235 };
236
237
238 enum qca_roaming_policy {
239         QCA_ROAMING_NOT_ALLOWED,
240         QCA_ROAMING_ALLOWED_WITHIN_ESS,
241 };
242
243 enum qca_wlan_vendor_attr_roam_auth {
244         QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_INVALID = 0,
245         QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_BSSID,
246         QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_REQ_IE,
247         QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_RESP_IE,
248         QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_AUTHORIZED,
249         QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_KEY_REPLAY_CTR,
250         QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_PTK_KCK,
251         QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_PTK_KEK,
252         QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_SUBNET_STATUS,
253         /* keep last */
254         QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_AFTER_LAST,
255         QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_MAX =
256         QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_AFTER_LAST - 1
257 };
258
259 enum qca_wlan_vendor_attr_p2p_listen_offload {
260         QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_INVALID = 0,
261         /* A 32-bit unsigned value; the P2P listen frequency (MHz); must be one
262          * of the social channels.
263          */
264         QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_CHANNEL,
265         /* A 32-bit unsigned value; the P2P listen offload period (ms).
266          */
267         QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_PERIOD,
268         /* A 32-bit unsigned value; the P2P listen interval duration (ms).
269          */
270         QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_INTERVAL,
271         /* A 32-bit unsigned value; number of interval times the firmware needs
272          * to run the offloaded P2P listen operation before it stops.
273          */
274         QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_COUNT,
275         /* An array of arbitrary binary data with one or more 8-byte values.
276          * The device types include both primary and secondary device types.
277          */
278         QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_DEVICE_TYPES,
279         /* An array of unsigned 8-bit characters; vendor information elements.
280          */
281         QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_VENDOR_IE,
282         /* A 32-bit unsigned value; a control flag to indicate whether listen
283          * results need to be flushed to wpa_supplicant.
284          */
285         QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_CTRL_FLAG,
286         /* A 8-bit unsigned value; reason code for P2P listen offload stop
287          * event.
288          */
289         QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_STOP_REASON,
290         /* keep last */
291         QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_AFTER_LAST,
292         QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_MAX =
293         QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_AFTER_LAST - 1
294 };
295
296 enum qca_wlan_vendor_attr_acs_offload {
297         QCA_WLAN_VENDOR_ATTR_ACS_CHANNEL_INVALID = 0,
298         QCA_WLAN_VENDOR_ATTR_ACS_PRIMARY_CHANNEL,
299         QCA_WLAN_VENDOR_ATTR_ACS_SECONDARY_CHANNEL,
300         QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE,
301         QCA_WLAN_VENDOR_ATTR_ACS_HT_ENABLED,
302         QCA_WLAN_VENDOR_ATTR_ACS_HT40_ENABLED,
303         QCA_WLAN_VENDOR_ATTR_ACS_VHT_ENABLED,
304         QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH,
305         QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST,
306         QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG0_CENTER_CHANNEL,
307         QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG1_CENTER_CHANNEL,
308         QCA_WLAN_VENDOR_ATTR_ACS_FREQ_LIST,
309         /* keep last */
310         QCA_WLAN_VENDOR_ATTR_ACS_AFTER_LAST,
311         QCA_WLAN_VENDOR_ATTR_ACS_MAX =
312         QCA_WLAN_VENDOR_ATTR_ACS_AFTER_LAST - 1
313 };
314
315 enum qca_wlan_vendor_acs_hw_mode {
316         QCA_ACS_MODE_IEEE80211B,
317         QCA_ACS_MODE_IEEE80211G,
318         QCA_ACS_MODE_IEEE80211A,
319         QCA_ACS_MODE_IEEE80211AD,
320         QCA_ACS_MODE_IEEE80211ANY,
321 };
322
323 /**
324  * enum qca_wlan_vendor_features - Vendor device/driver feature flags
325  *
326  * @QCA_WLAN_VENDOR_FEATURE_KEY_MGMT_OFFLOAD: Device supports key
327  *      management offload, a mechanism where the station's firmware
328  *      does the exchange with the AP to establish the temporal keys
329  *      after roaming, rather than having the user space wpa_supplicant do it.
330  * @QCA_WLAN_VENDOR_FEATURE_SUPPORT_HW_MODE_ANY: Device supports automatic
331  *      band selection based on channel selection results.
332  * @QCA_WLAN_VENDOR_FEATURE_OFFCHANNEL_SIMULTANEOUS: Device supports
333  *      simultaneous off-channel operations.
334  * @QCA_WLAN_VENDOR_FEATURE_P2P_LISTEN_OFFLOAD: Device supports P2P
335  *      Listen offload; a mechanism where the station's firmware takes care of
336  *      responding to incoming Probe Request frames received from other P2P
337  *      Devices whilst in Listen state, rather than having the user space
338  *      wpa_supplicant do it. Information from received P2P requests are
339  *      forwarded from firmware to host whenever the host processor wakes up.
340  * @NUM_QCA_WLAN_VENDOR_FEATURES: Number of assigned feature bits
341  */
342 enum qca_wlan_vendor_features {
343         QCA_WLAN_VENDOR_FEATURE_KEY_MGMT_OFFLOAD        = 0,
344         QCA_WLAN_VENDOR_FEATURE_SUPPORT_HW_MODE_ANY     = 1,
345         QCA_WLAN_VENDOR_FEATURE_OFFCHANNEL_SIMULTANEOUS = 2,
346         QCA_WLAN_VENDOR_FEATURE_P2P_LISTEN_OFFLOAD      = 3,
347         NUM_QCA_WLAN_VENDOR_FEATURES /* keep last */
348 };
349
350 /**
351  * enum qca_wlan_vendor_attr_data_offload_ind - Vendor Data Offload Indication
352  *
353  * @QCA_WLAN_VENDOR_ATTR_DATA_OFFLOAD_IND_SESSION: Session corresponding to
354  *      the offloaded data.
355  * @QCA_WLAN_VENDOR_ATTR_DATA_OFFLOAD_IND_PROTOCOL: Protocol of the offloaded
356  *      data.
357  * @QCA_WLAN_VENDOR_ATTR_DATA_OFFLOAD_IND_EVENT: Event type for the data offload
358  *      indication.
359  */
360 enum qca_wlan_vendor_attr_data_offload_ind {
361         QCA_WLAN_VENDOR_ATTR_DATA_OFFLOAD_IND_INVALID = 0,
362         QCA_WLAN_VENDOR_ATTR_DATA_OFFLOAD_IND_SESSION,
363         QCA_WLAN_VENDOR_ATTR_DATA_OFFLOAD_IND_PROTOCOL,
364         QCA_WLAN_VENDOR_ATTR_DATA_OFFLOAD_IND_EVENT,
365
366         /* keep last */
367         QCA_WLAN_VENDOR_ATTR_DATA_OFFLOAD_IND_AFTER_LAST,
368         QCA_WLAN_VENDOR_ATTR_DATA_OFFLOAD_IND_MAX =
369         QCA_WLAN_VENDOR_ATTR_DATA_OFFLOAD_IND_AFTER_LAST - 1
370 };
371
372 enum qca_vendor_attr_get_preferred_freq_list {
373         QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_INVALID,
374         /* A 32-unsigned value; the interface type/mode for which the preferred
375          * frequency list is requested (see enum qca_iface_type for possible
376          * values); used in GET_PREFERRED_FREQ_LIST command from user-space to
377          * kernel and in the kernel response back to user-space.
378          */
379         QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_IFACE_TYPE,
380         /* An array of 32-unsigned values; values are frequency (MHz); sent
381          * from kernel space to user space.
382          */
383         QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST,
384         /* keep last */
385         QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_AFTER_LAST,
386         QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_MAX =
387         QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_AFTER_LAST - 1
388 };
389
390 enum qca_vendor_attr_probable_oper_channel {
391         QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_INVALID,
392         /* 32-bit unsigned value; indicates the connection/iface type likely to
393          * come on this channel (see enum qca_iface_type).
394          */
395         QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_IFACE_TYPE,
396         /* 32-bit unsigned value; the frequency (MHz) of the probable channel */
397         QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_FREQ,
398         /* keep last */
399         QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_AFTER_LAST,
400         QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_MAX =
401         QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_AFTER_LAST - 1
402 };
403
404 enum qca_iface_type {
405         QCA_IFACE_TYPE_STA,
406         QCA_IFACE_TYPE_AP,
407         QCA_IFACE_TYPE_P2P_CLIENT,
408         QCA_IFACE_TYPE_P2P_GO,
409         QCA_IFACE_TYPE_IBSS,
410         QCA_IFACE_TYPE_TDLS,
411 };
412
413 enum qca_set_band {
414         QCA_SETBAND_AUTO,
415         QCA_SETBAND_5G,
416         QCA_SETBAND_2G,
417 };
418
419 /**
420  * enum qca_vendor_attr_get_tsf: Vendor attributes for TSF capture
421  * @QCA_WLAN_VENDOR_ATTR_TSF_CMD: enum qca_tsf_operation (u32)
422  * @QCA_WLAN_VENDOR_ATTR_TSF_TIMER_VALUE: Unsigned 64 bit TSF timer value
423  * @QCA_WLAN_VENDOR_ATTR_TSF_SOC_TIMER_VALUE: Unsigned 64 bit Synchronized
424  *      SOC timer value at TSF capture
425  */
426 enum qca_vendor_attr_tsf_cmd {
427         QCA_WLAN_VENDOR_ATTR_TSF_INVALID = 0,
428         QCA_WLAN_VENDOR_ATTR_TSF_CMD,
429         QCA_WLAN_VENDOR_ATTR_TSF_TIMER_VALUE,
430         QCA_WLAN_VENDOR_ATTR_TSF_SOC_TIMER_VALUE,
431         QCA_WLAN_VENDOR_ATTR_TSF_AFTER_LAST,
432         QCA_WLAN_VENDOR_ATTR_TSF_MAX =
433         QCA_WLAN_VENDOR_ATTR_TSF_AFTER_LAST - 1
434 };
435
436 /**
437  * enum qca_tsf_operation: TSF driver commands
438  * @QCA_TSF_CAPTURE: Initiate TSF Capture
439  * @QCA_TSF_GET: Get TSF capture value
440  * @QCA_TSF_SYNC_GET: Initiate TSF capture and return with captured value
441  */
442 enum qca_tsf_cmd {
443         QCA_TSF_CAPTURE,
444         QCA_TSF_GET,
445         QCA_TSF_SYNC_GET,
446 };
447
448 /**
449  * enum qca_vendor_attr_wisa_cmd
450  * @QCA_WLAN_VENDOR_ATTR_WISA_MODE: WISA mode value (u32)
451  * WISA setup vendor commands
452  */
453 enum qca_vendor_attr_wisa_cmd {
454         QCA_WLAN_VENDOR_ATTR_WISA_INVALID = 0,
455         QCA_WLAN_VENDOR_ATTR_WISA_MODE,
456         QCA_WLAN_VENDOR_ATTR_WISA_AFTER_LAST,
457         QCA_WLAN_VENDOR_ATTR_WISA_MAX =
458         QCA_WLAN_VENDOR_ATTR_WISA_AFTER_LAST - 1
459 };
460
461 /* IEEE 802.11 Vendor Specific elements */
462
463 /**
464  * enum qca_vendor_element_id - QCA Vendor Specific element types
465  *
466  * These values are used to identify QCA Vendor Specific elements. The
467  * payload of the element starts with the three octet OUI (OUI_QCA) and
468  * is followed by a single octet type which is defined by this enum.
469  *
470  * @QCA_VENDOR_ELEM_P2P_PREF_CHAN_LIST: P2P preferred channel list.
471  *      This element can be used to specify preference order for supported
472  *      channels. The channels in this list are in preference order (the first
473  *      one has the highest preference) and are described as a pair of
474  *      (global) Operating Class and Channel Number (each one octet) fields.
475  *
476  *      This extends the standard P2P functionality by providing option to have
477  *      more than one preferred operating channel. When this element is present,
478  *      it replaces the preference indicated in the Operating Channel attribute.
479  *      For supporting other implementations, the Operating Channel attribute is
480  *      expected to be used with the highest preference channel. Similarly, all
481  *      the channels included in this Preferred channel list element are
482  *      expected to be included in the Channel List attribute.
483  *
484  *      This vendor element may be included in GO Negotiation Request, P2P
485  *      Invitation Request, and Provision Discovery Request frames.
486  *
487  * @QCA_VENDOR_ELEM_HE_CAPAB: HE Capabilities element.
488  *      This element can be used for pre-standard publication testing of HE
489  *      before P802.11ax draft assigns the element ID. The payload of this
490  *      vendor specific element is defined by the latest P802.11ax draft.
491  *      Please note that the draft is still work in progress and this element
492  *      payload is subject to change.
493  *
494  * @QCA_VENDOR_ELEM_HE_OPER: HE Operation element.
495  *      This element can be used for pre-standard publication testing of HE
496  *      before P802.11ax draft assigns the element ID. The payload of this
497  *      vendor specific element is defined by the latest P802.11ax draft.
498  *      Please note that the draft is still work in progress and this element
499  *      payload is subject to change.
500  */
501 enum qca_vendor_element_id {
502         QCA_VENDOR_ELEM_P2P_PREF_CHAN_LIST = 0,
503         QCA_VENDOR_ELEM_HE_CAPAB = 1,
504         QCA_VENDOR_ELEM_HE_OPER = 2,
505 };
506
507 /**
508  * enum qca_wlan_vendor_attr_scan - Specifies vendor scan attributes
509  *
510  * @QCA_WLAN_VENDOR_ATTR_SCAN_IE: IEs that should be included as part of scan
511  * @QCA_WLAN_VENDOR_ATTR_SCAN_FREQUENCIES: Nested unsigned 32-bit attributes
512  *      with frequencies to be scanned (in MHz)
513  * @QCA_WLAN_VENDOR_ATTR_SCAN_SSIDS: Nested attribute with SSIDs to be scanned
514  * @QCA_WLAN_VENDOR_ATTR_SCAN_SUPP_RATES: Nested array attribute of supported
515  *      rates to be included
516  * @QCA_WLAN_VENDOR_ATTR_SCAN_TX_NO_CCK_RATE: flag used to send probe requests
517  *      at non CCK rate in 2GHz band
518  * @QCA_WLAN_VENDOR_ATTR_SCAN_FLAGS: Unsigned 32-bit scan flags
519  * @QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE: Unsigned 64-bit cookie provided by the
520  *      driver for the specific scan request
521  * @QCA_WLAN_VENDOR_ATTR_SCAN_STATUS: Unsigned 8-bit status of the scan
522  *      request decoded as in enum scan_status
523  * @QCA_WLAN_VENDOR_ATTR_SCAN_MAC: 6-byte MAC address to use when randomisation
524  *      scan flag is set
525  * @QCA_WLAN_VENDOR_ATTR_SCAN_MAC_MASK: 6-byte MAC address mask to be used with
526  *      randomisation
527  */
528 enum qca_wlan_vendor_attr_scan {
529         QCA_WLAN_VENDOR_ATTR_SCAN_INVALID_PARAM = 0,
530         QCA_WLAN_VENDOR_ATTR_SCAN_IE,
531         QCA_WLAN_VENDOR_ATTR_SCAN_FREQUENCIES,
532         QCA_WLAN_VENDOR_ATTR_SCAN_SSIDS,
533         QCA_WLAN_VENDOR_ATTR_SCAN_SUPP_RATES,
534         QCA_WLAN_VENDOR_ATTR_SCAN_TX_NO_CCK_RATE,
535         QCA_WLAN_VENDOR_ATTR_SCAN_FLAGS,
536         QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE,
537         QCA_WLAN_VENDOR_ATTR_SCAN_STATUS,
538         QCA_WLAN_VENDOR_ATTR_SCAN_MAC,
539         QCA_WLAN_VENDOR_ATTR_SCAN_MAC_MASK,
540         QCA_WLAN_VENDOR_ATTR_SCAN_AFTER_LAST,
541         QCA_WLAN_VENDOR_ATTR_SCAN_MAX =
542         QCA_WLAN_VENDOR_ATTR_SCAN_AFTER_LAST - 1
543 };
544
545 /**
546  * enum scan_status - Specifies the valid values the vendor scan attribute
547  *      QCA_WLAN_VENDOR_ATTR_SCAN_STATUS can take
548  *
549  * @VENDOR_SCAN_STATUS_NEW_RESULTS: implies the vendor scan is successful with
550  *      new scan results
551  * @VENDOR_SCAN_STATUS_ABORTED: implies the vendor scan was aborted in-between
552  */
553 enum scan_status {
554         VENDOR_SCAN_STATUS_NEW_RESULTS,
555         VENDOR_SCAN_STATUS_ABORTED,
556         VENDOR_SCAN_STATUS_MAX,
557 };
558
559 /**
560  * enum qca_vendor_attr_ota_test - Specifies the values for vendor
561  *                       command QCA_NL80211_VENDOR_SUBCMD_OTA_TEST
562  * @QCA_WLAN_VENDOR_ATTR_OTA_TEST_ENABLE: enable ota test
563  */
564 enum qca_vendor_attr_ota_test {
565         QCA_WLAN_VENDOR_ATTR_OTA_TEST_INVALID,
566         /* 8-bit unsigned value to indicate if OTA test is enabled */
567         QCA_WLAN_VENDOR_ATTR_OTA_TEST_ENABLE,
568         /* keep last */
569         QCA_WLAN_VENDOR_ATTR_OTA_TEST_AFTER_LAST,
570         QCA_WLAN_VENDOR_ATTR_OTA_TEST_MAX =
571         QCA_WLAN_VENDOR_ATTR_OTA_TEST_AFTER_LAST - 1
572 };
573
574 /**
575  * enum qca_vendor_attr_txpower_scale - vendor sub commands index
576  *
577  * @QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE: scaling value
578  */
579 enum qca_vendor_attr_txpower_scale {
580         QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_INVALID,
581         /* 8-bit unsigned value to indicate the scaling of tx power */
582         QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE,
583         /* keep last */
584         QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_AFTER_LAST,
585         QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_MAX =
586         QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_AFTER_LAST - 1
587 };
588
589 /**
590  * enum qca_vendor_attr_txpower_decr_db - Attributes for TX power decrease
591  *
592  * These attributes are used with QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_DECR_DB.
593  */
594 enum qca_vendor_attr_txpower_decr_db {
595         QCA_WLAN_VENDOR_ATTR_TXPOWER_DECR_DB_INVALID,
596         /* 8-bit unsigned value to indicate the reduction of TX power in dB for
597          * a virtual interface. */
598         QCA_WLAN_VENDOR_ATTR_TXPOWER_DECR_DB,
599         /* keep last */
600         QCA_WLAN_VENDOR_ATTR_TXPOWER_DECR_DB_AFTER_LAST,
601         QCA_WLAN_VENDOR_ATTR_TXPOWER_DECR_DB_MAX =
602         QCA_WLAN_VENDOR_ATTR_TXPOWER_DECR_DB_AFTER_LAST - 1
603 };
604
605 /* Attributes for data used by
606  * QCA_NL80211_VENDOR_SUBCMD_SET_CONFIGURATION and
607  * QCA_NL80211_VENDOR_SUBCMD_GET_CONFIGURATION subcommands.
608  */
609 enum qca_wlan_vendor_attr_config {
610         QCA_WLAN_VENDOR_ATTR_CONFIG_INVALID,
611         /* Unsigned 32-bit value to set the DTIM period.
612          * Whether the wifi chipset wakes at every dtim beacon or a multiple of
613          * the DTIM period. If DTIM is set to 3, the STA shall wake up every 3
614          * DTIM beacons.
615          */
616         QCA_WLAN_VENDOR_ATTR_CONFIG_DYNAMIC_DTIM,
617         /* Unsigned 32-bit value to set the wifi_iface stats averaging factor
618          * used to calculate statistics like average the TSF offset or average
619          * number of frame leaked.
620          * For instance, upon Beacon frame reception:
621          * current_avg = ((beacon_TSF - TBTT) * factor + previous_avg * (0x10000 - factor) ) / 0x10000
622          * For instance, when evaluating leaky APs:
623          * current_avg = ((num frame received within guard time) * factor + previous_avg * (0x10000 - factor)) / 0x10000
624          */
625         QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR,
626         /* Unsigned 32-bit value to configure guard time, i.e., when
627          * implementing IEEE power management based on frame control PM bit, how
628          * long the driver waits before shutting down the radio and after
629          * receiving an ACK frame for a Data frame with PM bit set.
630          */
631         QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME,
632         /* Unsigned 32-bit value to change the FTM capability dynamically */
633         QCA_WLAN_VENDOR_ATTR_CONFIG_FINE_TIME_MEASUREMENT,
634         /* Unsigned 16-bit value to configure maximum TX rate dynamically */
635         QCA_WLAN_VENDOR_ATTR_CONF_TX_RATE,
636         /* Unsigned 32-bit value to configure the number of continuous
637          * Beacon Miss which shall be used by the firmware to penalize
638          * the RSSI.
639          */
640         QCA_WLAN_VENDOR_ATTR_CONFIG_PENALIZE_AFTER_NCONS_BEACON_MISS,
641         /* Unsigned 8-bit value to configure the channel avoidance indication
642          * behavior. Firmware to send only one indication and ignore duplicate
643          * indications when set to avoid multiple Apps wakeups.
644          */
645         QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_AVOIDANCE_IND,
646         /* 8-bit unsigned value to configure the maximum TX MPDU for
647          * aggregation. */
648         QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION,
649         /* 8-bit unsigned value to configure the maximum RX MPDU for
650          * aggregation. */
651         QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION,
652         /* 8-bit unsigned value to configure the Non aggregrate/11g sw
653          * retry threshold (0 disable, 31 max). */
654         QCA_WLAN_VENDOR_ATTR_CONFIG_NON_AGG_RETRY,
655         /* 8-bit unsigned value to configure the aggregrate sw
656          * retry threshold (0 disable, 31 max). */
657         QCA_WLAN_VENDOR_ATTR_CONFIG_AGG_RETRY,
658         /* 8-bit unsigned value to configure the MGMT frame
659          * retry threshold (0 disable, 31 max). */
660         QCA_WLAN_VENDOR_ATTR_CONFIG_MGMT_RETRY,
661         /* 8-bit unsigned value to configure the CTRL frame
662          * retry threshold (0 disable, 31 max). */
663         QCA_WLAN_VENDOR_ATTR_CONFIG_CTRL_RETRY,
664         /* 8-bit unsigned value to configure the propagation delay for
665          * 2G/5G band (0~63, units in us) */
666         QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_DELAY,
667
668         /* keep last */
669         QCA_WLAN_VENDOR_ATTR_CONFIG_AFTER_LAST,
670         QCA_WLAN_VENDOR_ATTR_CONFIG_MAX =
671         QCA_WLAN_VENDOR_ATTR_CONFIG_AFTER_LAST - 1,
672 };
673
674 /**
675  * enum qca_wlan_vendor_attr_sap_config - Parameters for AP configuration
676  */
677 enum qca_wlan_vendor_attr_sap_config {
678         QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_INVALID = 0,
679         /* 1 - reserved for QCA */
680         /* List of frequencies on which AP is expected to operate.
681          * This is irrespective of ACS configuration. This list is a priority
682          * based one and is looked for before the AP is created to ensure the
683          * best concurrency sessions (avoid MCC and use DBS/SCC) co-exist in
684          * the system.
685          */
686         QCA_WLAN_VENDOR_ATTR_SAP_MANDATORY_FREQUENCY_LIST = 2,
687
688         QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_AFTER_LAST,
689         QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_MAX =
690         QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_AFTER_LAST - 1,
691 };
692
693 /**
694  * enum qca_wlan_vendor_attr_sap_conditional_chan_switch - Parameters for AP
695  *                                      conditional channel switch
696  */
697 enum qca_wlan_vendor_attr_sap_conditional_chan_switch {
698         QCA_WLAN_VENDOR_ATTR_SAP_CONDITIONAL_CHAN_SWITCH_INVALID = 0,
699         /* Priority based frequency list (an array of u32 values in host byte
700          * order) */
701         QCA_WLAN_VENDOR_ATTR_SAP_CONDITIONAL_CHAN_SWITCH_FREQ_LIST = 1,
702         /* Status of the conditional switch (u32).
703          * 0: Success, Non-zero: Failure
704          */
705         QCA_WLAN_VENDOR_ATTR_SAP_CONDITIONAL_CHAN_SWITCH_STATUS = 2,
706
707         QCA_WLAN_VENDOR_ATTR_SAP_CONDITIONAL_CHAN_SWITCH_AFTER_LAST,
708         QCA_WLAN_VENDOR_ATTR_SAP_CONDITIONAL_CHAN_SWITCH_MAX =
709         QCA_WLAN_VENDOR_ATTR_SAP_CONDITIONAL_CHAN_SWITCH_AFTER_LAST - 1,
710 };
711
712 #endif /* QCA_VENDOR_H */