qcacld-3.0: Clean up code under PRE_CAC_COMP flag
pre cac componentization is done, so clean up code under PRE_CAC_COMP flag. Change-Id: I6465bce9fc883797f42358aaeb8dabf70e449cde CRs-Fixed: 3232820
This commit is contained in:

committed by
Madan Koyyalamudi

parent
f327e23c86
commit
a258f3cd42
@@ -161,15 +161,7 @@ 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 */
|
||||
eSAP_DFS_NO_AVAILABLE_CHANNEL,
|
||||
eSAP_STOP_BSS_DUE_TO_NO_CHNL,
|
||||
@@ -861,107 +853,6 @@ QDF_STATUS wlan_sap_update_next_channel(struct sap_context *sap_ctx,
|
||||
uint8_t channel,
|
||||
enum phy_ch_width chan_bw);
|
||||
|
||||
/*
|
||||
* 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
|
||||
* @status: Status of pre cac
|
||||
*
|
||||
* Updates the state of pre cac in the SAP context
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS wlan_sap_set_pre_cac_status(struct sap_context *sap_ctx,
|
||||
bool status);
|
||||
|
||||
/**
|
||||
* wlan_sap_set_chan_freq_before_pre_cac() - Save the channel before pre cac
|
||||
* @sap_ctx: SAP context
|
||||
* @freq_before_pre_cac: Channel frequency before pre cac
|
||||
*
|
||||
* Saves the channel frequency that was in use before pre cac operation
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_sap_set_chan_freq_before_pre_cac(struct sap_context *sap_ctx,
|
||||
qdf_freq_t freq_before_pre_cac);
|
||||
#else
|
||||
static inline QDF_STATUS
|
||||
wlan_sap_set_pre_cac_status(struct sap_context *sap_ctx, bool status)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline QDF_STATUS
|
||||
wlan_sap_set_chan_freq_before_pre_cac(struct sap_context *sap_ctx,
|
||||
qdf_freq_t freq_before_pre_cac)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#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
|
||||
* @status: Status of pre cac complete
|
||||
*
|
||||
* Sets the status of pre cac i.e., whether pre cac is complete or not
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS wlan_sap_set_pre_cac_complete_status(struct sap_context *sap_ctx,
|
||||
bool status);
|
||||
|
||||
/**
|
||||
* wlan_sap_is_pre_cac_context() - checks if @context is for a pre-cac adapter
|
||||
* @context: the SAP context to check
|
||||
*
|
||||
* Return: true if @context is for a pre-cac adapter
|
||||
*/
|
||||
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
|
||||
#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)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
wlan_sap_is_pre_cac_context(struct sap_context *context)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool wlan_sap_is_pre_cac_active(mac_handle_t handle)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif /* PRE_CAC_COMP */
|
||||
#endif /* PRE_CAC_SUPPORT */
|
||||
|
||||
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
|
||||
/**
|
||||
* wlansap_check_cc_intf() - Get interfering concurrent channel
|
||||
|
@@ -477,15 +477,7 @@ 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;
|
||||
@@ -562,15 +554,7 @@ 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);
|
||||
@@ -1016,28 +1000,6 @@ static bool sap_is_csa_restart_state(struct wlan_objmgr_psoc *psoc,
|
||||
}
|
||||
|
||||
#ifdef PRE_CAC_SUPPORT
|
||||
/*
|
||||
* Code under PRE_CAC_COMP will be cleaned up
|
||||
* once pre cac component is done
|
||||
*/
|
||||
#ifndef PRE_CAC_COMP
|
||||
static void wlan_sap_pre_cac_radar_ind(struct sap_context *sap_ctx,
|
||||
struct mac_context *mac_ctx)
|
||||
{
|
||||
qdf_mc_timer_t *dfs_timer = &mac_ctx->sap.SapDfsInfo.sap_dfs_cac_timer;
|
||||
|
||||
sap_debug("sapdfs: Radar detect on pre cac:%d", sap_ctx->sessionId);
|
||||
if (!sap_ctx->dfs_cac_offload) {
|
||||
qdf_mc_timer_stop(dfs_timer);
|
||||
qdf_mc_timer_destroy(dfs_timer);
|
||||
}
|
||||
|
||||
mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running = false;
|
||||
sap_signal_hdd_event(sap_ctx, NULL,
|
||||
eSAP_DFS_RADAR_DETECT_DURING_PRE_CAC,
|
||||
(void *)eSAP_STATUS_SUCCESS);
|
||||
}
|
||||
#else
|
||||
static void wlan_sap_pre_cac_radar_ind(struct sap_context *sap_ctx,
|
||||
struct mac_context *mac_ctx)
|
||||
{
|
||||
@@ -1052,7 +1014,6 @@ static void wlan_sap_pre_cac_radar_ind(struct sap_context *sap_ctx,
|
||||
mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running = false;
|
||||
wlan_pre_cac_handle_radar_ind(sap_ctx->vdev);
|
||||
}
|
||||
#endif /* PRE_CAC_COMP */
|
||||
#else
|
||||
static inline void
|
||||
wlan_sap_pre_cac_radar_ind(struct sap_context *sap_ctx,
|
||||
@@ -1164,21 +1125,12 @@ QDF_STATUS wlansap_roam_callback(void *ctx,
|
||||
sap_ctx->chan_freq);
|
||||
goto EXIT;
|
||||
}
|
||||
/*
|
||||
* Code under PRE_CAC_COMP will be cleaned up
|
||||
* once pre cac component is done
|
||||
*/
|
||||
#ifndef PRE_CAC_COMP
|
||||
if (sap_ctx->is_pre_cac_on) {
|
||||
wlan_sap_pre_cac_radar_ind(sap_ctx, mac_ctx);
|
||||
break;
|
||||
}
|
||||
#else
|
||||
|
||||
if (wlan_pre_cac_get_status(mac_ctx->psoc)) {
|
||||
wlan_sap_pre_cac_radar_ind(sap_ctx, mac_ctx);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
sap_debug("sapdfs: Indicate eSAP_DFS_RADAR_DETECT to HDD");
|
||||
sap_signal_hdd_event(sap_ctx, NULL, eSAP_DFS_RADAR_DETECT,
|
||||
(void *) eSAP_STATUS_SUCCESS);
|
||||
|
@@ -155,15 +155,7 @@ 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);
|
||||
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
|
||||
CASE_RETURN_STRING(eSAP_ACS_SCAN_SUCCESS_EVENT);
|
||||
@@ -530,32 +522,13 @@ 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;
|
||||
@@ -1505,19 +1478,9 @@ QDF_STATUS sap_set_session_param(mac_handle_t mac_handle,
|
||||
int i;
|
||||
|
||||
sapctx->sessionId = session_id;
|
||||
/*
|
||||
* Code under PRE_CAC_COMP will be cleaned up
|
||||
* once pre cac component is done
|
||||
*/
|
||||
#ifndef PRE_CAC_COMP
|
||||
sapctx->is_pre_cac_on = false;
|
||||
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++) {
|
||||
@@ -2286,15 +2249,7 @@ 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:
|
||||
sap_ap_event->sapHddEventCode = sap_hddevent;
|
||||
sap_ap_event->sapevt.sapStopBssCompleteEvent.status =
|
||||
@@ -2742,42 +2697,6 @@ 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
|
||||
* @mac: Global MAC structure
|
||||
* @intf: Interface number
|
||||
*
|
||||
* Notifies pre cac end to upper layer
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS wlansap_update_pre_cac_end(struct sap_context *sap_context,
|
||||
struct mac_context *mac, uint8_t intf)
|
||||
{
|
||||
QDF_STATUS qdf_status;
|
||||
|
||||
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);
|
||||
qdf_status = sap_signal_hdd_event(sap_context,
|
||||
NULL, eSAP_DFS_PRE_CAC_END,
|
||||
(void *)eSAP_STATUS_SUCCESS);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
||||
sap_err("pre cac notify failed on intf %d", intf);
|
||||
return qdf_status;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#else
|
||||
/**
|
||||
* wlansap_pre_cac_end_notify() - Update pre cac end to upper layer
|
||||
* @sap_context: SAP context
|
||||
@@ -2799,7 +2718,6 @@ static void wlansap_pre_cac_end_notify(struct sap_context *sap_context,
|
||||
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)
|
||||
@@ -2836,22 +2754,6 @@ QDF_STATUS sap_cac_end_notify(mac_handle_t mac_handle,
|
||||
* temporary interface created for pre cac and switch
|
||||
* the original SAP to the pre CAC channel.
|
||||
*/
|
||||
/*
|
||||
* Code under PRE_CAC_COMP will be cleaned up
|
||||
* once pre cac component is done
|
||||
*/
|
||||
#ifndef PRE_CAC_COMP
|
||||
if (sap_context->is_pre_cac_on) {
|
||||
qdf_status = wlansap_update_pre_cac_end(
|
||||
sap_context, mac, intf);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status))
|
||||
return qdf_status;
|
||||
/* pre CAC is not allowed with any concurrency.
|
||||
* So, we can break from here.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
#else
|
||||
if (wlan_pre_cac_get_status(mac->psoc)) {
|
||||
wlansap_pre_cac_end_notify(sap_context,
|
||||
mac, intf);
|
||||
@@ -2860,7 +2762,6 @@ QDF_STATUS sap_cac_end_notify(mac_handle_t mac_handle,
|
||||
*/
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
qdf_status = sap_signal_hdd_event(sap_context, NULL,
|
||||
eSAP_DFS_CAC_END,
|
||||
@@ -3546,15 +3447,7 @@ 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)) {
|
||||
@@ -4343,24 +4236,12 @@ 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,
|
||||
|
@@ -217,15 +217,6 @@ struct sap_context {
|
||||
eSapHddEvent sap_state;
|
||||
eSapStatus sap_status;
|
||||
uint32_t roc_ind_scan_id;
|
||||
/*
|
||||
* Code under PRE_CAC_COMP will be cleaned up
|
||||
* once pre cac component is done
|
||||
*/
|
||||
#ifndef PRE_CAC_COMP
|
||||
bool is_pre_cac_on;
|
||||
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;
|
||||
|
@@ -1660,129 +1660,6 @@ QDF_STATUS wlan_sap_update_next_channel(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
|
||||
#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)
|
||||
{
|
||||
if (!sap_ctx) {
|
||||
sap_err("Invalid SAP pointer");
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
|
||||
sap_ctx->is_pre_cac_on = status;
|
||||
sap_debug("is_pre_cac_on:%d", sap_ctx->is_pre_cac_on);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
wlan_sap_set_chan_freq_before_pre_cac(struct sap_context *sap_ctx,
|
||||
qdf_freq_t freq_before_pre_cac)
|
||||
{
|
||||
if (!sap_ctx) {
|
||||
sap_err("Invalid SAP pointer");
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
|
||||
sap_ctx->freq_before_pre_cac = freq_before_pre_cac;
|
||||
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)
|
||||
{
|
||||
if (!sap_ctx) {
|
||||
sap_err("Invalid SAP pointer");
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
|
||||
sap_ctx->pre_cac_complete = status;
|
||||
sap_debug("pre cac complete status:%d session:%d",
|
||||
status, sap_ctx->sessionId);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
bool wlan_sap_is_pre_cac_context(struct sap_context *context)
|
||||
{
|
||||
return context && context->is_pre_cac_on;
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_sap_is_pre_cac_active() - Checks if pre cac in in progress
|
||||
* @handle: Global MAC handle
|
||||
*
|
||||
* Checks if pre cac is in progress in any of the SAP contexts
|
||||
*
|
||||
* Return: True is pre cac is active, false otherwise
|
||||
*/
|
||||
bool wlan_sap_is_pre_cac_active(mac_handle_t handle)
|
||||
{
|
||||
struct mac_context *mac = NULL;
|
||||
struct sap_ctx_list *ctx_list;
|
||||
int i;
|
||||
|
||||
mac = MAC_CONTEXT(handle);
|
||||
if (!mac) {
|
||||
sap_err("Invalid mac context");
|
||||
return false;
|
||||
}
|
||||
|
||||
ctx_list = mac->sap.sapCtxList;
|
||||
for (i = 0; i < SAP_MAX_NUM_SESSION; i++) {
|
||||
if (wlan_sap_is_pre_cac_context(ctx_list[i].sap_context))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_sap_get_pre_cac_vdev_id() - Get vdev id of the pre cac interface
|
||||
* @handle: Global handle
|
||||
* @vdev_id: vdev id
|
||||
*
|
||||
* Fetches the vdev id of the pre cac interface
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS wlan_sap_get_pre_cac_vdev_id(mac_handle_t handle, uint8_t *vdev_id)
|
||||
{
|
||||
struct mac_context *mac = NULL;
|
||||
uint8_t i;
|
||||
|
||||
mac = MAC_CONTEXT(handle);
|
||||
if (!mac) {
|
||||
sap_err("Invalid mac context");
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
|
||||
for (i = 0; i < SAP_MAX_NUM_SESSION; i++) {
|
||||
struct sap_context *context =
|
||||
mac->sap.sapCtxList[i].sap_context;
|
||||
if (context && context->is_pre_cac_on) {
|
||||
*vdev_id = i;
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
#endif /* PRE_CAC_COMP */
|
||||
#endif /* PRE_CAC_SUPPORT */
|
||||
|
||||
void wlansap_get_sec_channel(uint8_t sec_ch_offset,
|
||||
uint32_t op_chan_freq,
|
||||
uint32_t *sec_chan_freq)
|
||||
@@ -2003,15 +1880,7 @@ 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);
|
||||
|
Reference in New Issue
Block a user