qcacld-3.0: Use dfs component support
Remove legacy dfs api’s and use dfs component. Change-Id: Ia0fa016b174ef4b50e2cc339e4e476ec65642dbf CRs-Fixed: 2021357
This commit is contained in:
@@ -1005,7 +1005,15 @@ void wlansap_extend_to_acs_range(tHalHandle hal, uint8_t *startChannelNum,
|
||||
uint8_t *endChannelNum, uint8_t *bandStartChannel,
|
||||
uint8_t *bandEndChannel);
|
||||
QDF_STATUS wlansap_get_dfs_nol(void *pSapCtx, uint8_t *nol, uint32_t *nol_len);
|
||||
QDF_STATUS wlansap_set_dfs_nol(void *pSapCtx, eSapDfsNolType conf);
|
||||
|
||||
/**
|
||||
* wlansap_set_dfs_nol() - Set dfs nol
|
||||
* @sap_ctx: SAP context
|
||||
* @conf: set type
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS wlansap_set_dfs_nol(void *sap_ctx, eSapDfsNolType conf);
|
||||
|
||||
/**
|
||||
* wlan_sap_set_vendor_acs() - Set vendor specific acs in sap context
|
||||
@@ -1031,6 +1039,16 @@ QDF_STATUS wlansap_set_tx_leakage_threshold(tHalHandle hal,
|
||||
|
||||
QDF_STATUS wlansap_set_invalid_session(void *cds_ctx);
|
||||
|
||||
/**
|
||||
* sap_dfs_set_current_channel() - Set current channel params in dfs component
|
||||
* @sap_ctx: sap context
|
||||
*
|
||||
* Set current channel params in dfs component, this info will be used to mark
|
||||
* the channels in nol when radar is detected.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void sap_dfs_set_current_channel(void *sap_ctx);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -715,8 +715,12 @@ wlansap_roam_process_dfs_radar_found(tpAniSirGlobal mac_ctx,
|
||||
* and destroy the CAC timer and post a
|
||||
* eSAP_DFS_CHANNEL_CAC_RADAR_FOUND to sapFsm.
|
||||
*/
|
||||
qdf_mc_timer_stop(&mac_ctx->sap.SapDfsInfo.sap_dfs_cac_timer);
|
||||
qdf_mc_timer_destroy(&mac_ctx->sap.SapDfsInfo.sap_dfs_cac_timer);
|
||||
if (!sap_ctx->dfs_cac_offload) {
|
||||
qdf_mc_timer_stop(&mac_ctx->
|
||||
sap.SapDfsInfo.sap_dfs_cac_timer);
|
||||
qdf_mc_timer_destroy(&mac_ctx->
|
||||
sap.SapDfsInfo.sap_dfs_cac_timer);
|
||||
}
|
||||
mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running = false;
|
||||
|
||||
/*
|
||||
@@ -1020,10 +1024,12 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId,
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED,
|
||||
FL("sapdfs: Radar detect on pre cac:%d"),
|
||||
sap_ctx->sessionId);
|
||||
qdf_mc_timer_stop(
|
||||
if (!sap_ctx->dfs_cac_offload) {
|
||||
qdf_mc_timer_stop(
|
||||
&mac_ctx->sap.SapDfsInfo.sap_dfs_cac_timer);
|
||||
qdf_mc_timer_destroy(
|
||||
qdf_mc_timer_destroy(
|
||||
&mac_ctx->sap.SapDfsInfo.sap_dfs_cac_timer);
|
||||
}
|
||||
mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running =
|
||||
false;
|
||||
sap_signal_hdd_event(sap_ctx, NULL,
|
||||
@@ -1036,11 +1042,8 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId,
|
||||
FL("sapdfs: Indicate eSAP_DFS_RADAR_DETECT to HDD"));
|
||||
sap_signal_hdd_event(sap_ctx, NULL, eSAP_DFS_RADAR_DETECT,
|
||||
(void *) eSAP_STATUS_SUCCESS);
|
||||
/* sync to latest DFS-NOL */
|
||||
sap_signal_hdd_event(sap_ctx, NULL, eSAP_DFS_NOL_GET,
|
||||
(void *) eSAP_STATUS_SUCCESS);
|
||||
mac_ctx->sap.SapDfsInfo.target_channel =
|
||||
sap_indicate_radar(sap_ctx, &csr_roam_info->dfs_event);
|
||||
sap_indicate_radar(sap_ctx);
|
||||
/* if there is an assigned next channel hopping */
|
||||
if (0 < mac_ctx->sap.SapDfsInfo.user_provided_target_channel) {
|
||||
mac_ctx->sap.SapDfsInfo.target_channel =
|
||||
@@ -1090,6 +1093,10 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId,
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
FL("Received set channel response"));
|
||||
break;
|
||||
case eCSR_ROAM_CAC_COMPLETE_IND:
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
FL("Received cac complete indication"));
|
||||
break;
|
||||
case eCSR_ROAM_EXT_CHG_CHNL_IND:
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
FL("Received set channel Indication"));
|
||||
@@ -1287,6 +1294,9 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId,
|
||||
wlansap_roam_process_dfs_chansw_update(hal, sap_ctx,
|
||||
&qdf_ret_status);
|
||||
break;
|
||||
case eCSR_ROAM_RESULT_CAC_END_IND:
|
||||
sap_dfs_cac_timer_callback(hal);
|
||||
break;
|
||||
case eCSR_ROAM_RESULT_CHANNEL_CHANGE_SUCCESS:
|
||||
wlansap_roam_process_ch_change_success(mac_ctx, sap_ctx,
|
||||
csr_roam_info, &qdf_ret_status);
|
||||
|
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
Load Diff
@@ -380,10 +380,6 @@ QDF_STATUS sap_release_global_lock(ptSapContext pSapCtx);
|
||||
void sap_update_unsafe_channel_list(tHalHandle hal, ptSapContext pSapCtx);
|
||||
#endif /* FEATURE_WLAN_CH_AVOID */
|
||||
|
||||
uint8_t
|
||||
sap_indicate_radar(ptSapContext sapContext,
|
||||
tSirSmeDfsEventInd *dfs_event);
|
||||
|
||||
QDF_STATUS sap_init_dfs_channel_nol_list(ptSapContext sapContext);
|
||||
|
||||
bool sap_dfs_is_channel_in_nol_list(ptSapContext sapContext,
|
||||
@@ -485,6 +481,16 @@ sap_mark_leaking_ch(ptSapContext sap_ctx,
|
||||
void sap_scan_event_callback(struct wlan_objmgr_vdev *vdev,
|
||||
struct scan_event *event, void *arg);
|
||||
|
||||
/**
|
||||
* sap_indicate_radar() - Process radar indication
|
||||
* @sap_ctx: pointer to sap context
|
||||
*
|
||||
* process radar indication.
|
||||
*
|
||||
* Return: channel to which sap wishes to switch.
|
||||
*/
|
||||
uint8_t sap_indicate_radar(ptSapContext sap_ctx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -57,6 +57,7 @@
|
||||
#include "wlan_policy_mgr_api.h"
|
||||
#include <wlan_scan_ucfg_api.h>
|
||||
#include "wlan_reg_services_api.h"
|
||||
#include <wlan_dfs_utils_api.h>
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Preprocessor Definitions and Constants
|
||||
@@ -2710,6 +2711,7 @@ wlansap_channel_change_request(void *pSapCtx, uint8_t target_channel)
|
||||
ch_params->center_freq_seg1;
|
||||
sapContext->csr_roamProfile.supported_rates.numRates = 0;
|
||||
sapContext->csr_roamProfile.extended_rates.numRates = 0;
|
||||
sap_dfs_set_current_channel(sapContext);
|
||||
|
||||
qdf_ret_status = sme_roam_channel_change_req(hHal, sapContext->bssid,
|
||||
ch_params, &sapContext->csr_roamProfile);
|
||||
@@ -3445,123 +3447,56 @@ QDF_STATUS wlansap_get_dfs_nol(void *pSapCtx, uint8_t *nol, uint32_t *nol_len)
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/*==========================================================================
|
||||
FUNCTION wlansap_set_dfs_nol
|
||||
|
||||
DESCRIPTION
|
||||
This API is used to set the dfs nol
|
||||
DEPENDENCIES
|
||||
NA.
|
||||
|
||||
PARAMETERS
|
||||
IN
|
||||
sapContext: Pointer to cds global context structure
|
||||
conf: set type
|
||||
|
||||
RETURN VALUE
|
||||
The QDF_STATUS code associated with performing the operation
|
||||
|
||||
QDF_STATUS_SUCCESS: Success
|
||||
|
||||
SIDE EFFECTS
|
||||
============================================================================*/
|
||||
QDF_STATUS wlansap_set_dfs_nol(void *pSapCtx, eSapDfsNolType conf)
|
||||
QDF_STATUS wlansap_set_dfs_nol(void *psap_ctx, eSapDfsNolType conf)
|
||||
{
|
||||
int i = 0;
|
||||
ptSapContext sapContext = (ptSapContext) pSapCtx;
|
||||
void *hHal = NULL;
|
||||
tpAniSirGlobal pMac = NULL;
|
||||
ptSapContext sap_ctx = (ptSapContext) psap_ctx;
|
||||
void *hal = NULL;
|
||||
tpAniSirGlobal mac = NULL;
|
||||
|
||||
if (NULL == sapContext) {
|
||||
if (!sap_ctx) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: Invalid SAP pointer from p_cds_gctx", __func__);
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
hHal = CDS_GET_HAL_CB(sapContext->p_cds_gctx);
|
||||
if (NULL == hHal) {
|
||||
|
||||
hal = CDS_GET_HAL_CB(sap_ctx->p_cds_gctx);
|
||||
if (!hal) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: Invalid HAL pointer from p_cds_gctx", __func__);
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
pMac = PMAC_STRUCT(hHal);
|
||||
|
||||
if (!pMac->sap.SapDfsInfo.numCurrentRegDomainDfsChannels) {
|
||||
mac = PMAC_STRUCT(hal);
|
||||
if (!mac->sap.SapDfsInfo.numCurrentRegDomainDfsChannels) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
|
||||
"%s: DFS NOL is empty", __func__);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (conf == eSAP_DFS_NOL_CLEAR) {
|
||||
struct wlan_objmgr_pdev *pdev;
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: clear the DFS NOL", __func__);
|
||||
|
||||
for (i = 0;
|
||||
i < pMac->sap.SapDfsInfo.numCurrentRegDomainDfsChannels;
|
||||
i++) {
|
||||
if (!pMac->sap.SapDfsInfo.
|
||||
sapDfsChannelNolList[i].dfs_channel_number)
|
||||
continue;
|
||||
|
||||
pMac->sap.SapDfsInfo.
|
||||
sapDfsChannelNolList[i].radar_status_flag =
|
||||
eSAP_DFS_CHANNEL_AVAILABLE;
|
||||
pMac->sap.SapDfsInfo.
|
||||
sapDfsChannelNolList[i].radar_found_timestamp = 0;
|
||||
pdev = mac->pdev;
|
||||
if (!pdev) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: null pdev", __func__);
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
dfs_clear_nol_channels(pdev);
|
||||
} else if (conf == eSAP_DFS_NOL_RANDOMIZE) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: Randomize the DFS NOL", __func__);
|
||||
|
||||
/* random 1/0 to decide to put the channel into NOL */
|
||||
for (i = 0;
|
||||
i < pMac->sap.SapDfsInfo.numCurrentRegDomainDfsChannels;
|
||||
i++) {
|
||||
uint32_t random_bytes = 0;
|
||||
get_random_bytes(&random_bytes, 1);
|
||||
|
||||
if (!pMac->sap.SapDfsInfo.
|
||||
sapDfsChannelNolList[i].dfs_channel_number)
|
||||
continue;
|
||||
|
||||
if ((random_bytes + jiffies) % 2) {
|
||||
/* mark the channel unavailable */
|
||||
pMac->sap.SapDfsInfo.sapDfsChannelNolList[i]
|
||||
.radar_status_flag =
|
||||
eSAP_DFS_CHANNEL_UNAVAILABLE;
|
||||
|
||||
/* mark the timestamp */
|
||||
pMac->sap.SapDfsInfo.sapDfsChannelNolList[i]
|
||||
.radar_found_timestamp =
|
||||
cds_get_monotonic_boottime();
|
||||
} else {
|
||||
/* mark the channel available */
|
||||
pMac->sap.SapDfsInfo.
|
||||
sapDfsChannelNolList[i].radar_status_flag =
|
||||
eSAP_DFS_CHANNEL_AVAILABLE;
|
||||
|
||||
/* clear the timestamp */
|
||||
pMac->sap.SapDfsInfo.
|
||||
sapDfsChannelNolList
|
||||
[i].radar_found_timestamp = 0;
|
||||
}
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: Set channel[%d] %s",
|
||||
__func__,
|
||||
pMac->sap.SapDfsInfo.sapDfsChannelNolList[i]
|
||||
.dfs_channel_number,
|
||||
(pMac->sap.SapDfsInfo.
|
||||
sapDfsChannelNolList[i].radar_status_flag >
|
||||
eSAP_DFS_CHANNEL_AVAILABLE) ? "UNAVAILABLE" :
|
||||
"AVAILABLE");
|
||||
}
|
||||
} else {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: unsupport type %d", __func__, conf);
|
||||
}
|
||||
|
||||
/* set DFS-NOL back to keep it update-to-date in CNSS */
|
||||
sap_signal_hdd_event(sapContext, NULL, eSAP_DFS_NOL_SET,
|
||||
sap_signal_hdd_event(sap_ctx, NULL, eSAP_DFS_NOL_SET,
|
||||
(void *) eSAP_STATUS_SUCCESS);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
Reference in New Issue
Block a user