1 /*
2  * Copyright (c) 2023 Cypress Semiconductor Corporation (an Infineon company) or
3  * an affiliate of Cypress Semiconductor Corporation
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #include <whd_buffer_api.h>
9 #include <zephyr/sd/sd.h>
10 #include <zephyr/sd/sdio.h>
11 #include <zephyr/drivers/gpio.h>
12 #include <zephyr/net/wifi_mgmt.h>
13 #include <cyhal.h>
14 
15 struct airoc_wifi_data {
16 	struct sd_card card;
17 	struct sdio_func sdio_func1;
18 	struct sdio_func sdio_func2;
19 	struct net_if *iface;
20 	bool second_interface_init;
21 	bool is_ap_up;
22 	bool is_sta_connected;
23 	uint8_t mac_addr[6];
24 	scan_result_cb_t scan_rslt_cb;
25 	whd_ssid_t ssid;
26 	whd_scan_result_t scan_result;
27 	struct k_sem sema_common;
28 	struct k_sem sema_scan;
29 #if defined(CONFIG_NET_STATISTICS_WIFI)
30 	struct net_stats_wifi stats;
31 #endif
32 	whd_driver_t whd_drv;
33 	struct gpio_callback host_oob_pin_cb;
34 	uint8_t frame_buf[NET_ETH_MAX_FRAME_SIZE];
35 };
36 
37 struct airoc_wifi_config {
38 	const struct device *sdhc_dev;
39 	struct gpio_dt_spec wifi_reg_on_gpio;
40 	struct gpio_dt_spec wifi_host_wake_gpio;
41 	struct gpio_dt_spec wifi_dev_wake_gpio;
42 };
43 
44 /**
45  * \brief This function returns pointer type to handle instance
46  *        of whd interface (whd_interface_t) which allocated in
47  *        Zephyr AIROC driver (drivers/wifi/infineon/airoc_wifi.c)
48  */
49 
50 whd_interface_t airoc_wifi_get_whd_interface(void);
51