1 /* SPDX-License-Identifier: GPL-2.0-only or Apache-2.0 */
3 * WF200 hardware interface definitions
5 * Copyright (c) 2018-2020, Silicon Laboratories Inc.
8 #ifndef WFX_HIF_API_CMD_H
9 #define WFX_HIF_API_CMD_H
11 #include "hif_api_general.h"
13 enum wfx_hif_requests_ids
{
14 HIF_REQ_ID_RESET
= 0x0a,
15 HIF_REQ_ID_READ_MIB
= 0x05,
16 HIF_REQ_ID_WRITE_MIB
= 0x06,
17 HIF_REQ_ID_START_SCAN
= 0x07,
18 HIF_REQ_ID_STOP_SCAN
= 0x08,
20 HIF_REQ_ID_JOIN
= 0x0b,
21 HIF_REQ_ID_SET_PM_MODE
= 0x10,
22 HIF_REQ_ID_SET_BSS_PARAMS
= 0x11,
23 HIF_REQ_ID_ADD_KEY
= 0x0c,
24 HIF_REQ_ID_REMOVE_KEY
= 0x0d,
25 HIF_REQ_ID_EDCA_QUEUE_PARAMS
= 0x13,
26 HIF_REQ_ID_START
= 0x17,
27 HIF_REQ_ID_BEACON_TRANSMIT
= 0x18,
28 HIF_REQ_ID_UPDATE_IE
= 0x1b,
29 HIF_REQ_ID_MAP_LINK
= 0x1c,
32 enum wfx_hif_confirmations_ids
{
33 HIF_CNF_ID_RESET
= 0x0a,
34 HIF_CNF_ID_READ_MIB
= 0x05,
35 HIF_CNF_ID_WRITE_MIB
= 0x06,
36 HIF_CNF_ID_START_SCAN
= 0x07,
37 HIF_CNF_ID_STOP_SCAN
= 0x08,
39 HIF_CNF_ID_MULTI_TRANSMIT
= 0x1e,
40 HIF_CNF_ID_JOIN
= 0x0b,
41 HIF_CNF_ID_SET_PM_MODE
= 0x10,
42 HIF_CNF_ID_SET_BSS_PARAMS
= 0x11,
43 HIF_CNF_ID_ADD_KEY
= 0x0c,
44 HIF_CNF_ID_REMOVE_KEY
= 0x0d,
45 HIF_CNF_ID_EDCA_QUEUE_PARAMS
= 0x13,
46 HIF_CNF_ID_START
= 0x17,
47 HIF_CNF_ID_BEACON_TRANSMIT
= 0x18,
48 HIF_CNF_ID_UPDATE_IE
= 0x1b,
49 HIF_CNF_ID_MAP_LINK
= 0x1c,
52 enum wfx_hif_indications_ids
{
54 HIF_IND_ID_SCAN_CMPL
= 0x86,
55 HIF_IND_ID_JOIN_COMPLETE
= 0x8f,
56 HIF_IND_ID_SET_PM_MODE_CMPL
= 0x89,
57 HIF_IND_ID_SUSPEND_RESUME_TX
= 0x8c,
58 HIF_IND_ID_EVENT
= 0x85
61 struct wfx_hif_req_reset
{
68 struct wfx_hif_cnf_reset
{
72 struct wfx_hif_req_read_mib
{
77 struct wfx_hif_cnf_read_mib
{
84 struct wfx_hif_req_write_mib
{
90 struct wfx_hif_cnf_write_mib
{
94 struct wfx_hif_req_update_ie
{
104 struct wfx_hif_cnf_update_ie
{
108 struct wfx_hif_ssid_def
{
110 u8 ssid
[IEEE80211_MAX_SSID_LEN
];
113 #define HIF_API_MAX_NB_SSIDS 2
114 #define HIF_API_MAX_NB_CHANNELS 14
116 struct wfx_hif_req_start_scan_alt
{
118 u8 maintain_current_bss
:1;
125 u8 max_transmit_rate
;
126 __le16 periodic_interval
;
128 s8 periodic_rssi_thr
;
129 u8 num_of_probe_requests
;
133 __le32 min_channel_time
;
134 __le32 max_channel_time
;
135 __le32 tx_power_level
; /* signed value */
136 struct wfx_hif_ssid_def ssid_def
[HIF_API_MAX_NB_SSIDS
];
140 struct wfx_hif_cnf_start_scan
{
144 struct wfx_hif_cnf_stop_scan
{
148 enum wfx_hif_pm_mode_status
{
149 HIF_PM_MODE_ACTIVE
= 0x0,
150 HIF_PM_MODE_PS
= 0x1,
151 HIF_PM_MODE_UNDETERMINED
= 0x2
154 struct wfx_hif_ind_scan_cmpl
{
157 u8 num_channels_completed
;
161 enum wfx_hif_queue_id
{
162 HIF_QUEUE_ID_BACKGROUND
= 0x0,
163 HIF_QUEUE_ID_BESTEFFORT
= 0x1,
164 HIF_QUEUE_ID_VIDEO
= 0x2,
165 HIF_QUEUE_ID_VOICE
= 0x3
168 enum wfx_hif_frame_format
{
169 HIF_FRAME_FORMAT_NON_HT
= 0x0,
170 HIF_FRAME_FORMAT_MIXED_FORMAT_HT
= 0x1,
171 HIF_FRAME_FORMAT_GF_HT_11N
= 0x2
174 struct wfx_hif_req_tx
{
175 /* packet_id is not interpreted by the device, so it is not necessary to declare it little
189 u8 retry_policy_index
:4;
204 enum wfx_hif_qos_ackplcy
{
205 HIF_QOS_ACKPLCY_NORMAL
= 0x0,
206 HIF_QOS_ACKPLCY_TXNOACK
= 0x1,
207 HIF_QOS_ACKPLCY_NOEXPACK
= 0x2,
208 HIF_QOS_ACKPLCY_BLCKACK
= 0x3
211 struct wfx_hif_cnf_tx
{
213 /* packet_id is copied from struct wfx_hif_req_tx without been interpreted by the device, so
214 * it is not necessary to declare it little endian
226 __le32 tx_queue_delay
;
229 struct wfx_hif_cnf_multi_transmit
{
232 struct wfx_hif_cnf_tx tx_conf_payload
[];
235 enum wfx_hif_ri_flags_encrypt
{
236 HIF_RI_FLAGS_UNENCRYPTED
= 0x0,
237 HIF_RI_FLAGS_WEP_ENCRYPTED
= 0x1,
238 HIF_RI_FLAGS_TKIP_ENCRYPTED
= 0x2,
239 HIF_RI_FLAGS_AES_ENCRYPTED
= 0x3,
240 HIF_RI_FLAGS_WAPI_ENCRYPTED
= 0x4
243 struct wfx_hif_ind_rx
{
275 struct wfx_hif_req_edca_queue_params
{
283 __le16 allowed_medium_time
;
287 struct wfx_hif_cnf_edca_queue_params
{
291 struct wfx_hif_req_join
{
292 u8 infrastructure_bss_mode
:1;
304 u8 force_no_beacon
:1;
308 u8 ssid
[IEEE80211_MAX_SSID_LEN
];
309 __le32 beacon_interval
;
310 __le32 basic_rate_set
;
313 struct wfx_hif_cnf_join
{
317 struct wfx_hif_ind_join_complete
{
321 struct wfx_hif_req_set_bss_params
{
322 u8 lost_count_only
:1;
324 u8 beacon_lost_count
;
326 __le32 operational_rate_set
;
329 struct wfx_hif_cnf_set_bss_params
{
333 struct wfx_hif_req_set_pm_mode
{
337 u8 fast_psm_idle_period
;
338 u8 ap_psm_change_period
;
339 u8 min_auto_ps_poll_period
;
342 struct wfx_hif_cnf_set_pm_mode
{
346 struct wfx_hif_ind_set_pm_mode_cmpl
{
352 struct wfx_hif_req_start
{
358 __le32 beacon_interval
;
364 u8 ssid
[IEEE80211_MAX_SSID_LEN
];
365 __le32 basic_rate_set
;
368 struct wfx_hif_cnf_start
{
372 struct wfx_hif_req_beacon_transmit
{
377 struct wfx_hif_cnf_beacon_transmit
{
381 #define HIF_LINK_ID_MAX 14
382 #define HIF_LINK_ID_NOT_ASSOCIATED (HIF_LINK_ID_MAX + 1)
384 struct wfx_hif_req_map_link
{
385 u8 mac_addr
[ETH_ALEN
];
392 struct wfx_hif_cnf_map_link
{
396 struct wfx_hif_ind_suspend_resume_tx
{
406 #define MAX_KEY_ENTRIES 24
407 #define HIF_API_WEP_KEY_DATA_SIZE 16
408 #define HIF_API_TKIP_KEY_DATA_SIZE 16
409 #define HIF_API_RX_MIC_KEY_SIZE 8
410 #define HIF_API_TX_MIC_KEY_SIZE 8
411 #define HIF_API_AES_KEY_DATA_SIZE 16
412 #define HIF_API_WAPI_KEY_DATA_SIZE 16
413 #define HIF_API_MIC_KEY_DATA_SIZE 16
414 #define HIF_API_IGTK_KEY_DATA_SIZE 16
415 #define HIF_API_RX_SEQUENCE_COUNTER_SIZE 8
416 #define HIF_API_IPN_SIZE 8
418 enum wfx_hif_key_type
{
419 HIF_KEY_TYPE_WEP_DEFAULT
= 0x0,
420 HIF_KEY_TYPE_WEP_PAIRWISE
= 0x1,
421 HIF_KEY_TYPE_TKIP_GROUP
= 0x2,
422 HIF_KEY_TYPE_TKIP_PAIRWISE
= 0x3,
423 HIF_KEY_TYPE_AES_GROUP
= 0x4,
424 HIF_KEY_TYPE_AES_PAIRWISE
= 0x5,
425 HIF_KEY_TYPE_WAPI_GROUP
= 0x6,
426 HIF_KEY_TYPE_WAPI_PAIRWISE
= 0x7,
427 HIF_KEY_TYPE_IGTK_GROUP
= 0x8,
428 HIF_KEY_TYPE_NONE
= 0x9
431 struct wfx_hif_wep_pairwise_key
{
432 u8 peer_address
[ETH_ALEN
];
435 u8 key_data
[HIF_API_WEP_KEY_DATA_SIZE
];
438 struct wfx_hif_wep_group_key
{
442 u8 key_data
[HIF_API_WEP_KEY_DATA_SIZE
];
445 struct wfx_hif_tkip_pairwise_key
{
446 u8 peer_address
[ETH_ALEN
];
448 u8 tkip_key_data
[HIF_API_TKIP_KEY_DATA_SIZE
];
449 u8 rx_mic_key
[HIF_API_RX_MIC_KEY_SIZE
];
450 u8 tx_mic_key
[HIF_API_TX_MIC_KEY_SIZE
];
453 struct wfx_hif_tkip_group_key
{
454 u8 tkip_key_data
[HIF_API_TKIP_KEY_DATA_SIZE
];
455 u8 rx_mic_key
[HIF_API_RX_MIC_KEY_SIZE
];
458 u8 rx_sequence_counter
[HIF_API_RX_SEQUENCE_COUNTER_SIZE
];
461 struct wfx_hif_aes_pairwise_key
{
462 u8 peer_address
[ETH_ALEN
];
464 u8 aes_key_data
[HIF_API_AES_KEY_DATA_SIZE
];
467 struct wfx_hif_aes_group_key
{
468 u8 aes_key_data
[HIF_API_AES_KEY_DATA_SIZE
];
471 u8 rx_sequence_counter
[HIF_API_RX_SEQUENCE_COUNTER_SIZE
];
474 struct wfx_hif_wapi_pairwise_key
{
475 u8 peer_address
[ETH_ALEN
];
478 u8 wapi_key_data
[HIF_API_WAPI_KEY_DATA_SIZE
];
479 u8 mic_key_data
[HIF_API_MIC_KEY_DATA_SIZE
];
482 struct wfx_hif_wapi_group_key
{
483 u8 wapi_key_data
[HIF_API_WAPI_KEY_DATA_SIZE
];
484 u8 mic_key_data
[HIF_API_MIC_KEY_DATA_SIZE
];
489 struct wfx_hif_igtk_group_key
{
490 u8 igtk_key_data
[HIF_API_IGTK_KEY_DATA_SIZE
];
493 u8 ipn
[HIF_API_IPN_SIZE
];
496 struct wfx_hif_req_add_key
{
503 struct wfx_hif_wep_pairwise_key wep_pairwise_key
;
504 struct wfx_hif_wep_group_key wep_group_key
;
505 struct wfx_hif_tkip_pairwise_key tkip_pairwise_key
;
506 struct wfx_hif_tkip_group_key tkip_group_key
;
507 struct wfx_hif_aes_pairwise_key aes_pairwise_key
;
508 struct wfx_hif_aes_group_key aes_group_key
;
509 struct wfx_hif_wapi_pairwise_key wapi_pairwise_key
;
510 struct wfx_hif_wapi_group_key wapi_group_key
;
511 struct wfx_hif_igtk_group_key igtk_group_key
;
515 struct wfx_hif_cnf_add_key
{
519 struct wfx_hif_req_remove_key
{
524 struct wfx_hif_cnf_remove_key
{
528 enum wfx_hif_event_ind
{
529 HIF_EVENT_IND_BSSLOST
= 0x1,
530 HIF_EVENT_IND_BSSREGAINED
= 0x2,
531 HIF_EVENT_IND_RCPI_RSSI
= 0x3,
532 HIF_EVENT_IND_PS_MODE_ERROR
= 0x4,
533 HIF_EVENT_IND_INACTIVITY
= 0x5
536 enum wfx_hif_ps_mode_error
{
537 HIF_PS_ERROR_NO_ERROR
= 0,
538 HIF_PS_ERROR_AP_NOT_RESP_TO_POLL
= 1,
539 HIF_PS_ERROR_AP_NOT_RESP_TO_UAPSD_TRIGGER
= 2,
540 HIF_PS_ERROR_AP_SENT_UNICAST_IN_DOZE
= 3,
541 HIF_PS_ERROR_AP_NO_DATA_AFTER_TIM
= 4
544 struct wfx_hif_ind_event
{
548 __le32 ps_mode_error
;