Skip to content
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ target_compile_definitions(
$<$<BOOL:${CONFIG_NRF71_ON_IPC}>:NRF71_ON_IPC>
$<$<BOOL:${CONFIG_NRF_WIFI_DYNAMIC_BANDWIDTH_SIGNALLING}>:NRF_WIFI_DYNAMIC_BANDWIDTH_SIGNALLING>
$<$<BOOL:${CONFIG_NRF_WIFI_DYNAMIC_ED}>:NRF_WIFI_DYNAMIC_ED>
$<$<BOOL:${CONFIG_WIFI_NRF71}>:WIFI_NRF71>
$<$<BOOL:${CONFIG_NRF71_SOFT_HPQM}>:SOFT_HPQM>
$<$<BOOL:${CONFIG_NRF71_CMD_RX_BUFF}>:CMD_RX_BUFF>
NRF_WIFI_MAX_PS_POLL_FAIL_CNT=${CONFIG_NRF_WIFI_MAX_PS_POLL_FAIL_CNT}
NRF70_RX_NUM_BUFS=${CONFIG_NRF70_RX_NUM_BUFS}
NRF70_MAX_TX_TOKENS=${CONFIG_NRF70_MAX_TX_TOKENS}
Expand Down Expand Up @@ -119,10 +122,15 @@ target_include_directories(
${NRF_WIFI_DIR}/fw_if/umac_if/inc
${NRF_WIFI_DIR}/fw_load/mips/fw/inc
${NRF_WIFI_DIR}/hw_if/hal/inc
${NRF_WIFI_DIR}/fw_if/umac_if/inc/fw
${NRF_WIFI_DIR}/fw_if/umac_if/inc/fw/stats
)

if(NOT CONFIG_WIFI_NRF71)
target_include_directories(
${NRF_WIFI_DIR}/fw_if/umac_if/inc/fw
)
endif()

target_include_directories_ifdef(CONFIG_NRF70_SYSTEM_MODE
nrf-wifi-osal
PUBLIC
Expand Down Expand Up @@ -159,14 +167,17 @@ target_sources(nrf-wifi-osal PRIVATE
${NRF_WIFI_DIR}/utils/src/queue.c
${NRF_WIFI_DIR}/utils/src/util.c
${NRF_WIFI_DIR}/hw_if/hal/src/common/hal_api_common.c
${NRF_WIFI_DIR}/hw_if/hal/src/common/hal_fw_patch_loader.c
${NRF_WIFI_DIR}/bus_if/bal/src/bal.c
${NRF_WIFI_DIR}/bus_if/bus/qspi/src/qspi.c
${NRF_WIFI_DIR}/fw_if/umac_if/src/common/fmac_cmd_common.c
${NRF_WIFI_DIR}/fw_if/umac_if/src/common/fmac_api_common.c
${NRF_WIFI_DIR}/fw_if/umac_if/src/common/fmac_util.c
)

if(NOT CONFIG_WIFI_NRF71)
target_sources(nrf-wifi-osal PRIVATE
${NRF_WIFI_DIR}/hw_if/hal/src/common/hal_fw_patch_loader.c
)
endif()
if(NOT CONFIG_NRF71_ON_IPC)
target_sources(nrf-wifi-osal PRIVATE
${NRF_WIFI_DIR}/hw_if/hal/src/common/hal_interrupt.c
Expand Down
43 changes: 28 additions & 15 deletions bus_if/bal/inc/bal_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void nrf_wifi_bal_deinit(struct nrf_wifi_bal_priv *bpriv);
* @return Pointer to the added device context.
*/
struct nrf_wifi_bal_dev_ctx *nrf_wifi_bal_dev_add(struct nrf_wifi_bal_priv *bpriv,
void *hal_dev_ctx);
void *hal_dev_ctx);

/**
* @brief Remove a device context from the BAL layer.
Expand Down Expand Up @@ -99,8 +99,8 @@ unsigned int nrf_wifi_bal_read_word(void *ctx, unsigned long addr_offset);
* @param val Value to write.
*/
void nrf_wifi_bal_write_word(void *ctx,
unsigned long addr_offset,
unsigned int val);
unsigned long addr_offset,
unsigned int val);

/**
* @brief Read a block of data from a specific address offset.
Expand All @@ -111,9 +111,9 @@ void nrf_wifi_bal_write_word(void *ctx,
* @param len Length of the data to read.
*/
void nrf_wifi_bal_read_block(void *ctx,
void *dest_addr,
unsigned long src_addr_offset,
size_t len);
void *dest_addr,
unsigned long src_addr_offset,
size_t len);

/**
* @brief Write a block of data to a specific address offset.
Expand All @@ -124,9 +124,22 @@ void nrf_wifi_bal_read_block(void *ctx,
* @param len Length of the data to write.
*/
void nrf_wifi_bal_write_block(void *ctx,
unsigned long dest_addr_offset,
const void *src_addr,
size_t len);
unsigned long dest_addr_offset,
const void *src_addr,
size_t len);
#ifdef WIFI_NRF71
#ifdef INLINE_RX
unsigned long nrf_wifi_bal_dma_map_inline_rx(void *ctx,
unsigned long virt_addr,
size_t len,
enum nrf_wifi_osal_dma_dir dma_dir);

