0001
0002
0003
0004
0005
0006
0007
0008 #ifndef WFX_HIF_API_CMD_H
0009 #define WFX_HIF_API_CMD_H
0010
0011 #include "hif_api_general.h"
0012
0013 enum wfx_hif_requests_ids {
0014 HIF_REQ_ID_RESET = 0x0a,
0015 HIF_REQ_ID_READ_MIB = 0x05,
0016 HIF_REQ_ID_WRITE_MIB = 0x06,
0017 HIF_REQ_ID_START_SCAN = 0x07,
0018 HIF_REQ_ID_STOP_SCAN = 0x08,
0019 HIF_REQ_ID_TX = 0x04,
0020 HIF_REQ_ID_JOIN = 0x0b,
0021 HIF_REQ_ID_SET_PM_MODE = 0x10,
0022 HIF_REQ_ID_SET_BSS_PARAMS = 0x11,
0023 HIF_REQ_ID_ADD_KEY = 0x0c,
0024 HIF_REQ_ID_REMOVE_KEY = 0x0d,
0025 HIF_REQ_ID_EDCA_QUEUE_PARAMS = 0x13,
0026 HIF_REQ_ID_START = 0x17,
0027 HIF_REQ_ID_BEACON_TRANSMIT = 0x18,
0028 HIF_REQ_ID_UPDATE_IE = 0x1b,
0029 HIF_REQ_ID_MAP_LINK = 0x1c,
0030 };
0031
0032 enum wfx_hif_confirmations_ids {
0033 HIF_CNF_ID_RESET = 0x0a,
0034 HIF_CNF_ID_READ_MIB = 0x05,
0035 HIF_CNF_ID_WRITE_MIB = 0x06,
0036 HIF_CNF_ID_START_SCAN = 0x07,
0037 HIF_CNF_ID_STOP_SCAN = 0x08,
0038 HIF_CNF_ID_TX = 0x04,
0039 HIF_CNF_ID_MULTI_TRANSMIT = 0x1e,
0040 HIF_CNF_ID_JOIN = 0x0b,
0041 HIF_CNF_ID_SET_PM_MODE = 0x10,
0042 HIF_CNF_ID_SET_BSS_PARAMS = 0x11,
0043 HIF_CNF_ID_ADD_KEY = 0x0c,
0044 HIF_CNF_ID_REMOVE_KEY = 0x0d,
0045 HIF_CNF_ID_EDCA_QUEUE_PARAMS = 0x13,
0046 HIF_CNF_ID_START = 0x17,
0047 HIF_CNF_ID_BEACON_TRANSMIT = 0x18,
0048 HIF_CNF_ID_UPDATE_IE = 0x1b,
0049 HIF_CNF_ID_MAP_LINK = 0x1c,
0050 };
0051
0052 enum wfx_hif_indications_ids {
0053 HIF_IND_ID_RX = 0x84,
0054 HIF_IND_ID_SCAN_CMPL = 0x86,
0055 HIF_IND_ID_JOIN_COMPLETE = 0x8f,
0056 HIF_IND_ID_SET_PM_MODE_CMPL = 0x89,
0057 HIF_IND_ID_SUSPEND_RESUME_TX = 0x8c,
0058 HIF_IND_ID_EVENT = 0x85
0059 };
0060
0061 struct wfx_hif_req_reset {
0062 u8 reset_stat:1;
0063 u8 reset_all_int:1;
0064 u8 reserved1:6;
0065 u8 reserved2[3];
0066 } __packed;
0067
0068 struct wfx_hif_cnf_reset {
0069 __le32 status;
0070 } __packed;
0071
0072 struct wfx_hif_req_read_mib {
0073 __le16 mib_id;
0074 __le16 reserved;
0075 } __packed;
0076
0077 struct wfx_hif_cnf_read_mib {
0078 __le32 status;
0079 __le16 mib_id;
0080 __le16 length;
0081 u8 mib_data[];
0082 } __packed;
0083
0084 struct wfx_hif_req_write_mib {
0085 __le16 mib_id;
0086 __le16 length;
0087 u8 mib_data[];
0088 } __packed;
0089
0090 struct wfx_hif_cnf_write_mib {
0091 __le32 status;
0092 } __packed;
0093
0094 struct wfx_hif_req_update_ie {
0095 u8 beacon:1;
0096 u8 probe_resp:1;
0097 u8 probe_req:1;
0098 u8 reserved1:5;
0099 u8 reserved2;
0100 __le16 num_ies;
0101 u8 ie[];
0102 } __packed;
0103
0104 struct wfx_hif_cnf_update_ie {
0105 __le32 status;
0106 } __packed;
0107
0108 struct wfx_hif_ssid_def {
0109 __le32 ssid_length;
0110 u8 ssid[IEEE80211_MAX_SSID_LEN];
0111 } __packed;
0112
0113 #define HIF_API_MAX_NB_SSIDS 2
0114 #define HIF_API_MAX_NB_CHANNELS 14
0115
0116 struct wfx_hif_req_start_scan_alt {
0117 u8 band;
0118 u8 maintain_current_bss:1;
0119 u8 periodic:1;
0120 u8 reserved1:6;
0121 u8 disallow_ps:1;
0122 u8 reserved2:1;
0123 u8 short_preamble:1;
0124 u8 reserved3:5;
0125 u8 max_transmit_rate;
0126 __le16 periodic_interval;
0127 u8 reserved4;
0128 s8 periodic_rssi_thr;
0129 u8 num_of_probe_requests;
0130 u8 probe_delay;
0131 u8 num_of_ssids;
0132 u8 num_of_channels;
0133 __le32 min_channel_time;
0134 __le32 max_channel_time;
0135 __le32 tx_power_level;
0136 struct wfx_hif_ssid_def ssid_def[HIF_API_MAX_NB_SSIDS];
0137 u8 channel_list[];
0138 } __packed;
0139
0140 struct wfx_hif_cnf_start_scan {
0141 __le32 status;
0142 } __packed;
0143
0144 struct wfx_hif_cnf_stop_scan {
0145 __le32 status;
0146 } __packed;
0147
0148 enum wfx_hif_pm_mode_status {
0149 HIF_PM_MODE_ACTIVE = 0x0,
0150 HIF_PM_MODE_PS = 0x1,
0151 HIF_PM_MODE_UNDETERMINED = 0x2
0152 };
0153
0154 struct wfx_hif_ind_scan_cmpl {
0155 __le32 status;
0156 u8 pm_mode;
0157 u8 num_channels_completed;
0158 __le16 reserved;
0159 } __packed;
0160
0161 enum wfx_hif_queue_id {
0162 HIF_QUEUE_ID_BACKGROUND = 0x0,
0163 HIF_QUEUE_ID_BESTEFFORT = 0x1,
0164 HIF_QUEUE_ID_VIDEO = 0x2,
0165 HIF_QUEUE_ID_VOICE = 0x3
0166 };
0167
0168 enum wfx_hif_frame_format {
0169 HIF_FRAME_FORMAT_NON_HT = 0x0,
0170 HIF_FRAME_FORMAT_MIXED_FORMAT_HT = 0x1,
0171 HIF_FRAME_FORMAT_GF_HT_11N = 0x2
0172 };
0173
0174 struct wfx_hif_req_tx {
0175
0176
0177
0178 u32 packet_id;
0179 u8 max_tx_rate;
0180 u8 queue_id:2;
0181 u8 peer_sta_id:4;
0182 u8 reserved1:2;
0183 u8 more:1;
0184 u8 fc_offset:3;
0185 u8 after_dtim:1;
0186 u8 reserved2:3;
0187 u8 start_exp:1;
0188 u8 reserved3:3;
0189 u8 retry_policy_index:4;
0190 __le32 reserved4;
0191 __le32 expire_time;
0192 u8 frame_format:4;
0193 u8 fec_coding:1;
0194 u8 short_gi:1;
0195 u8 reserved5:1;
0196 u8 stbc:1;
0197 u8 reserved6;
0198 u8 aggregation:1;
0199 u8 reserved7:7;
0200 u8 reserved8;
0201 u8 frame[];
0202 } __packed;
0203
0204 enum wfx_hif_qos_ackplcy {
0205 HIF_QOS_ACKPLCY_NORMAL = 0x0,
0206 HIF_QOS_ACKPLCY_TXNOACK = 0x1,
0207 HIF_QOS_ACKPLCY_NOEXPACK = 0x2,
0208 HIF_QOS_ACKPLCY_BLCKACK = 0x3
0209 };
0210
0211 struct wfx_hif_cnf_tx {
0212 __le32 status;
0213
0214
0215
0216 u32 packet_id;
0217 u8 txed_rate;
0218 u8 ack_failures;
0219 u8 aggr:1;
0220 u8 requeue:1;
0221 u8 ack_policy:2;
0222 u8 txop_limit:1;
0223 u8 reserved1:3;
0224 u8 reserved2;
0225 __le32 media_delay;
0226 __le32 tx_queue_delay;
0227 } __packed;
0228
0229 struct wfx_hif_cnf_multi_transmit {
0230 u8 num_tx_confs;
0231 u8 reserved[3];
0232 struct wfx_hif_cnf_tx tx_conf_payload[];
0233 } __packed;
0234
0235 enum wfx_hif_ri_flags_encrypt {
0236 HIF_RI_FLAGS_UNENCRYPTED = 0x0,
0237 HIF_RI_FLAGS_WEP_ENCRYPTED = 0x1,
0238 HIF_RI_FLAGS_TKIP_ENCRYPTED = 0x2,
0239 HIF_RI_FLAGS_AES_ENCRYPTED = 0x3,
0240 HIF_RI_FLAGS_WAPI_ENCRYPTED = 0x4
0241 };
0242
0243 struct wfx_hif_ind_rx {
0244 __le32 status;
0245 u8 channel_number;
0246 u8 reserved1;
0247 u8 rxed_rate;
0248 u8 rcpi_rssi;
0249 u8 encryp:3;
0250 u8 in_aggr:1;
0251 u8 first_aggr:1;
0252 u8 last_aggr:1;
0253 u8 defrag:1;
0254 u8 beacon:1;
0255 u8 tim:1;
0256 u8 bitmap:1;
0257 u8 match_ssid:1;
0258 u8 match_bssid:1;
0259 u8 more:1;
0260 u8 reserved2:1;
0261 u8 ht:1;
0262 u8 stbc:1;
0263 u8 match_uc_addr:1;
0264 u8 match_mc_addr:1;
0265 u8 match_bc_addr:1;
0266 u8 key_type:1;
0267 u8 key_index:4;
0268 u8 reserved3:1;
0269 u8 peer_sta_id:4;
0270 u8 reserved4:2;
0271 u8 reserved5:1;
0272 u8 frame[];
0273 } __packed;
0274
0275 struct wfx_hif_req_edca_queue_params {
0276 u8 queue_id;
0277 u8 reserved1;
0278 u8 aifsn;
0279 u8 reserved2;
0280 __le16 cw_min;
0281 __le16 cw_max;
0282 __le16 tx_op_limit;
0283 __le16 allowed_medium_time;
0284 __le32 reserved3;
0285 } __packed;
0286
0287 struct wfx_hif_cnf_edca_queue_params {
0288 __le32 status;
0289 } __packed;
0290
0291 struct wfx_hif_req_join {
0292 u8 infrastructure_bss_mode:1;
0293 u8 reserved1:7;
0294 u8 band;
0295 u8 channel_number;
0296 u8 reserved2;
0297 u8 bssid[ETH_ALEN];
0298 __le16 atim_window;
0299 u8 short_preamble:1;
0300 u8 reserved3:7;
0301 u8 probe_for_join;
0302 u8 reserved4;
0303 u8 reserved5:2;
0304 u8 force_no_beacon:1;
0305 u8 force_with_ind:1;
0306 u8 reserved6:4;
0307 __le32 ssid_length;
0308 u8 ssid[IEEE80211_MAX_SSID_LEN];
0309 __le32 beacon_interval;
0310 __le32 basic_rate_set;
0311 } __packed;
0312
0313 struct wfx_hif_cnf_join {
0314 __le32 status;
0315 } __packed;
0316
0317 struct wfx_hif_ind_join_complete {
0318 __le32 status;
0319 } __packed;
0320
0321 struct wfx_hif_req_set_bss_params {
0322 u8 lost_count_only:1;
0323 u8 reserved:7;
0324 u8 beacon_lost_count;
0325 __le16 aid;
0326 __le32 operational_rate_set;
0327 } __packed;
0328
0329 struct wfx_hif_cnf_set_bss_params {
0330 __le32 status;
0331 } __packed;
0332
0333 struct wfx_hif_req_set_pm_mode {
0334 u8 enter_psm:1;
0335 u8 reserved:6;
0336 u8 fast_psm:1;
0337 u8 fast_psm_idle_period;
0338 u8 ap_psm_change_period;
0339 u8 min_auto_ps_poll_period;
0340 } __packed;
0341
0342 struct wfx_hif_cnf_set_pm_mode {
0343 __le32 status;
0344 } __packed;
0345
0346 struct wfx_hif_ind_set_pm_mode_cmpl {
0347 __le32 status;
0348 u8 pm_mode;
0349 u8 reserved[3];
0350 } __packed;
0351
0352 struct wfx_hif_req_start {
0353 u8 mode;
0354 u8 band;
0355 u8 channel_number;
0356 u8 reserved1;
0357 __le32 reserved2;
0358 __le32 beacon_interval;
0359 u8 dtim_period;
0360 u8 short_preamble:1;
0361 u8 reserved3:7;
0362 u8 reserved4;
0363 u8 ssid_length;
0364 u8 ssid[IEEE80211_MAX_SSID_LEN];
0365 __le32 basic_rate_set;
0366 } __packed;
0367
0368 struct wfx_hif_cnf_start {
0369 __le32 status;
0370 } __packed;
0371
0372 struct wfx_hif_req_beacon_transmit {
0373 u8 enable_beaconing;
0374 u8 reserved[3];
0375 } __packed;
0376
0377 struct wfx_hif_cnf_beacon_transmit {
0378 __le32 status;
0379 } __packed;
0380
0381 #define HIF_LINK_ID_MAX 14
0382 #define HIF_LINK_ID_NOT_ASSOCIATED (HIF_LINK_ID_MAX + 1)
0383
0384 struct wfx_hif_req_map_link {
0385 u8 mac_addr[ETH_ALEN];
0386 u8 unmap:1;
0387 u8 mfpc:1;
0388 u8 reserved:6;
0389 u8 peer_sta_id;
0390 } __packed;
0391
0392 struct wfx_hif_cnf_map_link {
0393 __le32 status;
0394 } __packed;
0395
0396 struct wfx_hif_ind_suspend_resume_tx {
0397 u8 resume:1;
0398 u8 reserved1:2;
0399 u8 bc_mc_only:1;
0400 u8 reserved2:4;
0401 u8 reserved3;
0402 __le16 peer_sta_set;
0403 } __packed;
0404
0405
0406 #define MAX_KEY_ENTRIES 24
0407 #define HIF_API_WEP_KEY_DATA_SIZE 16
0408 #define HIF_API_TKIP_KEY_DATA_SIZE 16
0409 #define HIF_API_RX_MIC_KEY_SIZE 8
0410 #define HIF_API_TX_MIC_KEY_SIZE 8
0411 #define HIF_API_AES_KEY_DATA_SIZE 16
0412 #define HIF_API_WAPI_KEY_DATA_SIZE 16
0413 #define HIF_API_MIC_KEY_DATA_SIZE 16
0414 #define HIF_API_IGTK_KEY_DATA_SIZE 16
0415 #define HIF_API_RX_SEQUENCE_COUNTER_SIZE 8
0416 #define HIF_API_IPN_SIZE 8
0417
0418 enum wfx_hif_key_type {
0419 HIF_KEY_TYPE_WEP_DEFAULT = 0x0,
0420 HIF_KEY_TYPE_WEP_PAIRWISE = 0x1,
0421 HIF_KEY_TYPE_TKIP_GROUP = 0x2,
0422 HIF_KEY_TYPE_TKIP_PAIRWISE = 0x3,
0423 HIF_KEY_TYPE_AES_GROUP = 0x4,
0424 HIF_KEY_TYPE_AES_PAIRWISE = 0x5,
0425 HIF_KEY_TYPE_WAPI_GROUP = 0x6,
0426 HIF_KEY_TYPE_WAPI_PAIRWISE = 0x7,
0427 HIF_KEY_TYPE_IGTK_GROUP = 0x8,
0428 HIF_KEY_TYPE_NONE = 0x9
0429 };
0430
0431 struct wfx_hif_wep_pairwise_key {
0432 u8 peer_address[ETH_ALEN];
0433 u8 reserved;
0434 u8 key_length;
0435 u8 key_data[HIF_API_WEP_KEY_DATA_SIZE];
0436 } __packed;
0437
0438 struct wfx_hif_wep_group_key {
0439 u8 key_id;
0440 u8 key_length;
0441 u8 reserved[2];
0442 u8 key_data[HIF_API_WEP_KEY_DATA_SIZE];
0443 } __packed;
0444
0445 struct wfx_hif_tkip_pairwise_key {
0446 u8 peer_address[ETH_ALEN];
0447 u8 reserved[2];
0448 u8 tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE];
0449 u8 rx_mic_key[HIF_API_RX_MIC_KEY_SIZE];
0450 u8 tx_mic_key[HIF_API_TX_MIC_KEY_SIZE];
0451 } __packed;
0452
0453 struct wfx_hif_tkip_group_key {
0454 u8 tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE];
0455 u8 rx_mic_key[HIF_API_RX_MIC_KEY_SIZE];
0456 u8 key_id;
0457 u8 reserved[3];
0458 u8 rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE];
0459 } __packed;
0460
0461 struct wfx_hif_aes_pairwise_key {
0462 u8 peer_address[ETH_ALEN];
0463 u8 reserved[2];
0464 u8 aes_key_data[HIF_API_AES_KEY_DATA_SIZE];
0465 } __packed;
0466
0467 struct wfx_hif_aes_group_key {
0468 u8 aes_key_data[HIF_API_AES_KEY_DATA_SIZE];
0469 u8 key_id;
0470 u8 reserved[3];
0471 u8 rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE];
0472 } __packed;
0473
0474 struct wfx_hif_wapi_pairwise_key {
0475 u8 peer_address[ETH_ALEN];
0476 u8 key_id;
0477 u8 reserved;
0478 u8 wapi_key_data[HIF_API_WAPI_KEY_DATA_SIZE];
0479 u8 mic_key_data[HIF_API_MIC_KEY_DATA_SIZE];
0480 } __packed;
0481
0482 struct wfx_hif_wapi_group_key {
0483 u8 wapi_key_data[HIF_API_WAPI_KEY_DATA_SIZE];
0484 u8 mic_key_data[HIF_API_MIC_KEY_DATA_SIZE];
0485 u8 key_id;
0486 u8 reserved[3];
0487 } __packed;
0488
0489 struct wfx_hif_igtk_group_key {
0490 u8 igtk_key_data[HIF_API_IGTK_KEY_DATA_SIZE];
0491 u8 key_id;
0492 u8 reserved[3];
0493 u8 ipn[HIF_API_IPN_SIZE];
0494 } __packed;
0495
0496 struct wfx_hif_req_add_key {
0497 u8 type;
0498 u8 entry_index;
0499 u8 int_id:2;
0500 u8 reserved1:6;
0501 u8 reserved2;
0502 union {
0503 struct wfx_hif_wep_pairwise_key wep_pairwise_key;
0504 struct wfx_hif_wep_group_key wep_group_key;
0505 struct wfx_hif_tkip_pairwise_key tkip_pairwise_key;
0506 struct wfx_hif_tkip_group_key tkip_group_key;
0507 struct wfx_hif_aes_pairwise_key aes_pairwise_key;
0508 struct wfx_hif_aes_group_key aes_group_key;
0509 struct wfx_hif_wapi_pairwise_key wapi_pairwise_key;
0510 struct wfx_hif_wapi_group_key wapi_group_key;
0511 struct wfx_hif_igtk_group_key igtk_group_key;
0512 } key;
0513 } __packed;
0514
0515 struct wfx_hif_cnf_add_key {
0516 __le32 status;
0517 } __packed;
0518
0519 struct wfx_hif_req_remove_key {
0520 u8 entry_index;
0521 u8 reserved[3];
0522 } __packed;
0523
0524 struct wfx_hif_cnf_remove_key {
0525 __le32 status;
0526 } __packed;
0527
0528 enum wfx_hif_event_ind {
0529 HIF_EVENT_IND_BSSLOST = 0x1,
0530 HIF_EVENT_IND_BSSREGAINED = 0x2,
0531 HIF_EVENT_IND_RCPI_RSSI = 0x3,
0532 HIF_EVENT_IND_PS_MODE_ERROR = 0x4,
0533 HIF_EVENT_IND_INACTIVITY = 0x5
0534 };
0535
0536 enum wfx_hif_ps_mode_error {
0537 HIF_PS_ERROR_NO_ERROR = 0,
0538 HIF_PS_ERROR_AP_NOT_RESP_TO_POLL = 1,
0539 HIF_PS_ERROR_AP_NOT_RESP_TO_UAPSD_TRIGGER = 2,
0540 HIF_PS_ERROR_AP_SENT_UNICAST_IN_DOZE = 3,
0541 HIF_PS_ERROR_AP_NO_DATA_AFTER_TIM = 4
0542 };
0543
0544 struct wfx_hif_ind_event {
0545 __le32 event_id;
0546 union {
0547 u8 rcpi_rssi;
0548 __le32 ps_mode_error;
0549 __le32 peer_sta_set;
0550 } event_data;
0551 } __packed;
0552
0553 #endif