1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
7 #include <linux/ieee80211.h>
9 #define QLINK_PROTO_VER 16
11 #define QLINK_MACID_RSVD 0xFF
12 #define QLINK_VIFID_RSVD 0xFF
14 /* Common QLINK protocol messages definitions.
18 * enum qlink_msg_type - QLINK message types
20 * Used to distinguish between message types of QLINK protocol.
22 * @QLINK_MSG_TYPE_CMD: Message is carrying data of a command sent from
23 * driver to wireless hardware.
24 * @QLINK_MSG_TYPE_CMDRSP: Message is carrying data of a response to a command.
25 * Sent from wireless HW to driver in reply to previously issued command.
26 * @QLINK_MSG_TYPE_EVENT: Data for an event originated in wireless hardware and
27 * sent asynchronously to driver.
30 QLINK_MSG_TYPE_CMD = 1,
31 QLINK_MSG_TYPE_CMDRSP = 2,
32 QLINK_MSG_TYPE_EVENT = 3
36 * struct qlink_msg_header - common QLINK protocol message header
38 * Portion of QLINK protocol header common for all message types.
40 * @type: Message type, one of &enum qlink_msg_type.
41 * @len: Total length of message including all headers.
43 struct qlink_msg_header {
48 /* Generic definitions of data and information carried in QLINK messages
52 * enum qlink_hw_capab - device capabilities.
54 * @QLINK_HW_CAPAB_REG_UPDATE: device can update it's regulatory region.
55 * @QLINK_HW_CAPAB_STA_INACT_TIMEOUT: device implements a logic to kick-out
56 * associated STAs due to inactivity. Inactivity timeout period is taken
57 * from QLINK_CMD_START_AP parameters.
58 * @QLINK_HW_CAPAB_DFS_OFFLOAD: device implements DFS offload functionality
59 * @QLINK_HW_CAPAB_SCAN_RANDOM_MAC_ADDR: device supports MAC Address
60 * Randomization in probe requests.
61 * @QLINK_HW_CAPAB_OBSS_SCAN: device can perform OBSS scanning.
62 * @QLINK_HW_CAPAB_HW_BRIDGE: device has hardware switch capabilities.
65 QLINK_HW_CAPAB_REG_UPDATE = BIT(0),
66 QLINK_HW_CAPAB_STA_INACT_TIMEOUT = BIT(1),
67 QLINK_HW_CAPAB_DFS_OFFLOAD = BIT(2),
68 QLINK_HW_CAPAB_SCAN_RANDOM_MAC_ADDR = BIT(3),
69 QLINK_HW_CAPAB_PWR_MGMT = BIT(4),
70 QLINK_HW_CAPAB_OBSS_SCAN = BIT(5),
71 QLINK_HW_CAPAB_SCAN_DWELL = BIT(6),
72 QLINK_HW_CAPAB_SAE = BIT(8),
73 QLINK_HW_CAPAB_HW_BRIDGE = BIT(9),
76 enum qlink_iface_type {
78 QLINK_IFTYPE_STATION = 2,
79 QLINK_IFTYPE_ADHOC = 3,
80 QLINK_IFTYPE_MONITOR = 4,
82 QLINK_IFTYPE_AP_VLAN = 6,
86 * struct qlink_intf_info - information on virtual interface.
88 * Data describing a single virtual interface.
90 * @if_type: Mode of interface operation, one of &enum qlink_iface_type
91 * @vlanid: VLAN ID for AP_VLAN interface type
92 * @mac_addr: MAC address of virtual interface.
94 struct qlink_intf_info {
97 u8 mac_addr[ETH_ALEN];
102 enum qlink_sta_flags {
103 QLINK_STA_FLAG_INVALID = 0,
104 QLINK_STA_FLAG_AUTHORIZED = BIT(0),
105 QLINK_STA_FLAG_SHORT_PREAMBLE = BIT(1),
106 QLINK_STA_FLAG_WME = BIT(2),
107 QLINK_STA_FLAG_MFP = BIT(3),
108 QLINK_STA_FLAG_AUTHENTICATED = BIT(4),
109 QLINK_STA_FLAG_TDLS_PEER = BIT(5),
110 QLINK_STA_FLAG_ASSOCIATED = BIT(6),
113 enum qlink_channel_width {
114 QLINK_CHAN_WIDTH_5 = 0,
116 QLINK_CHAN_WIDTH_20_NOHT,
120 QLINK_CHAN_WIDTH_80P80,
121 QLINK_CHAN_WIDTH_160,
125 * struct qlink_channel - qlink control channel definition
127 * @hw_value: hardware-specific value for the channel
128 * @center_freq: center frequency in MHz
129 * @flags: channel flags from &enum qlink_channel_flags
130 * @band: band this channel belongs to
131 * @max_antenna_gain: maximum antenna gain in dBi
132 * @max_power: maximum transmission power (in dBm)
133 * @max_reg_power: maximum regulatory transmission power (in dBm)
134 * @dfs_state: current state of this channel.
135 * Only relevant if radar is required on this channel.
136 * @beacon_found: helper to regulatory code to indicate when a beacon
137 * has been found on this channel. Use regulatory_hint_found_beacon()
138 * to enable this, this is useful only on 5 GHz band.
140 struct qlink_channel {
155 * struct qlink_chandef - qlink channel definition
157 * @chan: primary channel definition
158 * @center_freq1: center frequency of first segment
159 * @center_freq2: center frequency of second segment (80+80 only)
160 * @width: channel width, one of @enum qlink_channel_width
162 struct qlink_chandef {
163 struct qlink_channel chan;
170 #define QLINK_MAX_NR_CIPHER_SUITES 5
171 #define QLINK_MAX_NR_AKM_SUITES 2
173 struct qlink_auth_encr {
176 __le32 n_ciphers_pairwise;
177 __le32 ciphers_pairwise[QLINK_MAX_NR_CIPHER_SUITES];
179 __le32 akm_suites[QLINK_MAX_NR_AKM_SUITES];
180 __le16 control_port_ethertype;
184 u8 control_port_no_encrypt;
189 * struct qlink_sta_info_state - station flags mask/value
191 * @mask: STA flags mask, bitmap of &enum qlink_sta_flags
192 * @value: STA flags values, bitmap of &enum qlink_sta_flags
194 struct qlink_sta_info_state {
200 * enum qlink_sr_ctrl_flags - control flags for spatial reuse parameter set
202 * @QLINK_SR_PSR_DISALLOWED: indicates whether or not PSR-based spatial reuse
203 * transmissions are allowed for STAs associated with the AP
204 * @QLINK_SR_NON_SRG_OBSS_PD_SR_DISALLOWED: indicates whether or not
205 * Non-SRG OBSS PD spatial reuse transmissions are allowed for STAs associated
207 * @NON_SRG_OFFSET_PRESENT: indicates whether or not Non-SRG OBSS PD Max offset
208 * field is valid in the element
209 * @QLINK_SR_SRG_INFORMATION_PRESENT: indicates whether or not SRG OBSS PD
210 * Min/Max offset fields ore valid in the element
212 enum qlink_sr_ctrl_flags {
213 QLINK_SR_PSR_DISALLOWED = BIT(0),
214 QLINK_SR_NON_SRG_OBSS_PD_SR_DISALLOWED = BIT(1),
215 QLINK_SR_NON_SRG_OFFSET_PRESENT = BIT(2),
216 QLINK_SR_SRG_INFORMATION_PRESENT = BIT(3),
220 * struct qlink_sr_params - spatial reuse parameters
222 * @sr_control: spatial reuse control field; flags contained in this field are
223 * defined in @qlink_sr_ctrl_flags
224 * @non_srg_obss_pd_max: added to -82 dBm to generate the value of the
225 * Non-SRG OBSS PD Max parameter
226 * @srg_obss_pd_min_offset: added to -82 dBm to generate the value of the
227 * SRG OBSS PD Min parameter
228 * @srg_obss_pd_max_offset: added to -82 dBm to generate the value of the
229 * SRG PBSS PD Max parameter
231 struct qlink_sr_params {
233 u8 non_srg_obss_pd_max;
234 u8 srg_obss_pd_min_offset;
235 u8 srg_obss_pd_max_offset;
238 /* QLINK Command messages related definitions
242 * enum qlink_cmd_type - list of supported commands
244 * Commands are QLINK messages of type @QLINK_MSG_TYPE_CMD, sent by driver to
245 * wireless network device for processing. Device is expected to send back a
246 * reply message of type &QLINK_MSG_TYPE_CMDRSP, containing at least command
247 * execution status (one of &enum qlink_cmd_result). Reply message
248 * may also contain data payload specific to the command type.
250 * @QLINK_CMD_SEND_FRAME: send specified frame over the air; firmware will
251 * encapsulate 802.3 packet into 802.11 frame automatically.
252 * @QLINK_CMD_BAND_INFO_GET: for the specified MAC and specified band, get
253 * the band's description including number of operational channels and
254 * info on each channel, HT/VHT capabilities, supported rates etc.
255 * This command is generic to a specified MAC, interface index must be set
256 * to QLINK_VIFID_RSVD in command header.
257 * @QLINK_CMD_REG_NOTIFY: notify device about regulatory domain change. This
258 * command is supported only if device reports QLINK_HW_SUPPORTS_REG_UPDATE
260 * @QLINK_CMD_START_CAC: start radar detection procedure on a specified channel.
261 * @QLINK_CMD_TXPWR: get or set current channel transmit power for
263 * @QLINK_CMD_NDEV_EVENT: signalizes changes made with a corresponding network
266 enum qlink_cmd_type {
267 QLINK_CMD_FW_INIT = 0x0001,
268 QLINK_CMD_FW_DEINIT = 0x0002,
269 QLINK_CMD_REGISTER_MGMT = 0x0003,
270 QLINK_CMD_SEND_FRAME = 0x0004,
271 QLINK_CMD_MGMT_SET_APPIE = 0x0005,
272 QLINK_CMD_PHY_PARAMS_GET = 0x0011,
273 QLINK_CMD_PHY_PARAMS_SET = 0x0012,
274 QLINK_CMD_GET_HW_INFO = 0x0013,
275 QLINK_CMD_MAC_INFO = 0x0014,
276 QLINK_CMD_ADD_INTF = 0x0015,
277 QLINK_CMD_DEL_INTF = 0x0016,
278 QLINK_CMD_CHANGE_INTF = 0x0017,
279 QLINK_CMD_UPDOWN_INTF = 0x0018,
280 QLINK_CMD_REG_NOTIFY = 0x0019,
281 QLINK_CMD_BAND_INFO_GET = 0x001A,
282 QLINK_CMD_CHAN_SWITCH = 0x001B,
283 QLINK_CMD_CHAN_GET = 0x001C,
284 QLINK_CMD_START_CAC = 0x001D,
285 QLINK_CMD_START_AP = 0x0021,
286 QLINK_CMD_STOP_AP = 0x0022,
287 QLINK_CMD_SET_MAC_ACL = 0x0023,
288 QLINK_CMD_GET_STA_INFO = 0x0030,
289 QLINK_CMD_ADD_KEY = 0x0040,
290 QLINK_CMD_DEL_KEY = 0x0041,
291 QLINK_CMD_SET_DEFAULT_KEY = 0x0042,
292 QLINK_CMD_SET_DEFAULT_MGMT_KEY = 0x0043,
293 QLINK_CMD_CHANGE_STA = 0x0051,
294 QLINK_CMD_DEL_STA = 0x0052,
295 QLINK_CMD_SCAN = 0x0053,
296 QLINK_CMD_CHAN_STATS = 0x0054,
297 QLINK_CMD_NDEV_EVENT = 0x0055,
298 QLINK_CMD_CONNECT = 0x0060,
299 QLINK_CMD_DISCONNECT = 0x0061,
300 QLINK_CMD_PM_SET = 0x0062,
301 QLINK_CMD_WOWLAN_SET = 0x0063,
302 QLINK_CMD_EXTERNAL_AUTH = 0x0066,
303 QLINK_CMD_TXPWR = 0x0067,
307 * struct qlink_cmd - QLINK command message header
309 * Header used for QLINK messages of QLINK_MSG_TYPE_CMD type.
311 * @mhdr: Common QLINK message header.
312 * @cmd_id: command id, one of &enum qlink_cmd_type.
313 * @seq_num: sequence number of command message, used for matching with
315 * @macid: index of physical radio device the command is destined to or
316 * QLINK_MACID_RSVD if not applicable.
317 * @vifid: index of virtual wireless interface on specified @macid the command
318 * is destined to or QLINK_VIFID_RSVD if not applicable.
321 struct qlink_msg_header mhdr;
330 * struct qlink_cmd_manage_intf - interface management command
332 * Data for interface management commands QLINK_CMD_ADD_INTF, QLINK_CMD_DEL_INTF
333 * and QLINK_CMD_CHANGE_INTF.
335 * @intf_info: interface description.
337 struct qlink_cmd_manage_intf {
338 struct qlink_cmd chdr;
339 struct qlink_intf_info intf_info;
342 enum qlink_mgmt_frame_type {
343 QLINK_MGMT_FRAME_ASSOC_REQ = 0x00,
344 QLINK_MGMT_FRAME_ASSOC_RESP = 0x01,
345 QLINK_MGMT_FRAME_REASSOC_REQ = 0x02,
346 QLINK_MGMT_FRAME_REASSOC_RESP = 0x03,
347 QLINK_MGMT_FRAME_PROBE_REQ = 0x04,
348 QLINK_MGMT_FRAME_PROBE_RESP = 0x05,
349 QLINK_MGMT_FRAME_BEACON = 0x06,
350 QLINK_MGMT_FRAME_ATIM = 0x07,
351 QLINK_MGMT_FRAME_DISASSOC = 0x08,
352 QLINK_MGMT_FRAME_AUTH = 0x09,
353 QLINK_MGMT_FRAME_DEAUTH = 0x0A,
354 QLINK_MGMT_FRAME_ACTION = 0x0B,
356 QLINK_MGMT_FRAME_TYPE_COUNT
360 * struct qlink_cmd_mgmt_frame_register - data for QLINK_CMD_REGISTER_MGMT
362 * @frame_type: MGMT frame type the registration request describes, one of
363 * &enum qlink_mgmt_frame_type.
364 * @do_register: 0 - unregister, otherwise register for reception of specified
367 struct qlink_cmd_mgmt_frame_register {
368 struct qlink_cmd chdr;
374 * @QLINK_FRAME_TX_FLAG_8023: frame has a 802.3 header; if not set, frame
375 * is a 802.11 encapsulated.
377 enum qlink_frame_tx_flags {
378 QLINK_FRAME_TX_FLAG_OFFCHAN = BIT(0),
379 QLINK_FRAME_TX_FLAG_NO_CCK = BIT(1),
380 QLINK_FRAME_TX_FLAG_ACK_NOWAIT = BIT(2),
381 QLINK_FRAME_TX_FLAG_8023 = BIT(3),
385 * struct qlink_cmd_frame_tx - data for QLINK_CMD_SEND_FRAME command
387 * @cookie: opaque request identifier.
388 * @freq: Frequency to use for frame transmission.
389 * @flags: Transmission flags, one of &enum qlink_frame_tx_flags.
390 * @frame_data: frame to transmit.
392 struct qlink_cmd_frame_tx {
393 struct qlink_cmd chdr;
401 * struct qlink_cmd_get_sta_info - data for QLINK_CMD_GET_STA_INFO command
403 * @sta_addr: MAC address of the STA statistics is requested for.
405 struct qlink_cmd_get_sta_info {
406 struct qlink_cmd chdr;
407 u8 sta_addr[ETH_ALEN];
411 * struct qlink_cmd_add_key - data for QLINK_CMD_ADD_KEY command.
413 * @key_index: index of the key being installed.
414 * @pairwise: whether to use pairwise key.
415 * @addr: MAC address of a STA key is being installed to.
416 * @cipher: cipher suite.
417 * @vlanid: VLAN ID for AP_VLAN interface type
418 * @key_data: key data itself.
420 struct qlink_cmd_add_key {
421 struct qlink_cmd chdr;
431 * struct qlink_cmd_del_key_req - data for QLINK_CMD_DEL_KEY command
433 * @key_index: index of the key being removed.
434 * @pairwise: whether to use pairwise key.
435 * @addr: MAC address of a STA for which a key is removed.
437 struct qlink_cmd_del_key {
438 struct qlink_cmd chdr;
445 * struct qlink_cmd_set_def_key - data for QLINK_CMD_SET_DEFAULT_KEY command
447 * @key_index: index of the key to be set as default one.
448 * @unicast: key is unicast.
449 * @multicast: key is multicast.
451 struct qlink_cmd_set_def_key {
452 struct qlink_cmd chdr;
459 * struct qlink_cmd_set_def_mgmt_key - data for QLINK_CMD_SET_DEFAULT_MGMT_KEY
461 * @key_index: index of the key to be set as default MGMT key.
463 struct qlink_cmd_set_def_mgmt_key {
464 struct qlink_cmd chdr;
469 * struct qlink_cmd_change_sta - data for QLINK_CMD_CHANGE_STA command
471 * @flag_update: STA flags to update
472 * @if_type: Mode of interface operation, one of &enum qlink_iface_type
473 * @vlanid: VLAN ID to assign to specific STA
474 * @sta_addr: address of the STA for which parameters are set.
476 struct qlink_cmd_change_sta {
477 struct qlink_cmd chdr;
478 struct qlink_sta_info_state flag_update;
481 u8 sta_addr[ETH_ALEN];
485 * struct qlink_cmd_del_sta - data for QLINK_CMD_DEL_STA command.
487 * See &struct station_del_parameters
489 struct qlink_cmd_del_sta {
490 struct qlink_cmd chdr;
493 u8 sta_addr[ETH_ALEN];
496 enum qlink_sta_connect_flags {
497 QLINK_STA_CONNECT_DISABLE_HT = BIT(0),
498 QLINK_STA_CONNECT_DISABLE_VHT = BIT(1),
499 QLINK_STA_CONNECT_USE_RRM = BIT(2),
503 * struct qlink_cmd_connect - data for QLINK_CMD_CONNECT command
505 * @bssid: BSSID of the BSS to connect to.
506 * @bssid_hint: recommended AP BSSID for initial connection to the BSS or
507 * 00:00:00:00:00:00 if not specified.
508 * @prev_bssid: previous BSSID, if specified (not 00:00:00:00:00:00) indicates
509 * a request to reassociate.
510 * @bg_scan_period: period of background scan.
511 * @flags: one of &enum qlink_sta_connect_flags.
512 * @ht_capa: HT Capabilities overrides.
513 * @ht_capa_mask: The bits of ht_capa which are to be used.
514 * @vht_capa: VHT Capability overrides
515 * @vht_capa_mask: The bits of vht_capa which are to be used.
516 * @aen: authentication information.
517 * @mfp: whether to use management frame protection.
518 * @payload: variable portion of connection request.
520 struct qlink_cmd_connect {
521 struct qlink_cmd chdr;
523 u8 bssid_hint[ETH_ALEN];
524 u8 prev_bssid[ETH_ALEN];
525 __le16 bg_scan_period;
527 struct ieee80211_ht_cap ht_capa;
528 struct ieee80211_ht_cap ht_capa_mask;
529 struct ieee80211_vht_cap vht_capa;
530 struct ieee80211_vht_cap vht_capa_mask;
531 struct qlink_auth_encr aen;
539 * struct qlink_cmd_external_auth - data for QLINK_CMD_EXTERNAL_AUTH command
541 * @bssid: BSSID of the BSS to connect to
542 * @status: authentication status code
543 * @payload: variable portion of connection request.
545 struct qlink_cmd_external_auth {
546 struct qlink_cmd chdr;
553 * struct qlink_cmd_disconnect - data for QLINK_CMD_DISCONNECT command
555 * @reason: code of the reason of disconnect, see &enum ieee80211_reasoncode.
557 struct qlink_cmd_disconnect {
558 struct qlink_cmd chdr;
563 * struct qlink_cmd_updown - data for QLINK_CMD_UPDOWN_INTF command
565 * @if_up: bring specified interface DOWN (if_up==0) or UP (otherwise).
566 * Interface is specified in common command header @chdr.
568 struct qlink_cmd_updown {
569 struct qlink_cmd chdr;
574 * enum qlink_band - a list of frequency bands
576 * @QLINK_BAND_2GHZ: 2.4GHz band
577 * @QLINK_BAND_5GHZ: 5GHz band
578 * @QLINK_BAND_60GHZ: 60GHz band
581 QLINK_BAND_2GHZ = BIT(0),
582 QLINK_BAND_5GHZ = BIT(1),
583 QLINK_BAND_60GHZ = BIT(2),
587 * struct qlink_cmd_band_info_get - data for QLINK_CMD_BAND_INFO_GET command
589 * @band: a PHY band for which information is queried, one of @enum qlink_band
591 struct qlink_cmd_band_info_get {
592 struct qlink_cmd chdr;
597 * struct qlink_cmd_get_chan_stats - data for QLINK_CMD_CHAN_STATS command
599 * @channel: channel number according to 802.11 17.3.8.3.2 and Annex J
601 struct qlink_cmd_get_chan_stats {
602 struct qlink_cmd chdr;
607 * enum qlink_reg_initiator - Indicates the initiator of a reg domain request
609 * See &enum nl80211_reg_initiator for more info.
611 enum qlink_reg_initiator {
612 QLINK_REGDOM_SET_BY_CORE,
613 QLINK_REGDOM_SET_BY_USER,
614 QLINK_REGDOM_SET_BY_DRIVER,
615 QLINK_REGDOM_SET_BY_COUNTRY_IE,
619 * enum qlink_user_reg_hint_type - type of user regulatory hint
621 * See &enum nl80211_user_reg_hint_type for more info.
623 enum qlink_user_reg_hint_type {
624 QLINK_USER_REG_HINT_USER = 0,
625 QLINK_USER_REG_HINT_CELL_BASE = 1,
626 QLINK_USER_REG_HINT_INDOOR = 2,
630 * struct qlink_cmd_reg_notify - data for QLINK_CMD_REG_NOTIFY command
632 * @alpha2: the ISO / IEC 3166 alpha2 country code.
633 * @initiator: which entity sent the request, one of &enum qlink_reg_initiator.
634 * @user_reg_hint_type: type of hint for QLINK_REGDOM_SET_BY_USER request, one
635 * of &enum qlink_user_reg_hint_type.
636 * @num_channels: number of &struct qlink_tlv_channel in a variable portion of a
638 * @dfs_region: one of &enum qlink_dfs_regions.
639 * @slave_radar: whether slave device should enable radar detection.
640 * @dfs_offload: enable or disable DFS offload to firmware.
641 * @info: variable portion of regulatory notifier callback.
643 struct qlink_cmd_reg_notify {
644 struct qlink_cmd chdr;
647 u8 user_reg_hint_type;
656 * struct qlink_cmd_chan_switch - data for QLINK_CMD_CHAN_SWITCH command
658 * @channel: channel number according to 802.11 17.3.8.3.2 and Annex J
659 * @radar_required: whether radar detection is required on the new channel
660 * @block_tx: whether transmissions should be blocked while changing
661 * @beacon_count: number of beacons until switch
663 struct qlink_cmd_chan_switch {
664 struct qlink_cmd chdr;
672 * enum qlink_hidden_ssid - values for %NL80211_ATTR_HIDDEN_SSID
674 * Refer to &enum nl80211_hidden_ssid
676 enum qlink_hidden_ssid {
677 QLINK_HIDDEN_SSID_NOT_IN_USE,
678 QLINK_HIDDEN_SSID_ZERO_LEN,
679 QLINK_HIDDEN_SSID_ZERO_CONTENTS
683 * struct qlink_cmd_start_ap - data for QLINK_CMD_START_AP command
685 * @beacon_interval: beacon interval
686 * @inactivity_timeout: station's inactivity period in seconds
687 * @dtim_period: DTIM period
688 * @hidden_ssid: whether to hide the SSID, one of &enum qlink_hidden_ssid
689 * @smps_mode: SMPS mode
690 * @ht_required: stations must support HT
691 * @vht_required: stations must support VHT
692 * @aen: encryption info
693 * @sr_params: spatial reuse parameters
694 * @twt_responder: enable Target Wake Time
695 * @info: variable configurations
697 struct qlink_cmd_start_ap {
698 struct qlink_cmd chdr;
699 __le16 beacon_interval;
700 __le16 inactivity_timeout;
709 struct qlink_auth_encr aen;
710 struct qlink_sr_params sr_params;
717 * struct qlink_cmd_start_cac - data for QLINK_CMD_START_CAC command
719 * @chan: a channel to start a radar detection procedure on.
720 * @cac_time_ms: CAC time.
722 struct qlink_cmd_start_cac {
723 struct qlink_cmd chdr;
724 struct qlink_chandef chan;
728 enum qlink_acl_policy {
729 QLINK_ACL_POLICY_ACCEPT_UNLESS_LISTED,
730 QLINK_ACL_POLICY_DENY_UNLESS_LISTED,
733 struct qlink_mac_address {
738 * struct qlink_acl_data - ACL data
740 * @policy: filter policy, one of &enum qlink_acl_policy.
741 * @num_entries: number of MAC addresses in array.
742 * @mac_address: MAC addresses array.
744 struct qlink_acl_data {
747 struct qlink_mac_address mac_addrs[0];
751 * enum qlink_pm_mode - Power Management mode
753 * @QLINK_PM_OFF: normal mode, no power saving enabled
754 * @QLINK_PM_AUTO_STANDBY: enable auto power save mode
758 QLINK_PM_AUTO_STANDBY = 1,
762 * struct qlink_cmd_pm_set - data for QLINK_CMD_PM_SET command
764 * @pm_standby timer: period of network inactivity in seconds before
765 * putting a radio in power save mode
766 * @pm_mode: power management mode
768 struct qlink_cmd_pm_set {
769 struct qlink_cmd chdr;
770 __le32 pm_standby_timer;
775 * enum qlink_txpwr_op - transmit power operation type
776 * @QLINK_TXPWR_SET: set tx power
777 * @QLINK_TXPWR_GET: get current tx power setting
779 enum qlink_txpwr_op {
785 * struct qlink_cmd_txpwr - get or set current transmit power
787 * @txpwr: new transmit power setting, in mBm
788 * @txpwr_setting: transmit power setting type, one of
789 * &enum nl80211_tx_power_setting
790 * @op_type: type of operation, one of &enum qlink_txpwr_op
792 struct qlink_cmd_txpwr {
793 struct qlink_cmd chdr;
801 * enum qlink_wowlan_trigger
803 * @QLINK_WOWLAN_TRIG_DISCONNECT: wakeup on disconnect
804 * @QLINK_WOWLAN_TRIG_MAGIC_PKT: wakeup on magic packet
805 * @QLINK_WOWLAN_TRIG_PATTERN_PKT: wakeup on user-defined packet
807 enum qlink_wowlan_trigger {
808 QLINK_WOWLAN_TRIG_DISCONNECT = BIT(0),
809 QLINK_WOWLAN_TRIG_MAGIC_PKT = BIT(1),
810 QLINK_WOWLAN_TRIG_PATTERN_PKT = BIT(2),
814 * struct qlink_cmd_wowlan_set - data for QLINK_CMD_WOWLAN_SET command
816 * @triggers: requested bitmask of WoWLAN triggers
818 struct qlink_cmd_wowlan_set {
819 struct qlink_cmd chdr;
824 enum qlink_ndev_event_type {
825 QLINK_NDEV_EVENT_CHANGEUPPER,
829 * struct qlink_cmd_ndev_event - data for QLINK_CMD_NDEV_EVENT command
831 * @event: type of event, one of &enum qlink_ndev_event_type
833 struct qlink_cmd_ndev_event {
834 struct qlink_cmd chdr;
839 enum qlink_ndev_upper_type {
840 QLINK_NDEV_UPPER_TYPE_NONE,
841 QLINK_NDEV_UPPER_TYPE_BRIDGE,
845 * struct qlink_cmd_ndev_changeupper - data for QLINK_NDEV_EVENT_CHANGEUPPER
847 * @br_domain: layer 2 broadcast domain ID that ndev is a member of
848 * @upper_type: type of upper device, one of &enum qlink_ndev_upper_type
850 struct qlink_cmd_ndev_changeupper {
851 struct qlink_cmd_ndev_event nehdr;
860 /* QLINK Command Responses messages related definitions
863 enum qlink_cmd_result {
864 QLINK_CMD_RESULT_OK = 0,
865 QLINK_CMD_RESULT_INVALID,
866 QLINK_CMD_RESULT_ENOTSUPP,
867 QLINK_CMD_RESULT_ENOTFOUND,
868 QLINK_CMD_RESULT_EALREADY,
869 QLINK_CMD_RESULT_EADDRINUSE,
870 QLINK_CMD_RESULT_EADDRNOTAVAIL,
871 QLINK_CMD_RESULT_EBUSY,
875 * struct qlink_resp - QLINK command response message header
877 * Header used for QLINK messages of QLINK_MSG_TYPE_CMDRSP type.
879 * @mhdr: see &struct qlink_msg_header.
880 * @cmd_id: command ID the response corresponds to, one of &enum qlink_cmd_type.
881 * @seq_num: sequence number of command message, used for matching with
883 * @result: result of the command execution, one of &enum qlink_cmd_result.
884 * @macid: index of physical radio device the response is sent from or
885 * QLINK_MACID_RSVD if not applicable.
886 * @vifid: index of virtual wireless interface on specified @macid the response
887 * is sent from or QLINK_VIFID_RSVD if not applicable.
890 struct qlink_msg_header mhdr;
899 * enum qlink_dfs_regions - regulatory DFS regions
901 * Corresponds to &enum nl80211_dfs_regions.
903 enum qlink_dfs_regions {
911 * struct qlink_resp_get_mac_info - response for QLINK_CMD_MAC_INFO command
913 * Data describing specific physical device providing wireless MAC
916 * @dev_mac: MAC address of physical WMAC device (used for first BSS on
918 * @num_tx_chain: Number of transmit chains used by WMAC.
919 * @num_rx_chain: Number of receive chains used by WMAC.
920 * @vht_cap_mod_mask: mask specifying which VHT capabilities can be altered.
921 * @ht_cap_mod_mask: mask specifying which HT capabilities can be altered.
922 * @bands_cap: wireless bands WMAC can operate in, bitmap of &enum qlink_band.
923 * @max_ap_assoc_sta: Maximum number of associations supported by WMAC.
924 * @radar_detect_widths: bitmask of channels BW for which WMAC can detect radar.
925 * @alpha2: country code ID firmware is configured to.
926 * @n_reg_rules: number of regulatory rules TLVs in variable portion of the
928 * @dfs_region: regulatory DFS region, one of &enum qlink_dfs_regions.
929 * @var_info: variable-length WMAC info data.
931 struct qlink_resp_get_mac_info {
932 struct qlink_resp rhdr;
933 u8 dev_mac[ETH_ALEN];
936 struct ieee80211_vht_cap vht_cap_mod_mask;
937 struct ieee80211_ht_cap ht_cap_mod_mask;
938 __le16 max_ap_assoc_sta;
939 __le16 radar_detect_widths;
940 __le32 max_acl_mac_addrs;
950 * struct qlink_resp_get_hw_info - response for QLINK_CMD_GET_HW_INFO command
952 * Description of wireless hardware capabilities and features.
954 * @fw_ver: wireless hardware firmware version.
955 * @hw_capab: Bitmap of capabilities supported by firmware.
956 * @ql_proto_ver: Version of QLINK protocol used by firmware.
957 * @num_mac: Number of separate physical radio devices provided by hardware.
958 * @mac_bitmap: Bitmap of MAC IDs that are active and can be used in firmware.
959 * @total_tx_chains: total number of transmit chains used by device.
960 * @total_rx_chains: total number of receive chains.
961 * @info: variable-length HW info.
963 struct qlink_resp_get_hw_info {
964 struct qlink_resp rhdr;
979 * struct qlink_resp_manage_intf - response for interface management commands
981 * Response data for QLINK_CMD_ADD_INTF and QLINK_CMD_CHANGE_INTF commands.
983 * @rhdr: Common Command Response message header.
984 * @intf_info: interface description.
986 struct qlink_resp_manage_intf {
987 struct qlink_resp rhdr;
988 struct qlink_intf_info intf_info;
991 enum qlink_sta_info_rate_flags {
992 QLINK_STA_INFO_RATE_FLAG_HT_MCS = BIT(0),
993 QLINK_STA_INFO_RATE_FLAG_VHT_MCS = BIT(1),
994 QLINK_STA_INFO_RATE_FLAG_SHORT_GI = BIT(2),
995 QLINK_STA_INFO_RATE_FLAG_60G = BIT(3),
996 QLINK_STA_INFO_RATE_FLAG_HE_MCS = BIT(4),
1000 * struct qlink_resp_get_sta_info - response for QLINK_CMD_GET_STA_INFO command
1002 * Response data containing statistics for specified STA.
1004 * @filled: a bitmask of &enum qlink_sta_info, specifies which info in response
1006 * @sta_addr: MAC address of STA the response carries statistic for.
1007 * @info: variable statistics for specified STA.
1009 struct qlink_resp_get_sta_info {
1010 struct qlink_resp rhdr;
1011 u8 sta_addr[ETH_ALEN];
1017 * struct qlink_resp_band_info_get - response for QLINK_CMD_BAND_INFO_GET cmd
1019 * @band: frequency band that the response describes, one of @enum qlink_band.
1020 * @num_chans: total number of channels info TLVs contained in reply.
1021 * @num_bitrates: total number of bitrate TLVs contained in reply.
1022 * @info: variable-length info portion.
1024 struct qlink_resp_band_info_get {
1025 struct qlink_resp rhdr;
1034 * struct qlink_resp_phy_params - response for QLINK_CMD_PHY_PARAMS_GET command
1036 * @info: variable-length array of PHY params.
1038 struct qlink_resp_phy_params {
1039 struct qlink_resp rhdr;
1044 * struct qlink_resp_get_chan_stats - response for QLINK_CMD_CHAN_STATS cmd
1046 * @info: variable-length channel info.
1048 struct qlink_resp_get_chan_stats {
1049 struct qlink_cmd rhdr;
1054 * struct qlink_resp_channel_get - response for QLINK_CMD_CHAN_GET command
1056 * @chan: definition of current operating channel.
1058 struct qlink_resp_channel_get {
1059 struct qlink_resp rhdr;
1060 struct qlink_chandef chan;
1064 * struct qlink_resp_txpwr - response for QLINK_CMD_TXPWR command
1066 * This response is intended for QLINK_TXPWR_GET operation and does not
1067 * contain any meaningful information in case of QLINK_TXPWR_SET operation.
1069 * @txpwr: current transmit power setting, in mBm
1071 struct qlink_resp_txpwr {
1072 struct qlink_resp rhdr;
1076 /* QLINK Events messages related definitions
1079 enum qlink_event_type {
1080 QLINK_EVENT_STA_ASSOCIATED = 0x0021,
1081 QLINK_EVENT_STA_DEAUTH = 0x0022,
1082 QLINK_EVENT_MGMT_RECEIVED = 0x0023,
1083 QLINK_EVENT_SCAN_RESULTS = 0x0024,
1084 QLINK_EVENT_SCAN_COMPLETE = 0x0025,
1085 QLINK_EVENT_BSS_JOIN = 0x0026,
1086 QLINK_EVENT_BSS_LEAVE = 0x0027,
1087 QLINK_EVENT_FREQ_CHANGE = 0x0028,
1088 QLINK_EVENT_RADAR = 0x0029,
1089 QLINK_EVENT_EXTERNAL_AUTH = 0x0030,
1090 QLINK_EVENT_MIC_FAILURE = 0x0031,
1094 * struct qlink_event - QLINK event message header
1096 * Header used for QLINK messages of QLINK_MSG_TYPE_EVENT type.
1098 * @mhdr: Common QLINK message header.
1099 * @event_id: Specifies specific event ID, one of &enum qlink_event_type.
1100 * @macid: index of physical radio device the event was generated on or
1101 * QLINK_MACID_RSVD if not applicable.
1102 * @vifid: index of virtual wireless interface on specified @macid the event
1103 * was generated on or QLINK_VIFID_RSVD if not applicable.
1105 struct qlink_event {
1106 struct qlink_msg_header mhdr;
1113 * struct qlink_event_sta_assoc - data for QLINK_EVENT_STA_ASSOCIATED event
1115 * @sta_addr: Address of a STA for which new association event was generated
1116 * @frame_control: control bits from 802.11 ASSOC_REQUEST header.
1117 * @payload: IEs from association request.
1119 struct qlink_event_sta_assoc {
1120 struct qlink_event ehdr;
1121 u8 sta_addr[ETH_ALEN];
1122 __le16 frame_control;
1127 * struct qlink_event_sta_deauth - data for QLINK_EVENT_STA_DEAUTH event
1129 * @sta_addr: Address of a deauthenticated STA.
1130 * @reason: reason for deauthentication.
1132 struct qlink_event_sta_deauth {
1133 struct qlink_event ehdr;
1134 u8 sta_addr[ETH_ALEN];
1139 * struct qlink_event_bss_join - data for QLINK_EVENT_BSS_JOIN event
1141 * @chan: new operating channel definition
1142 * @bssid: BSSID of a BSS which interface tried to joined.
1143 * @status: status of joining attempt, see &enum ieee80211_statuscode.
1145 struct qlink_event_bss_join {
1146 struct qlink_event ehdr;
1147 struct qlink_chandef chan;
1154 * struct qlink_event_bss_leave - data for QLINK_EVENT_BSS_LEAVE event
1156 * @reason: reason of disconnecting from BSS.
1158 struct qlink_event_bss_leave {
1159 struct qlink_event ehdr;
1164 * struct qlink_event_freq_change - data for QLINK_EVENT_FREQ_CHANGE event
1166 * @chan: new operating channel definition
1168 struct qlink_event_freq_change {
1169 struct qlink_event ehdr;
1170 struct qlink_chandef chan;
1173 enum qlink_rxmgmt_flags {
1174 QLINK_RXMGMT_FLAG_ANSWERED = 1 << 0,
1178 * struct qlink_event_rxmgmt - data for QLINK_EVENT_MGMT_RECEIVED event
1180 * @freq: Frequency on which the frame was received in MHz.
1181 * @flags: bitmap of &enum qlink_rxmgmt_flags.
1182 * @sig_dbm: signal strength in dBm.
1183 * @frame_data: data of Rx'd frame itself.
1185 struct qlink_event_rxmgmt {
1186 struct qlink_event ehdr;
1195 * struct qlink_event_scan_result - data for QLINK_EVENT_SCAN_RESULTS event
1197 * @tsf: TSF timestamp indicating when scan results were generated.
1198 * @freq: Center frequency of the channel where BSS for which the scan result
1199 * event was generated was discovered.
1200 * @capab: capabilities field.
1201 * @bintval: beacon interval announced by discovered BSS.
1202 * @sig_dbm: signal strength in dBm.
1203 * @bssid: BSSID announced by discovered BSS.
1204 * @ssid_len: length of SSID announced by BSS.
1205 * @ssid: SSID announced by discovered BSS.
1206 * @payload: IEs that are announced by discovered BSS in its MGMt frames.
1208 struct qlink_event_scan_result {
1209 struct qlink_event ehdr;
1216 u8 ssid[IEEE80211_MAX_SSID_LEN];
1223 * enum qlink_scan_complete_flags - indicates result of scan request.
1225 * @QLINK_SCAN_NONE: Scan request was processed.
1226 * @QLINK_SCAN_ABORTED: Scan was aborted.
1228 enum qlink_scan_complete_flags {
1229 QLINK_SCAN_NONE = 0,
1230 QLINK_SCAN_ABORTED = BIT(0),
1234 * struct qlink_event_scan_complete - data for QLINK_EVENT_SCAN_COMPLETE event
1236 * @flags: flags indicating the status of pending scan request,
1237 * see &enum qlink_scan_complete_flags.
1239 struct qlink_event_scan_complete {
1240 struct qlink_event ehdr;
1244 enum qlink_radar_event {
1245 QLINK_RADAR_DETECTED,
1246 QLINK_RADAR_CAC_FINISHED,
1247 QLINK_RADAR_CAC_ABORTED,
1248 QLINK_RADAR_NOP_FINISHED,
1249 QLINK_RADAR_PRE_CAC_EXPIRED,
1250 QLINK_RADAR_CAC_STARTED,
1254 * struct qlink_event_radar - data for QLINK_EVENT_RADAR event
1256 * @chan: channel on which radar event happened.
1257 * @event: radar event type, one of &enum qlink_radar_event.
1259 struct qlink_event_radar {
1260 struct qlink_event ehdr;
1261 struct qlink_chandef chan;
1267 * struct qlink_event_external_auth - data for QLINK_EVENT_EXTERNAL_AUTH event
1269 * @ssid: SSID announced by BSS
1270 * @ssid_len: SSID length
1271 * @bssid: BSSID of the BSS to connect to
1272 * @akm_suite: AKM suite for external authentication
1273 * @action: action type/trigger for external authentication
1275 struct qlink_event_external_auth {
1276 struct qlink_event ehdr;
1277 u8 ssid[IEEE80211_MAX_SSID_LEN];
1285 * struct qlink_event_mic_failure - data for QLINK_EVENT_MIC_FAILURE event
1287 * @src: source MAC address of the frame
1288 * @key_index: index of the key being reported
1289 * @pairwise: whether the key is pairwise or group
1291 struct qlink_event_mic_failure {
1292 struct qlink_event ehdr;
1298 /* QLINK TLVs (Type-Length Values) definitions
1302 * enum qlink_tlv_id - list of TLVs that Qlink messages can carry
1304 * @QTN_TLV_ID_STA_STATS_MAP: a bitmap of &enum qlink_sta_info, used to
1305 * indicate which statistic carried in QTN_TLV_ID_STA_STATS is valid.
1306 * @QTN_TLV_ID_STA_STATS: per-STA statistics as defined by
1307 * &struct qlink_sta_stats. Valid values are marked as such in a bitmap
1308 * carried by QTN_TLV_ID_STA_STATS_MAP.
1309 * @QTN_TLV_ID_MAX_SCAN_SSIDS: maximum number of SSIDs the device can scan
1310 * for in any given scan.
1311 * @QTN_TLV_ID_SCAN_DWELL_ACTIVE: time spent on a single channel for an active
1313 * @QTN_TLV_ID_SCAN_DWELL_PASSIVE: time spent on a single channel for a passive
1315 * @QTN_TLV_ID_SCAN_SAMPLE_DURATION: total duration of sampling a single channel
1316 * during a scan including off-channel dwell time and operating channel
1318 * @QTN_TLV_ID_IFTYPE_DATA: supported band data.
1321 QTN_TLV_ID_FRAG_THRESH = 0x0201,
1322 QTN_TLV_ID_RTS_THRESH = 0x0202,
1323 QTN_TLV_ID_SRETRY_LIMIT = 0x0203,
1324 QTN_TLV_ID_LRETRY_LIMIT = 0x0204,
1325 QTN_TLV_ID_REG_RULE = 0x0207,
1326 QTN_TLV_ID_CHANNEL = 0x020F,
1327 QTN_TLV_ID_CHANDEF = 0x0210,
1328 QTN_TLV_ID_STA_STATS_MAP = 0x0211,
1329 QTN_TLV_ID_STA_STATS = 0x0212,
1330 QTN_TLV_ID_COVERAGE_CLASS = 0x0213,
1331 QTN_TLV_ID_IFACE_LIMIT = 0x0214,
1332 QTN_TLV_ID_NUM_IFACE_COMB = 0x0215,
1333 QTN_TLV_ID_CHANNEL_STATS = 0x0216,
1334 QTN_TLV_ID_KEY = 0x0302,
1335 QTN_TLV_ID_SEQ = 0x0303,
1336 QTN_TLV_ID_IE_SET = 0x0305,
1337 QTN_TLV_ID_EXT_CAPABILITY_MASK = 0x0306,
1338 QTN_TLV_ID_ACL_DATA = 0x0307,
1339 QTN_TLV_ID_BUILD_NAME = 0x0401,
1340 QTN_TLV_ID_BUILD_REV = 0x0402,
1341 QTN_TLV_ID_BUILD_TYPE = 0x0403,
1342 QTN_TLV_ID_BUILD_LABEL = 0x0404,
1343 QTN_TLV_ID_HW_ID = 0x0405,
1344 QTN_TLV_ID_CALIBRATION_VER = 0x0406,
1345 QTN_TLV_ID_UBOOT_VER = 0x0407,
1346 QTN_TLV_ID_RANDOM_MAC_ADDR = 0x0408,
1347 QTN_TLV_ID_MAX_SCAN_SSIDS = 0x0409,
1348 QTN_TLV_ID_WOWLAN_CAPAB = 0x0410,
1349 QTN_TLV_ID_WOWLAN_PATTERN = 0x0411,
1350 QTN_TLV_ID_SCAN_FLUSH = 0x0412,
1351 QTN_TLV_ID_SCAN_DWELL_ACTIVE = 0x0413,
1352 QTN_TLV_ID_SCAN_DWELL_PASSIVE = 0x0416,
1353 QTN_TLV_ID_SCAN_SAMPLE_DURATION = 0x0417,
1354 QTN_TLV_ID_IFTYPE_DATA = 0x0418,
1357 struct qlink_tlv_hdr {
1363 struct qlink_iface_comb_num {
1364 __le32 iface_comb_num;
1367 struct qlink_iface_limit {
1372 struct qlink_iface_limit_record {
1373 __le16 max_interfaces;
1374 u8 num_different_channels;
1376 struct qlink_iface_limit limits[0];
1379 #define QLINK_RSSI_OFFSET 120
1381 struct qlink_tlv_frag_rts_thr {
1382 struct qlink_tlv_hdr hdr;
1386 struct qlink_tlv_rlimit {
1387 struct qlink_tlv_hdr hdr;
1391 struct qlink_tlv_cclass {
1392 struct qlink_tlv_hdr hdr;
1397 * enum qlink_reg_rule_flags - regulatory rule flags
1399 * See description of &enum nl80211_reg_rule_flags
1401 enum qlink_reg_rule_flags {
1402 QLINK_RRF_NO_OFDM = BIT(0),
1403 QLINK_RRF_NO_CCK = BIT(1),
1404 QLINK_RRF_NO_INDOOR = BIT(2),
1405 QLINK_RRF_NO_OUTDOOR = BIT(3),
1406 QLINK_RRF_DFS = BIT(4),
1407 QLINK_RRF_PTP_ONLY = BIT(5),
1408 QLINK_RRF_PTMP_ONLY = BIT(6),
1409 QLINK_RRF_NO_IR = BIT(7),
1410 QLINK_RRF_AUTO_BW = BIT(8),
1411 QLINK_RRF_IR_CONCURRENT = BIT(9),
1412 QLINK_RRF_NO_HT40MINUS = BIT(10),
1413 QLINK_RRF_NO_HT40PLUS = BIT(11),
1414 QLINK_RRF_NO_80MHZ = BIT(12),
1415 QLINK_RRF_NO_160MHZ = BIT(13),
1419 * struct qlink_tlv_reg_rule - data for QTN_TLV_ID_REG_RULE TLV
1421 * Regulatory rule description.
1423 * @start_freq_khz: start frequency of the range the rule is attributed to.
1424 * @end_freq_khz: end frequency of the range the rule is attributed to.
1425 * @max_bandwidth_khz: max bandwidth that channels in specified range can be
1427 * @max_antenna_gain: max antenna gain that can be used in the specified
1428 * frequency range, dBi.
1429 * @max_eirp: maximum EIRP.
1430 * @flags: regulatory rule flags in &enum qlink_reg_rule_flags.
1431 * @dfs_cac_ms: DFS CAC period.
1433 struct qlink_tlv_reg_rule {
1434 struct qlink_tlv_hdr hdr;
1435 __le32 start_freq_khz;
1436 __le32 end_freq_khz;
1437 __le32 max_bandwidth_khz;
1438 __le32 max_antenna_gain;
1444 enum qlink_channel_flags {
1445 QLINK_CHAN_DISABLED = BIT(0),
1446 QLINK_CHAN_NO_IR = BIT(1),
1447 QLINK_CHAN_RADAR = BIT(3),
1448 QLINK_CHAN_NO_HT40PLUS = BIT(4),
1449 QLINK_CHAN_NO_HT40MINUS = BIT(5),
1450 QLINK_CHAN_NO_OFDM = BIT(6),
1451 QLINK_CHAN_NO_80MHZ = BIT(7),
1452 QLINK_CHAN_NO_160MHZ = BIT(8),
1453 QLINK_CHAN_INDOOR_ONLY = BIT(9),
1454 QLINK_CHAN_IR_CONCURRENT = BIT(10),
1455 QLINK_CHAN_NO_20MHZ = BIT(11),
1456 QLINK_CHAN_NO_10MHZ = BIT(12),
1459 enum qlink_dfs_state {
1461 QLINK_DFS_UNAVAILABLE,
1462 QLINK_DFS_AVAILABLE,
1466 * struct qlink_tlv_channel - data for QTN_TLV_ID_CHANNEL TLV
1470 * @channel: ieee80211 channel settings.
1472 struct qlink_tlv_channel {
1473 struct qlink_tlv_hdr hdr;
1474 struct qlink_channel chan;
1478 * struct qlink_tlv_chandef - data for QTN_TLV_ID_CHANDEF TLV
1480 * Channel definition.
1482 * @chan: channel definition data.
1484 struct qlink_tlv_chandef {
1485 struct qlink_tlv_hdr hdr;
1486 struct qlink_chandef chdef;
1489 enum qlink_ie_set_type {
1490 QLINK_IE_SET_UNKNOWN,
1491 QLINK_IE_SET_ASSOC_REQ,
1492 QLINK_IE_SET_ASSOC_RESP,
1493 QLINK_IE_SET_PROBE_REQ,
1495 QLINK_IE_SET_BEACON_HEAD,
1496 QLINK_IE_SET_BEACON_TAIL,
1497 QLINK_IE_SET_BEACON_IES,
1498 QLINK_IE_SET_PROBE_RESP,
1499 QLINK_IE_SET_PROBE_RESP_IES,
1503 * struct qlink_tlv_ie_set - data for QTN_TLV_ID_IE_SET
1505 * @type: type of MGMT frame IEs belong to, one of &enum qlink_ie_set_type.
1506 * @flags: for future use.
1507 * @ie_data: IEs data.
1509 struct qlink_tlv_ie_set {
1510 struct qlink_tlv_hdr hdr;
1517 * struct qlink_tlv_ext_ie - extension IE
1519 * @eid_ext: element ID extension, one of &enum ieee80211_eid_ext.
1520 * @ie_data: IEs data.
1522 struct qlink_tlv_ext_ie {
1523 struct qlink_tlv_hdr hdr;
1528 #define IEEE80211_HE_PPE_THRES_MAX_LEN 25
1529 struct qlink_sband_iftype_data {
1531 struct ieee80211_he_cap_elem he_cap_elem;
1532 struct ieee80211_he_mcs_nss_supp he_mcs_nss_supp;
1533 u8 ppe_thres[IEEE80211_HE_PPE_THRES_MAX_LEN];
1537 * struct qlink_tlv_iftype_data - data for QTN_TLV_ID_IFTYPE_DATA
1539 * @n_iftype_data: number of entries in iftype_data.
1540 * @iftype_data: interface type data entries.
1542 struct qlink_tlv_iftype_data {
1543 struct qlink_tlv_hdr hdr;
1546 struct qlink_sband_iftype_data iftype_data[0];
1549 struct qlink_chan_stats {
1559 * enum qlink_sta_info - station information bitmap
1561 * Used to indicate which statistics values in &struct qlink_sta_stats
1562 * are valid. Individual values are used to fill a bitmap carried in a
1563 * payload of QTN_TLV_ID_STA_STATS_MAP.
1565 * @QLINK_STA_INFO_CONNECTED_TIME: connected_time value is valid.
1566 * @QLINK_STA_INFO_INACTIVE_TIME: inactive_time value is valid.
1567 * @QLINK_STA_INFO_RX_BYTES: lower 32 bits of rx_bytes value are valid.
1568 * @QLINK_STA_INFO_TX_BYTES: lower 32 bits of tx_bytes value are valid.
1569 * @QLINK_STA_INFO_RX_BYTES64: rx_bytes value is valid.
1570 * @QLINK_STA_INFO_TX_BYTES64: tx_bytes value is valid.
1571 * @QLINK_STA_INFO_RX_DROP_MISC: rx_dropped_misc value is valid.
1572 * @QLINK_STA_INFO_BEACON_RX: rx_beacon value is valid.
1573 * @QLINK_STA_INFO_SIGNAL: signal value is valid.
1574 * @QLINK_STA_INFO_SIGNAL_AVG: signal_avg value is valid.
1575 * @QLINK_STA_INFO_RX_BITRATE: rxrate value is valid.
1576 * @QLINK_STA_INFO_TX_BITRATE: txrate value is valid.
1577 * @QLINK_STA_INFO_RX_PACKETS: rx_packets value is valid.
1578 * @QLINK_STA_INFO_TX_PACKETS: tx_packets value is valid.
1579 * @QLINK_STA_INFO_TX_RETRIES: tx_retries value is valid.
1580 * @QLINK_STA_INFO_TX_FAILED: tx_failed value is valid.
1581 * @QLINK_STA_INFO_STA_FLAGS: sta_flags value is valid.
1583 enum qlink_sta_info {
1584 QLINK_STA_INFO_CONNECTED_TIME,
1585 QLINK_STA_INFO_INACTIVE_TIME,
1586 QLINK_STA_INFO_RX_BYTES,
1587 QLINK_STA_INFO_TX_BYTES,
1588 QLINK_STA_INFO_RX_BYTES64,
1589 QLINK_STA_INFO_TX_BYTES64,
1590 QLINK_STA_INFO_RX_DROP_MISC,
1591 QLINK_STA_INFO_BEACON_RX,
1592 QLINK_STA_INFO_SIGNAL,
1593 QLINK_STA_INFO_SIGNAL_AVG,
1594 QLINK_STA_INFO_RX_BITRATE,
1595 QLINK_STA_INFO_TX_BITRATE,
1596 QLINK_STA_INFO_RX_PACKETS,
1597 QLINK_STA_INFO_TX_PACKETS,
1598 QLINK_STA_INFO_TX_RETRIES,
1599 QLINK_STA_INFO_TX_FAILED,
1600 QLINK_STA_INFO_STA_FLAGS,
1605 * struct qlink_sta_info_rate - STA rate statistics
1607 * @rate: data rate in Mbps.
1608 * @flags: bitmap of &enum qlink_sta_info_rate_flags.
1609 * @mcs: 802.11-defined MCS index.
1610 * nss: Number of Spatial Streams.
1611 * @bw: bandwidth, one of &enum qlink_channel_width.
1613 struct qlink_sta_info_rate {
1622 * struct qlink_sta_stats - data for QTN_TLV_ID_STA_STATS
1624 * Carries statistics of a STA. Not all fields may be filled with
1625 * valid values. Valid fields should be indicated as such using a bitmap of
1626 * &enum qlink_sta_info. Bitmap is carried separately in a payload of
1627 * QTN_TLV_ID_STA_STATS_MAP.
1629 struct qlink_sta_stats {
1635 __le32 connected_time;
1636 __le32 inactive_time;
1641 __le32 rx_dropped_misc;
1642 __le32 beacon_loss_count;
1643 __le32 expected_throughput;
1644 struct qlink_sta_info_state sta_flags;
1645 struct qlink_sta_info_rate txrate;
1646 struct qlink_sta_info_rate rxrate;
1652 u8 rx_beacon_signal_avg;
1660 * struct qlink_random_mac_addr - data for QTN_TLV_ID_RANDOM_MAC_ADDR TLV
1662 * Specifies MAC address mask/value for generation random MAC address
1665 * @mac_addr: MAC address used with randomisation
1666 * @mac_addr_mask: MAC address mask used with randomisation, bits that
1667 * are 0 in the mask should be randomised, bits that are 1 should
1668 * be taken from the @mac_addr
1670 struct qlink_random_mac_addr {
1671 u8 mac_addr[ETH_ALEN];
1672 u8 mac_addr_mask[ETH_ALEN];
1676 * struct qlink_wowlan_capab_data - data for QTN_TLV_ID_WOWLAN_CAPAB TLV
1678 * WoWLAN capabilities supported by cards.
1680 * @version: version of WoWLAN data structure, to ensure backward
1681 * compatibility for firmwares with limited WoWLAN support
1682 * @len: Total length of WoWLAN data
1683 * @data: supported WoWLAN features
1685 struct qlink_wowlan_capab_data {
1692 * struct qlink_wowlan_support - supported WoWLAN capabilities
1694 * @n_patterns: number of supported wakeup patterns
1695 * @pattern_max_len: maximum length of each pattern
1696 * @pattern_min_len: minimum length of each pattern
1698 struct qlink_wowlan_support {
1700 __le32 pattern_max_len;
1701 __le32 pattern_min_len;
1704 #endif /* _QTN_QLINK_H_ */