qcacld-3.0: Move pre cac success code to pre cac component

Move pre cac success code to pre cac component.

Change-Id: I9d4f6c52ada96905e185fecef6556c59e05ab284
CRs-Fixed: 3199947
This commit is contained in:
Dundi Raviteja
2022-05-22 13:17:11 +05:30
zatwierdzone przez Madan Koyyalamudi
rodzic 8ed92a56e6
commit 2bbdc1835e
19 zmienionych plików z 933 dodań i 69 usunięć

Wyświetl plik

@@ -161,7 +161,13 @@ typedef enum {
eSAP_DFS_CAC_START,
eSAP_DFS_CAC_INTERRUPTED,
eSAP_DFS_CAC_END,
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
eSAP_DFS_PRE_CAC_END,
#endif
eSAP_DFS_RADAR_DETECT,
eSAP_DFS_RADAR_DETECT_DURING_PRE_CAC,
/* No ch available after DFS RADAR detect */
@@ -855,12 +861,12 @@ QDF_STATUS wlan_sap_update_next_channel(struct sap_context *sap_ctx,
uint8_t channel,
enum phy_ch_width chan_bw);
#if defined(FEATURE_SAP_COND_CHAN_SWITCH) && defined(PRE_CAC_SUPPORT)
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
#if defined(FEATURE_SAP_COND_CHAN_SWITCH) && defined(PRE_CAC_SUPPORT)
/**
* wlan_sap_set_pre_cac_status() - Set the pre cac status
* @sap_ctx: SAP context
@@ -872,7 +878,6 @@ QDF_STATUS wlan_sap_update_next_channel(struct sap_context *sap_ctx,
*/
QDF_STATUS wlan_sap_set_pre_cac_status(struct sap_context *sap_ctx,
bool status);
#endif
/**
* wlan_sap_set_chan_freq_before_pre_cac() - Save the channel before pre cac
@@ -887,17 +892,11 @@ QDF_STATUS
wlan_sap_set_chan_freq_before_pre_cac(struct sap_context *sap_ctx,
qdf_freq_t freq_before_pre_cac);
#else
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
static inline QDF_STATUS
wlan_sap_set_pre_cac_status(struct sap_context *sap_ctx, bool status)
{
return QDF_STATUS_SUCCESS;
}
#endif
static inline QDF_STATUS
wlan_sap_set_chan_freq_before_pre_cac(struct sap_context *sap_ctx,
@@ -905,9 +904,15 @@ wlan_sap_set_chan_freq_before_pre_cac(struct sap_context *sap_ctx,
{
return QDF_STATUS_SUCCESS;
}
#endif
#endif /* FEATURE_SAP_COND_CHAN_SWITCH and PRE_CAC_SUPPORT */
#endif /* PRE_CAC_COMP */
#ifdef PRE_CAC_SUPPORT
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
/**
* wlan_sap_set_pre_cac_complete_status() - Sets pre cac complete status
* @sap_ctx: SAP context
@@ -920,11 +925,6 @@ wlan_sap_set_chan_freq_before_pre_cac(struct sap_context *sap_ctx,
QDF_STATUS wlan_sap_set_pre_cac_complete_status(struct sap_context *sap_ctx,
bool status);
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
/**
* wlan_sap_is_pre_cac_context() - checks if @context is for a pre-cac adapter
* @context: the SAP context to check
@@ -935,8 +935,13 @@ bool wlan_sap_is_pre_cac_context(struct sap_context *context);
bool wlan_sap_is_pre_cac_active(mac_handle_t handle);
QDF_STATUS wlan_sap_get_pre_cac_vdev_id(mac_handle_t handle, uint8_t *vdev_id);
#endif /* PRE_CAC_COMP */
#endif
#else
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
static inline QDF_STATUS
wlan_sap_set_pre_cac_complete_status(struct sap_context *sap_ctx,
bool status)
@@ -944,11 +949,6 @@ wlan_sap_set_pre_cac_complete_status(struct sap_context *sap_ctx,
return QDF_STATUS_SUCCESS;
}
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
static inline bool
wlan_sap_is_pre_cac_context(struct sap_context *context)
{
@@ -959,8 +959,8 @@ static inline bool wlan_sap_is_pre_cac_active(mac_handle_t handle)
{
return false;
}
#endif
#endif
#endif /* PRE_CAC_COMP */
#endif /* PRE_CAC_SUPPORT */
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
/**

Wyświetl plik

@@ -474,7 +474,15 @@ wlansap_roam_process_ch_change_success(struct mac_context *mac_ctx,
sap_ctx->chan_freq = target_chan_freq;
/* check if currently selected channel is a DFS channel */
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
if (is_ch_dfs && sap_ctx->pre_cac_complete) {
#else
if (is_ch_dfs && wlan_pre_cac_complete_get(sap_ctx->vdev)) {
#endif
/* Start beaconing on the new pre cac channel */
wlansap_start_beacon_req(sap_ctx);
sap_ctx->fsm_state = SAP_STARTING;
@@ -551,7 +559,15 @@ wlansap_roam_process_dfs_chansw_update(mac_handle_t mac_handle,
* with no CSA IE will be sent to firmware.
*/
dfs_beacon_start_req = true;
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
sap_ctx->pre_cac_complete = false;
#else
wlan_pre_cac_complete_set(sap_ctx->vdev, false);
#endif
*ret_status = sme_roam_start_beacon_req(mac_handle,
sap_ctx->bssid,
dfs_beacon_start_req);

Wyświetl plik

@@ -155,7 +155,13 @@ static uint8_t *sap_hdd_event_to_string(eSapHddEvent event)
CASE_RETURN_STRING(eSAP_DFS_CAC_START);
CASE_RETURN_STRING(eSAP_DFS_CAC_INTERRUPTED);
CASE_RETURN_STRING(eSAP_DFS_CAC_END);
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
CASE_RETURN_STRING(eSAP_DFS_PRE_CAC_END);
#endif
CASE_RETURN_STRING(eSAP_DFS_RADAR_DETECT);
CASE_RETURN_STRING(eSAP_DFS_RADAR_DETECT_DURING_PRE_CAC);
CASE_RETURN_STRING(eSAP_DFS_NO_AVAILABLE_CHANNEL);
@@ -521,12 +527,32 @@ is_wlansap_cac_required_for_chan(struct mac_context *mac_ctx,
if (WLAN_REG_IS_6GHZ_CHAN_FREQ(chan_freq))
is_ch_dfs = false;
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
sap_debug("vdev id %d chan %d is_ch_dfs %d pre_cac_complete %d ignore_cac %d cac_state %d",
sap_ctx->sessionId, chan_freq, is_ch_dfs,
sap_ctx->pre_cac_complete, mac_ctx->sap.SapDfsInfo.ignore_cac,
mac_ctx->sap.SapDfsInfo.cac_state);
#else
sap_debug("vdev id %d chan %d is_ch_dfs %d pre_cac_complete %d ignore_cac %d cac_state %d",
sap_ctx->sessionId, chan_freq, is_ch_dfs,
wlan_pre_cac_complete_get(sap_ctx->vdev),
mac_ctx->sap.SapDfsInfo.ignore_cac,
mac_ctx->sap.SapDfsInfo.cac_state);
#endif
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
if (!is_ch_dfs || sap_ctx->pre_cac_complete ||
#else
if (!is_ch_dfs || wlan_pre_cac_complete_get(sap_ctx->vdev) ||
#endif
mac_ctx->sap.SapDfsInfo.ignore_cac ||
mac_ctx->sap.SapDfsInfo.cac_state == eSAP_DFS_SKIP_CAC)
cac_required = false;
@@ -1482,11 +1508,13 @@ QDF_STATUS sap_set_session_param(mac_handle_t mac_handle,
*/
#ifndef PRE_CAC_COMP
sapctx->is_pre_cac_on = false;
#else
wlan_pre_cac_set_status(sapctx->vdev, false);
#endif
sapctx->pre_cac_complete = false;
sapctx->freq_before_pre_cac = 0;
#else
wlan_pre_cac_set_status(sapctx->vdev, false);
wlan_pre_cac_complete_set(sapctx->vdev, false);
wlan_pre_cac_set_freq_before_pre_cac(sapctx->vdev, 0);
#endif
/* When SSR, SAP will restart, clear the old context,sessionId */
for (i = 0; i < SAP_MAX_NUM_SESSION; i++) {
@@ -2255,7 +2283,13 @@ QDF_STATUS sap_signal_hdd_event(struct sap_context *sap_ctx,
case eSAP_DFS_CAC_START:
case eSAP_DFS_CAC_INTERRUPTED:
case eSAP_DFS_CAC_END:
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
case eSAP_DFS_PRE_CAC_END:
#endif
case eSAP_DFS_RADAR_DETECT:
case eSAP_DFS_RADAR_DETECT_DURING_PRE_CAC:
case eSAP_DFS_NO_AVAILABLE_CHANNEL:
@@ -2705,6 +2739,11 @@ static QDF_STATUS sap_cac_start_notify(mac_handle_t mac_handle)
}
#ifdef PRE_CAC_SUPPORT
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
/**
* wlansap_update_pre_cac_end() - Update pre cac end to upper layer
* @sap_context: SAP context
@@ -2735,6 +2774,29 @@ static QDF_STATUS wlansap_update_pre_cac_end(struct sap_context *sap_context,
return QDF_STATUS_SUCCESS;
}
#else
/**
* wlansap_pre_cac_end_notify() - Update pre cac end to upper layer
* @sap_context: SAP context
* @mac: Global MAC structure
* @intf: Interface number
*
* Notifies pre cac end to upper layer
*
* Return: None
*/
static void wlansap_pre_cac_end_notify(struct sap_context *sap_context,
struct mac_context *mac,
uint8_t intf)
{
sap_context->isCacEndNotified = true;
mac->sap.SapDfsInfo.sap_radar_found_status = false;
sap_context->fsm_state = SAP_STARTED;
sap_warn("pre cac end notify on %d: move to state SAP_STARTED", intf);
wlan_pre_cac_handle_cac_end(sap_context->vdev);
}
#endif /* PRE_CAC_COMP */
QDF_STATUS sap_cac_end_notify(mac_handle_t mac_handle,
struct csr_roam_info *roamInfo)
@@ -2777,9 +2839,6 @@ QDF_STATUS sap_cac_end_notify(mac_handle_t mac_handle,
*/
#ifndef PRE_CAC_COMP
if (sap_context->is_pre_cac_on) {
#else
if (wlan_pre_cac_get_status(mac->psoc)) {
#endif
qdf_status = wlansap_update_pre_cac_end(
sap_context, mac, intf);
if (QDF_IS_STATUS_ERROR(qdf_status))
@@ -2789,6 +2848,16 @@ QDF_STATUS sap_cac_end_notify(mac_handle_t mac_handle,
*/
break;
}
#else
if (wlan_pre_cac_get_status(mac->psoc)) {
wlansap_pre_cac_end_notify(sap_context,
mac, intf);
/* pre CAC is not allowed with any concurrency.
* So, we can break from here.
*/
break;
}
#endif
qdf_status = sap_signal_hdd_event(sap_context, NULL,
eSAP_DFS_CAC_END,
@@ -3474,7 +3543,15 @@ static QDF_STATUS sap_fsm_state_starting(struct sap_context *sap_ctx,
if ((false == sap_dfs_info->ignore_cac) &&
(eSAP_DFS_DO_NOT_SKIP_CAC ==
sap_dfs_info->cac_state) &&
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
!sap_ctx->pre_cac_complete &&
#else
!wlan_pre_cac_complete_get(sap_ctx->vdev) &&
#endif
policy_mgr_get_dfs_master_dynamic_enabled(
mac_ctx->psoc,
sap_ctx->sessionId)) {
@@ -4263,11 +4340,24 @@ qdf_freq_t sap_indicate_radar(struct sap_context *sap_ctx)
/* set the Radar Found flag in SapDfsInfo */
mac->sap.SapDfsInfo.sap_radar_found_status = true;
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
if (sap_ctx->freq_before_pre_cac) {
sap_info("sapdfs: set chan freq before pre cac %d as target chan",
sap_ctx->freq_before_pre_cac);
return sap_ctx->freq_before_pre_cac;
}
#else
chan_freq = wlan_pre_cac_get_freq_before_pre_cac(sap_ctx->vdev);
if (chan_freq) {
sap_info("sapdfs: set chan freq before pre cac %d as target chan",
chan_freq);
return chan_freq;
}
#endif
if (sap_ctx->vendor_acs_dfs_lte_enabled && (QDF_STATUS_SUCCESS ==
sap_signal_hdd_event(sap_ctx, NULL, eSAP_DFS_NEXT_CHANNEL_REQ,

Wyświetl plik

@@ -223,12 +223,12 @@ struct sap_context {
*/
#ifndef PRE_CAC_COMP
bool is_pre_cac_on;
#endif
bool pre_cac_complete;
qdf_freq_t freq_before_pre_cac;
#endif
bool vendor_acs_dfs_lte_enabled;
uint8_t dfs_vendor_channel;
uint8_t dfs_vendor_chan_bw;
qdf_freq_t freq_before_pre_cac;
uint16_t beacon_tx_rate;
enum sap_acs_dfs_mode dfs_mode;
wlan_scan_requester req_id;

Wyświetl plik

@@ -57,6 +57,7 @@
#include "wlan_mlme_ucfg_api.h"
#include "wlan_mlme_vdev_mgr_interface.h"
#include "pld_common.h"
#include "wlan_pre_cac_api.h"
#define SAP_DEBUG
static struct sap_context *gp_sap_ctx[SAP_MAX_NUM_SESSION];
@@ -1659,12 +1660,12 @@ QDF_STATUS wlan_sap_update_next_channel(struct sap_context *sap_ctx,
return QDF_STATUS_SUCCESS;
}
#if defined(FEATURE_SAP_COND_CHAN_SWITCH) && defined(PRE_CAC_SUPPORT)
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
#if defined(FEATURE_SAP_COND_CHAN_SWITCH) && defined(PRE_CAC_SUPPORT)
QDF_STATUS wlan_sap_set_pre_cac_status(struct sap_context *sap_ctx,
bool status)
{
@@ -1678,7 +1679,6 @@ QDF_STATUS wlan_sap_set_pre_cac_status(struct sap_context *sap_ctx,
return QDF_STATUS_SUCCESS;
}
#endif
QDF_STATUS
wlan_sap_set_chan_freq_before_pre_cac(struct sap_context *sap_ctx,
@@ -1693,8 +1693,14 @@ wlan_sap_set_chan_freq_before_pre_cac(struct sap_context *sap_ctx,
return QDF_STATUS_SUCCESS;
}
#endif /* FEATURE_SAP_COND_CHAN_SWITCH */
#endif /* PRE_CAC_COMP */
#ifdef PRE_CAC_SUPPORT
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
QDF_STATUS wlan_sap_set_pre_cac_complete_status(struct sap_context *sap_ctx,
bool status)
{
@@ -1704,18 +1710,12 @@ QDF_STATUS wlan_sap_set_pre_cac_complete_status(struct sap_context *sap_ctx,
}
sap_ctx->pre_cac_complete = status;
sap_debug("pre cac complete status:%d session:%d",
status, sap_ctx->sessionId);
return QDF_STATUS_SUCCESS;
}
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
bool wlan_sap_is_pre_cac_context(struct sap_context *context)
{
return context && context->is_pre_cac_on;
@@ -2003,7 +2003,15 @@ QDF_STATUS wlansap_start_beacon_req(struct sap_context *sap_ctx)
if (mac->sap.SapDfsInfo.sap_radar_found_status == false) {
/* CAC Wait done without any Radar Detection */
dfs_cac_wait_status = true;
/*
* Code under PRE_CAC_COMP will be cleaned up
* once pre cac component is done
*/
#ifndef PRE_CAC_COMP
sap_ctx->pre_cac_complete = false;
#else
wlan_pre_cac_complete_set(sap_ctx->vdev, false);
#endif
status = sme_roam_start_beacon_req(MAC_HANDLE(mac),
sap_ctx->bssid,
dfs_cac_wait_status);