Skip to content

Commit

Permalink
drivers: wifi: Fix AP mode build
Browse files Browse the repository at this point in the history
commit ec6725b ("drivers: wifi: Re-organize code to separate
radiotest and default mode") has broken the AP build.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
  • Loading branch information
krish2718 authored and rlubos committed Sep 20, 2023
1 parent b5e89e5 commit 74857e3
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions drivers/wifi/nrf700x/osal/fw_if/umac_if/src/fmac_ap.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "fmac_peer.h"
#include "queue.h"
#include "fmac_tx.h"
#include "fmac_util.h"

enum wifi_nrf_status sap_client_ps_get_frames(struct wifi_nrf_fmac_dev_ctx *fmac_dev_ctx,
struct nrf_wifi_sap_ps_get_frames *config)
Expand All @@ -23,6 +24,8 @@ enum wifi_nrf_status sap_client_ps_get_frames(struct wifi_nrf_fmac_dev_ctx *fmac
int id = -1;
int ac = 0;
int desc = 0;
struct wifi_nrf_fmac_dev_ctx_def *def_dev_ctx = NULL;
struct wifi_nrf_fmac_priv_def *def_priv = NULL;

if (!fmac_dev_ctx || !config) {
wifi_nrf_osal_log_err(fmac_dev_ctx->fpriv->opriv,
Expand All @@ -31,8 +34,11 @@ enum wifi_nrf_status sap_client_ps_get_frames(struct wifi_nrf_fmac_dev_ctx *fmac
goto out;
}

def_dev_ctx = wifi_dev_priv(fmac_dev_ctx);
def_priv = wifi_fmac_priv(fmac_dev_ctx->fpriv);

wifi_nrf_osal_spinlock_take(fmac_dev_ctx->fpriv->opriv,
fmac_dev_ctx->tx_config.tx_lock);
def_dev_ctx->tx_config.tx_lock);

id = wifi_nrf_fmac_peer_get_id(fmac_dev_ctx, config->mac_addr);

Expand All @@ -43,15 +49,15 @@ enum wifi_nrf_status sap_client_ps_get_frames(struct wifi_nrf_fmac_dev_ctx *fmac
config->mac_addr);

wifi_nrf_osal_spinlock_rel(fmac_dev_ctx->fpriv->opriv,
fmac_dev_ctx->tx_config.tx_lock);
def_dev_ctx->tx_config.tx_lock);
goto out;
}


peer = &fmac_dev_ctx->tx_config.peers[id];
peer = &def_dev_ctx->tx_config.peers[id];
peer->ps_token_count = config->num_frames;

wakeup_client_q = fmac_dev_ctx->tx_config.wakeup_client_q;
wakeup_client_q = def_dev_ctx->tx_config.wakeup_client_q;

if (wakeup_client_q) {
wifi_nrf_utils_q_enqueue(fmac_dev_ctx->fpriv->opriv,
Expand All @@ -62,13 +68,13 @@ enum wifi_nrf_status sap_client_ps_get_frames(struct wifi_nrf_fmac_dev_ctx *fmac
for (ac = WIFI_NRF_FMAC_AC_VO; ac >= 0; --ac) {
desc = tx_desc_get(fmac_dev_ctx, ac);

if (desc < fmac_dev_ctx->fpriv->num_tx_tokens) {
if (desc < def_priv->num_tx_tokens) {
tx_pending_process(fmac_dev_ctx, desc, ac);
}
}

wifi_nrf_osal_spinlock_rel(fmac_dev_ctx->fpriv->opriv,
fmac_dev_ctx->tx_config.tx_lock);
def_dev_ctx->tx_config.tx_lock);

status = WIFI_NRF_STATUS_SUCCESS;
out:
Expand All @@ -88,16 +94,16 @@ enum wifi_nrf_status sap_client_update_pmmode(struct wifi_nrf_fmac_dev_ctx *fmac
struct wifi_nrf_fmac_dev_ctx_def *def_dev_ctx = NULL;
struct wifi_nrf_fmac_priv_def *def_priv = NULL;

def_dev_ctx = wifi_dev_priv(fmac_dev_ctx);
def_priv = wifi_fmac_priv(fmac_dev_ctx->fpriv);

if (!fmac_dev_ctx || !config) {
wifi_nrf_osal_log_err(fmac_dev_ctx->fpriv->opriv,
"%s: Invalid params\n",
__func__);
goto out;
}

def_dev_ctx = wifi_dev_priv(fmac_dev_ctx);
def_priv = wifi_fmac_priv(fmac_dev_ctx->fpriv);

wifi_nrf_osal_spinlock_take(fmac_dev_ctx->fpriv->opriv,
def_dev_ctx->tx_config.tx_lock);

Expand Down Expand Up @@ -139,7 +145,7 @@ enum wifi_nrf_status sap_client_update_pmmode(struct wifi_nrf_fmac_dev_ctx *fmac
}

wifi_nrf_osal_spinlock_rel(fmac_dev_ctx->fpriv->opriv,
fmac_dev_ctx->tx_config.tx_lock);
def_dev_ctx->tx_config.tx_lock);

status = WIFI_NRF_STATUS_SUCCESS;

Expand Down

0 comments on commit 74857e3

Please sign in to comment.