nrfxlib API 0.1.0
Loading...
Searching...
No Matches
fmac_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
16#ifndef __FMAC_STRUCTS_H__
17#define __FMAC_STRUCTS_H__
18
19#include "osal_api.h"
20#include "host_rpu_umac_if.h"
21#include "fmac_structs_common.h"
22
23#define MAX_PEERS 5
24#define MAX_SW_PEERS (MAX_PEERS + 1)
25#define NRF_WIFI_AC_TWT_PRIORITY_EMERGENCY 0xFF
26#define NRF_WIFI_MAGIC_NUM_RAWTX 0x12345678
27
28
46};
47
48
60};
61
62
74};
75
76#if defined(CONFIG_NRF700X_RAW_DATA_RX) || defined(CONFIG_NRF700X_PROMISC_DATA_RX)
83struct raw_rx_pkt_header {
85 unsigned short frequency;
87 signed short signal;
89 unsigned char rate_flags;
91 unsigned char rate;
92};
93#endif /* CONFIG_NRF700X_RAW_DATA_RX || CONFIG_NRF700X_PROMISC_DATA_RX */
94
103 void (*rpu_recovery_callbk_fn)(void *os_vif_ctx,
104 void *event_data,
105 unsigned int event_len);
106
108 void (*scan_start_callbk_fn)(void *os_vif_ctx,
109 struct nrf_wifi_umac_event_trigger_scan *scan_start_event,
110 unsigned int event_len);
111
113 void (*scan_done_callbk_fn)(void *os_vif_ctx,
114 struct nrf_wifi_umac_event_trigger_scan *scan_done_event,
115 unsigned int event_len);
116
118 void (*scan_abort_callbk_fn)(void *os_vif_ctx,
119 struct nrf_wifi_umac_event_trigger_scan *scan_done_event,
120 unsigned int event_len);
121
123 void (*scan_res_callbk_fn)(void *os_vif_ctx,
125 unsigned int event_len,
126 bool more_res);
127
129 void (*disp_scan_res_callbk_fn)(void *os_vif_ctx,
131 unsigned int event_len,
132 bool more_res);
133
134#if defined(CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS) || defined(__DOXYGEN__)
136 void (*rx_bcn_prb_resp_callbk_fn)(void *os_vif_ctx,
137 void *frm,
138 unsigned short frequency,
139 signed short signal);
140#endif /* CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS */
141
142#if defined(CONFIG_NRF700X_STA_MODE) || defined(__DOXYGEN__)
144 enum nrf_wifi_status (*if_carr_state_chg_callbk_fn)(void *os_vif_ctx,
146
148 void (*rx_frm_callbk_fn)(void *os_vif_ctx,
149 void *frm);
150
152 void (*auth_resp_callbk_fn)(void *os_vif_ctx,
153 struct nrf_wifi_umac_event_mlme *auth_resp_event,
154 unsigned int event_len);
155
157 void (*assoc_resp_callbk_fn)(void *os_vif_ctx,
158 struct nrf_wifi_umac_event_mlme *assoc_resp_event,
159 unsigned int event_len);
160
162 void (*deauth_callbk_fn)(void *os_vif_ctx,
163 struct nrf_wifi_umac_event_mlme *deauth_event,
164 unsigned int event_len);
165
167 void (*disassoc_callbk_fn)(void *os_vif_ctx,
168 struct nrf_wifi_umac_event_mlme *disassoc_event,
169 unsigned int event_len);
170
172 void (*mgmt_rx_callbk_fn)(void *os_vif_ctx,
173 struct nrf_wifi_umac_event_mlme *mgmt_rx_event,
174 unsigned int event_len);
175
177 void (*unprot_mlme_mgmt_rx_callbk_fn)(void *os_vif_ctx,
178 struct nrf_wifi_umac_event_mlme *unprot_mlme_event,
179 unsigned int event_len);
180
182 void (*tx_pwr_get_callbk_fn)(void *os_vif_ctx,
184 unsigned int event_len);
185
187 void (*chnl_get_callbk_fn)(void *os_vif_ctx,
189 unsigned int event_len);
190
192 void (*cookie_rsp_callbk_fn)(void *os_vif_ctx,
193 struct nrf_wifi_umac_event_cookie_rsp *cookie_rsp,
194 unsigned int event_len);
195
197 void (*tx_status_callbk_fn)(void *os_vif_ctx,
198 struct nrf_wifi_umac_event_mlme *tx_status_event,
199 unsigned int event_len);
200
202 void (*set_if_callbk_fn)(void *os_vif_ctx,
203 struct nrf_wifi_umac_event_set_interface *set_if_event,
204 unsigned int event_len);
205
207 void (*roc_callbk_fn)(void *os_vif_ctx,
208 struct nrf_wifi_event_remain_on_channel *roc_event,
209 unsigned int event_len);
210
212 void (*roc_cancel_callbk_fn)(void *os_vif_ctx,
213 struct nrf_wifi_event_remain_on_channel *roc_cancel_event,
214 unsigned int event_len);
215
217 void (*get_station_callbk_fn)(void *os_vif_ctx,
219 unsigned int event_len);
220
222 void (*get_interface_callbk_fn)(void *os_vif_ctx,
223 struct nrf_wifi_interface_info *info,
224 unsigned int event_len);
225
227 void (*mgmt_tx_status)(void *if_priv,
228 struct nrf_wifi_umac_event_mlme *mlme_event,
229 unsigned int event_len);
230
232 void (*twt_config_callbk_fn)(void *if_priv,
233 struct nrf_wifi_umac_cmd_config_twt *twt_config_event_info,
234 unsigned int event_len);
235
237 void (*twt_teardown_callbk_fn)(void *if_priv,
238 struct nrf_wifi_umac_cmd_teardown_twt *twt_teardown_event_info,
239 unsigned int event_len);
240
242 void (*event_get_wiphy)(void *if_priv,
243 struct nrf_wifi_event_get_wiphy *get_wiphy,
244 unsigned int event_len);
245
247 void (*twt_sleep_callbk_fn)(void *if_priv,
248 struct nrf_wifi_umac_event_twt_sleep *twt_sleep_event_info,
249 unsigned int event_len);
250
252 void (*event_get_reg)(void *if_priv,
253 struct nrf_wifi_reg *get_reg,
254 unsigned int event_len);
255
259 void (*event_get_ps_info)(void *if_priv,
260 struct nrf_wifi_umac_event_power_save_info *get_ps_config,
261 unsigned int event_len);
262
264 void (*get_conn_info_callbk_fn)(void *os_vif_ctx,
266 unsigned int event_len);
267
269 void (*process_rssi_from_rx)(void *os_vif_ctx,
270 signed short signal);
271#endif /* CONFIG_NRF700X_STA_MODE */
272#if defined(CONFIG_NRF700X_RAW_DATA_RX) || defined(CONFIG_NRF700X_PROMISC_DATA_RX)
273 void (*rx_sniffer_frm_callbk_fn)(void *os_vif_ctx,
274 void *frm,
275 struct raw_rx_pkt_header *,
276 bool pkt_free);
277#endif /* CONFIG_NRF700X_RAW_DATA_RX || CONFIG_NRF700X_PROMISC_DATA_RX */
278 void (*reg_change_callbk_fn)(void *os_vif_ctx,
279 struct nrf_wifi_event_regulatory_change *reg_change,
280 unsigned int event_len);
281};
282
283#if defined(CONFIG_NRF700X_STA_MODE) || defined(__DOXYGEN__)
288enum nrf_wifi_fmac_twt_state {
290 NRF_WIFI_FMAC_TWT_STATE_SLEEP,
292 NRF_WIFI_FMAC_TWT_STATE_AWAKE
293};
294
301struct peers_info {
303 int peer_id;
305 unsigned char if_idx;
307 unsigned char ps_state;
309 unsigned char is_legacy;
311 unsigned char qos_supported;
313 unsigned char pend_q_bmp __NRF_WIFI_ALIGN_4;
315 unsigned char ra_addr[NRF_WIFI_ETH_ADDR_LEN] __NRF_WIFI_ALIGN_4;
317 unsigned int pairwise_cipher;
319 int ps_token_count;
320};
321
326struct tx_config {
328 void *tx_lock;
330 struct peers_info peers[MAX_SW_PEERS];
332 unsigned int *send_pkt_coalesce_count_p;
334 void *data_pending_txq[MAX_SW_PEERS][NRF_WIFI_FMAC_AC_MAX];
336 void *wakeup_client_q;
338 unsigned long *buf_pool_bmp_p;
340 unsigned int outstanding_descs[NRF_WIFI_FMAC_AC_MAX];
342 unsigned int curr_peer_opp[NRF_WIFI_FMAC_AC_MAX];
344 unsigned int next_spare_desc_ac;
346 struct tx_pkt_info *pkt_info_p;
351 unsigned int spare_desc_queue_map;
352#if defined(CONFIG_NRF700X_TX_DONE_WQ_ENABLED) || defined(__DOXYGEN__)
354 void *tx_done_tasklet_event_q;
355#endif /* CONFIG_NRF700X_TX_DONE_WQ_ENABLED */
356};
357#endif /* CONFIG_NRF700X_STA_MODE */
358
375 unsigned int num_rx_bufs;
376#if defined(CONFIG_NRF700X_STA_MODE)
378 unsigned char num_tx_tokens;
380 unsigned char num_tx_tokens_per_ac;
382 unsigned char num_tx_tokens_spare;
384 unsigned int max_ampdu_len_per_token;
386 unsigned int avail_ampdu_len_per_token;
387#endif /* CONFIG_NRF700X_STA_MODE */
388};
389
390#ifdef CONFIG_NRF700X_RAW_DATA_TX
391
396enum nrf_wifi_fmac_rawtx_mode {
398 NRF_WIFI_FMAC_RAWTX_MODE_LEGACY,
400 NRF_WIFI_FMAC_RAWTX_MODE_HT,
402 NRF_WIFI_FMAC_RAWTX_MODE_VHT,
404 NRF_WIFI_FMAC_RAWTX_MODE_HE_SU,
406 NRF_WIFI_FMAC_RAWTX_MODE_HE_ER_SU,
408 NRF_WIFI_FMAC_RAWTX_MODE_HE_TB,
410 NRF_WIFI_FMAC_RAWTX_MODE_MAX
411};
412
419struct raw_tx_pkt_header {
421 unsigned int magic_num;
423 unsigned char data_rate;
425 unsigned short packet_length;
427 unsigned char tx_mode;
429 unsigned char queue;
431 unsigned char raw_tx_flag;
432};
433
440struct raw_tx_stats {
442 unsigned int raw_pkts_sent;
444 unsigned int raw_pkt_send_failure;
446 unsigned int raw_pkt_send_success;
447};
448#endif /* CONFIG_NRF700X_RAW_DATA_TX */
449
459#if defined(CONFIG_NRF700X_RX_WQ_ENABLED)
461 void *rx_tasklet;
463 void *rx_tasklet_event_q;
464#endif /* CONFIG_NRF700X_RX_WQ_ENABLED */
468 unsigned char num_sta;
470 unsigned char num_ap;
473#if defined(CONFIG_NRF700X_STA_MODE)
475 struct nrf_wifi_fmac_buf_map_info *tx_buf_info;
477 struct tx_config tx_config;
479 enum nrf_wifi_fmac_twt_state twt_sleep_status;
480#if defined(CONFIG_NRF700X_TX_DONE_WQ_ENABLED)
482 void *tx_done_tasklet;
483#endif /* CONFIG_NRF700X_TX_DONE_WQ_ENABLED */
484#endif /* CONFIG_NRF700X_STA_MODE */
485#ifdef CONFIG_NRF700X_RAW_DATA_TX
486 struct raw_tx_pkt_header raw_tx_config;
487 struct raw_tx_stats raw_pkt_stats;
488#endif /* CONFIG_NRF700X_RAW_DATA_TX */
489};
490
513 unsigned char mode;
514#if defined(CONFIG_NRF700X_RAW_DATA_TX) || defined(CONFIG_NRF700X_RAW_DATA_RX)
516 unsigned char channel;
518 bool txinjection_mode;
519#endif /* CONFIG_NRF700X_RAW_DATA_TX || CONFIG_NRF700X_RAW_DATA_RX */
520#if defined(CONFIG_NRF700X_RAW_DATA_RX) || defined(CONFIG_NRF700X_PROMISC_DATA_RX)
522 unsigned char packet_filter;
523#endif /* CONFIG_NRF700X_RAW_DATA_RX || CONFIG_NRF700X_PROMISC_DATA_RX */
524#ifdef CONFIG_NRF700X_PROMISC_DATA_RX
526 bool promisc_mode;
527#endif /* CONFIG_NRF700X_PROMISC_DATA_RX */
528};
529
536 bool mapped;
538 unsigned long nwb;
539};
540
544#endif /* __FMAC_STRUCTS_H__ */
nrf_wifi_fmac_if_carr_state
The carrier state of an interface.
Definition: fmac_structs.h:67
@ NRF_WIFI_FMAC_IF_CARR_STATE_INVALID
Definition: fmac_structs.h:73
@ NRF_WIFI_FMAC_IF_CARR_STATE_ON
Definition: fmac_structs.h:71
@ NRF_WIFI_FMAC_IF_CARR_STATE_OFF
Definition: fmac_structs.h:69
#define MAX_SW_PEERS
Definition: fmac_structs.h:24
nrf_wifi_fmac_if_op_state
The operational state of an interface.
Definition: fmac_structs.h:53
@ NRF_WIFI_FMAC_IF_OP_STATE_DOWN
Definition: fmac_structs.h:55
@ NRF_WIFI_FMAC_IF_OP_STATE_INVALID
Definition: fmac_structs.h:59
@ NRF_WIFI_FMAC_IF_OP_STATE_UP
Definition: fmac_structs.h:57
nrf_wifi_fmac_ac
WLAN access categories.
Definition: fmac_structs.h:33
@ NRF_WIFI_FMAC_AC_BK
Definition: fmac_structs.h:35
@ NRF_WIFI_FMAC_AC_VO
Definition: fmac_structs.h:41
@ NRF_WIFI_FMAC_AC_MAX
Definition: fmac_structs.h:45
@ NRF_WIFI_FMAC_AC_BE
Definition: fmac_structs.h:37
@ NRF_WIFI_FMAC_AC_MC
Definition: fmac_structs.h:43
@ NRF_WIFI_FMAC_AC_VI
Definition: fmac_structs.h:39
#define MAX_NUM_VIFS
Definition: host_rpu_sys_if.h:55
#define MAX_NUM_OF_RX_QUEUES
Definition: lmac_if_common.h:200
#define NRF_WIFI_ETH_ADDR_LEN
Definition: host_rpu_sys_if.h:47
nrf_wifi_status
The status of an operation performed by the RPU driver.
Definition: osal_structs.h:29
This structure specifies the configuration parameters used for configuring data-related settings.
Definition: host_rpu_sys_if.h:702
This structure represents wiphy parameters.
Definition: host_rpu_umac_if.h:3260
This structure represents the event that is generated when the regulatory domain is modified or updat...
Definition: host_rpu_umac_if.h:3482
This structure represents the response to command "Remain on Channel".
Definition: host_rpu_umac_if.h:2999
unsigned long nwb
Definition: fmac_structs.h:538
bool mapped
Definition: fmac_structs.h:536
Structure to hold TX/RX buffer pool configuration data.
Definition: fmac_structs.h:534
void(* scan_start_callbk_fn)(void *os_vif_ctx, struct nrf_wifi_umac_event_trigger_scan *scan_start_event, unsigned int event_len)
Definition: fmac_structs.h:108
void(* disp_scan_res_callbk_fn)(void *os_vif_ctx, struct nrf_wifi_umac_event_new_scan_display_results *scan_res, unsigned int event_len, bool more_res)
Definition: fmac_structs.h:129
void(* scan_abort_callbk_fn)(void *os_vif_ctx, struct nrf_wifi_umac_event_trigger_scan *scan_done_event, unsigned int event_len)
Definition: fmac_structs.h:118
void(* scan_res_callbk_fn)(void *os_vif_ctx, struct nrf_wifi_umac_event_new_scan_results *scan_res, unsigned int event_len, bool more_res)
Definition: fmac_structs.h:123
void(* scan_done_callbk_fn)(void *os_vif_ctx, struct nrf_wifi_umac_event_trigger_scan *scan_done_event, unsigned int event_len)
Definition: fmac_structs.h:113
void(* reg_change_callbk_fn)(void *os_vif_ctx, struct nrf_wifi_event_regulatory_change *reg_change, unsigned int event_len)
Definition: fmac_structs.h:278
void(* rpu_recovery_callbk_fn)(void *os_vif_ctx, void *event_data, unsigned int event_len)
Definition: fmac_structs.h:103
Callback functions to be invoked by UMAC IF layer when a particular event occurs.
Definition: fmac_structs.h:101
struct rpu_host_stats host_stats
Definition: fmac_structs.h:466
unsigned char num_ap
Definition: fmac_structs.h:470
unsigned char num_sta
Definition: fmac_structs.h:468
struct nrf_wifi_fmac_buf_map_info * rx_buf_info
Definition: fmac_structs.h:472
struct nrf_wifi_fmac_vif_ctx * vif_ctx[MAX_NUM_VIFS]
Definition: fmac_structs.h:458
Structure to hold per device context information for the UMAC IF layer.
Definition: fmac_structs.h:456
Structure to hold common fmac dev context parameter data.
Definition: fmac_structs_common.h:146
struct nrf_wifi_fmac_callbk_fns callbk_fns
Definition: fmac_structs.h:367
unsigned int rx_desc[MAX_NUM_OF_RX_QUEUES]
Definition: fmac_structs.h:373
unsigned int num_rx_bufs
Definition: fmac_structs.h:375
struct nrf_wifi_data_config_params data_config
Definition: fmac_structs.h:369
struct rx_buf_pool_params rx_buf_pools[MAX_NUM_OF_RX_QUEUES]
Definition: fmac_structs.h:371
Structure to hold context information for the UMAC IF layer.
Definition: fmac_structs.h:365
char mac_addr[NRF_WIFI_ETH_ADDR_LEN]
Definition: fmac_structs.h:503
int if_type
Definition: fmac_structs.h:509
struct nrf_wifi_fmac_dev_ctx * fmac_dev_ctx
Definition: fmac_structs.h:499
unsigned char mode
Definition: fmac_structs.h:513
void * os_vif_ctx
Definition: fmac_structs.h:501
int groupwise_cipher
Definition: fmac_structs.h:505
unsigned char bssid[NRF_WIFI_ETH_ADDR_LEN]
Definition: fmac_structs.h:511
bool ifflags
Definition: fmac_structs.h:507
Structure to hold per VIF context information for the UMAC IF layer.
Definition: fmac_structs.h:497
This structure represents an event that contains information about a network interface.
Definition: host_rpu_umac_if.h:3032
This structure represents an event that contains regulatory domain information.
Definition: host_rpu_umac_if.h:3446
This structure defines the parameters required for setting up TWT session.
Definition: host_rpu_umac_if.h:2396
This structure defines the command used to delete or remove a TWT session.
Definition: host_rpu_umac_if.h:2423
This structure represents the information related to the connection of a station.
Definition: host_rpu_umac_if.h:2846
This structure represents channel information and serves as the event for the command NRF_WIFI_UMAC_C...
Definition: host_rpu_umac_if.h:2816
This structure represents the event that corresponds to the command NRF_WIFI_UMAC_CMD_GET_TX_POWER....
Definition: host_rpu_umac_if.h:2729
This structure represent different responses received from the access point during various stages of ...
Definition: host_rpu_umac_if.h:2647
This structure serves as a response to the command NRF_WIFI_UMAC_CMD_GET_SCAN_RESULTS of display scan...
Definition: host_rpu_umac_if.h:2620
This structure serves as a response to the command NRF_WIFI_UMAC_CMD_GET_SCAN_RESULTS....
Definition: host_rpu_umac_if.h:2525
This structure represents an event that is generated when a station is added or removed.
Definition: host_rpu_umac_if.h:2679
This structure represents an event that provides information about the RPU power save mode....
Definition: host_rpu_umac_if.h:2916
This structure represents the response to the command NRF_WIFI_UMAC_CMD_SET_INTERFACE....
Definition: host_rpu_umac_if.h:2744
This structure represents the event used to indicate that a scan has started.
Definition: host_rpu_umac_if.h:2485
This structure defines an event used to indicate to the host whether to block or unblock Tx (transmit...
Definition: host_rpu_umac_if.h:2449
Structure to hold host specific statistics.
Definition: fmac_structs_common.h:28
Definition: lmac_if_common.h:202
Structure containing information about a TX packet.
Definition: fmac_tx.h:54