1 /* 2 * 3 *Copyright (c) 2024 Nordic Semiconductor ASA 4 * 5 *SPDX-License-Identifier: BSD-3-Clause 6 */ 7 8 /** 9 * @file 10 * @addtogroup nrf_wifi_fw_if Wi-Fi driver and firmware interface 11 * @{ 12 * @brief System interface between host and RPU 13 */ 14 15 #ifndef __HOST_RPU_SYS_IF_H__ 16 #define __HOST_RPU_SYS_IF_H__ 17 18 #include "host_rpu_common_if.h" 19 #include "lmac_if_common.h" 20 21 #include "common/pack_def.h" 22 23 #define USE_PROTECTION_NONE 0 24 #define USE_PROTECTION_RTS 1 25 #define USE_PROTECTION_CTS2SELF 2 26 27 #define USE_SHORT_PREAMBLE 0 28 #define DONT_USE_SHORT_PREAMBLE 1 29 30 #define MARK_RATE_AS_MCS_INDEX 0x80 31 #define MARK_RATE_AS_RATE 0x00 32 33 #define ENABLE_GREEN_FIELD 0x01 34 #define ENABLE_CHNL_WIDTH_40MHZ 0x02 35 #define ENABLE_SGI 0x04 36 #define ENABLE_11N_FORMAT 0x08 37 #define ENABLE_VHT_FORMAT 0x10 38 #define ENABLE_CHNL_WIDTH_80MHZ 0x20 39 40 #define MAX_TX_AGG_SIZE 16 41 #define MAX_RX_BUFS_PER_EVNT 64 42 #define MAX_MGMT_BUFS 16 43 44 /*#define ETH_ADDR_LEN 6*/ 45 #define MAX_RF_CALIB_DATA 900 46 47 #define NRF_WIFI_ETH_ADDR_LEN 6 48 49 #define PHY_THRESHOLD_NORMAL (-65) 50 #define PHY_THRESHOLD_PROD_MODE (-93) 51 52 #define MAX_TX_STREAMS 1 53 #define MAX_RX_STREAMS 1 54 55 #define MAX_NUM_VIFS 2 56 #define MAX_NUM_STAS 2 57 #define MAX_NUM_APS 1 58 59 #define NRF_WIFI_COUNTRY_CODE_LEN 2 60 61 /** 62 * @brief This enum provides a list of different operating modes. 63 * 64 */ 65 enum rpu_op_mode { 66 /** Radio test mode is used for performing radio tests using 67 * continuous Tx/Rx on a configured channel at a particular rate or power. 68 */ 69 RPU_OP_MODE_RADIO_TEST, 70 /** In this mode different types of calibration like RF calibration can be performed */ 71 RPU_OP_MODE_FCM, 72 /** Regular mode of operation */ 73 RPU_OP_MODE_REG, 74 /** Debug mode can be used to control certain parameters like TX rate 75 * in order to debug functional issues. 76 */ 77 RPU_OP_MODE_DBG, 78 /** Highest mode number currently defined */ 79 RPU_OP_MODE_MAX 80 }; 81 82 /** 83 * @brief This enum defines various types of statistics. 84 */ 85 enum rpu_stats_type { 86 /** All statistics includes PHY, LMAC & UMAC */ 87 RPU_STATS_TYPE_ALL, 88 /** Host statistics */ 89 RPU_STATS_TYPE_HOST, 90 /** UMAC statistics */ 91 RPU_STATS_TYPE_UMAC, 92 /** LMAC statistics*/ 93 RPU_STATS_TYPE_LMAC, 94 /** PHY statistics */ 95 RPU_STATS_TYPE_PHY, 96 /** Offloaded Raw TX statistics */ 97 RPU_STATS_TYPE_OFFLOADED_RAW_TX, 98 /** Highest statistics type number currently defined */ 99 RPU_STATS_TYPE_MAX 100 }; 101 102 /** 103 * @brief- Throughput mode 104 * Throughput mode to be used for transmitting the packet. 105 */ 106 enum rpu_tput_mode { 107 /** Legacy mode */ 108 RPU_TPUT_MODE_LEGACY, 109 /** High Throuput mode(11n) */ 110 RPU_TPUT_MODE_HT, 111 /** Very hight throughput(11ac) */ 112 RPU_TPUT_MODE_VHT, 113 /** HE SU mode */ 114 RPU_TPUT_MODE_HE_SU, 115 /** HE ER SU mode */ 116 RPU_TPUT_MODE_HE_ER_SU, 117 /** HE TB mode */ 118 RPU_TPUT_MODE_HE_TB, 119 /** Highest throughput mode currently defined */ 120 RPU_TPUT_MODE_MAX 121 }; 122 123 /** 124 * @brief - System commands. 125 * 126 */ 127 enum nrf_wifi_sys_commands { 128 /** Command to initialize RPU and RPU responds with NRF_WIFI_EVENT_INIT_DONE */ 129 NRF_WIFI_CMD_INIT, 130 /** command to send a Tx packet in radiotest mode */ 131 NRF_WIFI_CMD_TX, 132 /** Unused */ 133 NRF_WIFI_CMD_IF_TYPE, 134 /** command to specify mode of operation */ 135 NRF_WIFI_CMD_MODE, 136 /** command to get statistics */ 137 NRF_WIFI_CMD_GET_STATS, 138 /** command to clear statistics */ 139 NRF_WIFI_CMD_CLEAR_STATS, 140 /** command to ENABLE/DISABLE receiving packets in radiotest mode */ 141 NRF_WIFI_CMD_RX, 142 /** Command to measure battery voltage and RPU responds with NRF_WIFI_EVENT_PWR_DATA */ 143 NRF_WIFI_CMD_PWR, 144 /** RPU De-initialization */ 145 NRF_WIFI_CMD_DEINIT, 146 /** Command for WIFI & SR coexistence */ 147 NRF_WIFI_CMD_SRCOEX, 148 /** Command to start RF test */ 149 NRF_WIFI_CMD_RF_TEST, 150 /** Configure HE_GI & HE_LTF */ 151 NRF_WIFI_CMD_HE_GI_LTF_CONFIG, 152 /** Command for getting UMAC memory statistics */ 153 NRF_WIFI_CMD_UMAC_INT_STATS, 154 /** Command for Setting the channel & Rf params in radiotest mode */ 155 NRF_WIFI_CMD_RADIO_TEST_INIT, 156 /** Command for setting country in radiotest mode */ 157 NRF_WIFI_CMD_RT_REQ_SET_REG, 158 /** Command to enable/disable fixed data rate in regular mode */ 159 NRF_WIFI_CMD_TX_FIX_DATA_RATE, 160 /** Command to set channel in promiscuous, monitor & packet injector mode */ 161 NRF_WIFI_CMD_CHANNEL, 162 /** Command to configure promiscuous mode, Monitor mode & packet injector mode */ 163 NRF_WIFI_CMD_RAW_CONFIG_MODE, 164 /** Command to configure promiscuous mode, Monitor mode filter*/ 165 NRF_WIFI_CMD_RAW_CONFIG_FILTER, 166 /** Command to configure packet injector mode or Raw Tx mode */ 167 NRF_WIFI_CMD_RAW_TX_PKT, 168 /** Command to reset interface statistics */ 169 NRF_WIFI_CMD_RESET_STATISTICS, 170 /** Command to configure raw tx offloading parameters */ 171 NRF_WIFI_CMD_OFFLOAD_RAW_TX_PARAMS, 172 /** Command to enable/disable raw tx offloading */ 173 NRF_WIFI_CMD_OFFLOAD_RAW_TX_CTRL, 174 }; 175 176 /** 177 * @brief - Events from the RPU. 178 * 179 */ 180 enum nrf_wifi_sys_events { 181 /** Response to NRF_WIFI_CMD_PWR */ 182 NRF_WIFI_EVENT_PWR_DATA, 183 /** Response to NRF_WIFI_CMD_INIT */ 184 NRF_WIFI_EVENT_INIT_DONE, 185 /** Response to NRF_WIFI_CMD_GET_STATS */ 186 NRF_WIFI_EVENT_STATS, 187 /** Response to NRF_WIFI_CMD_DEINIT */ 188 NRF_WIFI_EVENT_DEINIT_DONE, 189 /** Response to NRF_WIFI_CMD_RF_TEST */ 190 NRF_WIFI_EVENT_RF_TEST, 191 /** Response to NRF_WIFI_CMD_SRCOEX. */ 192 NRF_WIFI_EVENT_COEX_CONFIG, 193 /** Response to NRF_WIFI_CMD_UMAC_INT_STATS */ 194 NRF_WIFI_EVENT_INT_UMAC_STATS, 195 /** Command status events for radio test commands*/ 196 NRF_WIFI_EVENT_RADIOCMD_STATUS, 197 /** Response to NRF_WIFI_CMD_CHANNEL */ 198 NRF_WIFI_EVENT_CHANNEL_SET_DONE, 199 /** Response to NRF_WIFI_CMD_RAW_CONFIG_MODE */ 200 NRF_WIFI_EVENT_MODE_SET_DONE, 201 /** Response to NRF_WIFI_CMD_RAW_CONFIG_FILTER */ 202 NRF_WIFI_EVENT_FILTER_SET_DONE, 203 /** Tx done event for the Raw Tx */ 204 NRF_WIFI_EVENT_RAW_TX_DONE, 205 /** Command status events for offloaded raw tx commands */ 206 NRF_WIFI_EVENT_OFFLOADED_RAWTX_STATUS, 207 }; 208 209 /** 210 * @brief - Channel Bandwidth types. 211 * 212 **/ 213 enum rpu_ch_bw { 214 /** 20MHz bandwidth */ 215 RPU_CH_BW_20, 216 /** 40MHz bandwidth */ 217 RPU_CH_BW_40, 218 /** 80MHz bandwidth */ 219 RPU_CH_BW_MAX 220 }; 221 222 /** 223 * @brief - This structure specifies the parameters required to configure a specific channel. 224 * 225 */ 226 struct chan_params { 227 /** Primary channel number */ 228 unsigned int primary_num; 229 /** Channel bandwidth */ 230 unsigned char bw; 231 /** 20Mhz offset value */ 232 signed int sec_20_offset; 233 /** 40Mhz offset value */ 234 signed int sec_40_offset; 235 } __NRF_WIFI_PKD; 236 237 /** 238 * @brief This structure specifies the parameters required to start or stop the RX (receive) 239 * operation in radiotest mode. 240 * 241 */ 242 struct rpu_conf_rx_radio_test_params { 243 /** Number of spatial streams supported. Currently unused. */ 244 unsigned char nss; 245 /* Input to the RF for operation */ 246 unsigned char rf_params[NRF_WIFI_RF_PARAMS_SIZE]; 247 /** An array containing RF and baseband control params */ 248 struct chan_params chan; 249 /** Copy OTP params to this memory */ 250 signed char phy_threshold; 251 /** Calibration bit map value. More information can be found in the phy_rf_params.h file. 252 */ 253 unsigned int phy_calib; 254 /** Start Rx : 1, Stop Rx :0 */ 255 unsigned char rx; 256 } __NRF_WIFI_PKD; 257 258 /** 259 * @brief This structure specifies the UMAC (Upper MAC) RX (receive) debug parameters 260 * specifically designed for debugging purpose. 261 * 262 */ 263 264 struct umac_rx_dbg_params { 265 /** Total lmac events received to UMAC */ 266 unsigned int lmac_events; 267 /** Total Rx events(LMAC_EVENT_RX) received in ISR */ 268 unsigned int rx_events; 269 /** Received coalised events from LMAC */ 270 unsigned int rx_coalesce_events; 271 /** Total Rx packets received from LMAC */ 272 unsigned int total_rx_pkts_from_lmac; 273 /** Maximum RX packets buffered at any point of time in UMAC.*/ 274 unsigned int max_refill_gap; 275 /** Difference between rx packets received from lmac and packets sent to host */ 276 unsigned int current_refill_gap; 277 /** Number of Packets queued to reorder buffer due to out of order */ 278 unsigned int out_of_order_mpdus; 279 /** Number of packets removed from reorder buffer */ 280 unsigned int reorder_free_mpdus; 281 /** Number of Rx packets resubmitted to LMAC by UMAC */ 282 unsigned int umac_consumed_pkts; 283 /** Number of Rx packets sent to Host for resubmiting */ 284 unsigned int host_consumed_pkts; 285 /** Total events posted to UMAC RX thread from LMAC */ 286 unsigned int rx_mbox_post; 287 /** Total events received to UMAC RX thread from LMAC */ 288 unsigned int rx_mbox_receive; 289 /** Number of packets received in out of order */ 290 unsigned int reordering_ampdu; 291 /** Messages posted to TX mbox from timer ISR */ 292 unsigned int timer_mbox_post; 293 /** Messages received from timer ISR */ 294 unsigned int timer_mbox_rcv; 295 /** Messages posted to TX mbox from work scheduler */ 296 unsigned int work_mbox_post; 297 /** Messages received from work scheduler */ 298 unsigned int work_mbox_rcv; 299 /** Messages posted to TX mbox from tasklet function */ 300 unsigned int tasklet_mbox_post; 301 /** Messages received from tasklet function */ 302 unsigned int tasklet_mbox_rcv; 303 /** Management frames sent to userspace */ 304 unsigned int userspace_offload_frames; 305 /** Number of times where requested buffer size is not available 306 * and allocated from next available memory buffer 307 */ 308 unsigned int alloc_buf_fail; 309 /** Total packets count in RX thread */ 310 unsigned int rx_packet_total_count; 311 /** Number of data packets received */ 312 unsigned int rx_packet_data_count; 313 /** Number of Qos data packets received */ 314 unsigned int rx_packet_qos_data_count; 315 /** Number of protected data packets received */ 316 unsigned int rx_packet_protected_data_count; 317 /** Number of management packets received */ 318 unsigned int rx_packet_mgmt_count; 319 /** Number of beacon packets received */ 320 unsigned int rx_packet_beacon_count; 321 /** Number of probe response packets received */ 322 unsigned int rx_packet_probe_resp_count; 323 /** Number of authentication packets received */ 324 unsigned int rx_packet_auth_count; 325 /** Number of deauthentication packets received */ 326 unsigned int rx_packet_deauth_count; 327 /** Number of assoc response packets received */ 328 unsigned int rx_packet_assoc_resp_count; 329 /** Number of disassociation packets received */ 330 unsigned int rx_packet_disassoc_count; 331 /** Number of action frames received */ 332 unsigned int rx_packet_action_count; 333 /** Number of probe request packets received */ 334 unsigned int rx_packet_probe_req_count; 335 /** Other management packets received */ 336 unsigned int rx_packet_other_mgmt_count; 337 /** Maximum coalised packets received from LMAC in any RX event */ 338 signed char max_coalesce_pkts; 339 /** Packets received with null skb pointer from LMAC */ 340 unsigned int null_skb_pointer_from_lmac; 341 /** Number of unexpected management packets received in coalesce event */ 342 unsigned int unexpected_mgmt_pkt; 343 344 } __NRF_WIFI_PKD; 345 346 /** 347 * @brief This structure specifies the UMAC TX (transmit) debug parameters used for 348 * debugging purposes. 349 * 350 */ 351 struct umac_tx_dbg_params { 352 /** Total number of tx commands received from host */ 353 unsigned int tx_cmd; 354 /** Non coalesce packets received */ 355 unsigned int tx_non_coalesce_pkts_rcvd_from_host; 356 /** coalesce packets received */ 357 unsigned int tx_coalesce_pkts_rcvd_from_host; 358 /** Maximum number of coalesce packets received in any 359 * TX command coalesce packets received 360 */ 361 unsigned int tx_max_coalesce_pkts_rcvd_from_host; 362 /** Maximum Tx commands currently in process at any point of time in UMAC */ 363 unsigned int tx_cmds_max_used; 364 /** Number of Tx commands that are currently in process in UMAC */ 365 unsigned int tx_cmds_currently_in_use; 366 /** Number of tx done events sent to host */ 367 unsigned int tx_done_events_send_to_host; 368 /** Number of tx done success packets sent to host */ 369 unsigned int tx_done_success_pkts_to_host; 370 /** Number of tx done failure packets sent to host */ 371 unsigned int tx_done_failure_pkts_to_host; 372 /** Number of packets received from host that needs to be encrypted */ 373 unsigned int tx_cmds_with_crypto_pkts_rcvd_from_host; 374 /** Number of packets received from host that need not to be encrypted */ 375 unsigned int tx_cmds_with_non_crypto_pkts_rcvd_from_host; 376 /** Number of broadcast packets received from host */ 377 unsigned int tx_cmds_with_broadcast_pkts_rcvd_from_host; 378 /** Number of multicast packets received from host */ 379 unsigned int tx_cmds_with_multicast_pkts_rcvd_from_host; 380 /** Number of unicast packets received from host */ 381 unsigned int tx_cmds_with_unicast_pkts_rcvd_from_host; 382 /** UMAC internal count */ 383 unsigned int xmit; 384 /** Number of addba requests sent */ 385 unsigned int send_addba_req; 386 /** Total ADD BA responses received from host */ 387 unsigned int addba_resp; 388 /** Total packets received in softmac tx function */ 389 unsigned int softmac_tx; 390 /** Number of packets generated internally in UMAC */ 391 unsigned int internal_pkts; 392 /** Number of packets Received from host */ 393 unsigned int external_pkts; 394 /** Total tx commmands sent to lmac */ 395 unsigned int tx_cmds_to_lmac; 396 /** Tx dones received from LMAC */ 397 unsigned int tx_dones_from_lmac; 398 /** Total commands sent to lmac in UMAC hal */ 399 unsigned int total_cmds_to_lmac; 400 /** Number of data packets sent */ 401 unsigned int tx_packet_data_count; 402 /** Number of management packets sent */ 403 unsigned int tx_packet_mgmt_count; 404 /** Number of beacon packets sent */ 405 unsigned int tx_packet_beacon_count; 406 /** Number of probe request packets sent */ 407 unsigned int tx_packet_probe_req_count; 408 /** Number of authentication packets sent */ 409 unsigned int tx_packet_auth_count; 410 /** Number of deauthentication packets sent */ 411 unsigned int tx_packet_deauth_count; 412 /** Number of association request packets sent */ 413 unsigned int tx_packet_assoc_req_count; 414 /** Number of disassociation packets sent */ 415 unsigned int tx_packet_disassoc_count; 416 /** Number of action packets sent */ 417 unsigned int tx_packet_action_count; 418 /** Other management packets sent */ 419 unsigned int tx_packet_other_mgmt_count; 420 /** Number of Non management packets sent */ 421 unsigned int tx_packet_non_mgmt_data_count; 422 423 } __NRF_WIFI_PKD; 424 425 /** 426 * @brief This structure specifies the UMAC command and event debug parameters used for 427 * debugging purpose. 428 * 429 */ 430 struct umac_cmd_evnt_dbg_params { 431 /** Number of command init received from host */ 432 unsigned char cmd_init; 433 /** Number of init_done events sent to host */ 434 unsigned char event_init_done; 435 /** Number of rf test command received from host */ 436 unsigned char cmd_rf_test; 437 /** Number of connect command received from host */ 438 unsigned char cmd_connect; 439 /** Number of get_stats command received from host */ 440 unsigned int cmd_get_stats; 441 /** Number of power save state events sent to host */ 442 unsigned int event_ps_state; 443 /** Unused*/ 444 unsigned int cmd_set_reg; 445 /** Number of get regulatory commands received from host */ 446 unsigned int cmd_get_reg; 447 /** Number of request set regulatory commands received from host */ 448 unsigned int cmd_req_set_reg; 449 /** Number of trigger scan commands received from host */ 450 unsigned int cmd_trigger_scan; 451 /** Number of scan done events sent to host */ 452 unsigned int event_scan_done; 453 /** Number of get scan commands received from the host to get scan results */ 454 unsigned int cmd_get_scan; 455 /** Number of scan commands sent to LMAC */ 456 unsigned int umac_scan_req; 457 /** Number of scan complete events received from LMAC */ 458 unsigned int umac_scan_complete; 459 /** Number of scan requests received from host when previous scan is in progress */ 460 unsigned int umac_scan_busy; 461 /** Number of authentication requests received from host */ 462 unsigned int cmd_auth; 463 /** Number of association requests received from host */ 464 unsigned int cmd_assoc; 465 /** Number of deauthentication requests received from host */ 466 unsigned int cmd_deauth; 467 /** Number of register frame commands received from host to register 468 * a management frame type which should be passed to host 469 */ 470 unsigned int cmd_register_frame; 471 /** Number of command frames from host which will be used for 472 * transmitting management frames 473 */ 474 unsigned int cmd_frame; 475 /** Number of delete key commands from host */ 476 unsigned int cmd_del_key; 477 /** Number of new key commands received from host */ 478 unsigned int cmd_new_key; 479 /** Number of set key commands received from host */ 480 unsigned int cmd_set_key; 481 /** Number of get key commands received from host */ 482 unsigned int cmd_get_key; 483 /** Number of beacon hint events sent to host */ 484 unsigned int event_beacon_hint; 485 /** Number of regulatory change events sent to host when regulatory change command 486 * received from host such as in response to command NL80211_CMD_REG_CHANGE 487 */ 488 unsigned int event_reg_change; 489 /** Number of regulatory change events sent to host other than 490 * host request for regulatory change 491 */ 492 unsigned int event_wiphy_reg_change; 493 /** Number of set station commands received from host */ 494 unsigned int cmd_set_station; 495 /** Number of new station commands received from host */ 496 unsigned int cmd_new_station; 497 /** Number of del station commands received from host */ 498 unsigned int cmd_del_station; 499 /** Number of new interface commands received from host */ 500 unsigned int cmd_new_interface; 501 /** Number of set interface commands received from host */ 502 unsigned int cmd_set_interface; 503 /** Number of get interface commands received from host */ 504 unsigned int cmd_get_interface; 505 /** Number of set_ifflags commands received from host */ 506 unsigned int cmd_set_ifflags; 507 /** Number of set_ifflags events sent to host */ 508 unsigned int cmd_set_ifflags_done; 509 /** Number of set bss command received from host */ 510 unsigned int cmd_set_bss; 511 /** Number of set wiphy command received from host */ 512 unsigned int cmd_set_wiphy; 513 /** Number of start access point command received from host */ 514 unsigned int cmd_start_ap; 515 /** Number of power save configuration commands sent to LMAC */ 516 unsigned int LMAC_CMD_PS; 517 /** Current power save state configured to LMAC through LMAC_CMD_PS command */ 518 unsigned int CURR_STATE; 519 } __NRF_WIFI_PKD; 520 521 /** 522 * @brief This structure specifies the UMAC interface debug parameters used for debugging purpose. 523 * 524 */ 525 struct nrf_wifi_interface_stats { 526 /** Number of unicast packets sent */ 527 unsigned int tx_unicast_pkt_count; 528 /** Number of multicast packets sent */ 529 unsigned int tx_multicast_pkt_count; 530 /** Number of broadcast packets sent */ 531 unsigned int tx_broadcast_pkt_count; 532 /** Number of tx data bytes sent */ 533 unsigned int tx_bytes; 534 /** Number of unicast packets received */ 535 unsigned int rx_unicast_pkt_count; 536 /** Number of multicast packets received */ 537 unsigned int rx_multicast_pkt_count; 538 /** Number of broadcast packets received */ 539 unsigned int rx_broadcast_pkt_count; 540 /** Number of beacon packets received */ 541 unsigned int rx_beacon_success_count; 542 /** Number of beacon packets missed */ 543 unsigned int rx_beacon_miss_count; 544 /** Number of rx data bytes received */ 545 unsigned int rx_bytes; 546 /** Number of packets with checksum mismatch received */ 547 unsigned int rx_checksum_error_count; 548 /** Number of duplicate packets received */ 549 unsigned int replay_attack_drop_cnt; 550 } __NRF_WIFI_PKD; 551 552 /** 553 * @brief This structure defines the UMAC debug statistics. It contains the necessary parameters 554 * and fields used to gather and present debugging statistics within the UMAC layer. 555 * 556 */ 557 struct rpu_umac_stats { 558 /** Transmit debug statistics @ref umac_tx_dbg_params */ 559 struct umac_tx_dbg_params tx_dbg_params; 560 /** Receive debug statistics @ref umac_rx_dbg_params */ 561 struct umac_rx_dbg_params rx_dbg_params; 562 /** Command Event debug statistics @ref umac_cmd_evnt_dbg_params */ 563 struct umac_cmd_evnt_dbg_params cmd_evnt_dbg_params; 564 /** Interface debug parameters @ref nrf_wifi_interface_stats */ 565 struct nrf_wifi_interface_stats interface_data_stats; 566 } __NRF_WIFI_PKD; 567 568 /** 569 * @brief This structure defines the LMAC debug parameters. 570 * 571 */ 572 struct rpu_lmac_stats { 573 /** Number of reset command counts from UMAC */ 574 unsigned int reset_cmd_cnt; 575 /** Number of reset complete events sent to UMAC */ 576 unsigned int reset_complete_event_cnt; 577 /** Number of events unable to generate */ 578 unsigned int unable_gen_event; 579 /** Number of channel program commands from UMAC */ 580 unsigned int ch_prog_cmd_cnt; 581 /** Number of channel program done events to UMAC */ 582 unsigned int channel_prog_done; 583 /** Number of Tx commands from UMAC */ 584 unsigned int tx_pkt_cnt; 585 /** Number of Tx done events to UMAC */ 586 unsigned int tx_pkt_done_cnt; 587 /** Unused */ 588 unsigned int scan_pkt_cnt; 589 /** Number of internal Tx packets */ 590 unsigned int internal_pkt_cnt; 591 /** Number of Tx dones for internal packets */ 592 unsigned int internal_pkt_done_cnt; 593 /** Number of acknowledgment responses */ 594 unsigned int ack_resp_cnt; 595 /** Number of transmit timeouts */ 596 unsigned int tx_timeout; 597 /** Number of deaggregation ISRs */ 598 unsigned int deagg_isr; 599 /** Number of deaggregation input descriptor empties */ 600 unsigned int deagg_inptr_desc_empty; 601 /** Number of deaggregation circular buffer full events */ 602 unsigned int deagg_circular_buffer_full; 603 /** Number of LMAC received ISRs */ 604 unsigned int lmac_rxisr_cnt; 605 /** Number of received packets decrypted */ 606 unsigned int rx_decryptcnt; 607 /** Number of packet decryption failures during processing */ 608 unsigned int process_decrypt_fail; 609 /** Number of RX event preparation failures */ 610 unsigned int prepa_rx_event_fail; 611 /** Number of RX core pool full counts */ 612 unsigned int rx_core_pool_full_cnt; 613 /** Number of RX MPDU CRC successes */ 614 unsigned int rx_mpdu_crc_success_cnt; 615 /** Number of RX MPDU CRC failures */ 616 unsigned int rx_mpdu_crc_fail_cnt; 617 /** Number of RX OFDM CRC successes */ 618 unsigned int rx_ofdm_crc_success_cnt; 619 /** Number of RX OFDM CRC failures */ 620 unsigned int rx_ofdm_crc_fail_cnt; 621 /** Number of RX DSSS CRC successes */ 622 unsigned int rxDSSSCrcSuccessCnt; 623 /** Number of RX DSSS CRC failures */ 624 unsigned int rxDSSSCrcFailCnt; 625 /** Number of RX crypto start counts */ 626 unsigned int rx_crypto_start_cnt; 627 /** Number of RX crypto done counts */ 628 unsigned int rx_crypto_done_cnt; 629 /** Number of RX event buffer full counts */ 630 unsigned int rx_event_buf_full; 631 /** Number of RX external RAM buffer full counts */ 632 unsigned int rx_extram_buf_full; 633 /** Number of scan requests receive from UMAC */ 634 unsigned int scan_req; 635 /** Number of scan complete events sent to UMAC */ 636 unsigned int scan_complete; 637 /** Number of scan abort requests */ 638 unsigned int scan_abort_req; 639 /** Number of scan abort complete events */ 640 unsigned int scan_abort_complete; 641 /** Number of internal buffer pool null counts */ 642 unsigned int internal_buf_pool_null; 643 /** RPU hardware lockup event detection count */ 644 unsigned int rpu_hw_lockup_count; 645 /** RPU hardware lockup recovery completed count */ 646 unsigned int rpu_hw_lockup_recovery_done; 647 } __NRF_WIFI_PKD; 648 649 650 /** 651 * @brief This structure defines the PHY (Physical Layer) debug statistics. 652 * 653 */ 654 struct rpu_phy_stats { 655 /** Rssi average value received from LMAC */ 656 signed char rssi_avg; 657 /** Unused */ 658 unsigned char pdout_val; 659 /** Number of OFDM CRC Pass packets */ 660 unsigned int ofdm_crc32_pass_cnt; 661 /** Number of OFDM CRC Fail packets */ 662 unsigned int ofdm_crc32_fail_cnt; 663 /** Number of DSSS CRC Pass packets */ 664 unsigned int dsss_crc32_pass_cnt; 665 /** Number of DSSS CRC Fail packets */ 666 unsigned int dsss_crc32_fail_cnt; 667 } __NRF_WIFI_PKD; 668 669 670 /** 671 * @brief The UMAC header structure for system commands and events defines the format 672 * used to transmit and receive system-level commands and events. 673 * 674 */ 675 struct nrf_wifi_sys_head { 676 /** Command/Event id */ 677 unsigned int cmd_event; 678 /** message length */ 679 unsigned int len; 680 } __NRF_WIFI_PKD; 681 682 /** Feature Disable */ 683 #define NRF_WIFI_FEATURE_DISABLE 0 684 /** Feature Enable */ 685 #define NRF_WIFI_FEATURE_ENABLE 1 686 687 /** 688 * @brief The maximum Rx (receive) A-MPDU size in KB. 689 * 690 */ 691 enum max_rx_ampdu_size { 692 /** 8KB AMPDU Size */ 693 MAX_RX_AMPDU_SIZE_8KB, 694 /** 16KB AMPDU Size */ 695 MAX_RX_AMPDU_SIZE_16KB, 696 /** 32KB AMPDU Size */ 697 MAX_RX_AMPDU_SIZE_32KB, 698 /** 64KB AMPDU Size */ 699 MAX_RX_AMPDU_SIZE_64KB 700 }; 701 702 /** 703 * @brief This structure specifies the configuration parameters used for configuring 704 * data-related settings. 705 * 706 */ 707 708 struct nrf_wifi_data_config_params { 709 /** rate_protection_type:0->NONE, 1->RTS/CTS, 2->CTS2SELF */ 710 unsigned char rate_protection_type; 711 /** Aggregation is enabled(NRF_WIFI_FEATURE_ENABLE) or 712 * disabled(NRF_WIFI_FEATURE_DISABLE) 713 */ 714 unsigned char aggregation; 715 /** WMM is enabled(NRF_WIFI_FEATURE_ENABLE) or 716 * disabled(NRF_WIFI_FEATURE_DISABLE) 717 */ 718 unsigned char wmm; 719 /** Max number of aggregated TX sessions */ 720 unsigned char max_num_tx_agg_sessions; 721 /** Max number of aggregated RX sessions */ 722 unsigned char max_num_rx_agg_sessions; 723 /** maximum aggregation size */ 724 unsigned char max_tx_aggregation; 725 /** Reorder buffer size (1 to 64) */ 726 unsigned char reorder_buf_size; 727 /** Max RX AMPDU size (8/16/32/64 KB), see &enum max_rx_ampdu_size */ 728 signed int max_rxampdu_size; 729 } __NRF_WIFI_PKD; 730 731 /** 732 * @brief This structure specifies the parameters that need to be provided for the command 733 * NRF_WIFI_CMD_INIT for all modes. The NRF_WIFI_CMD_INIT command is typically used to 734 * initialize the Wi-Fi module and prepare it for further communication. 735 * 736 */ 737 struct nrf_wifi_sys_params { 738 /** enable rpu sleep */ 739 unsigned int sleep_enable; 740 /** Normal/FTM mode */ 741 unsigned int hw_bringup_time; 742 /** Antenna Configuration, applicable only for 1x1 */ 743 unsigned int sw_bringup_time; 744 /** Internal tuning parameter */ 745 unsigned int bcn_time_out; 746 /** Set to 1 if rpu is expected to perform sleep clock calibration */ 747 unsigned int calib_sleep_clk; 748 /** calib bit map value. More info can be found in phy_rf_params.h NRF_WIFI_DEF_PHY_CALIB */ 749 unsigned int phy_calib; 750 /** MAC address of the interface. Not applicable to Radio Test mode */ 751 unsigned char mac_addr[NRF_WIFI_ETH_ADDR_LEN]; 752 /** An array containing RF & baseband control params */ 753 unsigned char rf_params[NRF_WIFI_RF_PARAMS_SIZE]; 754 /** Indicates whether the rf_params has a valid value */ 755 unsigned char rf_params_valid; 756 } __NRF_WIFI_PKD; 757 758 759 /** 760 * @brief This structure defines the parameters used to control the transmit (TX) power. 761 * 762 */ 763 764 struct nrf_wifi_tx_pwr_ctrl_params { 765 /** Antenna gain for 2.4 GHz band */ 766 unsigned char ant_gain_2g; 767 /** Antenna gain for 5 GHz band (5150 MHz - 5350 MHz) */ 768 unsigned char ant_gain_5g_band1; 769 /** Antenna gain for 5 GHz band (5470 MHz - 5730 MHz) */ 770 unsigned char ant_gain_5g_band2; 771 /** Antenna gain for 5 GHz band (5730 MHz - 5895 MHz) */ 772 unsigned char ant_gain_5g_band3; 773 /** DSSS Transmit power backoff (in dB) for lower edge of 2.4 GHz frequency band */ 774 unsigned char band_edge_2g_lo_dss; 775 /** HT/VHT Transmit power backoff (in dB) for lower edge of 2.4 GHz frequency band */ 776 unsigned char band_edge_2g_lo_ht; 777 /** HE Transmit power backoff (in dB) for lower edge of 2.4 GHz frequency band */ 778 unsigned char band_edge_2g_lo_he; 779 /** DSSS Transmit power backoff (in dB) for upper edge of 2.4 GHz frequency band */ 780 unsigned char band_edge_2g_hi_dsss; 781 /** HT/VHT Transmit power backoff (in dB) for upper edge of 2.4 GHz frequency band */ 782 unsigned char band_edge_2g_hi_ht; 783 /** HE Transmit power backoff (in dB) for upper edge of 2.4 GHz frequency band */ 784 unsigned char band_edge_2g_hi_he; 785 /** HT Transmit power backoff (in dB) for lower edge of UNII-1 frequency band */ 786 unsigned char band_edge_5g_unii_1_lo_ht; 787 /** HE Transmit power backoff (in dB) for lower edge of UNII-1 frequency band */ 788 unsigned char band_edge_5g_unii_1_lo_he; 789 /** HT/VHT Transmit power backoff (in dB) for upper edge of UNII-1 frequency band */ 790 unsigned char band_edge_5g_unii_1_hi_ht; 791 /** HE Transmit power backoff (in dB) for upper edge of UNII-1 frequency band */ 792 unsigned char band_edge_5g_unii_1_hi_he; 793 /** HT/VHT Transmit power backoff (in dB) for lower edge of UNII-2A frequency band */ 794 unsigned char band_edge_5g_unii_2a_lo_ht; 795 /** HE Transmit power backoff (in dB) for lower edge of UNII-2A frequency band */ 796 unsigned char band_edge_5g_unii_2a_lo_he; 797 /** HT/VHT Transmit power backoff (in dB) for upper edge of UNII-2A frequency band */ 798 unsigned char band_edge_5g_unii_2a_hi_ht; 799 /** HE Transmit power backoff (in dB) for upper edge of UNII-2A frequency band */ 800 unsigned char band_edge_5g_unii_2a_hi_he; 801 /** HT/VHT Transmit power backoff (in dB) for lower edge of UNII-2C frequency band */ 802 unsigned char band_edge_5g_unii_2c_lo_ht; 803 /** HE Transmit power backoff (in dB) for lower edge of UNII-2C frequency band */ 804 unsigned char band_edge_5g_unii_2c_lo_he; 805 /** HT/VHT Transmit power backoff (in dB) for upper edge of UNII-2C frequency band */ 806 unsigned char band_edge_5g_unii_2c_hi_ht; 807 /** HE Transmit power backoff (in dB) for upper edge of UNII-2C frequency band */ 808 unsigned char band_edge_5g_unii_2c_hi_he; 809 /** HT/VHT Transmit power backoff (in dB) for lower edge of UNII-3 frequency band */ 810 unsigned char band_edge_5g_unii_3_lo_ht; 811 /** HE Transmit power backoff (in dB) for lower edge of UNII-3 frequency band */ 812 unsigned char band_edge_5g_unii_3_lo_he; 813 /** HT/VHT Transmit power backoff (in dB) for upper edge of UNII-3 frequency band */ 814 unsigned char band_edge_5g_unii_3_hi_ht; 815 /** HE Transmit power backoff (in dB) for upper edge of UNII-3 frequency band */ 816 unsigned char band_edge_5g_unii_3_hi_he; 817 /** HT/VHT Transmit power backoff (in dB) for lower edge of UNII-4 frequency band */ 818 unsigned char band_edge_5g_unii_4_lo_ht; 819 /** HE Transmit power backoff (in dB) for lower edge of UNII-4 frequency band */ 820 unsigned char band_edge_5g_unii_4_lo_he; 821 /** HT/VHT Transmit power backoff (in dB) for upper edge of UNII-4 frequency band */ 822 unsigned char band_edge_5g_unii_4_hi_ht; 823 /** HE Transmit power backoff (in dB) for upper edge of UNII-4 frequency band */ 824 unsigned char band_edge_5g_unii_4_hi_he; 825 } __NRF_WIFI_PKD; 826 827 /** 828 * @brief This structure defines board dependent parameters like PCB loss. 829 * 830 */ 831 struct nrf_wifi_board_params { 832 /** PCB loss for 2.4 GHz band */ 833 unsigned char pcb_loss_2g; 834 /** PCB loss for 5 GHz band (5150 MHz - 5350 MHz) */ 835 unsigned char pcb_loss_5g_band1; 836 /** PCB loss for 5 GHz band (5470 MHz - 5730 MHz) */ 837 unsigned char pcb_loss_5g_band2; 838 /** PCB loss for 5 GHz band (5730 MHz - 5895 MHz) */ 839 unsigned char pcb_loss_5g_band3; 840 } __NRF_WIFI_PKD; 841 842 /** 843 * @brief This enum defines different types of operating bands. 844 * 845 */ 846 enum op_band { 847 /** All bands */ 848 BAND_ALL, 849 /** 2.4Ghz band */ 850 BAND_24G 851 }; 852 853 /** 854 * @brief This enum defines keep alive state 855 * 856 */ 857 enum nrf_wifi_keep_alive_status { 858 /** Keep alive feature disabled */ 859 KEEP_ALIVE_DISABLED = 0, 860 /** Keep alive feature enabled */ 861 KEEP_ALIVE_ENABLED = 1 862 }; 863 864 /** 865 * @brief This enum specifies the type of frames used to retrieve buffered data 866 * from the AP in power save mode. 867 */ 868 enum ps_exit_strategy { 869 /** Uses an intelligent algo and decide whether to 870 * stay or exit power save mode to receive buffered frames. 871 */ 872 INT_PS = 0, 873 /** Exits power save mode for every TIM */ 874 EVERY_TIM 875 }; 876 877 #define TWT_EXTEND_SP_EDCA 0x1 878 #define DISABLE_DFS_CHANNELS 0x2 879 880 /** 881 * @brief This structure defines the command responsible for initializing the UMAC. 882 * After the host driver brings up, the host sends NRF_WIFI_CMD_INIT to the RPU. 883 * The RPU then performs the initialization and responds with NRF_WIFI_EVENT_INIT_DONE 884 * once the initialization is completed. 885 * 886 */ 887 888 struct nrf_wifi_cmd_sys_init { 889 /** umac header, @ref nrf_wifi_sys_head */ 890 struct nrf_wifi_sys_head sys_head; 891 /** id of the interface */ 892 unsigned int wdev_id; 893 /** @ref nrf_wifi_sys_params */ 894 struct nrf_wifi_sys_params sys_params; 895 /** LMAC Rx buffs pool params, @ref rx_buf_pool_params */ 896 struct rx_buf_pool_params rx_buf_pools[MAX_NUM_OF_RX_QUEUES]; 897 /** Data configuration params, @ref nrf_wifi_data_config_params */ 898 struct nrf_wifi_data_config_params data_config_params; 899 /** Calibration trigger control info based on battery voltage and temperature changes. 900 * @ref temp_vbat_config from lmac_if_common.h 901 */ 902 struct temp_vbat_config temp_vbat_config_params; 903 /** 0:umac checksum disable 1: umac checksum enable */ 904 unsigned char tcp_ip_checksum_offload; 905 /** Country code to set */ 906 unsigned char country_code[NRF_WIFI_COUNTRY_CODE_LEN]; 907 /** Operating band see enum op_band */ 908 unsigned int op_band; 909 /** Offload mgmt buffer refill to UMAC when enabled */ 910 unsigned char mgmt_buff_offload; 911 /** Enable features from driver config */ 912 unsigned int feature_flags; 913 /** To deactivate beamforming, By default the RPU enables the beamforming feature. 914 * If a user wishes to turn it off, they should set this parameter to 1. 915 */ 916 unsigned int disable_beamforming; 917 /** The RPU uses this value (in seconds) to decide how long to wait 918 * without receiving beacons before disconnection. 919 */ 920 unsigned int discon_timeout; 921 /** RPU uses QoS null frame or PS-Poll frame to retrieve buffered frames 922 * from the AP in power save @ref ps_exit_strategy. 923 */ 924 unsigned char ps_exit_strategy; 925 /** The RPU uses this value to configure watchdog timer */ 926 unsigned int watchdog_timer_val; 927 /** The RPU uses this value to decide whether keep alive 928 * feature is enabled or not see enum keep_alive_status 929 */ 930 unsigned char keep_alive_enable; 931 /** The RPU uses this value(in seconds) for periodicity of the keep 932 * alive frame. 933 */ 934 unsigned int keep_alive_period; 935 /** The RPU uses this value to define the limit on display scan BSS entries. 936 * By default, the limit is set to 250 in scan-only mode and 150 in regular mode. 937 * If this value is greater than 0, it overrides the default limits. 938 */ 939 unsigned int display_scan_bss_limit; 940 /** The RPU uses this value to enable/disable priority window for Wi-Fi scan 941 * in the case of coexistence with Short Range radio. 942 */ 943 unsigned int coex_disable_ptiwin_for_wifi_scan; 944 } __NRF_WIFI_PKD; 945 946 /** 947 * @brief This structure defines the command used to de-initialize the RPU. 948 * 949 */ 950 951 struct nrf_wifi_cmd_sys_deinit { 952 /** umac header, @ref nrf_wifi_sys_head */ 953 struct nrf_wifi_sys_head sys_head; 954 } __NRF_WIFI_PKD; 955 956 #define NRF_WIFI_HE_GI_800NS 0 957 #define NRF_WIFI_HE_GI_1600NS 1 958 #define NRF_WIFI_HE_GI_3200NS 2 959 960 #define NRF_WIFI_HE_LTF_3200NS 0 961 #define NRF_WIFI_HE_LTF_6400NS 1 962 #define NRF_WIFI_HE_LTF_12800NS 2 963 964 /** 965 * @brief This structure defines the command used to configure 966 * High-Efficiency Guard Interval(HE-GI) and High-Efficiency Long Training Field (HE-LTF). 967 * 968 * HE-GI duration determines the guard interval length used in the HE transmission. 969 * HE-LTF is used for channel estimation and signal detection in HE transmissions. 970 * 971 */ 972 973 struct nrf_wifi_cmd_he_gi_ltf_config { 974 /** umac header, see &nrf_wifi_sys_head */ 975 struct nrf_wifi_sys_head sys_head; 976 /** wdev interface id */ 977 unsigned char wdev_id; 978 /** HE GI type (NRF_WIFI_HE_GI_800NS/NRF_WIFI_HE_GI_1600NS/NRF_WIFI_HE_GI_3200NS) */ 979 unsigned char he_gi_type; 980 /** HE LTF (NRF_WIFI_HE_LTF_3200NS/NRF_WIFI_HE_LTF_6400NS/NRF_WIFI_HE_LTF_12800NS) */ 981 unsigned char he_ltf; 982 /** Fixed HE GI & LTF values can be enabled and disabled */ 983 unsigned char enable; 984 } __NRF_WIFI_PKD; 985 986 #define NRF_WIFI_DISABLE 0 987 #define NRF_WIFI_ENABLE 1 988 /** 989 * @brief This enum represents the different types of preambles used. 990 * Preambles are sequences of known symbols transmitted before the actual 991 * data transmission to enable synchronization, channel estimation, and 992 * frame detection at the receiver. 993 * 994 */ 995 enum rpu_pkt_preamble { 996 /** Short preamble packet */ 997 RPU_PKT_PREAMBLE_SHORT, 998 /** Long preamble packet */ 999 RPU_PKT_PREAMBLE_LONG, 1000 /** mixed preamble packet */ 1001 RPU_PKT_PREAMBLE_MIXED, 1002 /** Highest preamble type currently defined */ 1003 RPU_PKT_PREAMBLE_MAX, 1004 }; 1005 1006 1007 /** 1008 * @brief This structure describes different Physical Layer (PHY) configuration parameters used 1009 * in RF test and Radio test scenarios. These parameters are specific to testing and evaluating 1010 * the performance of the radio hardware. 1011 * 1012 */ 1013 struct rpu_conf_params { 1014 /** Unused. Number of spatial streams supported. Support is there for 1x1 only. */ 1015 unsigned char nss; 1016 /** Unused */ 1017 unsigned char antenna_sel; 1018 /** An array containing RF & baseband control params */ 1019 unsigned char rf_params[NRF_WIFI_RF_PARAMS_SIZE]; 1020 /** Not required */ 1021 unsigned char tx_pkt_chnl_bw; 1022 /** WLAN packet formats. 0->Legacy 1->HT 2->VHT 3->HE(SU) 4->HE(ERSU) and 5->HE(TB) */ 1023 unsigned char tx_pkt_tput_mode; 1024 /** Short Guard enable/disable */ 1025 unsigned char tx_pkt_sgi; 1026 /** Not required */ 1027 unsigned char tx_pkt_nss; 1028 /** Preamble type. 0->short, 1->Long and 2->Mixed */ 1029 unsigned char tx_pkt_preamble; 1030 /** Not used */ 1031 unsigned char tx_pkt_stbc; 1032 /** 0->BCC 1->LDPC. Supporting only BCC in nRF7002 */ 1033 unsigned char tx_pkt_fec_coding; 1034 /** Valid MCS number between 0 to 7 */ 1035 signed char tx_pkt_mcs; 1036 /** Legacy rate to be used in Mbps (1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54) */ 1037 signed char tx_pkt_rate; 1038 /** Copy OTP params to this memory */ 1039 signed char phy_threshold; 1040 /** Calibration bit map value. refer NRF_WIFI_DEF_PHY_CALIB */ 1041 unsigned int phy_calib; 1042 /** Radio test mode or System mode selection */ 1043 signed int op_mode; 1044 /** Channel related info viz, channel, bandwidth, primary 20 offset */ 1045 struct chan_params chan; 1046 /** Value of 0 means continuous transmission.Greater than 1 is invalid */ 1047 unsigned char tx_mode; 1048 /** Number of packets to be transmitted. Any number above 0. 1049 * Set -1 for continuous transmission 1050 */ 1051 signed int tx_pkt_num; 1052 /** Length of the packet (in bytes) to be transmitted */ 1053 unsigned short tx_pkt_len; 1054 /** Desired TX power in dBm in the range 0 dBm to 21 dBm in steps of 1 dBm */ 1055 unsigned int tx_power; 1056 /** Transmit WLAN packet */ 1057 unsigned char tx; 1058 /** Receive WLAN packet */ 1059 unsigned char rx; 1060 /** Not required */ 1061 unsigned char aux_adc_input_chain_id; 1062 /** Unused */ 1063 unsigned char agg; 1064 /** Select HE LTF type viz, 0->1x, 1->2x and 2->4x */ 1065 unsigned char he_ltf; 1066 /** Select HE LTF type viz, 0->0.8us, 1->1.6us and 2->3.2us */ 1067 unsigned char he_gi; 1068 /** Not required */ 1069 unsigned char set_he_ltf_gi; 1070 /** Not required */ 1071 unsigned char power_save; 1072 /** Not required */ 1073 unsigned int rts_threshold; 1074 /** Not required */ 1075 unsigned int uapsd_queue; 1076 /** Interval between TX packets in us (Min: 200, Max: 200000, Default: 200) */ 1077 unsigned int tx_pkt_gap_us; 1078 /** Configure WLAN antenna switch(0-separate/1-shared) */ 1079 unsigned char wlan_ant_switch_ctrl; 1080 /** Switch to control the SR antenna or shared WiFi antenna */ 1081 unsigned char sr_ant_switch_ctrl; 1082 /** Resource unit (RU) size (26,52,106 or 242) */ 1083 unsigned char ru_tone; 1084 /** Location of resource unit (RU) in 20 MHz spectrum */ 1085 unsigned char ru_index; 1086 /** Desired tone frequency to be transmitted */ 1087 signed char tx_tone_freq; 1088 /** RX LNA gain */ 1089 unsigned char lna_gain; 1090 /** RX BB gain */ 1091 unsigned char bb_gain; 1092 /** Number of RX samples to be captured */ 1093 unsigned short int capture_length; 1094 /** Capture timeout in seconds */ 1095 unsigned short int capture_timeout; 1096 /** Configure WLAN to bypass regulatory */ 1097 unsigned char bypass_regulatory; 1098 /** Two letter country code (00: Default for WORLD) */ 1099 unsigned char country_code[NRF_WIFI_COUNTRY_CODE_LEN]; 1100 /** Contention window value to be configured */ 1101 unsigned int tx_pkt_cw; 1102 } __NRF_WIFI_PKD; 1103 1104 /** 1105 * @brief This structure defines the command used to configure the RPU with different 1106 * PHY configuration parameters specifically designed for RF test and Radio test scenarios. 1107 * The command is intended to set up the RPU for testing and evaluating the performance 1108 * of the radio hardware. 1109 * 1110 */ 1111 1112 struct nrf_wifi_cmd_mode_params { 1113 /** UMAC header, See &struct nrf_wifi_sys_head */ 1114 struct nrf_wifi_sys_head sys_head; 1115 /** configuration parameters of different modes see &union rpu_conf_params */ 1116 struct rpu_conf_params conf; 1117 /** Packet length */ 1118 unsigned short pkt_length[MAX_TX_AGG_SIZE]; 1119 /** Packet ddr pointer */ 1120 unsigned int ddr_ptrs[MAX_TX_AGG_SIZE]; 1121 } __NRF_WIFI_PKD; 1122 1123 /** 1124 * @brief This structure represents the parameters required to initialize a radio test. 1125 * 1126 */ 1127 struct nrf_wifi_radio_test_init_info { 1128 /** An array containing RF & baseband control params */ 1129 unsigned char rf_params[NRF_WIFI_RF_PARAMS_SIZE]; 1130 /** Channel related info viz, channel, bandwidth, primary 20 offset */ 1131 struct chan_params chan; 1132 /** Phy threshold value to be sent to LMAC in channel programming */ 1133 signed char phy_threshold; 1134 /** Calibration bit map value. refer phy_rf_params.h NRF_WIFI_DEF_PHY_CALIB */ 1135 unsigned int phy_calib; 1136 } __NRF_WIFI_PKD; 1137 1138 /** 1139 * @brief This structure defines the command used to initialize a radio test. 1140 * 1141 */ 1142 struct nrf_wifi_cmd_radio_test_init { 1143 /** UMAC header, @ref nrf_wifi_sys_head*/ 1144 struct nrf_wifi_sys_head sys_head; 1145 /** radiotest init configuration parameters @ref nrf_wifi_radio_test_init_info */ 1146 struct nrf_wifi_radio_test_init_info conf; 1147 } __NRF_WIFI_PKD; 1148 1149 /** 1150 * @brief This structure defines the command used to enable or disable the reception (Rx). 1151 * It allows controlling the radio hardware's receive functionality to start or stop listening 1152 * for incoming data frames. 1153 */ 1154 1155 struct nrf_wifi_cmd_rx { 1156 /** UMAC header, @ref nrf_wifi_sys_head */ 1157 struct nrf_wifi_sys_head sys_head; 1158 /** rx configuration parameters @ref rpu_conf_rx_radio_test_params */ 1159 struct rpu_conf_rx_radio_test_params conf; 1160 } __NRF_WIFI_PKD; 1161 1162 /** 1163 * @brief This structure defines the command used to retrieve statistics from the RPU. 1164 * 1165 */ 1166 struct nrf_wifi_cmd_get_stats { 1167 /** UMAC header, @ref nrf_wifi_sys_head*/ 1168 struct nrf_wifi_sys_head sys_head; 1169 /** Statistics type &enum rpu_stats_type */ 1170 signed int stats_type; 1171 /** Production mode or FCM mode */ 1172 signed int op_mode; 1173 } __NRF_WIFI_PKD; 1174 1175 /** 1176 * @brief This structure represents the channel parameters to configure specific channel. 1177 * 1178 */ 1179 struct nrf_wifi_cmd_set_channel { 1180 /** UMAC header, @ref nrf_wifi_sys_head. */ 1181 struct nrf_wifi_sys_head sys_head; 1182 /** Interface index. */ 1183 unsigned char if_index; 1184 /** channel parameters, @ref chan_params. */ 1185 struct chan_params chan; 1186 } __NRF_WIFI_PKD; 1187 1188 /** 1189 * @brief This enum represents different types of operation modes. 1190 */ 1191 enum wifi_operation_modes { 1192 /** STA mode setting enable. */ 1193 NRF_WIFI_STA_MODE = 0x1, 1194 /** Monitor mode setting enable. */ 1195 NRF_WIFI_MONITOR_MODE = 0x2, 1196 /** TX injection mode setting enable. */ 1197 NRF_WIFI_TX_INJECTION_MODE = 0x4, 1198 /** Promiscuous mode setting enable. */ 1199 NRF_WIFI_PROMISCUOUS_MODE = 0x8, 1200 /** AP mode setting enable. */ 1201 NRF_WIFI_AP_MODE = 0x10, 1202 /** STA-AP mode setting enable. */ 1203 NRF_WIFI_STA_AP_MODE = 0x20, 1204 /** Max limit check based on current modes supported. */ 1205 WIFI_MODE_LIMIT_CHK = 0x2f, 1206 }; 1207 1208 /** 1209 * @brief This enum represents different types of filters used. 1210 */ 1211 1212 enum wifi_packet_filter { 1213 /** Support management, data and control packet sniffing. */ 1214 NRF_WIFI_PACKET_FILTER_ALL = 0x1, 1215 /** Support only sniffing of management packets. */ 1216 NRF_WIFI_PACKET_FILTER_MGMT = 0x2, 1217 /** Support only sniffing of data packets. */ 1218 NRF_WIFI_PACKET_FILTER_DATA = 0x4, 1219 /** Support only sniffing of control packets. */ 1220 NRF_WIFI_PACKET_FILTER_CTRL = 0x8, 1221 }; 1222 1223 /** 1224 * @brief This structure defines the command used to configure 1225 * promiscuous mode/Monitor mode/Packet injector mode. 1226 */ 1227 struct nrf_wifi_cmd_raw_config_mode { 1228 /** UMAC header, @ref nrf_wifi_sys_head. */ 1229 struct nrf_wifi_sys_head sys_head; 1230 /** Interface index. */ 1231 unsigned char if_index; 1232 /** Wireless device operating mode. */ 1233 unsigned char op_mode; 1234 } __NRF_WIFI_PKD; 1235 1236 /** 1237 * @brief This structure defines the command used to configure 1238 * filters and capture length in promiscuous and monitor modes. 1239 */ 1240 struct nrf_wifi_cmd_raw_config_filter { 1241 /** UMAC header, @ref nrf_wifi_sys_head. */ 1242 struct nrf_wifi_sys_head sys_head; 1243 /** Interface index. */ 1244 unsigned char if_index; 1245 /** Wireless device operating mode filters for Promiscuous/Monitor modes. */ 1246 unsigned char filter; 1247 /** capture length. */ 1248 unsigned short capture_len; 1249 } __NRF_WIFI_PKD; 1250 1251 /** 1252 * @brief This enum represents the queues used to segregate the TX frames depending on 1253 * their QoS categories. A separate queue is used for Beacon frames / frames 1254 * transmitted during DTIM intervals. 1255 */ 1256 1257 enum UMAC_QUEUE_NUM { 1258 /** Queue for frames belonging to the "Background" Access Category. */ 1259 UMAC_AC_BK = 0, 1260 /** Queue for frames belonging to the "Best-Effort" Access Category. */ 1261 UMAC_AC_BE, 1262 /** Queue for frames belonging to the "Video" Access Category. */ 1263 UMAC_AC_VI, 1264 /** Queue for frames belonging to the "Voice" Access Category. */ 1265 UMAC_AC_VO, 1266 /** Queue for frames belonging to the "Beacon" Access Category. */ 1267 UMAC_AC_BCN, 1268 /** Maximum number of transmit queues supported. */ 1269 UMAC_AC_MAX_CNT 1270 }; 1271 1272 /** 1273 * @brief This structure defines the raw tx parameters used in packet injector mode. 1274 * 1275 */ 1276 struct nrf_wifi_raw_tx_pkt { 1277 /** Queue number will be BK, BE, VI, VO and BCN refer UMAC_QUEUE_NUM. */ 1278 unsigned char queue_num; 1279 /** Descriptor identifier or token identifier. */ 1280 unsigned char desc_num; 1281 /** Packet lengths of frames. */ 1282 unsigned short pkt_length; 1283 /** Number of times a packet should be transmitted at each possible rate. */ 1284 unsigned char rate_retries; 1285 /** refer see &enum rpu_tput_mode. */ 1286 unsigned char rate_flags; 1287 /** rate: legacy rates: 1,2,55,11,6,9,12,18,24,36,48,54 1288 * 11N VHT HE : MCS index 0 to 7. 1289 **/ 1290 unsigned char rate; 1291 /** Starting Physical address of each frame in Ext-RAM after dma_mapping. */ 1292 unsigned int frame_ddr_pointer; 1293 } __NRF_WIFI_PKD; 1294 1295 /** 1296 * @brief This structure defines the command used to configure packet injector mode. 1297 * 1298 */ 1299 struct nrf_wifi_cmd_raw_tx { 1300 /** UMAC header, @ref nrf_wifi_sys_head. */ 1301 struct nrf_wifi_sys_head sys_head; 1302 /** Interface index. */ 1303 unsigned char if_index; 1304 /** Raw tx packet information. */ 1305 struct nrf_wifi_raw_tx_pkt raw_tx_info; 1306 } __NRF_WIFI_PKD; 1307 1308 /** 1309 * @brief This enum provides a list of different raw tx offloading types. 1310 */ 1311 enum nrf_wifi_offload_rawtx_ctrl_type { 1312 NRF_WIFI_OFFLOAD_TX_STOP, 1313 NRF_WIFI_OFFLOAD_TX_START, 1314 NRF_WIFI_OFFLOAD_TX_CONFIG, 1315 }; 1316 1317 /** 1318 * @brief This structure defines the offloaded raw tx control information. 1319 * 1320 */ 1321 struct nrf_wifi_offload_ctrl_params 1322 { 1323 /** Time interval in micro seconds */ 1324 unsigned int period_in_us; 1325 /** Transmit power in dBm ( 0 to 20) */ 1326 int tx_pwr; 1327 /** Channel number */ 1328 unsigned int channel_no; 1329 } __NRF_WIFI_PKD; 1330 1331 #define NRF_WIFI_ENABLE_HE_SU 0x40 1332 #define NRF_WIFI_ENABLE_HE_ER_SU 0x80 1333 1334 /** 1335 * @brief This structure defines the offloading raw tx parameters 1336 * 1337 */ 1338 struct nrf_wifi_offload_tx_ctrl 1339 { 1340 /** Packet lengths of frames, min 26 bytes and max 600 bytes */ 1341 unsigned int pkt_length; 1342 /** Rate preamble type (USE_SHORT_PREAMBLE/DONT_USE_SHORT_PREAMBLE) */ 1343 unsigned int rate_preamble_type; 1344 /** Number of times a packet should be transmitted at each possible rate */ 1345 unsigned int rate_retries; 1346 /** Rate: legacy rates: 1,2,55,11,6,9,12,18,24,36,48,54 1347 * 11N VHT HE: MCS index 0 to 7. 1348 */ 1349 unsigned int rate; 1350 /** Refer see &enum rpu_tput_mode */ 1351 unsigned int rate_flags; 1352 /** HE GI type (NRF_WIFI_HE_GI_800NS/NRF_WIFI_HE_GI_1600NS/NRF_WIFI_HE_GI_3200NS) */ 1353 unsigned char he_gi_type; 1354 /** HE LTF (NRF_WIFI_HE_LTF_3200NS/NRF_WIFI_HE_LTF_6400NS/NRF_WIFI_HE_LTF_12800NS) */ 1355 unsigned char he_ltf; 1356 /** Payload pointer */ 1357 unsigned int pkt_ram_ptr; 1358 } __NRF_WIFI_PKD; 1359 1360 /** 1361 * @brief This structure defines the command used for offloading Raw tx 1362 * 1363 */ 1364 struct nrf_wifi_cmd_offload_raw_tx_params { 1365 /** UMAC header, @ref nrf_wifi_sys_head */ 1366 struct nrf_wifi_sys_head sys_head; 1367 /** Id of the interface */ 1368 unsigned int wdev_id; 1369 /** Offloaded raw tx control information, @ref nrf_wifi_offload_ctrl_params */ 1370 struct nrf_wifi_offload_ctrl_params ctrl_info; 1371 /** Offloaded raw tx params, @ref nrf_wifi_offload_tx_ctrl */ 1372 struct nrf_wifi_offload_tx_ctrl tx_params; 1373 } __NRF_WIFI_PKD; 1374 1375 /** 1376 * @brief This structure defines the command used for offloading Raw tx 1377 * 1378 */ 1379 struct nrf_wifi_cmd_offload_raw_tx_ctrl { 1380 /** UMAC header, @ref nrf_wifi_sys_head */ 1381 struct nrf_wifi_sys_head sys_head; 1382 /** Id of the interface */ 1383 unsigned int wdev_id; 1384 /** Offloading type @ref nrf_wifi_offload_rawtx_ctrl_type */ 1385 unsigned char ctrl_type; 1386 } __NRF_WIFI_PKD; 1387 1388 /** 1389 * @brief This structure defines an event that indicates set channel command done. 1390 * 1391 */ 1392 struct nrf_wifi_event_set_channel { 1393 /** UMAC header, @ref nrf_wifi_sys_head. */ 1394 struct nrf_wifi_sys_head sys_head; 1395 /** Interface index. */ 1396 unsigned char if_index; 1397 /** channel number. */ 1398 unsigned int chan_num; 1399 /** status of the set channel command, success(0)/Fail(-1). */ 1400 int status; 1401 } __NRF_WIFI_PKD; 1402 1403 /** 1404 * @brief This structure defines an event that indicates set raw config 1405 * mode command done. 1406 * 1407 */ 1408 struct nrf_wifi_event_raw_config_mode { 1409 /** UMAC header, @ref nrf_wifi_sys_head. */ 1410 struct nrf_wifi_sys_head sys_head; 1411 /** Interface index. */ 1412 unsigned char if_index; 1413 /** Operating mode. */ 1414 unsigned char op_mode; 1415 /** status of the set raw config mode command, success(0)/Fail(-1). */ 1416 int status; 1417 } __NRF_WIFI_PKD; 1418 1419 /** 1420 * @brief This structure defines an event that indicates set raw config 1421 * filter command done. 1422 * 1423 */ 1424 struct nrf_wifi_event_raw_config_filter { 1425 /** UMAC header, @ref nrf_wifi_sys_head. */ 1426 struct nrf_wifi_sys_head sys_head; 1427 /** Interface index. */ 1428 unsigned char if_index; 1429 /** mode filter configured. */ 1430 unsigned char filter; 1431 /** capture len configured. */ 1432 unsigned short capture_len; 1433 /** status of the set raw filter command, success(0)/Fail(-1). */ 1434 int status; 1435 } __NRF_WIFI_PKD; 1436 1437 /** 1438 * @brief This structure defines an event that indicates the Raw tx done. 1439 * 1440 */ 1441 struct nrf_wifi_event_raw_tx_done { 1442 /** UMAC header, @ref nrf_wifi_sys_head. */ 1443 struct nrf_wifi_sys_head sys_head; 1444 /** descriptor number. */ 1445 unsigned char desc_num; 1446 /** status of the raw tx packet command, success(0)/Fail(-1). */ 1447 int status; 1448 } __NRF_WIFI_PKD; 1449 1450 /** 1451 * @brief This structure defines the command used to clear or reset statistics. 1452 * 1453 * 1454 */ 1455 struct nrf_wifi_cmd_clear_stats { 1456 /** UMAC header, @ref nrf_wifi_sys_head */ 1457 struct nrf_wifi_sys_head sys_head; 1458 /** Type of statistics to clear &enum rpu_stats_type */ 1459 signed int stats_type; 1460 } __NRF_WIFI_PKD; 1461 1462 /** 1463 * @brief This structure represents the command used to obtain power monitor information 1464 * specific to different data types. 1465 * 1466 */ 1467 struct nrf_wifi_cmd_pwr { 1468 /** UMAC header, @ref nrf_wifi_sys_head */ 1469 struct nrf_wifi_sys_head sys_head; 1470 /** Type of Control info that host need */ 1471 signed int data_type; 1472 } __NRF_WIFI_PKD; 1473 1474 /** 1475 * @brief Structure for coexistence (coex) switch configuration. 1476 * 1477 */ 1478 struct coex_wlan_switch_ctrl { 1479 /** Host to coexistence manager message id */ 1480 signed int rpu_msg_id; 1481 /** Switch configuration value */ 1482 signed int switch_A; 1483 } __NRF_WIFI_PKD; 1484 1485 /** 1486 * @brief The structure represents the command used to configure the Wi-Fi side shared switch 1487 * for SR coexistence. 1488 * 1489 */ 1490 struct nrf_wifi_cmd_srcoex { 1491 /** UMAC header, @ref nrf_wifi_sys_head */ 1492 struct nrf_wifi_sys_head sys_head; 1493 /** Switch configuration data */ 1494 struct coex_wlan_switch_ctrl conf; 1495 } __NRF_WIFI_PKD; 1496 1497 /** 1498 * @brief The structure defines the parameters used to configure the coexistence hardware. 1499 * 1500 */ 1501 1502 struct rpu_cmd_coex_config_info { 1503 /** Length of coexistence configuration data */ 1504 unsigned int len; 1505 /** Coexistence configuration data */ 1506 unsigned char coex_cmd[0]; 1507 } __NRF_WIFI_PKD; 1508 1509 /** 1510 * @brief This structure defines the command used to configure the coexistence hardware. 1511 * 1512 */ 1513 struct nrf_wifi_cmd_coex_config { 1514 /** UMAC header, @ref nrf_wifi_sys_head */ 1515 struct nrf_wifi_sys_head sys_head; 1516 /** Coexistence configuration data. @ref rpu_cmd_coex_config_info */ 1517 struct rpu_cmd_coex_config_info coex_config_info; 1518 } __NRF_WIFI_PKD; 1519 1520 /** 1521 * @brief This structure describes the coexistence configuration data received 1522 * in the NRF_WIFI_EVENT_COEX_CONFIG event. 1523 * 1524 */ 1525 struct rpu_evnt_coex_config_info { 1526 /** Length of coexistence configuration data */ 1527 unsigned int len; 1528 /** Coexistence configuration data */ 1529 unsigned char coex_event[0]; 1530 } __NRF_WIFI_PKD; 1531 1532 /** 1533 * @brief This structure defines the event used to represent coexistence configuration. 1534 * 1535 */ 1536 struct nrf_wifi_event_coex_config { 1537 /** UMAC header, @ref nrf_wifi_sys_head */ 1538 struct nrf_wifi_sys_head sys_head; 1539 /** Coexistence configuration data in the event. @ref rpu_evnt_coex_config_info */ 1540 struct rpu_evnt_coex_config_info coex_config_info; 1541 } __NRF_WIFI_PKD; 1542 1543 /** 1544 * @brief This structure defines the command used to fix the transmission (Tx) data rate. 1545 * The command allows setting a specific data rate for data transmission, ensuring that the 1546 * system uses the designated rate instead of dynamically adapting to changing channel conditions. 1547 * 1548 */ 1549 1550 struct nrf_wifi_cmd_fix_tx_rate { 1551 /** UMAC header, @ref nrf_wifi_sys_head */ 1552 struct nrf_wifi_sys_head sys_head; 1553 /** refer see &enum rpu_tput_mode */ 1554 unsigned char rate_flags; 1555 /** fixed_rate: -1 Disable fixed rate and use ratecontrol selected rate 1556 * fixed rate: >0 legacy rates: 1,2,55,11,6,9,12,18,24,36,48,54 1557 * 11N VHT HE : MCS index 0 to 7. 1558 */ 1559 int fixed_rate; 1560 } __NRF_WIFI_PKD; 1561 1562 /** 1563 * @brief This structure describes rf test command information. 1564 * 1565 */ 1566 struct rpu_cmd_rftest_info { 1567 /** length of the rf test command */ 1568 unsigned int len; 1569 /** Rf test command data */ 1570 unsigned char rfcmd[0]; 1571 } __NRF_WIFI_PKD; 1572 1573 /** 1574 * @brief This structure defines the command used for RF (Radio Frequency) testing. 1575 * RF test commands are specifically designed to configure and control the radio hardware 1576 * for conducting tests and evaluating its performance in various scenarios. 1577 * 1578 */ 1579 struct nrf_wifi_cmd_rftest { 1580 /** UMAC header, @ref nrf_wifi_sys_head */ 1581 struct nrf_wifi_sys_head sys_head; 1582 /** @ref rpu_cmd_rftest_info */ 1583 struct rpu_cmd_rftest_info rf_test_info; 1584 } __NRF_WIFI_PKD; 1585 1586 /** 1587 * @brief This structure describes rf test event information. 1588 * 1589 */ 1590 struct rpu_evnt_rftest_info { 1591 /** length of the rf test event */ 1592 unsigned int len; 1593 /** Rf test event data */ 1594 unsigned char rfevent[0]; 1595 } __NRF_WIFI_PKD; 1596 1597 /** 1598 * @brief This structure describes the event generated during RF (Radio Frequency) testing. 1599 * 1600 */ 1601 struct nrf_wifi_event_rftest { 1602 /** UMAC header, @ref nrf_wifi_sys_head */ 1603 struct nrf_wifi_sys_head sys_head; 1604 /** @ref rpu_evnt_rftest_info */ 1605 struct rpu_evnt_rftest_info rf_test_info; 1606 } __NRF_WIFI_PKD; 1607 1608 /** 1609 * @brief This structure is a comprehensive combination of all the firmware statistics 1610 * that the RPU (Radio Processing Unit) can provide in System mode. 1611 * 1612 */ 1613 struct rpu_sys_fw_stats { 1614 /** PHY statistics @ref rpu_phy_stats */ 1615 struct rpu_phy_stats phy; 1616 /** LMAC statistics @ref rpu_lmac_stats */ 1617 struct rpu_lmac_stats lmac; 1618 /** UMAC statistics @ref rpu_umac_stats */ 1619 struct rpu_umac_stats umac; 1620 } __NRF_WIFI_PKD; 1621 1622 /** 1623 * @brief This structure is a comprehensive combination of all the firmware statistics 1624 * that the RPU (Radio Processing Unit) can provide in Radio test mode. 1625 * 1626 */ 1627 struct rpu_rt_fw_stats { 1628 /** PHY statistics @ref rpu_phy_stats */ 1629 struct rpu_phy_stats phy; 1630 } __NRF_WIFI_PKD; 1631 1632 /** 1633 * @brief This structure defines the Offloaded raw tx debug statistics. 1634 * 1635 */ 1636 struct rpu_off_raw_tx_fw_stats { 1637 unsigned int offload_raw_tx_state; 1638 unsigned int offload_raw_tx_cnt; 1639 unsigned int offload_raw_tx_complete_cnt; 1640 unsigned int warm_boot_cnt; 1641 } __NRF_WIFI_PKD; 1642 1643 1644 /** 1645 * @brief This structure represents the event that provides RPU statistics in response 1646 * to the command NRF_WIFI_CMD_GET_STATS in a wireless communication system in System 1647 * mode. 1648 * 1649 * The NRF_WIFI_CMD_GET_STATS command is used to request various statistics from the RPU. 1650 * 1651 */ 1652 1653 struct nrf_wifi_sys_umac_event_stats { 1654 /** UMAC header, @ref nrf_wifi_sys_head */ 1655 struct nrf_wifi_sys_head sys_head; 1656 /** All the statistics that the firmware can provide @ref rpu_fw_stats*/ 1657 struct rpu_sys_fw_stats fw; 1658 } __NRF_WIFI_PKD; 1659 1660 1661 /** 1662 * @brief This structure represents the event that provides RPU statistics in response 1663 * to the command NRF_WIFI_CMD_GET_STATS in a wireless communication system in Radio 1664 * test mode. 1665 * 1666 * The NRF_WIFI_CMD_GET_STATS command is used to request various statistics from the RPU. 1667 * 1668 */ 1669 1670 struct nrf_wifi_rt_umac_event_stats { 1671 /** UMAC header, @ref nrf_wifi_sys_head */ 1672 struct nrf_wifi_sys_head sys_head; 1673 /** All the statistics that the firmware can provide @ref rpu_fw_stats*/ 1674 struct rpu_rt_fw_stats fw; 1675 } __NRF_WIFI_PKD; 1676 1677 1678 /** 1679 * @brief This structure represents the event that provides RPU statistics in response 1680 * to the command NRF_WIFI_CMD_GET_STATS in a wireless communication system in Offloaded 1681 * raw TX mode. 1682 * 1683 * The NRF_WIFI_CMD_GET_STATS command is used to request various statistics from the RPU. 1684 * 1685 */ 1686 1687 struct nrf_wifi_off_raw_tx_umac_event_stats { 1688 /** UMAC header, @ref nrf_wifi_sys_head */ 1689 struct nrf_wifi_sys_head sys_head; 1690 /** All the statistics that the firmware can provide @ref rpu_fw_stats*/ 1691 struct rpu_off_raw_tx_fw_stats fw; 1692 } __NRF_WIFI_PKD; 1693 1694 1695 /** 1696 * @brief This enum defines various command status values that can occur 1697 * during radio tests and offloaded raw transmissions. 1698 */ 1699 enum nrf_wifi_cmd_status { 1700 /** Command success */ 1701 NRF_WIFI_UMAC_CMD_SUCCESS = 1, 1702 /** Invalid channel error */ 1703 NRF_WIFI_UMAC_INVALID_CHNL, 1704 /** Invalid power error wrt configured regulatory domain */ 1705 NRF_WIFI_UMAC_INVALID_TXPWR 1706 }; 1707 1708 /** 1709 * @brief This structure defines an event that indicates the error status values that may occur 1710 * during a radio test. It serves as a response to the radio test commands. 1711 * 1712 */ 1713 struct nrf_wifi_umac_event_err_status { 1714 /** UMAC header, @ref nrf_wifi_sys_head */ 1715 struct nrf_wifi_sys_head sys_head; 1716 /** status of the command, Fail/success &enum nrf_wifi_radio_test_err_status */ 1717 unsigned int status; 1718 } __NRF_WIFI_PKD; 1719 1720 /** 1721 * @brief This structure represents the UMAC initialization done event. 1722 * The event is sent by the RPU (Radio Processing Unit) in response to 1723 * the NRF_WIFI_CMD_INIT command, indicating that the RPU initialization 1724 * process has been completed successfully. 1725 */ 1726 1727 struct nrf_wifi_event_init_done { 1728 /** UMAC header, @ref nrf_wifi_sys_head */ 1729 struct nrf_wifi_sys_head sys_head; 1730 } __NRF_WIFI_PKD; 1731 1732 /** 1733 * @brief structure for UMAC memory pool information. 1734 * 1735 */ 1736 struct pool_data_to_host { 1737 /** Size of the memory buffer */ 1738 unsigned int buffer_size; 1739 /** Number of pool items available for the above memory buffer */ 1740 unsigned char num_pool_items; 1741 /** Maximum pools allocated at any point of time */ 1742 unsigned char items_num_max_allocated; 1743 /** Currently allocated pools */ 1744 unsigned char items_num_cur_allocated; 1745 /** Total number of pool allocated */ 1746 unsigned int items_num_total_allocated; 1747 /** Number of times this memory pool is full */ 1748 unsigned int items_num_not_allocated; 1749 } __NRF_WIFI_PKD; 1750 1751 /** 1752 * @brief This structure represents the event that provides UMAC (Upper MAC) internal 1753 * memory statistics in response to the NRF_WIFI_CMD_UMAC_INT_STATS command. 1754 * 1755 */ 1756 struct umac_int_stats { 1757 /** UMAC header, @ref nrf_wifi_sys_head */ 1758 struct nrf_wifi_sys_head sys_head; 1759 /** See @ref pool_data_to_host */ 1760 struct pool_data_to_host scratch_dynamic_memory_info[56]; 1761 /** See @ref pool_data_to_host */ 1762 struct pool_data_to_host retention_dynamic_memory_info[56]; 1763 } __NRF_WIFI_PKD; 1764 1765 /** 1766 * @brief This structure represents the event that indicates the completion of UMAC 1767 * deinitialization. The RPU sends this event as a response to the NRF_WIFI_CMD_DEINIT 1768 * command, signaling that the UMAC has been successfully deinitialized. 1769 */ 1770 1771 struct nrf_wifi_event_deinit_done { 1772 /** UMAC header, @ref nrf_wifi_sys_head */ 1773 struct nrf_wifi_sys_head sys_head; 1774 } __NRF_WIFI_PKD; 1775 1776 /** 1777 * @brief This structure describes the command for reset of interface statistics. 1778 * 1779 */ 1780 struct nrf_wifi_cmd_reset_stats { 1781 /** UMAC header, @ref nrf_wifi_sys_head */ 1782 struct nrf_wifi_sys_head sys_head; 1783 } __NRF_WIFI_PKD; 1784 1785 /** 1786 * @} 1787 */ 1788 #endif /* __HOST_RPU_SYS_IF_H__ */ 1789