Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: wfx: import HIF API headers

These files are shared with firmware sources. Only a subset of these
definitions are used by driver but, for now, it is easier to import all.

API defines 3 kinds of messages:
- Requests (req) are sent from host to chip
- Confirmations (cnf) are sent by chip and are always in reply to a
request
- Indications (ind) are spontaneous message from chip to host

One request normally generate one confirmation. There are a few
exceptions to this rule:
- "shutdown" request is not acknowledged
- multiple tx request can be acknowledged a unique "multi-tx"
confirmation

In add, API defines MIB. They are sub-structures for write_mib and
read_mib API.

Note that all numbers in API have to be little endian when sent/received
from/to chip (I didn't declared them with __le32 because driver also use
them internally).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jérôme Pouiller and committed by
Greg Kroah-Hartman
e4ee3cb3 652b4afb

+1676
+681
drivers/staging/wfx/hif_api_cmd.h
··· 1 + /* SPDX-License-Identifier: Apache-2.0 */ 2 + /* 3 + * WFx hardware interface definitions 4 + * 5 + * Copyright (c) 2018-2019, Silicon Laboratories Inc. 6 + */ 7 + 8 + #ifndef WFX_HIF_API_CMD_H 9 + #define WFX_HIF_API_CMD_H 10 + 11 + #include "hif_api_general.h" 12 + 13 + #define HIF_NUM_AC 4 14 + 15 + #define HIF_API_SSID_SIZE API_SSID_SIZE 16 + 17 + enum hif_requests_ids { 18 + HIF_REQ_ID_RESET = 0x0a, 19 + HIF_REQ_ID_READ_MIB = 0x05, 20 + HIF_REQ_ID_WRITE_MIB = 0x06, 21 + HIF_REQ_ID_START_SCAN = 0x07, 22 + HIF_REQ_ID_STOP_SCAN = 0x08, 23 + HIF_REQ_ID_TX = 0x04, 24 + HIF_REQ_ID_JOIN = 0x0b, 25 + HIF_REQ_ID_SET_PM_MODE = 0x10, 26 + HIF_REQ_ID_SET_BSS_PARAMS = 0x11, 27 + HIF_REQ_ID_ADD_KEY = 0x0c, 28 + HIF_REQ_ID_REMOVE_KEY = 0x0d, 29 + HIF_REQ_ID_EDCA_QUEUE_PARAMS = 0x13, 30 + HIF_REQ_ID_START = 0x17, 31 + HIF_REQ_ID_BEACON_TRANSMIT = 0x18, 32 + HIF_REQ_ID_UPDATE_IE = 0x1b, 33 + HIF_REQ_ID_MAP_LINK = 0x1c, 34 + }; 35 + 36 + enum hif_confirmations_ids { 37 + HIF_CNF_ID_RESET = 0x0a, 38 + HIF_CNF_ID_READ_MIB = 0x05, 39 + HIF_CNF_ID_WRITE_MIB = 0x06, 40 + HIF_CNF_ID_START_SCAN = 0x07, 41 + HIF_CNF_ID_STOP_SCAN = 0x08, 42 + HIF_CNF_ID_TX = 0x04, 43 + HIF_CNF_ID_MULTI_TRANSMIT = 0x1e, 44 + HIF_CNF_ID_JOIN = 0x0b, 45 + HIF_CNF_ID_SET_PM_MODE = 0x10, 46 + HIF_CNF_ID_SET_BSS_PARAMS = 0x11, 47 + HIF_CNF_ID_ADD_KEY = 0x0c, 48 + HIF_CNF_ID_REMOVE_KEY = 0x0d, 49 + HIF_CNF_ID_EDCA_QUEUE_PARAMS = 0x13, 50 + HIF_CNF_ID_START = 0x17, 51 + HIF_CNF_ID_BEACON_TRANSMIT = 0x18, 52 + HIF_CNF_ID_UPDATE_IE = 0x1b, 53 + HIF_CNF_ID_MAP_LINK = 0x1c, 54 + }; 55 + 56 + enum hif_indications_ids { 57 + HIF_IND_ID_RX = 0x84, 58 + HIF_IND_ID_SCAN_CMPL = 0x86, 59 + HIF_IND_ID_JOIN_COMPLETE = 0x8f, 60 + HIF_IND_ID_SET_PM_MODE_CMPL = 0x89, 61 + HIF_IND_ID_SUSPEND_RESUME_TX = 0x8c, 62 + HIF_IND_ID_EVENT = 0x85 63 + }; 64 + 65 + union hif_commands_ids { 66 + enum hif_requests_ids request; 67 + enum hif_confirmations_ids confirmation; 68 + enum hif_indications_ids indication; 69 + }; 70 + 71 + enum hif_status { 72 + HIF_STATUS_SUCCESS = 0x0, 73 + HIF_STATUS_FAILURE = 0x1, 74 + HIF_INVALID_PARAMETER = 0x2, 75 + HIF_STATUS_WARNING = 0x3, 76 + HIF_ERROR_UNSUPPORTED_MSG_ID = 0x4, 77 + HIF_STATUS_DECRYPTFAILURE = 0x10, 78 + HIF_STATUS_MICFAILURE = 0x11, 79 + HIF_STATUS_NO_KEY_FOUND = 0x12, 80 + HIF_STATUS_RETRY_EXCEEDED = 0x13, 81 + HIF_STATUS_TX_LIFETIME_EXCEEDED = 0x14, 82 + HIF_REQUEUE = 0x15, 83 + HIF_STATUS_REFUSED = 0x16, 84 + HIF_STATUS_BUSY = 0x17 85 + }; 86 + 87 + struct hif_reset_flags { 88 + uint8_t reset_stat:1; 89 + uint8_t reset_all_int:1; 90 + uint8_t reserved1:6; 91 + uint8_t reserved2[3]; 92 + } __packed; 93 + 94 + struct hif_req_reset { 95 + struct hif_reset_flags reset_flags; 96 + } __packed; 97 + 98 + struct hif_cnf_reset { 99 + uint32_t status; 100 + } __packed; 101 + 102 + struct hif_req_read_mib { 103 + uint16_t mib_id; 104 + uint16_t reserved; 105 + } __packed; 106 + 107 + struct hif_cnf_read_mib { 108 + uint32_t status; 109 + uint16_t mib_id; 110 + uint16_t length; 111 + uint8_t mib_data[]; 112 + } __packed; 113 + 114 + struct hif_req_write_mib { 115 + uint16_t mib_id; 116 + uint16_t length; 117 + uint8_t mib_data[]; 118 + } __packed; 119 + 120 + struct hif_cnf_write_mib { 121 + uint32_t status; 122 + } __packed; 123 + 124 + struct hif_ie_flags { 125 + uint8_t beacon:1; 126 + uint8_t probe_resp:1; 127 + uint8_t probe_req:1; 128 + uint8_t reserved1:5; 129 + uint8_t reserved2; 130 + } __packed; 131 + 132 + struct hif_ie_tlv { 133 + uint8_t type; 134 + uint8_t length; 135 + uint8_t data[]; 136 + } __packed; 137 + 138 + struct hif_req_update_ie { 139 + struct hif_ie_flags ie_flags; 140 + uint16_t num_i_es; 141 + struct hif_ie_tlv ie[]; 142 + } __packed; 143 + 144 + struct hif_cnf_update_ie { 145 + uint32_t status; 146 + } __packed; 147 + 148 + struct hif_scan_type { 149 + uint8_t type:1; 150 + uint8_t mode:1; 151 + uint8_t reserved:6; 152 + } __packed; 153 + 154 + struct hif_scan_flags { 155 + uint8_t fbg:1; 156 + uint8_t reserved1:1; 157 + uint8_t pre:1; 158 + uint8_t reserved2:5; 159 + } __packed; 160 + 161 + struct hif_auto_scan_param { 162 + uint16_t interval; 163 + uint8_t reserved; 164 + int8_t rssi_thr; 165 + } __packed; 166 + 167 + struct hif_ssid_def { 168 + uint32_t ssid_length; 169 + uint8_t ssid[HIF_API_SSID_SIZE]; 170 + } __packed; 171 + 172 + #define HIF_API_MAX_NB_SSIDS 2 173 + #define HIF_API_MAX_NB_CHANNELS 14 174 + 175 + struct hif_req_start_scan { 176 + uint8_t band; 177 + struct hif_scan_type scan_type; 178 + struct hif_scan_flags scan_flags; 179 + uint8_t max_transmit_rate; 180 + struct hif_auto_scan_param auto_scan_param; 181 + uint8_t num_of_probe_requests; 182 + uint8_t probe_delay; 183 + uint8_t num_of_ssi_ds; 184 + uint8_t num_of_channels; 185 + uint32_t min_channel_time; 186 + uint32_t max_channel_time; 187 + int32_t tx_power_level; 188 + uint8_t ssid_and_channel_lists[]; 189 + } __packed; 190 + 191 + struct hif_start_scan_req_cstnbssid_body { 192 + uint8_t band; 193 + struct hif_scan_type scan_type; 194 + struct hif_scan_flags scan_flags; 195 + uint8_t max_transmit_rate; 196 + struct hif_auto_scan_param auto_scan_param; 197 + uint8_t num_of_probe_requests; 198 + uint8_t probe_delay; 199 + uint8_t num_of_ssi_ds; 200 + uint8_t num_of_channels; 201 + uint32_t min_channel_time; 202 + uint32_t max_channel_time; 203 + int32_t tx_power_level; 204 + struct hif_ssid_def ssid_def[HIF_API_MAX_NB_SSIDS]; 205 + uint8_t channel_list[]; 206 + } __packed; 207 + 208 + struct hif_cnf_start_scan { 209 + uint32_t status; 210 + } __packed; 211 + 212 + struct hif_cnf_stop_scan { 213 + uint32_t status; 214 + } __packed; 215 + 216 + enum hif_pm_mode_status { 217 + HIF_PM_MODE_ACTIVE = 0x0, 218 + HIF_PM_MODE_PS = 0x1, 219 + HIF_PM_MODE_UNDETERMINED = 0x2 220 + }; 221 + 222 + struct hif_ind_scan_cmpl { 223 + uint32_t status; 224 + uint8_t pm_mode; 225 + uint8_t num_channels_completed; 226 + uint16_t reserved; 227 + } __packed; 228 + 229 + enum hif_queue_id { 230 + HIF_QUEUE_ID_BACKGROUND = 0x0, 231 + HIF_QUEUE_ID_BESTEFFORT = 0x1, 232 + HIF_QUEUE_ID_VIDEO = 0x2, 233 + HIF_QUEUE_ID_VOICE = 0x3 234 + }; 235 + 236 + enum hif_frame_format { 237 + HIF_FRAME_FORMAT_NON_HT = 0x0, 238 + HIF_FRAME_FORMAT_MIXED_FORMAT_HT = 0x1, 239 + HIF_FRAME_FORMAT_GF_HT_11N = 0x2 240 + }; 241 + 242 + enum hif_stbc { 243 + HIF_STBC_NOT_ALLOWED = 0x0, 244 + HIF_STBC_ALLOWED = 0x1 245 + }; 246 + 247 + struct hif_queue { 248 + uint8_t queue_id:2; 249 + uint8_t peer_sta_id:4; 250 + uint8_t reserved:2; 251 + } __packed; 252 + 253 + struct hif_data_flags { 254 + uint8_t more:1; 255 + uint8_t fc_offset:3; 256 + uint8_t reserved:4; 257 + } __packed; 258 + 259 + struct hif_tx_flags { 260 + uint8_t start_exp:1; 261 + uint8_t reserved:3; 262 + uint8_t retry_policy_index:4; 263 + } __packed; 264 + 265 + struct hif_ht_tx_parameters { 266 + uint8_t frame_format:4; 267 + uint8_t fec_coding:1; 268 + uint8_t short_gi:1; 269 + uint8_t reserved1:1; 270 + uint8_t stbc:1; 271 + uint8_t reserved2; 272 + uint8_t aggregation:1; 273 + uint8_t reserved3:7; 274 + uint8_t reserved4; 275 + } __packed; 276 + 277 + struct hif_req_tx { 278 + uint32_t packet_id; 279 + uint8_t max_tx_rate; 280 + struct hif_queue queue_id; 281 + struct hif_data_flags data_flags; 282 + struct hif_tx_flags tx_flags; 283 + uint32_t reserved; 284 + uint32_t expire_time; 285 + struct hif_ht_tx_parameters ht_tx_parameters; 286 + uint8_t frame[]; 287 + } __packed; 288 + 289 + enum hif_qos_ackplcy { 290 + HIF_QOS_ACKPLCY_NORMAL = 0x0, 291 + HIF_QOS_ACKPLCY_TXNOACK = 0x1, 292 + HIF_QOS_ACKPLCY_NOEXPACK = 0x2, 293 + HIF_QOS_ACKPLCY_BLCKACK = 0x3 294 + }; 295 + 296 + struct hif_tx_result_flags { 297 + uint8_t aggr:1; 298 + uint8_t requeue:1; 299 + uint8_t ack_policy:2; 300 + uint8_t txop_limit:1; 301 + uint8_t reserved1:3; 302 + uint8_t reserved2; 303 + } __packed; 304 + 305 + struct hif_cnf_tx { 306 + uint32_t status; 307 + uint32_t packet_id; 308 + uint8_t txed_rate; 309 + uint8_t ack_failures; 310 + struct hif_tx_result_flags tx_result_flags; 311 + uint32_t media_delay; 312 + uint32_t tx_queue_delay; 313 + } __packed; 314 + 315 + struct hif_cnf_multi_transmit { 316 + uint32_t num_tx_confs; 317 + struct hif_cnf_tx tx_conf_payload[]; 318 + } __packed; 319 + 320 + enum hif_ri_flags_encrypt { 321 + HIF_RI_FLAGS_UNENCRYPTED = 0x0, 322 + HIF_RI_FLAGS_WEP_ENCRYPTED = 0x1, 323 + HIF_RI_FLAGS_TKIP_ENCRYPTED = 0x2, 324 + HIF_RI_FLAGS_AES_ENCRYPTED = 0x3, 325 + HIF_RI_FLAGS_WAPI_ENCRYPTED = 0x4 326 + }; 327 + 328 + struct hif_rx_flags { 329 + uint8_t encryp:3; 330 + uint8_t in_aggr:1; 331 + uint8_t first_aggr:1; 332 + uint8_t last_aggr:1; 333 + uint8_t defrag:1; 334 + uint8_t beacon:1; 335 + uint8_t tim:1; 336 + uint8_t bitmap:1; 337 + uint8_t match_ssid:1; 338 + uint8_t match_bssid:1; 339 + uint8_t more:1; 340 + uint8_t reserved1:1; 341 + uint8_t ht:1; 342 + uint8_t stbc:1; 343 + uint8_t match_uc_addr:1; 344 + uint8_t match_mc_addr:1; 345 + uint8_t match_bc_addr:1; 346 + uint8_t key_type:1; 347 + uint8_t key_index:4; 348 + uint8_t reserved2:1; 349 + uint8_t peer_sta_id:4; 350 + uint8_t reserved3:2; 351 + uint8_t reserved4:1; 352 + } __packed; 353 + 354 + struct hif_ind_rx { 355 + uint32_t status; 356 + uint16_t channel_number; 357 + uint8_t rxed_rate; 358 + uint8_t rcpi_rssi; 359 + struct hif_rx_flags rx_flags; 360 + uint8_t frame[]; 361 + } __packed; 362 + 363 + 364 + struct hif_req_edca_queue_params { 365 + uint8_t queue_id; 366 + uint8_t reserved1; 367 + uint8_t aifsn; 368 + uint8_t reserved2; 369 + uint16_t cw_min; 370 + uint16_t cw_max; 371 + uint16_t tx_op_limit; 372 + uint16_t allowed_medium_time; 373 + uint32_t reserved3; 374 + } __packed; 375 + 376 + struct hif_cnf_edca_queue_params { 377 + uint32_t status; 378 + } __packed; 379 + 380 + enum hif_ap_mode { 381 + HIF_MODE_IBSS = 0x0, 382 + HIF_MODE_BSS = 0x1 383 + }; 384 + 385 + enum hif_preamble { 386 + HIF_PREAMBLE_LONG = 0x0, 387 + HIF_PREAMBLE_SHORT = 0x1, 388 + HIF_PREAMBLE_SHORT_LONG12 = 0x2 389 + }; 390 + 391 + struct hif_join_flags { 392 + uint8_t reserved1:2; 393 + uint8_t force_no_beacon:1; 394 + uint8_t force_with_ind:1; 395 + uint8_t reserved2:4; 396 + } __packed; 397 + 398 + struct hif_req_join { 399 + uint8_t mode; 400 + uint8_t band; 401 + uint16_t channel_number; 402 + uint8_t bssid[ETH_ALEN]; 403 + uint16_t atim_window; 404 + uint8_t preamble_type; 405 + uint8_t probe_for_join; 406 + uint8_t reserved; 407 + struct hif_join_flags join_flags; 408 + uint32_t ssid_length; 409 + uint8_t ssid[HIF_API_SSID_SIZE]; 410 + uint32_t beacon_interval; 411 + uint32_t basic_rate_set; 412 + } __packed; 413 + 414 + struct hif_cnf_join { 415 + uint32_t status; 416 + } __packed; 417 + 418 + struct hif_ind_join_complete { 419 + uint32_t status; 420 + } __packed; 421 + 422 + struct hif_bss_flags { 423 + uint8_t lost_count_only:1; 424 + uint8_t reserved:7; 425 + } __packed; 426 + 427 + struct hif_req_set_bss_params { 428 + struct hif_bss_flags bss_flags; 429 + uint8_t beacon_lost_count; 430 + uint16_t aid; 431 + uint32_t operational_rate_set; 432 + } __packed; 433 + 434 + struct hif_cnf_set_bss_params { 435 + uint32_t status; 436 + } __packed; 437 + 438 + struct hif_pm_mode { 439 + uint8_t enter_psm:1; 440 + uint8_t reserved:6; 441 + uint8_t fast_psm:1; 442 + } __packed; 443 + 444 + struct hif_req_set_pm_mode { 445 + struct hif_pm_mode pm_mode; 446 + uint8_t fast_psm_idle_period; 447 + uint8_t ap_psm_change_period; 448 + uint8_t min_auto_ps_poll_period; 449 + } __packed; 450 + 451 + struct hif_cnf_set_pm_mode { 452 + uint32_t status; 453 + } __packed; 454 + 455 + struct hif_ind_set_pm_mode_cmpl { 456 + uint32_t status; 457 + uint8_t pm_mode; 458 + uint8_t reserved[3]; 459 + } __packed; 460 + 461 + 462 + struct hif_req_start { 463 + uint8_t mode; 464 + uint8_t band; 465 + uint16_t channel_number; 466 + uint32_t reserved1; 467 + uint32_t beacon_interval; 468 + uint8_t dtim_period; 469 + uint8_t preamble_type; 470 + uint8_t reserved2; 471 + uint8_t ssid_length; 472 + uint8_t ssid[HIF_API_SSID_SIZE]; 473 + uint32_t basic_rate_set; 474 + } __packed; 475 + 476 + struct hif_cnf_start { 477 + uint32_t status; 478 + } __packed; 479 + 480 + enum hif_beacon { 481 + HIF_BEACON_STOP = 0x0, 482 + HIF_BEACON_START = 0x1 483 + }; 484 + 485 + struct hif_req_beacon_transmit { 486 + uint8_t enable_beaconing; 487 + uint8_t reserved[3]; 488 + } __packed; 489 + 490 + struct hif_cnf_beacon_transmit { 491 + uint32_t status; 492 + } __packed; 493 + 494 + enum hif_sta_map_direction { 495 + HIF_STA_MAP = 0x0, 496 + HIF_STA_UNMAP = 0x1 497 + }; 498 + 499 + struct hif_map_link_flags { 500 + uint8_t map_direction:1; 501 + uint8_t mfpc:1; 502 + uint8_t reserved:6; 503 + } __packed; 504 + 505 + struct hif_req_map_link { 506 + uint8_t mac_addr[ETH_ALEN]; 507 + struct hif_map_link_flags map_link_flags; 508 + uint8_t peer_sta_id; 509 + } __packed; 510 + 511 + struct hif_cnf_map_link { 512 + uint32_t status; 513 + } __packed; 514 + 515 + struct hif_suspend_resume_flags { 516 + uint8_t resume:1; 517 + uint8_t reserved1:2; 518 + uint8_t bc_mc_only:1; 519 + uint8_t reserved2:4; 520 + uint8_t reserved3; 521 + } __packed; 522 + 523 + struct hif_ind_suspend_resume_tx { 524 + struct hif_suspend_resume_flags suspend_resume_flags; 525 + uint16_t peer_sta_set; 526 + } __packed; 527 + 528 + 529 + #define MAX_KEY_ENTRIES 24 530 + #define HIF_API_WEP_KEY_DATA_SIZE 16 531 + #define HIF_API_TKIP_KEY_DATA_SIZE 16 532 + #define HIF_API_RX_MIC_KEY_SIZE 8 533 + #define HIF_API_TX_MIC_KEY_SIZE 8 534 + #define HIF_API_AES_KEY_DATA_SIZE 16 535 + #define HIF_API_WAPI_KEY_DATA_SIZE 16 536 + #define HIF_API_MIC_KEY_DATA_SIZE 16 537 + #define HIF_API_IGTK_KEY_DATA_SIZE 16 538 + #define HIF_API_RX_SEQUENCE_COUNTER_SIZE 8 539 + #define HIF_API_IPN_SIZE 8 540 + 541 + enum hif_key_type { 542 + HIF_KEY_TYPE_WEP_DEFAULT = 0x0, 543 + HIF_KEY_TYPE_WEP_PAIRWISE = 0x1, 544 + HIF_KEY_TYPE_TKIP_GROUP = 0x2, 545 + HIF_KEY_TYPE_TKIP_PAIRWISE = 0x3, 546 + HIF_KEY_TYPE_AES_GROUP = 0x4, 547 + HIF_KEY_TYPE_AES_PAIRWISE = 0x5, 548 + HIF_KEY_TYPE_WAPI_GROUP = 0x6, 549 + HIF_KEY_TYPE_WAPI_PAIRWISE = 0x7, 550 + HIF_KEY_TYPE_IGTK_GROUP = 0x8, 551 + HIF_KEY_TYPE_NONE = 0x9 552 + }; 553 + 554 + struct hif_wep_pairwise_key { 555 + uint8_t peer_address[ETH_ALEN]; 556 + uint8_t reserved; 557 + uint8_t key_length; 558 + uint8_t key_data[HIF_API_WEP_KEY_DATA_SIZE]; 559 + } __packed; 560 + 561 + struct hif_wep_group_key { 562 + uint8_t key_id; 563 + uint8_t key_length; 564 + uint8_t reserved[2]; 565 + uint8_t key_data[HIF_API_WEP_KEY_DATA_SIZE]; 566 + } __packed; 567 + 568 + struct hif_tkip_pairwise_key { 569 + uint8_t peer_address[ETH_ALEN]; 570 + uint8_t reserved[2]; 571 + uint8_t tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE]; 572 + uint8_t rx_mic_key[HIF_API_RX_MIC_KEY_SIZE]; 573 + uint8_t tx_mic_key[HIF_API_TX_MIC_KEY_SIZE]; 574 + } __packed; 575 + 576 + struct hif_tkip_group_key { 577 + uint8_t tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE]; 578 + uint8_t rx_mic_key[HIF_API_RX_MIC_KEY_SIZE]; 579 + uint8_t key_id; 580 + uint8_t reserved[3]; 581 + uint8_t rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE]; 582 + } __packed; 583 + 584 + struct hif_aes_pairwise_key { 585 + uint8_t peer_address[ETH_ALEN]; 586 + uint8_t reserved[2]; 587 + uint8_t aes_key_data[HIF_API_AES_KEY_DATA_SIZE]; 588 + } __packed; 589 + 590 + struct hif_aes_group_key { 591 + uint8_t aes_key_data[HIF_API_AES_KEY_DATA_SIZE]; 592 + uint8_t key_id; 593 + uint8_t reserved[3]; 594 + uint8_t rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE]; 595 + } __packed; 596 + 597 + struct hif_wapi_pairwise_key { 598 + uint8_t peer_address[ETH_ALEN]; 599 + uint8_t key_id; 600 + uint8_t reserved; 601 + uint8_t wapi_key_data[HIF_API_WAPI_KEY_DATA_SIZE]; 602 + uint8_t mic_key_data[HIF_API_MIC_KEY_DATA_SIZE]; 603 + } __packed; 604 + 605 + struct hif_wapi_group_key { 606 + uint8_t wapi_key_data[HIF_API_WAPI_KEY_DATA_SIZE]; 607 + uint8_t mic_key_data[HIF_API_MIC_KEY_DATA_SIZE]; 608 + uint8_t key_id; 609 + uint8_t reserved[3]; 610 + } __packed; 611 + 612 + struct hif_igtk_group_key { 613 + uint8_t igtk_key_data[HIF_API_IGTK_KEY_DATA_SIZE]; 614 + uint8_t key_id; 615 + uint8_t reserved[3]; 616 + uint8_t ipn[HIF_API_IPN_SIZE]; 617 + } __packed; 618 + 619 + union hif_privacy_key_data { 620 + struct hif_wep_pairwise_key wep_pairwise_key; 621 + struct hif_wep_group_key wep_group_key; 622 + struct hif_tkip_pairwise_key tkip_pairwise_key; 623 + struct hif_tkip_group_key tkip_group_key; 624 + struct hif_aes_pairwise_key aes_pairwise_key; 625 + struct hif_aes_group_key aes_group_key; 626 + struct hif_wapi_pairwise_key wapi_pairwise_key; 627 + struct hif_wapi_group_key wapi_group_key; 628 + struct hif_igtk_group_key igtk_group_key; 629 + }; 630 + 631 + struct hif_req_add_key { 632 + uint8_t type; 633 + uint8_t entry_index; 634 + uint8_t int_id:2; 635 + uint8_t reserved1:6; 636 + uint8_t reserved2; 637 + union hif_privacy_key_data key; 638 + } __packed; 639 + 640 + struct hif_cnf_add_key { 641 + uint32_t status; 642 + } __packed; 643 + 644 + struct hif_req_remove_key { 645 + uint8_t entry_index; 646 + uint8_t reserved[3]; 647 + } __packed; 648 + 649 + struct hif_cnf_remove_key { 650 + uint32_t status; 651 + } __packed; 652 + 653 + enum hif_event_ind { 654 + HIF_EVENT_IND_BSSLOST = 0x1, 655 + HIF_EVENT_IND_BSSREGAINED = 0x2, 656 + HIF_EVENT_IND_RCPI_RSSI = 0x3, 657 + HIF_EVENT_IND_PS_MODE_ERROR = 0x4, 658 + HIF_EVENT_IND_INACTIVITY = 0x5 659 + }; 660 + 661 + enum hif_ps_mode_error { 662 + HIF_PS_ERROR_NO_ERROR = 0, 663 + HIF_PS_ERROR_AP_NOT_RESP_TO_POLL = 1, 664 + HIF_PS_ERROR_AP_NOT_RESP_TO_UAPSD_TRIGGER = 2, 665 + HIF_PS_ERROR_AP_SENT_UNICAST_IN_DOZE = 3, 666 + HIF_PS_ERROR_AP_NO_DATA_AFTER_TIM = 4 667 + }; 668 + 669 + union hif_event_data { 670 + uint8_t rcpi_rssi; 671 + uint32_t ps_mode_error; 672 + uint32_t peer_sta_set; 673 + }; 674 + 675 + struct hif_ind_event { 676 + uint32_t event_id; 677 + union hif_event_data event_data; 678 + } __packed; 679 + 680 + 681 + #endif
+437
drivers/staging/wfx/hif_api_general.h
··· 1 + /* SPDX-License-Identifier: Apache-2.0 */ 2 + /* 3 + * WFx hardware interface definitions 4 + * 5 + * Copyright (c) 2018-2019, Silicon Laboratories Inc. 6 + */ 7 + 8 + #ifndef WFX_HIF_API_GENERAL_H 9 + #define WFX_HIF_API_GENERAL_H 10 + 11 + #ifdef __KERNEL__ 12 + #include <linux/types.h> 13 + #include <linux/if_ether.h> 14 + #else 15 + #include <net/ethernet.h> 16 + #include <stdint.h> 17 + #define __packed __attribute__((__packed__)) 18 + #endif 19 + 20 + #define API_SSID_SIZE 32 21 + 22 + #define HIF_ID_IS_INDICATION 0x80 23 + #define HIF_COUNTER_MAX 7 24 + 25 + struct hif_msg { 26 + uint16_t len; 27 + uint8_t id; 28 + uint8_t reserved:1; 29 + uint8_t interface:2; 30 + uint8_t seqnum:3; 31 + uint8_t encrypted:2; 32 + uint8_t body[]; 33 + } __packed; 34 + 35 + enum hif_general_requests_ids { 36 + HIF_REQ_ID_CONFIGURATION = 0x09, 37 + HIF_REQ_ID_CONTROL_GPIO = 0x26, 38 + HIF_REQ_ID_SET_SL_MAC_KEY = 0x27, 39 + HIF_REQ_ID_SL_EXCHANGE_PUB_KEYS = 0x28, 40 + HIF_REQ_ID_SL_CONFIGURE = 0x29, 41 + HIF_REQ_ID_PREVENT_ROLLBACK = 0x2a, 42 + HIF_REQ_ID_PTA_SETTINGS = 0x2b, 43 + HIF_REQ_ID_PTA_PRIORITY = 0x2c, 44 + HIF_REQ_ID_PTA_STATE = 0x2d, 45 + HIF_REQ_ID_SHUT_DOWN = 0x32, 46 + }; 47 + 48 + enum hif_general_confirmations_ids { 49 + HIF_CNF_ID_CONFIGURATION = 0x09, 50 + HIF_CNF_ID_CONTROL_GPIO = 0x26, 51 + HIF_CNF_ID_SET_SL_MAC_KEY = 0x27, 52 + HIF_CNF_ID_SL_EXCHANGE_PUB_KEYS = 0x28, 53 + HIF_CNF_ID_SL_CONFIGURE = 0x29, 54 + HIF_CNF_ID_PREVENT_ROLLBACK = 0x2a, 55 + HIF_CNF_ID_PTA_SETTINGS = 0x2b, 56 + HIF_CNF_ID_PTA_PRIORITY = 0x2c, 57 + HIF_CNF_ID_PTA_STATE = 0x2d, 58 + HIF_CNF_ID_SHUT_DOWN = 0x32, 59 + }; 60 + 61 + enum hif_general_indications_ids { 62 + HIF_IND_ID_EXCEPTION = 0xe0, 63 + HIF_IND_ID_STARTUP = 0xe1, 64 + HIF_IND_ID_WAKEUP = 0xe2, 65 + HIF_IND_ID_GENERIC = 0xe3, 66 + HIF_IND_ID_ERROR = 0xe4, 67 + HIF_IND_ID_SL_EXCHANGE_PUB_KEYS = 0xe5 68 + }; 69 + 70 + enum hif_hi_status { 71 + HI_STATUS_SUCCESS = 0x0000, 72 + HI_STATUS_FAILURE = 0x0001, 73 + HI_INVALID_PARAMETER = 0x0002, 74 + HI_STATUS_GPIO_WARNING = 0x0003, 75 + HI_ERROR_UNSUPPORTED_MSG_ID = 0x0004, 76 + SL_MAC_KEY_STATUS_SUCCESS = 0x005A, 77 + SL_MAC_KEY_STATUS_FAILED_KEY_ALREADY_BURNED = 0x006B, 78 + SL_MAC_KEY_STATUS_FAILED_RAM_MODE_NOT_ALLOWED = 0x007C, 79 + SL_MAC_KEY_STATUS_FAILED_UNKNOWN_MODE = 0x008D, 80 + SL_PUB_KEY_EXCHANGE_STATUS_SUCCESS = 0x009E, 81 + SL_PUB_KEY_EXCHANGE_STATUS_FAILED = 0x00AF, 82 + PREVENT_ROLLBACK_CNF_SUCCESS = 0x1234, 83 + PREVENT_ROLLBACK_CNF_WRONG_MAGIC_WORD = 0x1256 84 + }; 85 + 86 + enum hif_api_rate_index { 87 + API_RATE_INDEX_B_1MBPS = 0, 88 + API_RATE_INDEX_B_2MBPS = 1, 89 + API_RATE_INDEX_B_5P5MBPS = 2, 90 + API_RATE_INDEX_B_11MBPS = 3, 91 + API_RATE_INDEX_PBCC_22MBPS = 4, 92 + API_RATE_INDEX_PBCC_33MBPS = 5, 93 + API_RATE_INDEX_G_6MBPS = 6, 94 + API_RATE_INDEX_G_9MBPS = 7, 95 + API_RATE_INDEX_G_12MBPS = 8, 96 + API_RATE_INDEX_G_18MBPS = 9, 97 + API_RATE_INDEX_G_24MBPS = 10, 98 + API_RATE_INDEX_G_36MBPS = 11, 99 + API_RATE_INDEX_G_48MBPS = 12, 100 + API_RATE_INDEX_G_54MBPS = 13, 101 + API_RATE_INDEX_N_6P5MBPS = 14, 102 + API_RATE_INDEX_N_13MBPS = 15, 103 + API_RATE_INDEX_N_19P5MBPS = 16, 104 + API_RATE_INDEX_N_26MBPS = 17, 105 + API_RATE_INDEX_N_39MBPS = 18, 106 + API_RATE_INDEX_N_52MBPS = 19, 107 + API_RATE_INDEX_N_58P5MBPS = 20, 108 + API_RATE_INDEX_N_65MBPS = 21, 109 + API_RATE_NUM_ENTRIES = 22 110 + }; 111 + 112 + 113 + enum hif_fw_type { 114 + HIF_FW_TYPE_ETF = 0x0, 115 + HIF_FW_TYPE_WFM = 0x1, 116 + HIF_FW_TYPE_WSM = 0x2 117 + }; 118 + 119 + struct hif_capabilities { 120 + uint8_t link_mode:2; 121 + uint8_t reserved1:6; 122 + uint8_t reserved2; 123 + uint8_t reserved3; 124 + uint8_t reserved4; 125 + } __packed; 126 + 127 + struct hif_otp_regul_sel_mode_info { 128 + uint8_t region_sel_mode:4; 129 + uint8_t reserved:4; 130 + } __packed; 131 + 132 + struct hif_otp_phy_info { 133 + uint8_t phy1_region:3; 134 + uint8_t phy0_region:3; 135 + uint8_t otp_phy_ver:2; 136 + } __packed; 137 + 138 + #define API_OPN_SIZE 14 139 + #define API_UID_SIZE 8 140 + #define API_DISABLED_CHANNEL_LIST_SIZE 2 141 + #define API_FIRMWARE_LABEL_SIZE 128 142 + 143 + struct hif_ind_startup { 144 + uint32_t status; 145 + uint16_t hardware_id; 146 + uint8_t opn[API_OPN_SIZE]; 147 + uint8_t uid[API_UID_SIZE]; 148 + uint16_t num_inp_ch_bufs; 149 + uint16_t size_inp_ch_buf; 150 + uint8_t num_links_ap; 151 + uint8_t num_interfaces; 152 + uint8_t mac_addr[2][ETH_ALEN]; 153 + uint8_t api_version_minor; 154 + uint8_t api_version_major; 155 + struct hif_capabilities capabilities; 156 + uint8_t firmware_build; 157 + uint8_t firmware_minor; 158 + uint8_t firmware_major; 159 + uint8_t firmware_type; 160 + uint8_t disabled_channel_list[API_DISABLED_CHANNEL_LIST_SIZE]; 161 + struct hif_otp_regul_sel_mode_info regul_sel_mode_info; 162 + struct hif_otp_phy_info otp_phy_info; 163 + uint32_t supported_rate_mask; 164 + uint8_t firmware_label[API_FIRMWARE_LABEL_SIZE]; 165 + } __packed; 166 + 167 + struct hif_ind_wakeup { 168 + } __packed; 169 + 170 + struct hif_req_configuration { 171 + uint16_t length; 172 + uint8_t pds_data[]; 173 + } __packed; 174 + 175 + struct hif_cnf_configuration { 176 + uint32_t status; 177 + } __packed; 178 + 179 + enum hif_gpio_mode { 180 + HIF_GPIO_MODE_D0 = 0x0, 181 + HIF_GPIO_MODE_D1 = 0x1, 182 + HIF_GPIO_MODE_OD0 = 0x2, 183 + HIF_GPIO_MODE_OD1 = 0x3, 184 + HIF_GPIO_MODE_TRISTATE = 0x4, 185 + HIF_GPIO_MODE_TOGGLE = 0x5, 186 + HIF_GPIO_MODE_READ = 0x6 187 + }; 188 + 189 + struct hif_req_control_gpio { 190 + uint8_t gpio_label; 191 + uint8_t gpio_mode; 192 + } __packed; 193 + 194 + enum hif_gpio_error { 195 + HIF_GPIO_ERROR_0 = 0x0, 196 + HIF_GPIO_ERROR_1 = 0x1, 197 + HIF_GPIO_ERROR_2 = 0x2 198 + }; 199 + 200 + struct hif_cnf_control_gpio { 201 + uint32_t status; 202 + uint32_t value; 203 + } __packed; 204 + 205 + enum hif_generic_indication_type { 206 + HIF_GENERIC_INDICATION_TYPE_RAW = 0x0, 207 + HIF_GENERIC_INDICATION_TYPE_STRING = 0x1, 208 + HIF_GENERIC_INDICATION_TYPE_RX_STATS = 0x2 209 + }; 210 + 211 + struct hif_rx_stats { 212 + uint32_t nb_rx_frame; 213 + uint32_t nb_crc_frame; 214 + uint32_t per_total; 215 + uint32_t throughput; 216 + uint32_t nb_rx_by_rate[API_RATE_NUM_ENTRIES]; 217 + uint16_t per[API_RATE_NUM_ENTRIES]; 218 + int16_t snr[API_RATE_NUM_ENTRIES]; 219 + int16_t rssi[API_RATE_NUM_ENTRIES]; 220 + int16_t cfo[API_RATE_NUM_ENTRIES]; 221 + uint32_t date; 222 + uint32_t pwr_clk_freq; 223 + uint8_t is_ext_pwr_clk; 224 + int8_t current_temp; 225 + } __packed; 226 + 227 + union hif_indication_data { 228 + struct hif_rx_stats rx_stats; 229 + uint8_t raw_data[1]; 230 + }; 231 + 232 + struct hif_ind_generic { 233 + uint32_t indication_type; 234 + union hif_indication_data indication_data; 235 + } __packed; 236 + 237 + 238 + #define HIF_EXCEPTION_DATA_SIZE 124 239 + 240 + struct hif_ind_exception { 241 + uint8_t data[HIF_EXCEPTION_DATA_SIZE]; 242 + } __packed; 243 + 244 + 245 + enum hif_error { 246 + HIF_ERROR_FIRMWARE_ROLLBACK = 0x0, 247 + HIF_ERROR_FIRMWARE_DEBUG_ENABLED = 0x1, 248 + HIF_ERROR_OUTDATED_SESSION_KEY = 0x2, 249 + HIF_ERROR_INVALID_SESSION_KEY = 0x3, 250 + HIF_ERROR_OOR_VOLTAGE = 0x4, 251 + HIF_ERROR_PDS_VERSION = 0x5, 252 + HIF_ERROR_OOR_TEMPERATURE = 0x6, 253 + HIF_ERROR_REQ_DURING_KEY_EXCHANGE = 0x7, 254 + HIF_ERROR_MULTI_TX_CNF_SECURELINK = 0x8, 255 + HIF_ERROR_SECURELINK_OVERFLOW = 0x9, 256 + HIF_ERROR_SECURELINK_DECRYPTION = 0xa 257 + }; 258 + 259 + struct hif_ind_error { 260 + uint32_t type; 261 + uint8_t data[]; 262 + } __packed; 263 + 264 + enum hif_secure_link_state { 265 + SEC_LINK_UNAVAILABLE = 0x0, 266 + SEC_LINK_RESERVED = 0x1, 267 + SEC_LINK_EVAL = 0x2, 268 + SEC_LINK_ENFORCED = 0x3 269 + }; 270 + 271 + enum hif_sl_encryption_type { 272 + NO_ENCRYPTION = 0, 273 + TX_ENCRYPTION = 1, 274 + RX_ENCRYPTION = 2, 275 + HP_ENCRYPTION = 3 276 + }; 277 + 278 + struct hif_sl_msg_hdr { 279 + uint32_t seqnum:30; 280 + uint32_t encrypted:2; 281 + } __packed; 282 + 283 + struct hif_sl_msg { 284 + struct hif_sl_msg_hdr hdr; 285 + uint16_t len; 286 + uint8_t payload[]; 287 + } __packed; 288 + 289 + #define AES_CCM_TAG_SIZE 16 290 + 291 + struct hif_sl_tag { 292 + uint8_t tag[16]; 293 + } __packed; 294 + 295 + enum hif_sl_mac_key_dest { 296 + SL_MAC_KEY_DEST_OTP = 0x78, 297 + SL_MAC_KEY_DEST_RAM = 0x87 298 + }; 299 + 300 + #define API_KEY_VALUE_SIZE 32 301 + 302 + struct hif_req_set_sl_mac_key { 303 + uint8_t otp_or_ram; 304 + uint8_t key_value[API_KEY_VALUE_SIZE]; 305 + } __packed; 306 + 307 + struct hif_cnf_set_sl_mac_key { 308 + uint32_t status; 309 + } __packed; 310 + 311 + #define API_HOST_PUB_KEY_SIZE 32 312 + #define API_HOST_PUB_KEY_MAC_SIZE 64 313 + 314 + enum hif_sl_session_key_alg { 315 + HIF_SL_CURVE25519 = 0x01, 316 + HIF_SL_KDF = 0x02 317 + }; 318 + 319 + struct hif_req_sl_exchange_pub_keys { 320 + uint8_t algorithm:2; 321 + uint8_t reserved1:6; 322 + uint8_t reserved2[3]; 323 + uint8_t host_pub_key[API_HOST_PUB_KEY_SIZE]; 324 + uint8_t host_pub_key_mac[API_HOST_PUB_KEY_MAC_SIZE]; 325 + } __packed; 326 + 327 + struct hif_cnf_sl_exchange_pub_keys { 328 + uint32_t status; 329 + } __packed; 330 + 331 + #define API_NCP_PUB_KEY_SIZE 32 332 + #define API_NCP_PUB_KEY_MAC_SIZE 64 333 + 334 + struct hif_ind_sl_exchange_pub_keys { 335 + uint32_t status; 336 + uint8_t ncp_pub_key[API_NCP_PUB_KEY_SIZE]; 337 + uint8_t ncp_pub_key_mac[API_NCP_PUB_KEY_MAC_SIZE]; 338 + } __packed; 339 + 340 + #define API_ENCR_BMP_SIZE 32 341 + 342 + struct hif_req_sl_configure { 343 + uint8_t encr_bmp[API_ENCR_BMP_SIZE]; 344 + uint8_t disable_session_key_protection:1; 345 + uint8_t reserved1:7; 346 + uint8_t reserved2[3]; 347 + } __packed; 348 + 349 + struct hif_cnf_sl_configure { 350 + uint32_t status; 351 + } __packed; 352 + 353 + struct hif_req_prevent_rollback { 354 + uint32_t magic_word; 355 + } __packed; 356 + 357 + struct hif_cnf_prevent_rollback { 358 + uint32_t status; 359 + } __packed; 360 + 361 + enum hif_pta_mode { 362 + PTA_1W_WLAN_MASTER = 0, 363 + PTA_1W_COEX_MASTER = 1, 364 + PTA_2W = 2, 365 + PTA_3W = 3, 366 + PTA_4W = 4 367 + }; 368 + 369 + enum hif_signal_level { 370 + SIGNAL_LOW = 0, 371 + SIGNAL_HIGH = 1 372 + }; 373 + 374 + enum hif_coex_type { 375 + COEX_TYPE_GENERIC = 0, 376 + COEX_TYPE_BLE = 1 377 + }; 378 + 379 + enum hif_grant_state { 380 + NO_GRANT = 0, 381 + GRANT = 1 382 + }; 383 + 384 + struct hif_req_pta_settings { 385 + uint8_t pta_mode; 386 + uint8_t request_signal_active_level; 387 + uint8_t priority_signal_active_level; 388 + uint8_t freq_signal_active_level; 389 + uint8_t grant_signal_active_level; 390 + uint8_t coex_type; 391 + uint8_t default_grant_state; 392 + uint8_t simultaneous_rx_accesses; 393 + uint8_t priority_sampling_time; 394 + uint8_t tx_rx_sampling_time; 395 + uint8_t freq_sampling_time; 396 + uint8_t grant_valid_time; 397 + uint8_t fem_control_time; 398 + uint8_t first_slot_time; 399 + uint16_t periodic_tx_rx_sampling_time; 400 + uint16_t coex_quota; 401 + uint16_t wlan_quota; 402 + } __packed; 403 + 404 + struct hif_cnf_pta_settings { 405 + uint32_t status; 406 + } __packed; 407 + 408 + enum hif_pta_priority { 409 + HIF_PTA_PRIORITY_COEX_MAXIMIZED = 0x00000562, 410 + HIF_PTA_PRIORITY_COEX_HIGH = 0x00000462, 411 + HIF_PTA_PRIORITY_BALANCED = 0x00001461, 412 + HIF_PTA_PRIORITY_WLAN_HIGH = 0x00001851, 413 + HIF_PTA_PRIORITY_WLAN_MAXIMIZED = 0x00001A51 414 + }; 415 + 416 + struct hif_req_pta_priority { 417 + uint32_t priority; 418 + } __packed; 419 + 420 + struct hif_cnf_pta_priority { 421 + uint32_t status; 422 + } __packed; 423 + 424 + enum hif_pta_state { 425 + PTA_OFF = 0, 426 + PTA_ON = 1 427 + }; 428 + 429 + struct hif_req_pta_state { 430 + uint32_t pta_state; 431 + } __packed; 432 + 433 + struct hif_cnf_pta_state { 434 + uint32_t status; 435 + } __packed; 436 + 437 + #endif
+558
drivers/staging/wfx/hif_api_mib.h
··· 1 + /* SPDX-License-Identifier: Apache-2.0 */ 2 + /* 3 + * WFx hardware interface definitions 4 + * 5 + * Copyright (c) 2018-2019, Silicon Laboratories Inc. 6 + */ 7 + 8 + #ifndef WFX_HIF_API_MIB_H 9 + #define WFX_HIF_API_MIB_H 10 + 11 + #include "hif_api_general.h" 12 + 13 + #define HIF_API_IPV4_ADDRESS_SIZE 4 14 + #define HIF_API_IPV6_ADDRESS_SIZE 16 15 + 16 + enum hif_mib_ids { 17 + HIF_MIB_ID_GL_OPERATIONAL_POWER_MODE = 0x2000, 18 + HIF_MIB_ID_GL_BLOCK_ACK_INFO = 0x2001, 19 + HIF_MIB_ID_GL_SET_MULTI_MSG = 0x2002, 20 + HIF_MIB_ID_CCA_CONFIG = 0x2003, 21 + HIF_MIB_ID_ETHERTYPE_DATAFRAME_CONDITION = 0x2010, 22 + HIF_MIB_ID_PORT_DATAFRAME_CONDITION = 0x2011, 23 + HIF_MIB_ID_MAGIC_DATAFRAME_CONDITION = 0x2012, 24 + HIF_MIB_ID_MAC_ADDR_DATAFRAME_CONDITION = 0x2013, 25 + HIF_MIB_ID_IPV4_ADDR_DATAFRAME_CONDITION = 0x2014, 26 + HIF_MIB_ID_IPV6_ADDR_DATAFRAME_CONDITION = 0x2015, 27 + HIF_MIB_ID_UC_MC_BC_DATAFRAME_CONDITION = 0x2016, 28 + HIF_MIB_ID_CONFIG_DATA_FILTER = 0x2017, 29 + HIF_MIB_ID_SET_DATA_FILTERING = 0x2018, 30 + HIF_MIB_ID_ARP_IP_ADDRESSES_TABLE = 0x2019, 31 + HIF_MIB_ID_NS_IP_ADDRESSES_TABLE = 0x201A, 32 + HIF_MIB_ID_RX_FILTER = 0x201B, 33 + HIF_MIB_ID_BEACON_FILTER_TABLE = 0x201C, 34 + HIF_MIB_ID_BEACON_FILTER_ENABLE = 0x201D, 35 + HIF_MIB_ID_GRP_SEQ_COUNTER = 0x2030, 36 + HIF_MIB_ID_TSF_COUNTER = 0x2031, 37 + HIF_MIB_ID_STATISTICS_TABLE = 0x2032, 38 + HIF_MIB_ID_COUNTERS_TABLE = 0x2033, 39 + HIF_MIB_ID_MAX_TX_POWER_LEVEL = 0x2034, 40 + HIF_MIB_ID_EXTENDED_COUNTERS_TABLE = 0x2035, 41 + HIF_MIB_ID_DOT11_MAC_ADDRESS = 0x2040, 42 + HIF_MIB_ID_DOT11_MAX_TRANSMIT_MSDU_LIFETIME = 0x2041, 43 + HIF_MIB_ID_DOT11_MAX_RECEIVE_LIFETIME = 0x2042, 44 + HIF_MIB_ID_DOT11_WEP_DEFAULT_KEY_ID = 0x2043, 45 + HIF_MIB_ID_DOT11_RTS_THRESHOLD = 0x2044, 46 + HIF_MIB_ID_SLOT_TIME = 0x2045, 47 + HIF_MIB_ID_CURRENT_TX_POWER_LEVEL = 0x2046, 48 + HIF_MIB_ID_NON_ERP_PROTECTION = 0x2047, 49 + HIF_MIB_ID_TEMPLATE_FRAME = 0x2048, 50 + HIF_MIB_ID_BEACON_WAKEUP_PERIOD = 0x2049, 51 + HIF_MIB_ID_RCPI_RSSI_THRESHOLD = 0x204A, 52 + HIF_MIB_ID_BLOCK_ACK_POLICY = 0x204B, 53 + HIF_MIB_ID_OVERRIDE_INTERNAL_TX_RATE = 0x204C, 54 + HIF_MIB_ID_SET_ASSOCIATION_MODE = 0x204D, 55 + HIF_MIB_ID_SET_UAPSD_INFORMATION = 0x204E, 56 + HIF_MIB_ID_SET_TX_RATE_RETRY_POLICY = 0x204F, 57 + HIF_MIB_ID_PROTECTED_MGMT_POLICY = 0x2050, 58 + HIF_MIB_ID_SET_HT_PROTECTION = 0x2051, 59 + HIF_MIB_ID_KEEP_ALIVE_PERIOD = 0x2052, 60 + HIF_MIB_ID_ARP_KEEP_ALIVE_PERIOD = 0x2053, 61 + HIF_MIB_ID_INACTIVITY_TIMER = 0x2054, 62 + HIF_MIB_ID_INTERFACE_PROTECTION = 0x2055, 63 + HIF_MIB_ID_BEACON_STATS = 0x2056, 64 + }; 65 + 66 + #define HIF_OP_POWER_MODE_MASK 0xf 67 + 68 + enum hif_op_power_mode { 69 + HIF_OP_POWER_MODE_ACTIVE = 0x0, 70 + HIF_OP_POWER_MODE_DOZE = 0x1, 71 + HIF_OP_POWER_MODE_QUIESCENT = 0x2 72 + }; 73 + 74 + struct hif_mib_gl_operational_power_mode { 75 + uint8_t power_mode:4; 76 + uint8_t reserved1:3; 77 + uint8_t wup_ind_activation:1; 78 + uint8_t reserved2[3]; 79 + } __packed; 80 + 81 + struct hif_mib_gl_block_ack_info { 82 + uint8_t rx_buffer_size; 83 + uint8_t rx_max_num_agreements; 84 + uint8_t tx_buffer_size; 85 + uint8_t tx_max_num_agreements; 86 + } __packed; 87 + 88 + struct hif_mib_gl_set_multi_msg { 89 + uint8_t enable_multi_tx_conf:1; 90 + uint8_t reserved1:7; 91 + uint8_t reserved2[3]; 92 + } __packed; 93 + 94 + enum hif_cca_thr_mode { 95 + HIF_CCA_THR_MODE_RELATIVE = 0x0, 96 + HIF_CCA_THR_MODE_ABSOLUTE = 0x1 97 + }; 98 + 99 + struct hif_mib_gl_cca_config { 100 + uint8_t cca_thr_mode; 101 + uint8_t reserved[3]; 102 + } __packed; 103 + 104 + #define MAX_NUMBER_DATA_FILTERS 0xA 105 + 106 + #define MAX_NUMBER_IPV4_ADDR_CONDITIONS 0x4 107 + #define MAX_NUMBER_IPV6_ADDR_CONDITIONS 0x4 108 + #define MAX_NUMBER_MAC_ADDR_CONDITIONS 0x4 109 + #define MAX_NUMBER_UC_MC_BC_CONDITIONS 0x4 110 + #define MAX_NUMBER_ETHER_TYPE_CONDITIONS 0x4 111 + #define MAX_NUMBER_PORT_CONDITIONS 0x4 112 + #define MAX_NUMBER_MAGIC_CONDITIONS 0x4 113 + #define MAX_NUMBER_ARP_CONDITIONS 0x2 114 + #define MAX_NUMBER_NS_CONDITIONS 0x2 115 + 116 + struct hif_mib_ethertype_data_frame_condition { 117 + uint8_t condition_idx; 118 + uint8_t reserved; 119 + uint16_t ether_type; 120 + } __packed; 121 + 122 + enum hif_udp_tcp_protocol { 123 + HIF_PROTOCOL_UDP = 0x0, 124 + HIF_PROTOCOL_TCP = 0x1, 125 + HIF_PROTOCOL_BOTH_UDP_TCP = 0x2 126 + }; 127 + 128 + enum hif_which_port { 129 + HIF_PORT_DST = 0x0, 130 + HIF_PORT_SRC = 0x1, 131 + HIF_PORT_SRC_OR_DST = 0x2 132 + }; 133 + 134 + struct hif_mib_ports_data_frame_condition { 135 + uint8_t condition_idx; 136 + uint8_t protocol; 137 + uint8_t which_port; 138 + uint8_t reserved1; 139 + uint16_t port_number; 140 + uint8_t reserved2[2]; 141 + } __packed; 142 + 143 + #define HIF_API_MAGIC_PATTERN_SIZE 32 144 + 145 + struct hif_mib_magic_data_frame_condition { 146 + uint8_t condition_idx; 147 + uint8_t offset; 148 + uint8_t magic_pattern_length; 149 + uint8_t reserved; 150 + uint8_t magic_pattern[HIF_API_MAGIC_PATTERN_SIZE]; 151 + } __packed; 152 + 153 + enum hif_mac_addr_type { 154 + HIF_MAC_ADDR_A1 = 0x0, 155 + HIF_MAC_ADDR_A2 = 0x1, 156 + HIF_MAC_ADDR_A3 = 0x2 157 + }; 158 + 159 + struct hif_mib_mac_addr_data_frame_condition { 160 + uint8_t condition_idx; 161 + uint8_t address_type; 162 + uint8_t mac_address[ETH_ALEN]; 163 + } __packed; 164 + 165 + enum hif_ip_addr_mode { 166 + HIF_IP_ADDR_SRC = 0x0, 167 + HIF_IP_ADDR_DST = 0x1 168 + }; 169 + 170 + struct hif_mib_ipv4_addr_data_frame_condition { 171 + uint8_t condition_idx; 172 + uint8_t address_mode; 173 + uint8_t reserved[2]; 174 + uint8_t i_pv4_address[HIF_API_IPV4_ADDRESS_SIZE]; 175 + } __packed; 176 + 177 + struct hif_mib_ipv6_addr_data_frame_condition { 178 + uint8_t condition_idx; 179 + uint8_t address_mode; 180 + uint8_t reserved[2]; 181 + uint8_t i_pv6_address[HIF_API_IPV6_ADDRESS_SIZE]; 182 + } __packed; 183 + 184 + union hif_addr_type { 185 + uint8_t value; 186 + struct { 187 + uint8_t type_unicast:1; 188 + uint8_t type_multicast:1; 189 + uint8_t type_broadcast:1; 190 + uint8_t reserved:5; 191 + } bits; 192 + }; 193 + 194 + struct hif_mib_uc_mc_bc_data_frame_condition { 195 + uint8_t condition_idx; 196 + union hif_addr_type param; 197 + uint8_t reserved[2]; 198 + } __packed; 199 + 200 + struct hif_mib_config_data_filter { 201 + uint8_t filter_idx; 202 + uint8_t enable; 203 + uint8_t reserved1[2]; 204 + uint8_t eth_type_cond; 205 + uint8_t port_cond; 206 + uint8_t magic_cond; 207 + uint8_t mac_cond; 208 + uint8_t ipv4_cond; 209 + uint8_t ipv6_cond; 210 + uint8_t uc_mc_bc_cond; 211 + uint8_t reserved2; 212 + } __packed; 213 + 214 + struct hif_mib_set_data_filtering { 215 + uint8_t default_filter; 216 + uint8_t enable; 217 + uint8_t reserved[2]; 218 + } __packed; 219 + 220 + enum hif_arp_ns_frame_treatment { 221 + HIF_ARP_NS_FILTERING_DISABLE = 0x0, 222 + HIF_ARP_NS_FILTERING_ENABLE = 0x1, 223 + HIF_ARP_NS_REPLY_ENABLE = 0x2 224 + }; 225 + 226 + struct hif_mib_arp_ip_addr_table { 227 + uint8_t condition_idx; 228 + uint8_t arp_enable; 229 + uint8_t reserved[2]; 230 + uint8_t ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; 231 + } __packed; 232 + 233 + struct hif_mib_ns_ip_addr_table { 234 + uint8_t condition_idx; 235 + uint8_t ns_enable; 236 + uint8_t reserved[2]; 237 + uint8_t ipv6_address[HIF_API_IPV6_ADDRESS_SIZE]; 238 + } __packed; 239 + 240 + struct hif_mib_rx_filter { 241 + uint8_t reserved1:1; 242 + uint8_t bssid_filter:1; 243 + uint8_t reserved2:1; 244 + uint8_t fwd_probe_req:1; 245 + uint8_t keep_alive_filter:1; 246 + uint8_t reserved3:3; 247 + uint8_t reserved4[3]; 248 + } __packed; 249 + 250 + #define HIF_API_OUI_SIZE 3 251 + #define HIF_API_MATCH_DATA_SIZE 3 252 + 253 + struct hif_ie_table_entry { 254 + uint8_t ie_id; 255 + uint8_t has_changed:1; 256 + uint8_t no_longer:1; 257 + uint8_t has_appeared:1; 258 + uint8_t reserved:1; 259 + uint8_t num_match_data:4; 260 + uint8_t oui[HIF_API_OUI_SIZE]; 261 + uint8_t match_data[HIF_API_MATCH_DATA_SIZE]; 262 + } __packed; 263 + 264 + struct hif_mib_bcn_filter_table { 265 + uint32_t num_of_info_elmts; 266 + struct hif_ie_table_entry ie_table[]; 267 + } __packed; 268 + 269 + enum hif_beacon_filter { 270 + HIF_BEACON_FILTER_DISABLE = 0x0, 271 + HIF_BEACON_FILTER_ENABLE = 0x1, 272 + HIF_BEACON_FILTER_AUTO_ERP = 0x2 273 + }; 274 + 275 + struct hif_mib_bcn_filter_enable { 276 + uint32_t enable; 277 + uint32_t bcn_count; 278 + } __packed; 279 + 280 + struct hif_mib_group_seq_counter { 281 + uint32_t bits4716; 282 + uint16_t bits1500; 283 + uint16_t reserved; 284 + } __packed; 285 + 286 + struct hif_mib_tsf_counter { 287 + uint32_t tsf_counterlo; 288 + uint32_t tsf_counterhi; 289 + } __packed; 290 + 291 + struct hif_mib_stats_table { 292 + int16_t latest_snr; 293 + uint8_t latest_rcpi; 294 + int8_t latest_rssi; 295 + } __packed; 296 + 297 + struct hif_mib_extended_count_table { 298 + uint32_t count_plcp_errors; 299 + uint32_t count_fcs_errors; 300 + uint32_t count_tx_packets; 301 + uint32_t count_rx_packets; 302 + uint32_t count_rx_packet_errors; 303 + uint32_t count_rx_decryption_failures; 304 + uint32_t count_rx_mic_failures; 305 + uint32_t count_rx_no_key_failures; 306 + uint32_t count_tx_multicast_frames; 307 + uint32_t count_tx_frames_success; 308 + uint32_t count_tx_frame_failures; 309 + uint32_t count_tx_frames_retried; 310 + uint32_t count_tx_frames_multi_retried; 311 + uint32_t count_rx_frame_duplicates; 312 + uint32_t count_rts_success; 313 + uint32_t count_rts_failures; 314 + uint32_t count_ack_failures; 315 + uint32_t count_rx_multicast_frames; 316 + uint32_t count_rx_frames_success; 317 + uint32_t count_rx_cmacicv_errors; 318 + uint32_t count_rx_cmac_replays; 319 + uint32_t count_rx_mgmt_ccmp_replays; 320 + uint32_t count_rx_bipmic_errors; 321 + uint32_t count_rx_beacon; 322 + uint32_t count_miss_beacon; 323 + uint32_t reserved[15]; 324 + } __packed; 325 + 326 + struct hif_mib_count_table { 327 + uint32_t count_plcp_errors; 328 + uint32_t count_fcs_errors; 329 + uint32_t count_tx_packets; 330 + uint32_t count_rx_packets; 331 + uint32_t count_rx_packet_errors; 332 + uint32_t count_rx_decryption_failures; 333 + uint32_t count_rx_mic_failures; 334 + uint32_t count_rx_no_key_failures; 335 + uint32_t count_tx_multicast_frames; 336 + uint32_t count_tx_frames_success; 337 + uint32_t count_tx_frame_failures; 338 + uint32_t count_tx_frames_retried; 339 + uint32_t count_tx_frames_multi_retried; 340 + uint32_t count_rx_frame_duplicates; 341 + uint32_t count_rts_success; 342 + uint32_t count_rts_failures; 343 + uint32_t count_ack_failures; 344 + uint32_t count_rx_multicast_frames; 345 + uint32_t count_rx_frames_success; 346 + uint32_t count_rx_cmacicv_errors; 347 + uint32_t count_rx_cmac_replays; 348 + uint32_t count_rx_mgmt_ccmp_replays; 349 + uint32_t count_rx_bipmic_errors; 350 + } __packed; 351 + 352 + struct hif_mib_max_tx_power_level { 353 + int32_t max_tx_power_level_rf_port1; 354 + int32_t max_tx_power_level_rf_port2; 355 + } __packed; 356 + 357 + struct hif_mib_beacon_stats { 358 + int32_t latest_tbtt_diff; 359 + uint32_t reserved[4]; 360 + } __packed; 361 + 362 + struct hif_mib_mac_address { 363 + uint8_t mac_addr[ETH_ALEN]; 364 + uint16_t reserved; 365 + } __packed; 366 + 367 + struct hif_mib_dot11_max_transmit_msdu_lifetime { 368 + uint32_t max_life_time; 369 + } __packed; 370 + 371 + struct hif_mib_dot11_max_receive_lifetime { 372 + uint32_t max_life_time; 373 + } __packed; 374 + 375 + struct hif_mib_wep_default_key_id { 376 + uint8_t wep_default_key_id; 377 + uint8_t reserved[3]; 378 + } __packed; 379 + 380 + struct hif_mib_dot11_rts_threshold { 381 + uint32_t threshold; 382 + } __packed; 383 + 384 + struct hif_mib_slot_time { 385 + uint32_t slot_time; 386 + } __packed; 387 + 388 + struct hif_mib_current_tx_power_level { 389 + int32_t power_level; 390 + } __packed; 391 + 392 + struct hif_mib_non_erp_protection { 393 + uint8_t use_cts_to_self:1; 394 + uint8_t reserved1:7; 395 + uint8_t reserved2[3]; 396 + } __packed; 397 + 398 + enum hif_tx_mode { 399 + HIF_TX_MODE_MIXED = 0x0, 400 + HIF_TX_MODE_GREENFIELD = 0x1 401 + }; 402 + 403 + enum hif_tmplt { 404 + HIF_TMPLT_PRBREQ = 0x0, 405 + HIF_TMPLT_BCN = 0x1, 406 + HIF_TMPLT_NULL = 0x2, 407 + HIF_TMPLT_QOSNUL = 0x3, 408 + HIF_TMPLT_PSPOLL = 0x4, 409 + HIF_TMPLT_PRBRES = 0x5, 410 + HIF_TMPLT_ARP = 0x6, 411 + HIF_TMPLT_NA = 0x7 412 + }; 413 + 414 + #define HIF_API_MAX_TEMPLATE_FRAME_SIZE 700 415 + 416 + struct hif_mib_template_frame { 417 + uint8_t frame_type; 418 + uint8_t init_rate:7; 419 + uint8_t mode:1; 420 + uint16_t frame_length; 421 + uint8_t frame[HIF_API_MAX_TEMPLATE_FRAME_SIZE]; 422 + } __packed; 423 + 424 + struct hif_mib_beacon_wake_up_period { 425 + uint8_t wakeup_period_min; 426 + uint8_t receive_dtim:1; 427 + uint8_t reserved1:7; 428 + uint8_t wakeup_period_max; 429 + uint8_t reserved2; 430 + } __packed; 431 + 432 + struct hif_mib_rcpi_rssi_threshold { 433 + uint8_t detection:1; 434 + uint8_t rcpi_rssi:1; 435 + uint8_t upperthresh:1; 436 + uint8_t lowerthresh:1; 437 + uint8_t reserved:4; 438 + uint8_t lower_threshold; 439 + uint8_t upper_threshold; 440 + uint8_t rolling_average_count; 441 + } __packed; 442 + 443 + #define DEFAULT_BA_MAX_RX_BUFFER_SIZE 16 444 + 445 + struct hif_mib_block_ack_policy { 446 + uint8_t block_ack_tx_tid_policy; 447 + uint8_t reserved1; 448 + uint8_t block_ack_rx_tid_policy; 449 + uint8_t block_ack_rx_max_buffer_size; 450 + } __packed; 451 + 452 + struct hif_mib_override_int_rate { 453 + uint8_t internal_tx_rate; 454 + uint8_t non_erp_internal_tx_rate; 455 + uint8_t reserved[2]; 456 + } __packed; 457 + 458 + enum hif_mpdu_start_spacing { 459 + HIF_MPDU_START_SPACING_NO_RESTRIC = 0x0, 460 + HIF_MPDU_START_SPACING_QUARTER = 0x1, 461 + HIF_MPDU_START_SPACING_HALF = 0x2, 462 + HIF_MPDU_START_SPACING_ONE = 0x3, 463 + HIF_MPDU_START_SPACING_TWO = 0x4, 464 + HIF_MPDU_START_SPACING_FOUR = 0x5, 465 + HIF_MPDU_START_SPACING_EIGHT = 0x6, 466 + HIF_MPDU_START_SPACING_SIXTEEN = 0x7 467 + }; 468 + 469 + struct hif_mib_set_association_mode { 470 + uint8_t preambtype_use:1; 471 + uint8_t mode:1; 472 + uint8_t rateset:1; 473 + uint8_t spacing:1; 474 + uint8_t reserved:4; 475 + uint8_t preamble_type; 476 + uint8_t mixed_or_greenfield_type; 477 + uint8_t mpdu_start_spacing; 478 + uint32_t basic_rate_set; 479 + } __packed; 480 + 481 + struct hif_mib_set_uapsd_information { 482 + uint8_t trig_bckgrnd:1; 483 + uint8_t trig_be:1; 484 + uint8_t trig_video:1; 485 + uint8_t trig_voice:1; 486 + uint8_t reserved1:4; 487 + uint8_t deliv_bckgrnd:1; 488 + uint8_t deliv_be:1; 489 + uint8_t deliv_video:1; 490 + uint8_t deliv_voice:1; 491 + uint8_t reserved2:4; 492 + uint16_t min_auto_trigger_interval; 493 + uint16_t max_auto_trigger_interval; 494 + uint16_t auto_trigger_step; 495 + } __packed; 496 + 497 + struct hif_mib_tx_rate_retry_policy { 498 + uint8_t policy_index; 499 + uint8_t short_retry_count; 500 + uint8_t long_retry_count; 501 + uint8_t first_rate_sel:2; 502 + uint8_t terminate:1; 503 + uint8_t count_init:1; 504 + uint8_t reserved1:4; 505 + uint8_t rate_recovery_count; 506 + uint8_t reserved2[3]; 507 + uint8_t rates[12]; 508 + } __packed; 509 + 510 + #define HIF_MIB_NUM_TX_RATE_RETRY_POLICIES 16 511 + 512 + struct hif_mib_set_tx_rate_retry_policy { 513 + uint8_t num_tx_rate_policies; 514 + uint8_t reserved[3]; 515 + struct hif_mib_tx_rate_retry_policy tx_rate_retry_policy[]; 516 + } __packed; 517 + 518 + struct hif_mib_protected_mgmt_policy { 519 + uint8_t pmf_enable:1; 520 + uint8_t unpmf_allowed:1; 521 + uint8_t host_enc_auth_frames:1; 522 + uint8_t reserved1:5; 523 + uint8_t reserved2[3]; 524 + } __packed; 525 + 526 + struct hif_mib_set_ht_protection { 527 + uint8_t dual_cts_prot:1; 528 + uint8_t reserved1:7; 529 + uint8_t reserved2[3]; 530 + } __packed; 531 + 532 + struct hif_mib_keep_alive_period { 533 + uint16_t keep_alive_period; 534 + uint8_t reserved[2]; 535 + } __packed; 536 + 537 + struct hif_mib_arp_keep_alive_period { 538 + uint16_t arp_keep_alive_period; 539 + uint8_t encr_type; 540 + uint8_t reserved; 541 + uint8_t sender_ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; 542 + uint8_t target_ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; 543 + } __packed; 544 + 545 + struct hif_mib_inactivity_timer { 546 + uint8_t min_active_time; 547 + uint8_t max_active_time; 548 + uint16_t reserved; 549 + } __packed; 550 + 551 + struct hif_mib_interface_protection { 552 + uint8_t use_cts_prot:1; 553 + uint8_t reserved1:7; 554 + uint8_t reserved2[3]; 555 + } __packed; 556 + 557 + 558 + #endif