nrfxlib API 0.1.0
Loading...
Searching...
No Matches
hal_structs.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
13#ifndef __HAL_STRUCTS_H__
14#define __HAL_STRUCTS_H__
15
16#include "lmac_if_common.h"
17#include "host_rpu_common_if.h"
18#include "osal_api.h"
19#include "bal_api.h"
20
22#define MAX_HAL_RPU_READY_WAIT (1 * 1000 * 1000)
23
24#if defined(CONFIG_NRF_WIFI_LOW_POWER) || defined(__DOXYGEN__)
25#define RPU_PS_WAKE_INTERVAL_MS 1
26#define RPU_PS_WAKE_TIMEOUT_S 1
27#endif /* CONFIG_NRF_WIFI_LOW_POWER */
28
39};
40
47static inline const char *rpu_proc_to_str(enum RPU_PROC_TYPE proc)
48{
49 switch (proc) {
51 return "LMAC";
53 return "UMAC";
54 default:
55 return "UNKNOWN";
56 }
57};
70};
71
88};
89
90#if defined(CONFIG_NRF_WIFI_LOW_POWER) || defined(__DOXYGEN__)
94enum RPU_PS_STATE {
96 RPU_PS_STATE_ASLEEP,
98 RPU_PS_STATE_AWAKE,
100 RPU_PS_STATE_MAX
101};
102#endif /* CONFIG_NRF_WIFI_LOW_POWER */
103
112};
113
119 unsigned int max_cmd_size;
121 unsigned int max_event_size;
122
123#if !defined(CONFIG_NRF700X_RADIO_TEST) || defined(__DOXYGEN__)
125 unsigned char rx_buf_headroom_sz;
127 unsigned char tx_buf_headroom_sz;
128#if defined(CONFIG_NRF700X_DATA_TX) || defined(__DOXYGEN__)
130 unsigned int max_tx_frms;
131#endif /* CONFIG_NRF700X_DATA_TX */
135 unsigned int max_tx_frm_sz;
138#endif /* !CONFIG_NRF700X_RADIO_TEST */
139};
140
148 unsigned char num_devs;
152 void *(*add_dev_callbk_fn)(void *add_dev_callbk_data, void *hal_dev_ctx);
154 void (*rem_dev_callbk_fn)(void *mac_ctx);
156 enum nrf_wifi_status (*init_dev_callbk_fn)(void *mac_ctx);
158 void (*deinit_dev_callbk_fn)(void *mac_ctx);
160 enum nrf_wifi_status (*intr_callbk_fn)(void *mac_ctx,
161 void *event_data,
162 unsigned int len);
164 enum nrf_wifi_status (*rpu_recovery_callbk_fn)(void *mac_ctx,
165 void *event_data, unsigned int len);
169 unsigned long addr_pktram_base;
170};
171
179 unsigned int rx_cmd_base;
181 unsigned int tx_cmd_base;
182};
183
189 bool mapped;
191 unsigned long virt_addr;
193 unsigned long phy_addr;
195 unsigned int buf_len;
196};
197
209 unsigned char idx;
213 unsigned int num_cmds;
215 void *cmd_q;
217 void *event_q;
227 void *lock_hal;
231 void *lock_rx;
237 unsigned long addr_rpu_pktram_base;
245 unsigned long tx_frame_offset;
246#if defined(CONFIG_NRF_WIFI_LOW_POWER) || defined(__DOXYGEN__)
248 enum RPU_PS_STATE rpu_ps_state;
250 void *rpu_ps_timer;
252 void *rpu_ps_lock;
254 bool dbg_enable;
256 bool irq_ctx;
258 bool rpu_fw_booted;
259#endif /* CONFIG_NRF_WIFI_LOW_POWER */
265 unsigned int event_data_len;
267 unsigned int event_data_pending;
269 unsigned int event_resubmit;
276};
277
283 unsigned int len;
285 char data[0];
286};
287#endif /* __HAL_STRUCTS_H__ */
#define MAX_NUM_OF_RX_QUEUES
Definition: lmac_if_common.h:200
NRF_WIFI_HAL_STATUS
Enumeration of NRF WiFi HAL status.
Definition: hal_structs.h:107
@ NRF_WIFI_HAL_STATUS_ENABLED
Definition: hal_structs.h:109
@ NRF_WIFI_HAL_STATUS_DISABLED
Definition: hal_structs.h:111
NRF_WIFI_HAL_MSG_TYPE
Enumeration of NRF Wi-Fi HAL message types.
Definition: hal_structs.h:75
@ NRF_WIFI_HAL_MSG_TYPE_CMD_DATA_MGMT
Definition: hal_structs.h:83
@ NRF_WIFI_HAL_MSG_TYPE_EVENT
Definition: hal_structs.h:79
@ NRF_WIFI_HAL_MSG_TYPE_MAX
Definition: hal_structs.h:87
@ NRF_WIFI_HAL_MSG_TYPE_CMD_CTRL
Definition: hal_structs.h:77
@ NRF_WIFI_HAL_MSG_TYPE_CMD_DATA_TX
Definition: hal_structs.h:85
@ NRF_WIFI_HAL_MSG_TYPE_CMD_DATA_RX
Definition: hal_structs.h:81
static const char * rpu_proc_to_str(enum RPU_PROC_TYPE proc)
Convert RPU_PROC_TYPE enum to string.
Definition: hal_structs.h:47
RPU_PROC_TYPE
Enumeration of RPU processor types.
Definition: hal_structs.h:32
@ RPU_PROC_TYPE_MCU_UMAC
Definition: hal_structs.h:36
@ RPU_PROC_TYPE_MAX
Definition: hal_structs.h:38
@ RPU_PROC_TYPE_MCU_LMAC
Definition: hal_structs.h:34
NRF_WIFI_REGION_TYPE
Enumeration of NRF Wi-Fi region types.
Definition: hal_structs.h:61
@ NRF_WIFI_REGION_TYPE_PKTRAM
Definition: hal_structs.h:65
@ NRF_WIFI_REGION_TYPE_GRAM
Definition: hal_structs.h:63
@ NRF_WIFI_REGION_TYPE_PBUS
Definition: hal_structs.h:69
@ NRF_WIFI_REGION_TYPE_SYSBUS
Definition: hal_structs.h:67
nrf_wifi_status
The status of an operation performed by the RPU driver.
Definition: osal_structs.h:29
Information about Hostport Queues (HPQ) to be used for exchanging information between the Host and RP...
Definition: rpu_if.h:409
Structure holding context information for the BAL.
Definition: bal_structs.h:31
unsigned long virt_addr
Definition: hal_structs.h:191
bool mapped
Definition: hal_structs.h:189
unsigned int buf_len
Definition: hal_structs.h:195
unsigned long phy_addr
Definition: hal_structs.h:193
Structure to hold buffer mapping information for the HAL layer.
Definition: hal_structs.h:187
unsigned char tx_buf_headroom_sz
Definition: hal_structs.h:127
unsigned int max_event_size
Definition: hal_structs.h:121
unsigned int max_cmd_size
Definition: hal_structs.h:119
unsigned int max_ampdu_len_per_token
Definition: hal_structs.h:137
unsigned char rx_buf_headroom_sz
Definition: hal_structs.h:125
struct rx_buf_pool_params rx_buf_pool[MAX_NUM_OF_RX_QUEUES]
Definition: hal_structs.h:133
unsigned int max_tx_frm_sz
Definition: hal_structs.h:135
Structure to hold configuration parameters for the HAL layer.
Definition: hal_structs.h:117
unsigned long addr_rpu_pktram_base_rx
Definition: hal_structs.h:241
struct nrf_wifi_hal_buf_map_info * tx_buf_info
Definition: hal_structs.h:235
unsigned char idx
Definition: hal_structs.h:209
void * cmd_q
Definition: hal_structs.h:215
unsigned long addr_rpu_pktram_base_tx
Definition: hal_structs.h:239
void * event_q
Definition: hal_structs.h:217
unsigned int event_data_len
Definition: hal_structs.h:265
void * lock_rx
Definition: hal_structs.h:231
unsigned int event_data_pending
Definition: hal_structs.h:267
struct nrf_wifi_hal_buf_map_info * rx_buf_info[MAX_NUM_OF_RX_QUEUES]
Definition: hal_structs.h:233
unsigned int event_resubmit
Definition: hal_structs.h:269
unsigned long tx_frame_offset
Definition: hal_structs.h:245
unsigned long addr_rpu_pktram_base_rx_pool[MAX_NUM_OF_RX_QUEUES]
Definition: hal_structs.h:243
struct nrf_wifi_hal_priv * hpriv
Definition: hal_structs.h:203
enum RPU_PROC_TYPE curr_proc
Definition: hal_structs.h:225
void * lock_hal
Definition: hal_structs.h:227
void * bal_dev_ctx
Definition: hal_structs.h:207
void * event_tasklet
Definition: hal_structs.h:229
unsigned long addr_rpu_pktram_base
Definition: hal_structs.h:237
void * lock_recovery
Definition: hal_structs.h:275
char * event_data_curr
Definition: hal_structs.h:263
unsigned int num_cmds
Definition: hal_structs.h:213
char * event_data
Definition: hal_structs.h:261
void * mac_dev_ctx
Definition: hal_structs.h:205
void * recovery_tasklet
Definition: hal_structs.h:273
enum NRF_WIFI_HAL_STATUS hal_status
Definition: hal_structs.h:271
struct nrf_wifi_hal_info rpu_info
Definition: hal_structs.h:211
Structure to hold per device context information for the HAL layer.
Definition: hal_structs.h:201
unsigned int tx_cmd_base
Definition: hal_structs.h:181
unsigned int rx_cmd_base
Definition: hal_structs.h:179
struct host_rpu_hpqm_info hpqm_info
Definition: hal_structs.h:177
Structure to hold RPU information.
Definition: hal_structs.h:175
unsigned int len
Definition: hal_structs.h:283
char data[0]
Definition: hal_structs.h:285
Structure to hold information about a HAL message.
Definition: hal_structs.h:281
enum nrf_wifi_status(* intr_callbk_fn)(void *mac_ctx, void *event_data, unsigned int len)
Definition: hal_structs.h:160
unsigned long addr_pktram_base
Definition: hal_structs.h:169
struct nrf_wifi_bal_priv * bpriv
Definition: hal_structs.h:146
void(* rem_dev_callbk_fn)(void *mac_ctx)
Definition: hal_structs.h:154
void(* deinit_dev_callbk_fn)(void *mac_ctx)
Definition: hal_structs.h:158
unsigned char num_devs
Definition: hal_structs.h:148
struct nrf_wifi_hal_cfg_params cfg_params
Definition: hal_structs.h:167
enum nrf_wifi_status(* rpu_recovery_callbk_fn)(void *mac_ctx, void *event_data, unsigned int len)
Definition: hal_structs.h:164
enum nrf_wifi_status(* init_dev_callbk_fn)(void *mac_ctx)
Definition: hal_structs.h:156
void * add_dev_callbk_data
Definition: hal_structs.h:150
Structure to hold context information for the HAL layer.
Definition: hal_structs.h:144
Definition: lmac_if_common.h:202