1 /*
2  * Copyright (c) 2022 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5  */
6 
7 /**
8  * @brief File containing declarations for the
9  * PCIe bus Layer of the Wi-Fi driver.
10  */
11 
12 #include "bal_structs.h"
13 
14 /* TODO: Move these defines to Platform layer */
15 #define NRF_WIFI_PCIE_DRV_NAME "nrf_wifi_pcie"
16 #define NRF_WIFI_PCI_VENDOR_ID 0x0700
17 #define NRF_WIFI_PCI_SUB_VENDOR_ID (~0)
18 #define NRF_WIFI_PCI_DEVICE_ID (~0)
19 #define NRF_WIFI_PCI_SUB_DEVICE_ID (~0)
20 
21 /**
22  * struct nrf_wifi_bus_pcie_priv - Structure to hold context information for the PCIe bus.
23  * @opriv: Pointer to the OSAL context.
24  * @mmap_dev_addr_base: Pointer to the base of the device i/o address memory
25  *                      mapped into the host memory.
26  * @mmap_dev_addr_len: Length of the device i/o address memory mapped into the
27  *                     host memory.
28  * @irq: Interrupt line used by the PCIe device.
29  * @irq_flags: Interrupts flag to indicate whether interrupt is shared etc.
30  *
31  * This structure maintains the context information necessary for the operation
32  * of the PCIe bus. Some of the elements of the structure need to be initialized
33  * during the initialization of the PCIe bus while others need to be kept
34  * updated over the duration of the PCIe bus operation.
35  */
36 struct nrf_wifi_bus_pcie_priv {
37 	struct nrf_wifi_osal_priv *opriv;
38 	void *os_pcie_priv;
39 
40 	int (*intr_callbk_fn)(void *bal_dev_ctx);
41 
42 	/* TODO: See if this can be removed by getting the information from PAL */
43 	struct nrf_wifi_bal_cfg_params cfg_params;
44 };
45 
46 
47 struct nrf_wifi_bus_pcie_dev_ctx {
48 	struct nrf_wifi_bus_pcie_priv *pcie_priv;
49 	void *bal_dev_ctx;
50 	void *os_pcie_dev_ctx;
51 
52 	void *iomem_addr_base;
53 	unsigned long addr_pktram_base;
54 #ifdef SOC_WEZEN
55 #ifdef INLINE_RX
56 	unsigned long addr_hostram_base_inline_rx;
57 #endif
58 #endif
59 #ifdef DEBUG_MODE_SUPPORT
60 #ifdef DCR14_VALIDATE
61 	bool bus_access_rec_enab;
62 	unsigned int bus_access_cnt;
63 #endif /* DCR14_VALIDATE */
64 #endif
65 };
66