1 /* SPDX-License-Identifier: Apache-2.0 */
3 * WFx hardware interface definitions
5 * Copyright (c) 2018-2019, Silicon Laboratories Inc.
8 #ifndef WFX_HIF_API_CMD_H
9 #define WFX_HIF_API_CMD_H
11 #include "hif_api_general.h"
13 #define HIF_API_SSID_SIZE API_SSID_SIZE
15 enum hif_requests_ids {
16 HIF_REQ_ID_RESET = 0x0a,
17 HIF_REQ_ID_READ_MIB = 0x05,
18 HIF_REQ_ID_WRITE_MIB = 0x06,
19 HIF_REQ_ID_START_SCAN = 0x07,
20 HIF_REQ_ID_STOP_SCAN = 0x08,
22 HIF_REQ_ID_JOIN = 0x0b,
23 HIF_REQ_ID_SET_PM_MODE = 0x10,
24 HIF_REQ_ID_SET_BSS_PARAMS = 0x11,
25 HIF_REQ_ID_ADD_KEY = 0x0c,
26 HIF_REQ_ID_REMOVE_KEY = 0x0d,
27 HIF_REQ_ID_EDCA_QUEUE_PARAMS = 0x13,
28 HIF_REQ_ID_START = 0x17,
29 HIF_REQ_ID_BEACON_TRANSMIT = 0x18,
30 HIF_REQ_ID_UPDATE_IE = 0x1b,
31 HIF_REQ_ID_MAP_LINK = 0x1c,
34 enum hif_confirmations_ids {
35 HIF_CNF_ID_RESET = 0x0a,
36 HIF_CNF_ID_READ_MIB = 0x05,
37 HIF_CNF_ID_WRITE_MIB = 0x06,
38 HIF_CNF_ID_START_SCAN = 0x07,
39 HIF_CNF_ID_STOP_SCAN = 0x08,
41 HIF_CNF_ID_MULTI_TRANSMIT = 0x1e,
42 HIF_CNF_ID_JOIN = 0x0b,
43 HIF_CNF_ID_SET_PM_MODE = 0x10,
44 HIF_CNF_ID_SET_BSS_PARAMS = 0x11,
45 HIF_CNF_ID_ADD_KEY = 0x0c,
46 HIF_CNF_ID_REMOVE_KEY = 0x0d,
47 HIF_CNF_ID_EDCA_QUEUE_PARAMS = 0x13,
48 HIF_CNF_ID_START = 0x17,
49 HIF_CNF_ID_BEACON_TRANSMIT = 0x18,
50 HIF_CNF_ID_UPDATE_IE = 0x1b,
51 HIF_CNF_ID_MAP_LINK = 0x1c,
54 enum hif_indications_ids {
56 HIF_IND_ID_SCAN_CMPL = 0x86,
57 HIF_IND_ID_JOIN_COMPLETE = 0x8f,
58 HIF_IND_ID_SET_PM_MODE_CMPL = 0x89,
59 HIF_IND_ID_SUSPEND_RESUME_TX = 0x8c,
60 HIF_IND_ID_EVENT = 0x85
63 union hif_commands_ids {
64 enum hif_requests_ids request;
65 enum hif_confirmations_ids confirmation;
66 enum hif_indications_ids indication;
70 HIF_STATUS_SUCCESS = 0x0,
71 HIF_STATUS_FAILURE = 0x1,
72 HIF_INVALID_PARAMETER = 0x2,
73 HIF_STATUS_WARNING = 0x3,
74 HIF_ERROR_UNSUPPORTED_MSG_ID = 0x4,
75 HIF_STATUS_DECRYPTFAILURE = 0x10,
76 HIF_STATUS_MICFAILURE = 0x11,
77 HIF_STATUS_NO_KEY_FOUND = 0x12,
78 HIF_STATUS_RETRY_EXCEEDED = 0x13,
79 HIF_STATUS_TX_LIFETIME_EXCEEDED = 0x14,
81 HIF_STATUS_REFUSED = 0x16,
82 HIF_STATUS_BUSY = 0x17
85 struct hif_reset_flags {
92 struct hif_req_reset {
93 struct hif_reset_flags reset_flags;
96 struct hif_req_read_mib {
101 struct hif_cnf_read_mib {
108 struct hif_req_write_mib {
114 struct hif_cnf_write_mib {
118 struct hif_ie_flags {
132 struct hif_req_update_ie {
133 struct hif_ie_flags ie_flags;
135 struct hif_ie_tlv ie[];
138 struct hif_cnf_update_ie {
142 struct hif_scan_type {
148 struct hif_scan_flags {
155 struct hif_auto_scan_param {
161 struct hif_ssid_def {
163 u8 ssid[HIF_API_SSID_SIZE];
166 #define HIF_API_MAX_NB_SSIDS 2
167 #define HIF_API_MAX_NB_CHANNELS 14
169 struct hif_req_start_scan_alt {
171 struct hif_scan_type scan_type;
172 struct hif_scan_flags scan_flags;
173 u8 max_transmit_rate;
174 struct hif_auto_scan_param auto_scan_param;
175 u8 num_of_probe_requests;
179 __le32 min_channel_time;
180 __le32 max_channel_time;
181 __le32 tx_power_level; // signed value
182 struct hif_ssid_def ssid_def[HIF_API_MAX_NB_SSIDS];
186 struct hif_cnf_start_scan {
190 struct hif_cnf_stop_scan {
194 enum hif_pm_mode_status {
195 HIF_PM_MODE_ACTIVE = 0x0,
196 HIF_PM_MODE_PS = 0x1,
197 HIF_PM_MODE_UNDETERMINED = 0x2
200 struct hif_ind_scan_cmpl {
203 u8 num_channels_completed;
208 HIF_QUEUE_ID_BACKGROUND = 0x0,
209 HIF_QUEUE_ID_BESTEFFORT = 0x1,
210 HIF_QUEUE_ID_VIDEO = 0x2,
211 HIF_QUEUE_ID_VOICE = 0x3
214 enum hif_frame_format {
215 HIF_FRAME_FORMAT_NON_HT = 0x0,
216 HIF_FRAME_FORMAT_MIXED_FORMAT_HT = 0x1,
217 HIF_FRAME_FORMAT_GF_HT_11N = 0x2
221 HIF_STBC_NOT_ALLOWED = 0x0,
222 HIF_STBC_ALLOWED = 0x1
231 struct hif_data_flags {
238 struct hif_tx_flags {
241 u8 retry_policy_index:4;
244 struct hif_ht_tx_parameters {
259 struct hif_queue queue_id;
260 struct hif_data_flags data_flags;
261 struct hif_tx_flags tx_flags;
264 struct hif_ht_tx_parameters ht_tx_parameters;
268 enum hif_qos_ackplcy {
269 HIF_QOS_ACKPLCY_NORMAL = 0x0,
270 HIF_QOS_ACKPLCY_TXNOACK = 0x1,
271 HIF_QOS_ACKPLCY_NOEXPACK = 0x2,
272 HIF_QOS_ACKPLCY_BLCKACK = 0x3
275 struct hif_tx_result_flags {
289 struct hif_tx_result_flags tx_result_flags;
291 __le32 tx_queue_delay;
294 struct hif_cnf_multi_transmit {
296 struct hif_cnf_tx tx_conf_payload[];
299 enum hif_ri_flags_encrypt {
300 HIF_RI_FLAGS_UNENCRYPTED = 0x0,
301 HIF_RI_FLAGS_WEP_ENCRYPTED = 0x1,
302 HIF_RI_FLAGS_TKIP_ENCRYPTED = 0x2,
303 HIF_RI_FLAGS_AES_ENCRYPTED = 0x3,
304 HIF_RI_FLAGS_WAPI_ENCRYPTED = 0x4
307 struct hif_rx_flags {
335 __le16 channel_number;
338 struct hif_rx_flags rx_flags;
343 struct hif_req_edca_queue_params {
351 __le16 allowed_medium_time;
355 struct hif_cnf_edca_queue_params {
359 struct hif_join_flags {
361 u8 force_no_beacon:1;
366 struct hif_req_join {
367 u8 infrastructure_bss_mode:1;
370 __le16 channel_number;
377 struct hif_join_flags join_flags;
379 u8 ssid[HIF_API_SSID_SIZE];
380 __le32 beacon_interval;
381 __le32 basic_rate_set;
384 struct hif_cnf_join {
388 struct hif_ind_join_complete {
392 struct hif_bss_flags {
393 u8 lost_count_only:1;
397 struct hif_req_set_bss_params {
398 struct hif_bss_flags bss_flags;
399 u8 beacon_lost_count;
401 __le32 operational_rate_set;
404 struct hif_cnf_set_bss_params {
414 struct hif_req_set_pm_mode {
415 struct hif_pm_mode pm_mode;
416 u8 fast_psm_idle_period;
417 u8 ap_psm_change_period;
418 u8 min_auto_ps_poll_period;
421 struct hif_cnf_set_pm_mode {
425 struct hif_ind_set_pm_mode_cmpl {
432 struct hif_req_start {
435 __le16 channel_number;
437 __le32 beacon_interval;
443 u8 ssid[HIF_API_SSID_SIZE];
444 __le32 basic_rate_set;
447 struct hif_cnf_start {
452 HIF_BEACON_STOP = 0x0,
453 HIF_BEACON_START = 0x1
456 struct hif_req_beacon_transmit {
461 struct hif_cnf_beacon_transmit {
465 #define HIF_LINK_ID_MAX 14
466 #define HIF_LINK_ID_NOT_ASSOCIATED (HIF_LINK_ID_MAX + 1)
468 enum hif_sta_map_direction {
473 struct hif_map_link_flags {
479 struct hif_req_map_link {
480 u8 mac_addr[ETH_ALEN];
481 struct hif_map_link_flags map_link_flags;
485 struct hif_cnf_map_link {
489 struct hif_suspend_resume_flags {
497 struct hif_ind_suspend_resume_tx {
498 struct hif_suspend_resume_flags suspend_resume_flags;
503 #define MAX_KEY_ENTRIES 24
504 #define HIF_API_WEP_KEY_DATA_SIZE 16
505 #define HIF_API_TKIP_KEY_DATA_SIZE 16
506 #define HIF_API_RX_MIC_KEY_SIZE 8
507 #define HIF_API_TX_MIC_KEY_SIZE 8
508 #define HIF_API_AES_KEY_DATA_SIZE 16
509 #define HIF_API_WAPI_KEY_DATA_SIZE 16
510 #define HIF_API_MIC_KEY_DATA_SIZE 16
511 #define HIF_API_IGTK_KEY_DATA_SIZE 16
512 #define HIF_API_RX_SEQUENCE_COUNTER_SIZE 8
513 #define HIF_API_IPN_SIZE 8
516 HIF_KEY_TYPE_WEP_DEFAULT = 0x0,
517 HIF_KEY_TYPE_WEP_PAIRWISE = 0x1,
518 HIF_KEY_TYPE_TKIP_GROUP = 0x2,
519 HIF_KEY_TYPE_TKIP_PAIRWISE = 0x3,
520 HIF_KEY_TYPE_AES_GROUP = 0x4,
521 HIF_KEY_TYPE_AES_PAIRWISE = 0x5,
522 HIF_KEY_TYPE_WAPI_GROUP = 0x6,
523 HIF_KEY_TYPE_WAPI_PAIRWISE = 0x7,
524 HIF_KEY_TYPE_IGTK_GROUP = 0x8,
525 HIF_KEY_TYPE_NONE = 0x9
528 struct hif_wep_pairwise_key {
529 u8 peer_address[ETH_ALEN];
532 u8 key_data[HIF_API_WEP_KEY_DATA_SIZE];
535 struct hif_wep_group_key {
539 u8 key_data[HIF_API_WEP_KEY_DATA_SIZE];
542 struct hif_tkip_pairwise_key {
543 u8 peer_address[ETH_ALEN];
545 u8 tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE];
546 u8 rx_mic_key[HIF_API_RX_MIC_KEY_SIZE];
547 u8 tx_mic_key[HIF_API_TX_MIC_KEY_SIZE];
550 struct hif_tkip_group_key {
551 u8 tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE];
552 u8 rx_mic_key[HIF_API_RX_MIC_KEY_SIZE];
555 u8 rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE];
558 struct hif_aes_pairwise_key {
559 u8 peer_address[ETH_ALEN];
561 u8 aes_key_data[HIF_API_AES_KEY_DATA_SIZE];
564 struct hif_aes_group_key {
565 u8 aes_key_data[HIF_API_AES_KEY_DATA_SIZE];
568 u8 rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE];
571 struct hif_wapi_pairwise_key {
572 u8 peer_address[ETH_ALEN];
575 u8 wapi_key_data[HIF_API_WAPI_KEY_DATA_SIZE];
576 u8 mic_key_data[HIF_API_MIC_KEY_DATA_SIZE];
579 struct hif_wapi_group_key {
580 u8 wapi_key_data[HIF_API_WAPI_KEY_DATA_SIZE];
581 u8 mic_key_data[HIF_API_MIC_KEY_DATA_SIZE];
586 struct hif_igtk_group_key {
587 u8 igtk_key_data[HIF_API_IGTK_KEY_DATA_SIZE];
590 u8 ipn[HIF_API_IPN_SIZE];
593 union hif_privacy_key_data {
594 struct hif_wep_pairwise_key wep_pairwise_key;
595 struct hif_wep_group_key wep_group_key;
596 struct hif_tkip_pairwise_key tkip_pairwise_key;
597 struct hif_tkip_group_key tkip_group_key;
598 struct hif_aes_pairwise_key aes_pairwise_key;
599 struct hif_aes_group_key aes_group_key;
600 struct hif_wapi_pairwise_key wapi_pairwise_key;
601 struct hif_wapi_group_key wapi_group_key;
602 struct hif_igtk_group_key igtk_group_key;
605 struct hif_req_add_key {
611 union hif_privacy_key_data key;
614 struct hif_cnf_add_key {
618 struct hif_req_remove_key {
623 struct hif_cnf_remove_key {
628 HIF_EVENT_IND_BSSLOST = 0x1,
629 HIF_EVENT_IND_BSSREGAINED = 0x2,
630 HIF_EVENT_IND_RCPI_RSSI = 0x3,
631 HIF_EVENT_IND_PS_MODE_ERROR = 0x4,
632 HIF_EVENT_IND_INACTIVITY = 0x5
635 enum hif_ps_mode_error {
636 HIF_PS_ERROR_NO_ERROR = 0,
637 HIF_PS_ERROR_AP_NOT_RESP_TO_POLL = 1,
638 HIF_PS_ERROR_AP_NOT_RESP_TO_UAPSD_TRIGGER = 2,
639 HIF_PS_ERROR_AP_SENT_UNICAST_IN_DOZE = 3,
640 HIF_PS_ERROR_AP_NO_DATA_AFTER_TIM = 4
643 union hif_event_data {
645 __le32 ps_mode_error;
649 struct hif_ind_event {
651 union hif_event_data event_data;