|
@@ -425,6 +425,46 @@ static uint8_t sap_ch_params_to_bonding_channels(
|
|
|
return nchannels;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * sap_operating_on_dfs() - check current sap operating on dfs
|
|
|
+ * @mac_ctx: mac ctx
|
|
|
+ * @sap_ctx: SAP context
|
|
|
+ *
|
|
|
+ * Return: true if any sub channel is dfs channel
|
|
|
+ */
|
|
|
+static
|
|
|
+bool sap_operating_on_dfs(struct mac_context *mac_ctx,
|
|
|
+ struct sap_context *sap_ctx)
|
|
|
+{
|
|
|
+ uint8_t is_dfs = false;
|
|
|
+ struct csr_roam_profile *profile =
|
|
|
+ &sap_ctx->csr_roamProfile;
|
|
|
+ uint32_t chan_freq = profile->op_freq;
|
|
|
+ struct ch_params *ch_params = &profile->ch_params;
|
|
|
+
|
|
|
+ if (WLAN_REG_IS_6GHZ_CHAN_FREQ(chan_freq) ||
|
|
|
+ WLAN_REG_IS_24GHZ_CH_FREQ(chan_freq))
|
|
|
+ return false;
|
|
|
+ if (ch_params->ch_width == CH_WIDTH_160MHZ) {
|
|
|
+ is_dfs = true;
|
|
|
+ } else if (ch_params->ch_width == CH_WIDTH_80P80MHZ) {
|
|
|
+ if (wlan_reg_is_passive_or_disable_for_freq(
|
|
|
+ mac_ctx->pdev,
|
|
|
+ chan_freq) ||
|
|
|
+ wlan_reg_is_passive_or_disable_for_freq(
|
|
|
+ mac_ctx->pdev,
|
|
|
+ ch_params->mhz_freq_seg1 - 10))
|
|
|
+ is_dfs = true;
|
|
|
+ } else {
|
|
|
+ if (wlan_reg_is_passive_or_disable_for_freq(
|
|
|
+ mac_ctx->pdev,
|
|
|
+ chan_freq))
|
|
|
+ is_dfs = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return is_dfs;
|
|
|
+}
|
|
|
+
|
|
|
void sap_get_cac_dur_dfs_region(struct sap_context *sap_ctx,
|
|
|
uint32_t *cac_duration_ms,
|
|
|
uint32_t *dfs_region)
|
|
@@ -2327,7 +2367,6 @@ static QDF_STATUS sap_fsm_handle_radar_during_cac(struct sap_context *sap_ctx,
|
|
|
|
|
|
for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++) {
|
|
|
struct sap_context *t_sap_ctx;
|
|
|
- struct csr_roam_profile *profile;
|
|
|
|
|
|
t_sap_ctx = mac_ctx->sap.sapCtxList[intf].sap_context;
|
|
|
if (((QDF_SAP_MODE ==
|
|
@@ -2335,10 +2374,8 @@ static QDF_STATUS sap_fsm_handle_radar_during_cac(struct sap_context *sap_ctx,
|
|
|
(QDF_P2P_GO_MODE ==
|
|
|
mac_ctx->sap.sapCtxList[intf].sapPersona)) &&
|
|
|
t_sap_ctx && t_sap_ctx->fsm_state != SAP_INIT) {
|
|
|
- profile = &t_sap_ctx->csr_roamProfile;
|
|
|
- if (!wlan_reg_is_passive_or_disable_for_freq(
|
|
|
- mac_ctx->pdev, profile->op_freq))
|
|
|
- continue;
|
|
|
+ if (!sap_operating_on_dfs(mac_ctx, t_sap_ctx))
|
|
|
+ continue;
|
|
|
t_sap_ctx->is_chan_change_inprogress = true;
|
|
|
/*
|
|
|
* eSAP_DFS_CHANNEL_CAC_RADAR_FOUND:
|
|
@@ -2679,13 +2716,14 @@ static QDF_STATUS sap_fsm_state_started(struct sap_context *sap_ctx,
|
|
|
* no need to move them
|
|
|
*/
|
|
|
profile = &temp_sap_ctx->csr_roamProfile;
|
|
|
- if (!wlan_reg_is_passive_or_disable_for_freq(
|
|
|
- mac_ctx->pdev, profile->op_freq)) {
|
|
|
+ if (!sap_operating_on_dfs(
|
|
|
+ mac_ctx, temp_sap_ctx)) {
|
|
|
sap_debug("vdev %d freq %d (state %d) is not DFS or disabled so continue",
|
|
|
temp_sap_ctx->sessionId,
|
|
|
profile->op_freq,
|
|
|
- wlan_reg_get_channel_state_for_freq(mac_ctx->pdev,
|
|
|
- profile->op_freq));
|
|
|
+ wlan_reg_get_channel_state_for_freq(
|
|
|
+ mac_ctx->pdev,
|
|
|
+ profile->op_freq));
|
|
|
continue;
|
|
|
}
|
|
|
sap_debug("vdev %d switch freq %d -> %d",
|