2 * Copyright (c) 2015-2016 Quantenna Communications, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
20 #include <linux/ieee80211.h>
22 #define QLINK_PROTO_VER 5
24 #define QLINK_MACID_RSVD 0xFF
25 #define QLINK_VIFID_RSVD 0xFF
27 /* Common QLINK protocol messages definitions.
31 * enum qlink_msg_type - QLINK message types
33 * Used to distinguish between message types of QLINK protocol.
35 * @QLINK_MSG_TYPE_CMD: Message is carrying data of a command sent from
36 * driver to wireless hardware.
37 * @QLINK_MSG_TYPE_CMDRSP: Message is carrying data of a response to a command.
38 * Sent from wireless HW to driver in reply to previously issued command.
39 * @QLINK_MSG_TYPE_EVENT: Data for an event originated in wireless hardware and
40 * sent asynchronously to driver.
43 QLINK_MSG_TYPE_CMD = 1,
44 QLINK_MSG_TYPE_CMDRSP = 2,
45 QLINK_MSG_TYPE_EVENT = 3
49 * struct qlink_msg_header - common QLINK protocol message header
51 * Portion of QLINK protocol header common for all message types.
53 * @type: Message type, one of &enum qlink_msg_type.
54 * @len: Total length of message including all headers.
56 struct qlink_msg_header {
61 /* Generic definitions of data and information carried in QLINK messages
65 QLINK_HW_SUPPORTS_REG_UPDATE = BIT(0),
69 QLINK_PHYMODE_BGN = BIT(0),
70 QLINK_PHYMODE_AN = BIT(1),
71 QLINK_PHYMODE_AC = BIT(2),
74 enum qlink_iface_type {
76 QLINK_IFTYPE_STATION = 2,
77 QLINK_IFTYPE_ADHOC = 3,
78 QLINK_IFTYPE_MONITOR = 4,
80 QLINK_IFTYPE_AP_VLAN = 6,
84 * struct qlink_intf_info - information on virtual interface.
86 * Data describing a single virtual interface.
88 * @if_type: Mode of interface operation, one of &enum qlink_iface_type
89 * @vlanid: VLAN ID for AP_VLAN interface type
90 * @mac_addr: MAC address of virtual interface.
92 struct qlink_intf_info {
95 u8 mac_addr[ETH_ALEN];
99 enum qlink_sta_flags {
100 QLINK_STA_FLAG_INVALID = 0,
101 QLINK_STA_FLAG_AUTHORIZED = BIT(0),
102 QLINK_STA_FLAG_SHORT_PREAMBLE = BIT(1),
103 QLINK_STA_FLAG_WME = BIT(2),
104 QLINK_STA_FLAG_MFP = BIT(3),
105 QLINK_STA_FLAG_AUTHENTICATED = BIT(4),
106 QLINK_STA_FLAG_TDLS_PEER = BIT(5),
107 QLINK_STA_FLAG_ASSOCIATED = BIT(6),
110 enum qlink_channel_width {
111 QLINK_CHAN_WIDTH_5 = BIT(0),
112 QLINK_CHAN_WIDTH_10 = BIT(1),
113 QLINK_CHAN_WIDTH_20_NOHT = BIT(2),
114 QLINK_CHAN_WIDTH_20 = BIT(3),
115 QLINK_CHAN_WIDTH_40 = BIT(4),
116 QLINK_CHAN_WIDTH_80 = BIT(5),
117 QLINK_CHAN_WIDTH_80P80 = BIT(6),
118 QLINK_CHAN_WIDTH_160 = BIT(7),
121 /* QLINK Command messages related definitions
125 * enum qlink_cmd_type - list of supported commands
127 * Commands are QLINK messages of type @QLINK_MSG_TYPE_CMD, sent by driver to
128 * wireless network device for processing. Device is expected to send back a
129 * reply message of type &QLINK_MSG_TYPE_CMDRSP, containing at least command
130 * execution status (one of &enum qlink_cmd_result) at least. Reply message
131 * may also contain data payload specific to the command type.
133 * @QLINK_CMD_CHANS_INFO_GET: for the specified MAC and specified band, get
134 * number of operational channels and information on each of the channel.
135 * This command is generic to a specified MAC, interface index must be set
136 * to QLINK_VIFID_RSVD in command header.
137 * @QLINK_CMD_REG_NOTIFY: notify device about regulatory domain change. This
138 * command is supported only if device reports QLINK_HW_SUPPORTS_REG_UPDATE
141 enum qlink_cmd_type {
142 QLINK_CMD_FW_INIT = 0x0001,
143 QLINK_CMD_FW_DEINIT = 0x0002,
144 QLINK_CMD_REGISTER_MGMT = 0x0003,
145 QLINK_CMD_SEND_MGMT_FRAME = 0x0004,
146 QLINK_CMD_MGMT_SET_APPIE = 0x0005,
147 QLINK_CMD_PHY_PARAMS_GET = 0x0011,
148 QLINK_CMD_PHY_PARAMS_SET = 0x0012,
149 QLINK_CMD_GET_HW_INFO = 0x0013,
150 QLINK_CMD_MAC_INFO = 0x0014,
151 QLINK_CMD_ADD_INTF = 0x0015,
152 QLINK_CMD_DEL_INTF = 0x0016,
153 QLINK_CMD_CHANGE_INTF = 0x0017,
154 QLINK_CMD_UPDOWN_INTF = 0x0018,
155 QLINK_CMD_REG_NOTIFY = 0x0019,
156 QLINK_CMD_CHANS_INFO_GET = 0x001A,
157 QLINK_CMD_CHAN_SWITCH = 0x001B,
158 QLINK_CMD_CONFIG_AP = 0x0020,
159 QLINK_CMD_START_AP = 0x0021,
160 QLINK_CMD_STOP_AP = 0x0022,
161 QLINK_CMD_GET_STA_INFO = 0x0030,
162 QLINK_CMD_ADD_KEY = 0x0040,
163 QLINK_CMD_DEL_KEY = 0x0041,
164 QLINK_CMD_SET_DEFAULT_KEY = 0x0042,
165 QLINK_CMD_SET_DEFAULT_MGMT_KEY = 0x0043,
166 QLINK_CMD_CHANGE_STA = 0x0051,
167 QLINK_CMD_DEL_STA = 0x0052,
168 QLINK_CMD_SCAN = 0x0053,
169 QLINK_CMD_CHAN_STATS = 0x0054,
170 QLINK_CMD_CONNECT = 0x0060,
171 QLINK_CMD_DISCONNECT = 0x0061,
175 * struct qlink_cmd - QLINK command message header
177 * Header used for QLINK messages of QLINK_MSG_TYPE_CMD type.
179 * @mhdr: Common QLINK message header.
180 * @cmd_id: command id, one of &enum qlink_cmd_type.
181 * @seq_num: sequence number of command message, used for matching with
183 * @macid: index of physical radio device the command is destined to or
184 * QLINK_MACID_RSVD if not applicable.
185 * @vifid: index of virtual wireless interface on specified @macid the command
186 * is destined to or QLINK_VIFID_RSVD if not applicable.
189 struct qlink_msg_header mhdr;
198 * struct qlink_cmd_manage_intf - interface management command
200 * Data for interface management commands QLINK_CMD_ADD_INTF, QLINK_CMD_DEL_INTF
201 * and QLINK_CMD_CHANGE_INTF.
203 * @intf_info: interface description.
205 struct qlink_cmd_manage_intf {
206 struct qlink_cmd chdr;
207 struct qlink_intf_info intf_info;
210 enum qlink_mgmt_frame_type {
211 QLINK_MGMT_FRAME_ASSOC_REQ = 0x00,
212 QLINK_MGMT_FRAME_ASSOC_RESP = 0x01,
213 QLINK_MGMT_FRAME_REASSOC_REQ = 0x02,
214 QLINK_MGMT_FRAME_REASSOC_RESP = 0x03,
215 QLINK_MGMT_FRAME_PROBE_REQ = 0x04,
216 QLINK_MGMT_FRAME_PROBE_RESP = 0x05,
217 QLINK_MGMT_FRAME_BEACON = 0x06,
218 QLINK_MGMT_FRAME_ATIM = 0x07,
219 QLINK_MGMT_FRAME_DISASSOC = 0x08,
220 QLINK_MGMT_FRAME_AUTH = 0x09,
221 QLINK_MGMT_FRAME_DEAUTH = 0x0A,
222 QLINK_MGMT_FRAME_ACTION = 0x0B,
224 QLINK_MGMT_FRAME_TYPE_COUNT
228 * struct qlink_cmd_mgmt_frame_register - data for QLINK_CMD_REGISTER_MGMT
230 * @frame_type: MGMT frame type the registration request describes, one of
231 * &enum qlink_mgmt_frame_type.
232 * @do_register: 0 - unregister, otherwise register for reception of specified
235 struct qlink_cmd_mgmt_frame_register {
236 struct qlink_cmd chdr;
241 enum qlink_mgmt_frame_tx_flags {
242 QLINK_MGMT_FRAME_TX_FLAG_NONE = 0,
243 QLINK_MGMT_FRAME_TX_FLAG_OFFCHAN = BIT(0),
244 QLINK_MGMT_FRAME_TX_FLAG_NO_CCK = BIT(1),
245 QLINK_MGMT_FRAME_TX_FLAG_ACK_NOWAIT = BIT(2),
249 * struct qlink_cmd_mgmt_frame_tx - data for QLINK_CMD_SEND_MGMT_FRAME command
251 * @cookie: opaque request identifier.
252 * @freq: Frequency to use for frame transmission.
253 * @flags: Transmission flags, one of &enum qlink_mgmt_frame_tx_flags.
254 * @frame_data: frame to transmit.
256 struct qlink_cmd_mgmt_frame_tx {
257 struct qlink_cmd chdr;
265 * struct qlink_cmd_mgmt_append_ie - data for QLINK_CMD_MGMT_SET_APPIE command
267 * @type: type of MGMT frame to appent requested IEs to, one of
268 * &enum qlink_mgmt_frame_type.
269 * @flags: for future use.
270 * @ie_data: IEs data to append.
272 struct qlink_cmd_mgmt_append_ie {
273 struct qlink_cmd chdr;
280 * struct qlink_cmd_get_sta_info - data for QLINK_CMD_GET_STA_INFO command
282 * @sta_addr: MAC address of the STA statistics is requested for.
284 struct qlink_cmd_get_sta_info {
285 struct qlink_cmd chdr;
286 u8 sta_addr[ETH_ALEN];
290 * struct qlink_cmd_add_key - data for QLINK_CMD_ADD_KEY command.
292 * @key_index: index of the key being installed.
293 * @pairwise: whether to use pairwise key.
294 * @addr: MAC address of a STA key is being installed to.
295 * @cipher: cipher suite.
296 * @vlanid: VLAN ID for AP_VLAN interface type
297 * @key_data: key data itself.
299 struct qlink_cmd_add_key {
300 struct qlink_cmd chdr;
310 * struct qlink_cmd_del_key_req - data for QLINK_CMD_DEL_KEY command
312 * @key_index: index of the key being removed.
313 * @pairwise: whether to use pairwise key.
314 * @addr: MAC address of a STA for which a key is removed.
316 struct qlink_cmd_del_key {
317 struct qlink_cmd chdr;
324 * struct qlink_cmd_set_def_key - data for QLINK_CMD_SET_DEFAULT_KEY command
326 * @key_index: index of the key to be set as default one.
327 * @unicast: key is unicast.
328 * @multicast: key is multicast.
330 struct qlink_cmd_set_def_key {
331 struct qlink_cmd chdr;
338 * struct qlink_cmd_set_def_mgmt_key - data for QLINK_CMD_SET_DEFAULT_MGMT_KEY
340 * @key_index: index of the key to be set as default MGMT key.
342 struct qlink_cmd_set_def_mgmt_key {
343 struct qlink_cmd chdr;
348 * struct qlink_cmd_change_sta - data for QLINK_CMD_CHANGE_STA command
350 * @sta_flags_mask: STA flags mask, bitmap of &enum qlink_sta_flags
351 * @sta_flags_set: STA flags values, bitmap of &enum qlink_sta_flags
352 * @if_type: Mode of interface operation, one of &enum qlink_iface_type
353 * @vlanid: VLAN ID to assign to specific STA
354 * @sta_addr: address of the STA for which parameters are set.
356 struct qlink_cmd_change_sta {
357 struct qlink_cmd chdr;
358 __le32 sta_flags_mask;
359 __le32 sta_flags_set;
362 u8 sta_addr[ETH_ALEN];
366 * struct qlink_cmd_del_sta - data for QLINK_CMD_DEL_STA command.
368 * See &struct station_del_parameters
370 struct qlink_cmd_del_sta {
371 struct qlink_cmd chdr;
374 u8 sta_addr[ETH_ALEN];
377 enum qlink_sta_connect_flags {
378 QLINK_STA_CONNECT_DISABLE_HT = BIT(0),
379 QLINK_STA_CONNECT_DISABLE_VHT = BIT(1),
380 QLINK_STA_CONNECT_USE_RRM = BIT(2),
384 * struct qlink_cmd_connect - data for QLINK_CMD_CONNECT command
386 * @flags: for future use.
387 * @freq: center frequence of a channel which should be used to connect.
388 * @bg_scan_period: period of background scan.
389 * @bssid: BSSID of the BSS to connect to.
390 * @payload: variable portion of connection request.
392 struct qlink_cmd_connect {
393 struct qlink_cmd chdr;
396 __le16 bg_scan_period;
402 * struct qlink_cmd_disconnect - data for QLINK_CMD_DISCONNECT command
404 * @reason: code of the reason of disconnect, see &enum ieee80211_reasoncode.
406 struct qlink_cmd_disconnect {
407 struct qlink_cmd chdr;
412 * struct qlink_cmd_updown - data for QLINK_CMD_UPDOWN_INTF command
414 * @if_up: bring specified interface DOWN (if_up==0) or UP (otherwise).
415 * Interface is specified in common command header @chdr.
417 struct qlink_cmd_updown {
418 struct qlink_cmd chdr;
423 * enum qlink_band - a list of frequency bands
425 * @QLINK_BAND_2GHZ: 2.4GHz band
426 * @QLINK_BAND_5GHZ: 5GHz band
427 * @QLINK_BAND_60GHZ: 60GHz band
430 QLINK_BAND_2GHZ = BIT(0),
431 QLINK_BAND_5GHZ = BIT(1),
432 QLINK_BAND_60GHZ = BIT(2),
436 * struct qlink_cmd_chans_info_get - data for QLINK_CMD_CHANS_INFO_GET command
438 * @band: a PHY band for which channels info is needed, one of @enum qlink_band
440 struct qlink_cmd_chans_info_get {
441 struct qlink_cmd chdr;
446 * struct qlink_cmd_get_chan_stats - data for QLINK_CMD_CHAN_STATS command
448 * @channel: channel number according to 802.11 17.3.8.3.2 and Annex J
450 struct qlink_cmd_get_chan_stats {
451 struct qlink_cmd chdr;
456 * enum qlink_reg_initiator - Indicates the initiator of a reg domain request
458 * See &enum nl80211_reg_initiator for more info.
460 enum qlink_reg_initiator {
461 QLINK_REGDOM_SET_BY_CORE,
462 QLINK_REGDOM_SET_BY_USER,
463 QLINK_REGDOM_SET_BY_DRIVER,
464 QLINK_REGDOM_SET_BY_COUNTRY_IE,
468 * enum qlink_user_reg_hint_type - type of user regulatory hint
470 * See &enum nl80211_user_reg_hint_type for more info.
472 enum qlink_user_reg_hint_type {
473 QLINK_USER_REG_HINT_USER = 0,
474 QLINK_USER_REG_HINT_CELL_BASE = 1,
475 QLINK_USER_REG_HINT_INDOOR = 2,
479 * struct qlink_cmd_reg_notify - data for QLINK_CMD_REG_NOTIFY command
481 * @alpha2: the ISO / IEC 3166 alpha2 country code.
482 * @initiator: which entity sent the request, one of &enum qlink_reg_initiator.
483 * @user_reg_hint_type: type of hint for QLINK_REGDOM_SET_BY_USER request, one
484 * of &enum qlink_user_reg_hint_type.
486 struct qlink_cmd_reg_notify {
487 struct qlink_cmd chdr;
490 u8 user_reg_hint_type;
494 * struct qlink_cmd_chan_switch - data for QLINK_CMD_CHAN_SWITCH command
496 * @channel: channel number according to 802.11 17.3.8.3.2 and Annex J
497 * @radar_required: whether radar detection is required on the new channel
498 * @block_tx: whether transmissions should be blocked while changing
499 * @beacon_count: number of beacons until switch
501 struct qlink_cmd_chan_switch {
502 struct qlink_cmd chdr;
509 /* QLINK Command Responses messages related definitions
512 enum qlink_cmd_result {
513 QLINK_CMD_RESULT_OK = 0,
514 QLINK_CMD_RESULT_INVALID,
515 QLINK_CMD_RESULT_ENOTSUPP,
516 QLINK_CMD_RESULT_ENOTFOUND,
517 QLINK_CMD_RESULT_EALREADY,
521 * struct qlink_resp - QLINK command response message header
523 * Header used for QLINK messages of QLINK_MSG_TYPE_CMDRSP type.
525 * @mhdr: see &struct qlink_msg_header.
526 * @cmd_id: command ID the response corresponds to, one of &enum qlink_cmd_type.
527 * @seq_num: sequence number of command message, used for matching with
529 * @result: result of the command execution, one of &enum qlink_cmd_result.
530 * @macid: index of physical radio device the response is sent from or
531 * QLINK_MACID_RSVD if not applicable.
532 * @vifid: index of virtual wireless interface on specified @macid the response
533 * is sent from or QLINK_VIFID_RSVD if not applicable.
536 struct qlink_msg_header mhdr;
545 * struct qlink_resp_get_mac_info - response for QLINK_CMD_MAC_INFO command
547 * Data describing specific physical device providing wireless MAC
550 * @dev_mac: MAC address of physical WMAC device (used for first BSS on
552 * @num_tx_chain: Number of transmit chains used by WMAC.
553 * @num_rx_chain: Number of receive chains used by WMAC.
554 * @vht_cap: VHT capabilities.
555 * @ht_cap: HT capabilities.
556 * @bands_cap: wireless bands WMAC can operate in, bitmap of &enum qlink_band.
557 * @phymode_cap: PHY modes WMAC can operate in, bitmap of &enum qlink_phy_mode.
558 * @max_ap_assoc_sta: Maximum number of associations supported by WMAC.
559 * @radar_detect_widths: bitmask of channels BW for which WMAC can detect radar.
560 * @var_info: variable-length WMAC info data.
562 struct qlink_resp_get_mac_info {
563 struct qlink_resp rhdr;
564 u8 dev_mac[ETH_ALEN];
567 struct ieee80211_vht_cap vht_cap;
568 struct ieee80211_ht_cap ht_cap;
571 __le16 max_ap_assoc_sta;
572 __le16 radar_detect_widths;
577 * enum qlink_dfs_regions - regulatory DFS regions
579 * Corresponds to &enum nl80211_dfs_regions.
581 enum qlink_dfs_regions {
589 * struct qlink_resp_get_hw_info - response for QLINK_CMD_GET_HW_INFO command
591 * Description of wireless hardware capabilities and features.
593 * @fw_ver: wireless hardware firmware version.
594 * @hw_capab: Bitmap of capabilities supported by firmware.
595 * @ql_proto_ver: Version of QLINK protocol used by firmware.
596 * @num_mac: Number of separate physical radio devices provided by hardware.
597 * @mac_bitmap: Bitmap of MAC IDs that are active and can be used in firmware.
598 * @total_tx_chains: total number of transmit chains used by device.
599 * @total_rx_chains: total number of receive chains.
600 * @alpha2: country code ID firmware is configured to.
601 * @n_reg_rules: number of regulatory rules TLVs in variable portion of the
603 * @dfs_region: regulatory DFS region, one of @enum qlink_dfs_region.
604 * @info: variable-length HW info, can contain QTN_TLV_ID_REG_RULE.
606 struct qlink_resp_get_hw_info {
607 struct qlink_resp rhdr;
622 * struct qlink_resp_manage_intf - response for interface management commands
624 * Response data for QLINK_CMD_ADD_INTF and QLINK_CMD_CHANGE_INTF commands.
626 * @rhdr: Common Command Response message header.
627 * @intf_info: interface description.
629 struct qlink_resp_manage_intf {
630 struct qlink_resp rhdr;
631 struct qlink_intf_info intf_info;
635 * struct qlink_resp_get_sta_info - response for QLINK_CMD_GET_STA_INFO command
637 * Response data containing statistics for specified STA.
639 * @sta_addr: MAC address of STA the response carries statistic for.
640 * @info: statistics for specified STA.
642 struct qlink_resp_get_sta_info {
643 struct qlink_resp rhdr;
644 u8 sta_addr[ETH_ALEN];
649 * struct qlink_resp_get_chan_info - response for QLINK_CMD_CHANS_INFO_GET cmd
651 * @band: frequency band to which channels belong to, one of @enum qlink_band.
652 * @num_chans: total number of channels info data contained in reply data.
653 * @info: variable-length channels info.
655 struct qlink_resp_get_chan_info {
656 struct qlink_resp rhdr;
664 * struct qlink_resp_phy_params - response for QLINK_CMD_PHY_PARAMS_GET command
666 * @info: variable-length array of PHY params.
668 struct qlink_resp_phy_params {
669 struct qlink_resp rhdr;
674 * struct qlink_resp_get_chan_stats - response for QLINK_CMD_CHAN_STATS cmd
676 * @info: variable-length channel info.
678 struct qlink_resp_get_chan_stats {
679 struct qlink_cmd rhdr;
683 /* QLINK Events messages related definitions
686 enum qlink_event_type {
687 QLINK_EVENT_STA_ASSOCIATED = 0x0021,
688 QLINK_EVENT_STA_DEAUTH = 0x0022,
689 QLINK_EVENT_MGMT_RECEIVED = 0x0023,
690 QLINK_EVENT_SCAN_RESULTS = 0x0024,
691 QLINK_EVENT_SCAN_COMPLETE = 0x0025,
692 QLINK_EVENT_BSS_JOIN = 0x0026,
693 QLINK_EVENT_BSS_LEAVE = 0x0027,
694 QLINK_EVENT_FREQ_CHANGE = 0x0028,
698 * struct qlink_event - QLINK event message header
700 * Header used for QLINK messages of QLINK_MSG_TYPE_EVENT type.
702 * @mhdr: Common QLINK message header.
703 * @event_id: Specifies specific event ID, one of &enum qlink_event_type.
704 * @macid: index of physical radio device the event was generated on or
705 * QLINK_MACID_RSVD if not applicable.
706 * @vifid: index of virtual wireless interface on specified @macid the event
707 * was generated on or QLINK_VIFID_RSVD if not applicable.
710 struct qlink_msg_header mhdr;
717 * struct qlink_event_sta_assoc - data for QLINK_EVENT_STA_ASSOCIATED event
719 * @sta_addr: Address of a STA for which new association event was generated
720 * @frame_control: control bits from 802.11 ASSOC_REQUEST header.
721 * @payload: IEs from association request.
723 struct qlink_event_sta_assoc {
724 struct qlink_event ehdr;
725 u8 sta_addr[ETH_ALEN];
726 __le16 frame_control;
731 * struct qlink_event_sta_deauth - data for QLINK_EVENT_STA_DEAUTH event
733 * @sta_addr: Address of a deauthenticated STA.
734 * @reason: reason for deauthentication.
736 struct qlink_event_sta_deauth {
737 struct qlink_event ehdr;
738 u8 sta_addr[ETH_ALEN];
743 * struct qlink_event_bss_join - data for QLINK_EVENT_BSS_JOIN event
745 * @bssid: BSSID of a BSS which interface tried to joined.
746 * @status: status of joining attempt, see &enum ieee80211_statuscode.
748 struct qlink_event_bss_join {
749 struct qlink_event ehdr;
755 * struct qlink_event_bss_leave - data for QLINK_EVENT_BSS_LEAVE event
757 * @reason: reason of disconnecting from BSS.
759 struct qlink_event_bss_leave {
760 struct qlink_event ehdr;
765 * struct qlink_event_freq_change - data for QLINK_EVENT_FREQ_CHANGE event
767 * @freq: new operating frequency in MHz
769 struct qlink_event_freq_change {
770 struct qlink_event ehdr;
774 enum qlink_rxmgmt_flags {
775 QLINK_RXMGMT_FLAG_ANSWERED = 1 << 0,
779 * struct qlink_event_rxmgmt - data for QLINK_EVENT_MGMT_RECEIVED event
781 * @freq: Frequency on which the frame was received in MHz.
782 * @sig_dbm: signal strength in dBm.
783 * @flags: bitmap of &enum qlink_rxmgmt_flags.
784 * @frame_data: data of Rx'd frame itself.
786 struct qlink_event_rxmgmt {
787 struct qlink_event ehdr;
794 enum qlink_frame_type {
795 QLINK_BSS_FTYPE_UNKNOWN,
796 QLINK_BSS_FTYPE_BEACON,
797 QLINK_BSS_FTYPE_PRESP,
801 * struct qlink_event_scan_result - data for QLINK_EVENT_SCAN_RESULTS event
803 * @tsf: TSF timestamp indicating when scan results were generated.
804 * @freq: Center frequency of the channel where BSS for which the scan result
805 * event was generated was discovered.
806 * @capab: capabilities field.
807 * @bintval: beacon interval announced by discovered BSS.
808 * @signal: signal strength.
809 * @frame_type: frame type used to get scan result, see &enum qlink_frame_type.
810 * @bssid: BSSID announced by discovered BSS.
811 * @ssid_len: length of SSID announced by BSS.
812 * @ssid: SSID announced by discovered BSS.
813 * @payload: IEs that are announced by discovered BSS in its MGMt frames.
815 struct qlink_event_scan_result {
816 struct qlink_event ehdr;
825 u8 ssid[IEEE80211_MAX_SSID_LEN];
830 * enum qlink_scan_complete_flags - indicates result of scan request.
832 * @QLINK_SCAN_NONE: Scan request was processed.
833 * @QLINK_SCAN_ABORTED: Scan was aborted.
835 enum qlink_scan_complete_flags {
837 QLINK_SCAN_ABORTED = BIT(0),
841 * struct qlink_event_scan_complete - data for QLINK_EVENT_SCAN_COMPLETE event
843 * @flags: flags indicating the status of pending scan request,
844 * see &enum qlink_scan_complete_flags.
846 struct qlink_event_scan_complete {
847 struct qlink_event ehdr;
851 /* QLINK TLVs (Type-Length Values) definitions
855 QTN_TLV_ID_FRAG_THRESH = 0x0201,
856 QTN_TLV_ID_RTS_THRESH = 0x0202,
857 QTN_TLV_ID_SRETRY_LIMIT = 0x0203,
858 QTN_TLV_ID_LRETRY_LIMIT = 0x0204,
859 QTN_TLV_ID_BCN_PERIOD = 0x0205,
860 QTN_TLV_ID_DTIM = 0x0206,
861 QTN_TLV_ID_REG_RULE = 0x0207,
862 QTN_TLV_ID_CHANNEL = 0x020F,
863 QTN_TLV_ID_COVERAGE_CLASS = 0x0213,
864 QTN_TLV_ID_IFACE_LIMIT = 0x0214,
865 QTN_TLV_ID_NUM_IFACE_COMB = 0x0215,
866 QTN_TLV_ID_CHANNEL_STATS = 0x0216,
867 QTN_TLV_ID_STA_BASIC_COUNTERS = 0x0300,
868 QTN_TLV_ID_STA_GENERIC_INFO = 0x0301,
869 QTN_TLV_ID_KEY = 0x0302,
870 QTN_TLV_ID_SEQ = 0x0303,
871 QTN_TLV_ID_CRYPTO = 0x0304,
872 QTN_TLV_ID_IE_SET = 0x0305,
875 struct qlink_tlv_hdr {
881 struct qlink_iface_limit {
886 struct qlink_iface_comb_num {
887 __le16 iface_comb_num;
890 struct qlink_sta_stat_basic_counters {
900 enum qlink_sta_info_rate_flags {
901 QLINK_STA_INFO_RATE_FLAG_INVALID = 0,
902 QLINK_STA_INFO_RATE_FLAG_HT_MCS = BIT(0),
903 QLINK_STA_INFO_RATE_FLAG_VHT_MCS = BIT(1),
904 QLINK_STA_INFO_RATE_FLAG_SHORT_GI = BIT(2),
905 QLINK_STA_INFO_RATE_FLAG_60G = BIT(3),
908 enum qlink_sta_info_rate_bw {
909 QLINK_STA_INFO_RATE_BW_5 = 0,
910 QLINK_STA_INFO_RATE_BW_10 = 1,
911 QLINK_STA_INFO_RATE_BW_20 = 2,
912 QLINK_STA_INFO_RATE_BW_40 = 3,
913 QLINK_STA_INFO_RATE_BW_80 = 4,
914 QLINK_STA_INFO_RATE_BW_160 = 5,
918 * struct qlink_sta_info_rate - STA rate statistics
920 * @rate: data rate in Mbps.
921 * @flags: bitmap of &enum qlink_sta_flags.
922 * @mcs: 802.11-defined MCS index.
923 * nss: Number of Spatial Streams.
924 * @bw: bandwidth, one of &enum qlink_sta_info_rate_bw.
926 struct qlink_sta_info_rate {
934 struct qlink_sta_info_state {
939 #define QLINK_RSSI_OFFSET 120
941 struct qlink_sta_info_generic {
942 struct qlink_sta_info_state state;
943 __le32 connected_time;
944 __le32 inactive_time;
945 struct qlink_sta_info_rate rx_rate;
946 struct qlink_sta_info_rate tx_rate;
951 struct qlink_tlv_frag_rts_thr {
952 struct qlink_tlv_hdr hdr;
956 struct qlink_tlv_rlimit {
957 struct qlink_tlv_hdr hdr;
961 struct qlink_tlv_cclass {
962 struct qlink_tlv_hdr hdr;
967 * enum qlink_reg_rule_flags - regulatory rule flags
969 * See description of &enum nl80211_reg_rule_flags
971 enum qlink_reg_rule_flags {
972 QLINK_RRF_NO_OFDM = BIT(0),
973 QLINK_RRF_NO_CCK = BIT(1),
974 QLINK_RRF_NO_INDOOR = BIT(2),
975 QLINK_RRF_NO_OUTDOOR = BIT(3),
976 QLINK_RRF_DFS = BIT(4),
977 QLINK_RRF_PTP_ONLY = BIT(5),
978 QLINK_RRF_PTMP_ONLY = BIT(6),
979 QLINK_RRF_NO_IR = BIT(7),
980 QLINK_RRF_AUTO_BW = BIT(8),
981 QLINK_RRF_IR_CONCURRENT = BIT(9),
982 QLINK_RRF_NO_HT40MINUS = BIT(10),
983 QLINK_RRF_NO_HT40PLUS = BIT(11),
984 QLINK_RRF_NO_80MHZ = BIT(12),
985 QLINK_RRF_NO_160MHZ = BIT(13),
989 * struct qlink_tlv_reg_rule - data for QTN_TLV_ID_REG_RULE TLV
991 * Regulatory rule description.
993 * @start_freq_khz: start frequency of the range the rule is attributed to.
994 * @end_freq_khz: end frequency of the range the rule is attributed to.
995 * @max_bandwidth_khz: max bandwidth that channels in specified range can be
997 * @max_antenna_gain: max antenna gain that can be used in the specified
998 * frequency range, dBi.
999 * @max_eirp: maximum EIRP.
1000 * @flags: regulatory rule flags in &enum qlink_reg_rule_flags.
1001 * @dfs_cac_ms: DFS CAC period.
1003 struct qlink_tlv_reg_rule {
1004 struct qlink_tlv_hdr hdr;
1005 __le32 start_freq_khz;
1006 __le32 end_freq_khz;
1007 __le32 max_bandwidth_khz;
1008 __le32 max_antenna_gain;
1014 enum qlink_channel_flags {
1015 QLINK_CHAN_DISABLED = BIT(0),
1016 QLINK_CHAN_NO_IR = BIT(1),
1017 QLINK_CHAN_RADAR = BIT(3),
1018 QLINK_CHAN_NO_HT40PLUS = BIT(4),
1019 QLINK_CHAN_NO_HT40MINUS = BIT(5),
1020 QLINK_CHAN_NO_OFDM = BIT(6),
1021 QLINK_CHAN_NO_80MHZ = BIT(7),
1022 QLINK_CHAN_NO_160MHZ = BIT(8),
1023 QLINK_CHAN_INDOOR_ONLY = BIT(9),
1024 QLINK_CHAN_IR_CONCURRENT = BIT(10),
1025 QLINK_CHAN_NO_20MHZ = BIT(11),
1026 QLINK_CHAN_NO_10MHZ = BIT(12),
1029 enum qlink_dfs_state {
1031 QLINK_DFS_UNAVAILABLE,
1032 QLINK_DFS_AVAILABLE,
1035 struct qlink_tlv_channel {
1036 struct qlink_tlv_hdr hdr;
1041 u8 max_antenna_gain;
1050 #define QLINK_MAX_NR_CIPHER_SUITES 5
1051 #define QLINK_MAX_NR_AKM_SUITES 2
1053 struct qlink_auth_encr {
1054 __le32 wpa_versions;
1055 __le32 cipher_group;
1056 __le32 n_ciphers_pairwise;
1057 __le32 ciphers_pairwise[QLINK_MAX_NR_CIPHER_SUITES];
1058 __le32 n_akm_suites;
1059 __le32 akm_suites[QLINK_MAX_NR_AKM_SUITES];
1060 __le16 control_port_ethertype;
1065 u8 control_port_no_encrypt;
1068 struct qlink_chan_stats {
1077 #endif /* _QTN_QLINK_H_ */