unsigned long nrf_wifi_bal_dma_unmap_inline_rx(void *ctx,
unsigned long phy_addr,
size_t len,
enum nrf_wifi_osal_dma_dir dma_dir);
#endif /* INLINE_RX */
#endif /* WIFI_NRF71 */

/**
* @brief Map a virtual address to a physical address for DMA transfer.
Expand All @@ -139,9 +152,9 @@ void nrf_wifi_bal_write_block(void *ctx,
* @return The mapped physical address.
*/
unsigned long nrf_wifi_bal_dma_map(void *ctx,
unsigned long virt_addr,
size_t len,
enum nrf_wifi_osal_dma_dir dma_dir);
unsigned long virt_addr,
size_t len,
enum nrf_wifi_osal_dma_dir dma_dir);

/**
* @brief Unmap a physical address for DMA transfer.
Expand All @@ -152,9 +165,9 @@ unsigned long nrf_wifi_bal_dma_map(void *ctx,
* @param dma_dir DMA direction.
*/
unsigned long nrf_wifi_bal_dma_unmap(void *ctx,
unsigned long phy_addr,
size_t len,
enum nrf_wifi_osal_dma_dir dma_dir);
unsigned long phy_addr,
size_t len,
enum nrf_wifi_osal_dma_dir dma_dir);

/**
* @brief Enable bus access recording.
Expand Down
13 changes: 13 additions & 0 deletions bus_if/bal/inc/bal_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,19 @@ struct nrf_wifi_bal_ops {
unsigned long phy_addr,
size_t len,
enum nrf_wifi_osal_dma_dir dma_dir);
#ifdef WIFI_NRF71
#ifdef INLINE_RX
unsigned long (*dma_map_inline_rx)(void *bus_dev_ctx,
unsigned long virt_addr,
size_t len,
enum nrf_wifi_osal_dma_dir dma_dir);

unsigned long (*dma_unmap_inline_rx)(void *bus_dev_ctx,
unsigned long phy_addr,
size_t len,
enum nrf_wifi_osal_dma_dir dma_dir);
#endif /* INLINE_RX */
#endif /* WIFI_NRF71 */

#if defined(NRF_WIFI_LOW_POWER) || defined(__DOXYGEN__)
/**
Expand Down
5 changes: 5 additions & 0 deletions bus_if/bal/inc/bal_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
struct nrf_wifi_bal_cfg_params {
/** Base address of the packet RAM. */
unsigned long addr_pktram_base;
#ifdef WIFI_NRF71
#ifdef INLINE_RX
unsigned long addr_hostram_base_inline_rx;
#endif
#endif
};

/**
Expand Down
39 changes: 39 additions & 0 deletions bus_if/bal/src/bal.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,45 @@ void nrf_wifi_bal_write_block(void *ctx,
len);
}

#ifdef WIFI_NRF71
#ifdef INLINE_RX
unsigned long nrf_wifi_bal_dma_map_inline_rx(void *ctx,
unsigned long virt_addr,
size_t len,
enum nrf_wifi_osal_dma_dir dma_dir)
{
struct nrf_wifi_bal_dev_ctx *bal_dev_ctx = NULL;
unsigned long phy_addr = 0;

bal_dev_ctx = (struct nrf_wifi_bal_dev_ctx *)ctx;

phy_addr = bal_dev_ctx->bpriv->ops->dma_map_inline_rx(
bal_dev_ctx->bus_dev_ctx,
virt_addr,
len,
dma_dir);
return phy_addr;
}

unsigned long nrf_wifi_bal_dma_unmap_inline_rx(void *ctx,
unsigned long phy_addr,
size_t len,
enum nrf_wifi_osal_dma_dir dma_dir)
{
struct nrf_wifi_bal_dev_ctx *bal_dev_ctx = NULL;
unsigned long virt_addr = 0;

bal_dev_ctx = (struct nrf_wifi_bal_dev_ctx *)ctx;

virt_addr = bal_dev_ctx->bpriv->ops->dma_unmap_inline_rx(
bal_dev_ctx->bus_dev_ctx,
phy_addr,
len,
dma_dir);
return virt_addr;
}
#endif /* INLINE_RX */
#endif /* WIFI_NRF71 */

unsigned long nrf_wifi_bal_dma_map(void *ctx,
unsigned long virt_addr,
Expand Down
4 changes: 2 additions & 2 deletions bus_if/bus/pcie/inc/pcie.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ struct nrf_wifi_bus_pcie_dev_ctx {

void *iomem_addr_base;
unsigned long addr_pktram_base;
#ifdef SOC_WEZEN
#ifdef WIFI_NRF71
#ifdef INLINE_RX
unsigned long addr_hostram_base_inline_rx;
unsigned long addr_hostram_base_inline_rx;
#endif
#endif
#ifdef DEBUG_MODE_SUPPORT
Expand Down
Loading