1 /*
2  * Copyright (c) 2024 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 /**
8  * @file spi.h
9  *
10  * @brief Header file for the Linux SPI bus layer specific structure declarations
11  * of the Wi-Fi driver.
12  */
13 
14 #ifndef __SPI_H__
15 #define __SPI_H__
16 
17 #include "osal_structs.h"
18 #include "bal_structs.h"
19 
20 /**
21  * @brief Structure to hold context information for the Linux SPI bus.
22  */
23 struct nrf_wifi_bus_spi_priv {
24 	/** Pointer to the OS-specific SPI context. */
25 	void *os_spi_priv;
26 
27 	/**
28 	 * @brief Interrupt callback function.
29 	 *
30 	 * @param hal_ctx The HAL context.
31 	 * @return The status of the interrupt callback function.
32 	 */
33 	enum nrf_wifi_status (*intr_callbk_fn)(void *hal_ctx);
34 
35 	/**
36 	 * @brief Configuration parameters for the Linux SPI bus.
37 	 */
38 	struct nrf_wifi_bal_cfg_params cfg_params;
39 };
40 
41 /**
42  * @brief Structure to hold the device context for the Linux SPI bus.
43  */
44 struct nrf_wifi_bus_spi_dev_ctx {
45 	/** Pointer to the SPI bus private context. */
46 	struct nrf_wifi_bus_spi_priv *spi_priv;
47 	/** Pointer to the BAL device context. */
48 	void *bal_dev_ctx;
49 	/** Pointer to the OS-specific SPI device context. */
50 	void *os_spi_dev_ctx;
51 
52 	/** Base address of the host. */
53 	unsigned long host_addr_base;
54 	/** Base address of the packet RAM. */
55 	unsigned long addr_pktram_base;
56 };
57 
58 #endif /* __LINUX_SPI_H__ */
59