1 /*
2  * Copyright (c) 2024 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /**
8  * @brief Header containing network stack interface specific declarations for
9  * the Zephyr OS layer of the Wi-Fi driver.
10  */
11 
12 #ifndef __ZEPHYR_NET_IF_H__
13 #define __ZEPHYR_NET_IF_H__
14 #include <zephyr/device.h>
15 #include <zephyr/net/net_pkt.h>
16 #include <zephyr/net/net_if.h>
17 #include <zephyr/net/ethernet.h>
18 #include <fmac_structs.h>
19 #include <zephyr/net/wifi_mgmt.h>
20 
21 #define UNICAST_MASK GENMASK(7, 1)
22 #define LOCAL_BIT BIT(1)
23 
24 void nrf_wifi_if_init_zep(struct net_if *iface);
25 
26 int nrf_wifi_if_start_zep(const struct device *dev);
27 
28 int nrf_wifi_if_stop_zep(const struct device *dev);
29 
30 int nrf_wifi_if_set_config_zep(const struct device *dev,
31 			       enum ethernet_config_type type,
32 			       const struct ethernet_config *config);
33 
34 int nrf_wifi_if_get_config_zep(const struct device *dev,
35 			       enum ethernet_config_type type,
36 			       struct ethernet_config *config);
37 
38 enum ethernet_hw_caps nrf_wifi_if_caps_get(const struct device *dev);
39 
40 int nrf_wifi_if_send(const struct device *dev,
41 		     struct net_pkt *pkt);
42 
43 void nrf_wifi_if_rx_frm(void *os_vif_ctx,
44 			void *frm);
45 
46 #if defined(CONFIG_NRF70_RAW_DATA_RX) || defined(CONFIG_NRF70_PROMISC_DATA_RX)
47 void nrf_wifi_if_sniffer_rx_frm(void *os_vif_ctx,
48 				void *frm,
49 				struct raw_rx_pkt_header *raw_rx_hdr,
50 				bool pkt_free);
51 #endif /* CONFIG_NRF70_RAW_DATA_RX || CONFIG_NRF70_PROMISC_DATA_RX */
52 
53 enum nrf_wifi_status nrf_wifi_if_carr_state_chg(void *os_vif_ctx,
54 						enum nrf_wifi_fmac_if_carr_state carr_state);
55 
56 int nrf_wifi_stats_get(const struct device *dev,
57 		       struct net_stats_wifi *stats);
58 
59 struct net_stats_eth *nrf_wifi_eth_stats_get(const struct device *dev);
60 
61 void nrf_wifi_set_iface_event_handler(void *os_vif_ctx,
62 						struct nrf_wifi_umac_event_set_interface *event,
63 						unsigned int event_len);
64 
65 int nrf_wifi_stats_reset(const struct device *dev);
66 #endif /* __ZEPHYR_NET_IF_H__ */
67