qcacld-3.0: Replace channel id with frequency in sap
Replace channel ID with channel frequency in sap for channel switch flow. Change-Id: I3e7bf0e6d84604223c1791ccfd3d95d1ff5f2992 CRs-Fixed: 2554468
This commit is contained in:
parent
9cdb07f02c
commit
faa9c0114a
@ -17614,9 +17614,8 @@ bool wlan_hdd_handle_sap_sta_dfs_conc(struct hdd_adapter *adapter,
|
||||
struct hdd_adapter *ap_adapter;
|
||||
struct hdd_ap_ctx *hdd_ap_ctx;
|
||||
struct hdd_hostapd_state *hostapd_state;
|
||||
uint8_t channel = 0;
|
||||
QDF_STATUS status;
|
||||
uint32_t ch_freq;
|
||||
uint32_t ch_freq = 0;
|
||||
|
||||
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
||||
if (!hdd_ctx) {
|
||||
@ -17664,13 +17663,12 @@ bool wlan_hdd_handle_sap_sta_dfs_conc(struct hdd_adapter *adapter,
|
||||
*/
|
||||
status = policy_mgr_get_channel_from_scan_result(
|
||||
hdd_ctx->psoc, roam_profile, &ch_freq);
|
||||
channel = wlan_freq_to_chan(ch_freq);
|
||||
|
||||
/*
|
||||
* If the STA's channel is 2.4 GHz, then set pcl with only 2.4 GHz
|
||||
* channels for roaming case.
|
||||
*/
|
||||
if (WLAN_REG_IS_24GHZ_CH(channel)) {
|
||||
if (WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq)) {
|
||||
hdd_info("sap is on dfs, new sta conn on 2.4 is allowed");
|
||||
return true;
|
||||
}
|
||||
@ -17681,12 +17679,10 @@ bool wlan_hdd_handle_sap_sta_dfs_conc(struct hdd_adapter *adapter,
|
||||
* better move SAP to STA's channel to make scc, so we have room
|
||||
* for 3port MCC scenario.
|
||||
*/
|
||||
if (!channel || wlan_reg_is_dfs_ch(hdd_ctx->pdev, channel) ||
|
||||
!policy_mgr_is_safe_channel(hdd_ctx->psoc,
|
||||
wlan_chan_to_freq(channel)))
|
||||
channel = wlan_freq_to_chan(
|
||||
policy_mgr_get_nondfs_preferred_channel(
|
||||
hdd_ctx->psoc, PM_SAP_MODE, true));
|
||||
if (!ch_freq || wlan_reg_is_dfs_for_freq(hdd_ctx->pdev, ch_freq) ||
|
||||
!policy_mgr_is_safe_channel(hdd_ctx->psoc, ch_freq))
|
||||
ch_freq = policy_mgr_get_nondfs_preferred_channel(
|
||||
hdd_ctx->psoc, PM_SAP_MODE, true);
|
||||
|
||||
hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter);
|
||||
qdf_event_reset(&hostapd_state->qdf_event);
|
||||
@ -17694,7 +17690,7 @@ bool wlan_hdd_handle_sap_sta_dfs_conc(struct hdd_adapter *adapter,
|
||||
CSA_REASON_STA_CONNECT_DFS_TO_NON_DFS);
|
||||
|
||||
status = wlansap_set_channel_change_with_csa(
|
||||
WLAN_HDD_GET_SAP_CTX_PTR(ap_adapter), channel,
|
||||
WLAN_HDD_GET_SAP_CTX_PTR(ap_adapter), ch_freq,
|
||||
hdd_ap_ctx->sap_config.ch_width_orig, false);
|
||||
|
||||
if (QDF_STATUS_SUCCESS != status) {
|
||||
|
@ -3036,7 +3036,7 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_channel,
|
||||
|
||||
status = wlansap_set_channel_change_with_csa(
|
||||
WLAN_HDD_GET_SAP_CTX_PTR(adapter),
|
||||
(uint32_t)target_channel,
|
||||
wlan_reg_chan_to_freq(hdd_ctx->pdev, target_channel),
|
||||
target_bw,
|
||||
(forced && !scc_on_lte_coex) || is_p2p_go_session);
|
||||
|
||||
|
@ -830,7 +830,9 @@ static __iw_softap_setparam(struct net_device *dev,
|
||||
if (adapter->device_mode != QDF_SAP_MODE)
|
||||
return -EINVAL;
|
||||
|
||||
ret = wlansap_set_dfs_target_chnl(mac_handle, set_value);
|
||||
ret = wlansap_set_dfs_target_chnl(mac_handle,
|
||||
wlan_reg_legacy_chan_to_freq(hdd_ctx->pdev,
|
||||
set_value));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2830,7 +2830,7 @@ typedef struct sSirUpdateIEsInd {
|
||||
typedef struct sSirDfsCsaIeRequest {
|
||||
uint16_t msgType;
|
||||
uint16_t msgLen;
|
||||
uint8_t targetChannel;
|
||||
uint32_t target_chan_freq;
|
||||
uint8_t csaIeRequired;
|
||||
uint8_t bssid[QDF_MAC_ADDR_SIZE];
|
||||
struct ch_params ch_params;
|
||||
|
@ -5639,7 +5639,7 @@ static void lim_process_sme_dfs_csa_ie_request(struct mac_context *mac_ctx,
|
||||
|
||||
/* target channel */
|
||||
session_entry->gLimChannelSwitch.primaryChannel =
|
||||
dfs_csa_ie_req->targetChannel;
|
||||
wlan_reg_freq_to_chan(mac_ctx->pdev, dfs_csa_ie_req->target_chan_freq);
|
||||
|
||||
/* Channel switch announcement needs to be included in beacon */
|
||||
session_entry->dfsIncludeChanSwIe = true;
|
||||
|
@ -563,13 +563,13 @@ typedef struct sSapDfsInfo {
|
||||
qdf_mc_timer_t sap_dfs_cac_timer;
|
||||
uint8_t sap_radar_found_status;
|
||||
/*
|
||||
* New channel to move to when a Radar is
|
||||
* New channel frequency to move to when a Radar is
|
||||
* detected on current Channel
|
||||
*/
|
||||
uint8_t target_channel;
|
||||
uint32_t target_chan_freq;
|
||||
uint8_t ignore_cac;
|
||||
eSapDfsCACState_t cac_state;
|
||||
uint8_t user_provided_target_channel;
|
||||
uint32_t user_provided_target_chan_freq;
|
||||
|
||||
/*
|
||||
* Requests for Channel Switch Announcement IE
|
||||
@ -917,7 +917,7 @@ QDF_STATUS wlansap_deauth_sta(struct sap_context *sap_ctx,
|
||||
/**
|
||||
* wlansap_set_channel_change_with_csa() - Set channel change with CSA
|
||||
* @sap_ctx: Pointer to SAP context
|
||||
* @targetChannel: Target channel
|
||||
* @target_chan_freq: Target channel frequncy
|
||||
* @target_bw: Target bandwidth
|
||||
* @strict: if true switch to the requested channel always, fail
|
||||
* otherwise
|
||||
@ -928,7 +928,7 @@ QDF_STATUS wlansap_deauth_sta(struct sap_context *sap_ctx,
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx,
|
||||
uint32_t targetChannel,
|
||||
uint32_t target_chan_freq,
|
||||
enum phy_ch_width target_bw,
|
||||
bool strict);
|
||||
|
||||
@ -1052,7 +1052,7 @@ QDF_STATUS wlansap_modify_acl(struct sap_context *sap_ctx,
|
||||
*
|
||||
*/
|
||||
QDF_STATUS wlansap_channel_change_request(struct sap_context *sap_ctx,
|
||||
uint8_t target_channel);
|
||||
uint32_t target_chan_freq);
|
||||
|
||||
/**
|
||||
* wlansap_get_sec_channel() - get the secondary sap channel
|
||||
@ -1159,7 +1159,7 @@ QDF_STATUS wlansap_set_dfs_preferred_channel_location(mac_handle_t mac_handle);
|
||||
/**
|
||||
* wlansap_set_dfs_target_chnl() - Set target channel
|
||||
* @mac_handle: Opaque handle for the global MAC context
|
||||
* @target_channel: target channel to be set
|
||||
* @target_chan_freq: target channel frequency to be set
|
||||
*
|
||||
* This API is used to set next target chnl as provided channel.
|
||||
* you can provide any valid channel to this API.
|
||||
@ -1167,7 +1167,7 @@ QDF_STATUS wlansap_set_dfs_preferred_channel_location(mac_handle_t mac_handle);
|
||||
* Return: The QDF_STATUS code associated with performing the operation
|
||||
*/
|
||||
QDF_STATUS wlansap_set_dfs_target_chnl(mac_handle_t mac_handle,
|
||||
uint8_t target_channel);
|
||||
uint32_t target_chan_freq);
|
||||
|
||||
/**
|
||||
* wlan_sap_get_roam_profile() - Returns sap roam profile.
|
||||
|
@ -371,15 +371,15 @@ wlansap_roam_process_ch_change_success(struct mac_context *mac_ctx,
|
||||
struct sap_sm_event sap_event;
|
||||
QDF_STATUS qdf_status;
|
||||
bool is_ch_dfs = false;
|
||||
uint8_t target_channel;
|
||||
uint32_t target_chan_freq;
|
||||
/*
|
||||
* Channel change is successful. If the new channel is a DFS channel,
|
||||
* then we will to perform channel availability check for 60 seconds
|
||||
*/
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED,
|
||||
FL("sapdfs: changing target channel to [%d] state %d"),
|
||||
mac_ctx->sap.SapDfsInfo.target_channel, sap_ctx->fsm_state);
|
||||
target_channel = mac_ctx->sap.SapDfsInfo.target_channel;
|
||||
FL("sapdfs: changing target channel freq to [%d] state %d"),
|
||||
mac_ctx->sap.SapDfsInfo.target_chan_freq, sap_ctx->fsm_state);
|
||||
target_chan_freq = mac_ctx->sap.SapDfsInfo.target_chan_freq;
|
||||
|
||||
/* If SAP is not in starting or started state don't proceed further */
|
||||
if (sap_ctx->fsm_state == SAP_INIT ||
|
||||
@ -393,7 +393,7 @@ wlansap_roam_process_ch_change_success(struct mac_context *mac_ctx,
|
||||
if (sap_ctx->ch_params.ch_width == CH_WIDTH_160MHZ) {
|
||||
is_ch_dfs = true;
|
||||
} else if (sap_ctx->ch_params.ch_width == CH_WIDTH_80P80MHZ) {
|
||||
if (wlan_reg_get_channel_state(mac_ctx->pdev, target_channel) ==
|
||||
if (wlan_reg_get_channel_state_for_freq(mac_ctx->pdev, target_chan_freq) ==
|
||||
CHANNEL_STATE_DFS ||
|
||||
wlan_reg_get_channel_state(mac_ctx->pdev,
|
||||
sap_ctx->ch_params.center_freq_seg1 -
|
||||
@ -401,13 +401,12 @@ wlansap_roam_process_ch_change_success(struct mac_context *mac_ctx,
|
||||
CHANNEL_STATE_DFS)
|
||||
is_ch_dfs = true;
|
||||
} else {
|
||||
if (wlan_reg_get_channel_state(mac_ctx->pdev, target_channel) ==
|
||||
if (wlan_reg_get_channel_state_for_freq(mac_ctx->pdev, target_chan_freq) ==
|
||||
CHANNEL_STATE_DFS)
|
||||
is_ch_dfs = true;
|
||||
}
|
||||
|
||||
sap_ctx->chan_freq = wlan_reg_chan_to_freq(mac_ctx->pdev,
|
||||
target_channel);
|
||||
sap_ctx->chan_freq = target_chan_freq;
|
||||
/* check if currently selected channel is a DFS channel */
|
||||
if (is_ch_dfs && sap_ctx->pre_cac_complete) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED, FL(
|
||||
@ -535,9 +534,9 @@ wlansap_roam_process_dfs_chansw_update(mac_handle_t mac_handle,
|
||||
* should continue to operate in the same mode as it is operating
|
||||
* currently. For e.g. 20/40/80 MHz operation
|
||||
*/
|
||||
if (mac_ctx->sap.SapDfsInfo.target_channel)
|
||||
wlan_reg_set_channel_params(mac_ctx->pdev,
|
||||
mac_ctx->sap.SapDfsInfo.target_channel,
|
||||
if (mac_ctx->sap.SapDfsInfo.target_chan_freq)
|
||||
wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
|
||||
mac_ctx->sap.SapDfsInfo.target_chan_freq,
|
||||
0, &sap_ctx->ch_params);
|
||||
|
||||
/*
|
||||
@ -572,7 +571,7 @@ wlansap_roam_process_dfs_chansw_update(mac_handle_t mac_handle,
|
||||
* change the channel
|
||||
*/
|
||||
qdf_status = wlansap_channel_change_request(sap_ctx,
|
||||
mac_ctx->sap.SapDfsInfo.target_channel);
|
||||
mac_ctx->sap.SapDfsInfo.target_chan_freq);
|
||||
if (!QDF_IS_STATUS_SUCCESS(qdf_status))
|
||||
*ret_status = QDF_STATUS_E_FAILURE;
|
||||
return;
|
||||
@ -622,7 +621,7 @@ wlansap_roam_process_dfs_chansw_update(mac_handle_t mac_handle,
|
||||
* change the channel
|
||||
*/
|
||||
qdf_status = wlansap_channel_change_request(sap_context,
|
||||
mac_ctx->sap.SapDfsInfo.target_channel);
|
||||
mac_ctx->sap.SapDfsInfo.target_chan_freq);
|
||||
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
FL("post chnl chng req failed, sap[%pK]"),
|
||||
@ -794,15 +793,15 @@ static void wlansap_update_vendor_acs_chan(struct mac_context *mac_ctx,
|
||||
return;
|
||||
}
|
||||
|
||||
mac_ctx->sap.SapDfsInfo.target_channel =
|
||||
sap_ctx->dfs_vendor_channel;
|
||||
mac_ctx->sap.SapDfsInfo.target_chan_freq =
|
||||
wlan_reg_chan_to_freq(mac_ctx->pdev, sap_ctx->dfs_vendor_channel);
|
||||
|
||||
mac_ctx->sap.SapDfsInfo.new_chanWidth =
|
||||
sap_ctx->dfs_vendor_chan_bw;
|
||||
mac_ctx->sap.SapDfsInfo.new_ch_params.ch_width =
|
||||
sap_ctx->dfs_vendor_chan_bw;
|
||||
|
||||
if (mac_ctx->sap.SapDfsInfo.target_channel != 0) {
|
||||
if (mac_ctx->sap.SapDfsInfo.target_chan_freq != 0) {
|
||||
mac_ctx->sap.SapDfsInfo.cac_state =
|
||||
eSAP_DFS_DO_NOT_SKIP_CAC;
|
||||
sap_cac_reset_notify(MAC_HANDLE(mac_ctx));
|
||||
@ -995,22 +994,22 @@ QDF_STATUS wlansap_roam_callback(void *ctx,
|
||||
FL("sapdfs: Indicate eSAP_DFS_RADAR_DETECT to HDD"));
|
||||
sap_signal_hdd_event(sap_ctx, NULL, eSAP_DFS_RADAR_DETECT,
|
||||
(void *) eSAP_STATUS_SUCCESS);
|
||||
mac_ctx->sap.SapDfsInfo.target_channel =
|
||||
sap_indicate_radar(sap_ctx);
|
||||
mac_ctx->sap.SapDfsInfo.target_chan_freq =
|
||||
wlan_reg_chan_to_freq(mac_ctx->pdev, 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 =
|
||||
mac_ctx->sap.SapDfsInfo.user_provided_target_channel;
|
||||
mac_ctx->sap.SapDfsInfo.user_provided_target_channel =
|
||||
if (0 < mac_ctx->sap.SapDfsInfo.user_provided_target_chan_freq) {
|
||||
mac_ctx->sap.SapDfsInfo.target_chan_freq =
|
||||
mac_ctx->sap.SapDfsInfo.user_provided_target_chan_freq;
|
||||
mac_ctx->sap.SapDfsInfo.user_provided_target_chan_freq =
|
||||
0;
|
||||
}
|
||||
/* if external acs enabled */
|
||||
if (sap_ctx->vendor_acs_dfs_lte_enabled &&
|
||||
!mac_ctx->sap.SapDfsInfo.target_channel) {
|
||||
!mac_ctx->sap.SapDfsInfo.target_chan_freq) {
|
||||
/* Return from here, processing will be done later */
|
||||
goto EXIT;
|
||||
}
|
||||
if (mac_ctx->sap.SapDfsInfo.target_channel != 0) {
|
||||
if (mac_ctx->sap.SapDfsInfo.target_chan_freq != 0) {
|
||||
mac_ctx->sap.SapDfsInfo.cac_state =
|
||||
eSAP_DFS_DO_NOT_SKIP_CAC;
|
||||
sap_cac_reset_notify(mac_handle);
|
||||
|
@ -2378,14 +2378,14 @@ static QDF_STATUS sap_fsm_handle_radar_during_cac(struct sap_context *sap_ctx,
|
||||
{
|
||||
uint8_t intf;
|
||||
|
||||
if (mac_ctx->sap.SapDfsInfo.target_channel) {
|
||||
wlan_reg_set_channel_params(mac_ctx->pdev,
|
||||
mac_ctx->sap.SapDfsInfo.target_channel, 0,
|
||||
if (mac_ctx->sap.SapDfsInfo.target_chan_freq) {
|
||||
wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
|
||||
mac_ctx->sap.SapDfsInfo.target_chan_freq, 0,
|
||||
&sap_ctx->ch_params);
|
||||
} else {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
FL("Invalid target channel %d"),
|
||||
mac_ctx->sap.SapDfsInfo.target_channel);
|
||||
FL("Invalid target channel freq %d"),
|
||||
mac_ctx->sap.SapDfsInfo.target_chan_freq);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
@ -2415,7 +2415,7 @@ static QDF_STATUS sap_fsm_handle_radar_during_cac(struct sap_context *sap_ctx,
|
||||
* sap_radar_found_status is set to 1
|
||||
*/
|
||||
wlansap_channel_change_request(t_sap_ctx,
|
||||
mac_ctx->sap.SapDfsInfo.target_channel);
|
||||
mac_ctx->sap.SapDfsInfo.target_chan_freq);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2579,8 +2579,7 @@ static QDF_STATUS sap_fsm_state_starting(struct sap_context *sap_ctx,
|
||||
mac_handle);
|
||||
} else if (msg == eSAP_OPERATING_CHANNEL_CHANGED) {
|
||||
/* The operating channel has changed, update hostapd */
|
||||
sap_ctx->chan_freq = wlan_reg_chan_to_freq(mac_ctx->pdev,
|
||||
mac_ctx->sap.SapDfsInfo.target_channel);
|
||||
sap_ctx->chan_freq = mac_ctx->sap.SapDfsInfo.target_chan_freq;
|
||||
|
||||
sap_ctx->fsm_state = SAP_STARTED;
|
||||
|
||||
@ -2648,10 +2647,10 @@ static QDF_STATUS sap_fsm_state_started(struct sap_context *sap_ctx,
|
||||
qdf_status = sap_goto_stopping(sap_ctx);
|
||||
} else if (eSAP_DFS_CHNL_SWITCH_ANNOUNCEMENT_START == msg) {
|
||||
uint8_t intf;
|
||||
if (!mac_ctx->sap.SapDfsInfo.target_channel) {
|
||||
if (!mac_ctx->sap.SapDfsInfo.target_chan_freq) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
FL("Invalid target channel %d"),
|
||||
mac_ctx->sap.SapDfsInfo.target_channel);
|
||||
FL("Invalid target channel freq %d"),
|
||||
mac_ctx->sap.SapDfsInfo.target_chan_freq);
|
||||
return qdf_status;
|
||||
}
|
||||
|
||||
|
@ -656,19 +656,19 @@ bool wlan_sap_get_ch_params(struct sap_context *sap_ctx,
|
||||
*/
|
||||
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
|
||||
static bool wlan_sap_validate_channel_switch(mac_handle_t mac_handle,
|
||||
uint16_t sap_ch,
|
||||
uint32_t sap_ch_freq,
|
||||
struct sap_context *sap_context)
|
||||
{
|
||||
return sme_validate_sap_channel_switch(
|
||||
mac_handle,
|
||||
sap_ch,
|
||||
sap_ch_freq,
|
||||
sap_context->csr_roamProfile.phyMode,
|
||||
sap_context->cc_switch_mode,
|
||||
sap_context->sessionId);
|
||||
}
|
||||
#else
|
||||
static bool wlan_sap_validate_channel_switch(mac_handle_t mac_handle,
|
||||
uint16_t sap_ch,
|
||||
uint32_t sap_ch_freq,
|
||||
struct sap_context *sap_context)
|
||||
{
|
||||
return true;
|
||||
@ -1254,7 +1254,7 @@ QDF_STATUS wlansap_deauth_sta(struct sap_context *sap_ctx,
|
||||
*/
|
||||
static QDF_STATUS
|
||||
wlansap_update_csa_channel_params(struct sap_context *sap_context,
|
||||
enum channel_enum channel)
|
||||
uint32_t chan_freq)
|
||||
{
|
||||
struct mac_context *mac_ctx;
|
||||
uint8_t bw;
|
||||
@ -1265,7 +1265,7 @@ wlansap_update_csa_channel_params(struct sap_context *sap_context,
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
|
||||
if (channel <= CHAN_ENUM_2484) {
|
||||
if (WLAN_REG_IS_24GHZ_CH_FREQ(chan_freq)) {
|
||||
/*
|
||||
* currently OBSS scan is done in hostapd, so to avoid
|
||||
* SAP coming up in HT40 on channel switch we are
|
||||
@ -1287,7 +1287,8 @@ wlansap_update_csa_channel_params(struct sap_context *sap_context,
|
||||
|
||||
op_class = wlan_reg_dmn_get_opclass_from_channel(
|
||||
mac_ctx->scan.countryCodeCurrent,
|
||||
channel, bw);
|
||||
wlan_reg_freq_to_chan(mac_ctx->pdev, chan_freq),
|
||||
bw);
|
||||
/*
|
||||
* Do not continue if bw is 20. This mean channel is not
|
||||
* found and thus set BW20 for the channel.
|
||||
@ -1363,22 +1364,8 @@ static char *sap_get_csa_reason_str(enum sap_csa_reason_code reason)
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* wlansap_set_channel_change_with_csa() - Set channel change with CSA
|
||||
* @sap_ctx: Pointer to SAP context
|
||||
* @targetChannel: Target channel
|
||||
* @target_bw: Target bandwidth
|
||||
* @strict: if true switch to the requested channel always,
|
||||
* SCC/MCC check will be ignored,
|
||||
* fail otherwise
|
||||
*
|
||||
* This api function does a channel change to the target channel specified.
|
||||
* CSA IE is included in the beacons before doing a channel change.
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx,
|
||||
uint32_t targetChannel,
|
||||
uint32_t target_chan_freq,
|
||||
enum phy_ch_width target_bw,
|
||||
bool strict)
|
||||
{
|
||||
@ -1403,14 +1390,14 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx,
|
||||
mac_handle = MAC_HANDLE(mac);
|
||||
|
||||
if (strict && !policy_mgr_is_safe_channel(
|
||||
mac->psoc, wlan_chan_to_freq(targetChannel))) {
|
||||
mac->psoc, target_chan_freq)) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
"%u is unsafe channel", targetChannel);
|
||||
"%u is unsafe channel freq", target_chan_freq);
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
|
||||
"%s: sap chan:%d target:%d conn on 5GHz:%d, csa_reason:%s(%d) strict %d vdev %d",
|
||||
__func__, sap_ctx->chan_freq, targetChannel,
|
||||
"%s: sap chan freq:%d target freq:%d conn on 5GHz:%d, csa_reason:%s(%d) strict %d vdev %d",
|
||||
__func__, sap_ctx->chan_freq, target_chan_freq,
|
||||
policy_mgr_is_any_mode_active_on_band_along_with_session(
|
||||
mac->psoc, sap_ctx->sessionId, POLICY_MGR_BAND_5),
|
||||
sap_get_csa_reason_str(sap_ctx->csa_reason),
|
||||
@ -1422,11 +1409,10 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx,
|
||||
* Now, validate if the passed channel is valid in the
|
||||
* current regulatory domain.
|
||||
*/
|
||||
if (wlan_reg_freq_to_chan(mac->pdev, sap_ctx->chan_freq) !=
|
||||
targetChannel &&
|
||||
((wlan_reg_get_channel_state(mac->pdev, targetChannel) ==
|
||||
if (sap_ctx->chan_freq != target_chan_freq &&
|
||||
((wlan_reg_get_channel_state_for_freq(mac->pdev, target_chan_freq) ==
|
||||
CHANNEL_STATE_ENABLE) ||
|
||||
(wlan_reg_get_channel_state(mac->pdev, targetChannel) ==
|
||||
(wlan_reg_get_channel_state_for_freq(mac->pdev, target_chan_freq) ==
|
||||
CHANNEL_STATE_DFS &&
|
||||
(!policy_mgr_is_any_mode_active_on_band_along_with_session(
|
||||
mac->psoc, sap_ctx->sessionId,
|
||||
@ -1438,13 +1424,13 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx,
|
||||
*/
|
||||
if (!strict) {
|
||||
valid = wlan_sap_validate_channel_switch(mac_handle,
|
||||
targetChannel,
|
||||
target_chan_freq,
|
||||
sap_ctx);
|
||||
if (!valid) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP,
|
||||
QDF_TRACE_LEVEL_ERROR,
|
||||
FL("Channel switch to %u is not allowed due to concurrent channel interference"),
|
||||
targetChannel);
|
||||
FL("Channel freq switch to %u is not allowed due to concurrent channel interference"),
|
||||
target_chan_freq);
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
}
|
||||
@ -1456,14 +1442,14 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx,
|
||||
*/
|
||||
if (sap_ctx->fsm_state == SAP_STARTED) {
|
||||
status = wlansap_update_csa_channel_params(sap_ctx,
|
||||
targetChannel);
|
||||
target_chan_freq);
|
||||
if (status != QDF_STATUS_SUCCESS)
|
||||
return status;
|
||||
|
||||
hw_mode_status =
|
||||
policy_mgr_check_and_set_hw_mode_for_channel_switch(
|
||||
mac->psoc, sap_ctx->sessionId,
|
||||
wlan_chan_to_freq(targetChannel),
|
||||
target_chan_freq,
|
||||
POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH);
|
||||
|
||||
/*
|
||||
@ -1489,7 +1475,7 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx,
|
||||
* Copy the requested target channel
|
||||
* to sap context.
|
||||
*/
|
||||
mac->sap.SapDfsInfo.target_channel = targetChannel;
|
||||
mac->sap.SapDfsInfo.target_chan_freq = target_chan_freq;
|
||||
mac->sap.SapDfsInfo.new_ch_params.ch_width =
|
||||
mac->sap.SapDfsInfo.new_chanWidth;
|
||||
|
||||
@ -1520,7 +1506,7 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx,
|
||||
new_ch_params.ch_width,
|
||||
target_bw);
|
||||
}
|
||||
wlan_reg_set_channel_params(mac->pdev, targetChannel,
|
||||
wlan_reg_set_channel_params_for_freq(mac->pdev, target_chan_freq,
|
||||
0, &mac->sap.SapDfsInfo.new_ch_params);
|
||||
/*
|
||||
* Set the CSA IE required flag.
|
||||
@ -1569,15 +1555,15 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx,
|
||||
|
||||
} else {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: Channel = %d is not valid in the current"
|
||||
"regulatory domain", __func__, targetChannel);
|
||||
"%s: Channel freq = %d is not valid in the current"
|
||||
"regulatory domain", __func__, target_chan_freq);
|
||||
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
"%s: Posted eSAP_CHANNEL_SWITCH_ANNOUNCEMENT_START successfully to sap_fsm for Channel = %d",
|
||||
__func__, targetChannel);
|
||||
"%s: Posted eSAP_CHANNEL_SWITCH_ANNOUNCEMENT_START successfully to sap_fsm for Channel freq = %d",
|
||||
__func__, target_chan_freq);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
@ -1858,14 +1844,14 @@ wlansap_set_cac_required_for_chan(struct mac_context *mac_ctx,
|
||||
}
|
||||
|
||||
QDF_STATUS wlansap_channel_change_request(struct sap_context *sap_ctx,
|
||||
uint8_t target_channel)
|
||||
uint32_t target_chan_freq)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
struct mac_context *mac_ctx;
|
||||
eCsrPhyMode phy_mode;
|
||||
struct ch_params *ch_params;
|
||||
|
||||
if (!target_channel) {
|
||||
if (!target_chan_freq) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: channel 0 requested", __func__);
|
||||
return QDF_STATUS_E_FAULT;
|
||||
@ -1886,18 +1872,18 @@ QDF_STATUS wlansap_channel_change_request(struct sap_context *sap_ctx,
|
||||
phy_mode = sap_ctx->csr_roamProfile.phyMode;
|
||||
|
||||
/* Update phy_mode if the target channel is in the other band */
|
||||
if (WLAN_CHAN_IS_5GHZ(target_channel) &&
|
||||
if (WLAN_REG_IS_5GHZ_CH_FREQ(target_chan_freq) &&
|
||||
((phy_mode == eCSR_DOT11_MODE_11g) ||
|
||||
(phy_mode == eCSR_DOT11_MODE_11g_ONLY)))
|
||||
phy_mode = eCSR_DOT11_MODE_11a;
|
||||
else if (WLAN_CHAN_IS_2GHZ(target_channel) &&
|
||||
else if (WLAN_REG_IS_24GHZ_CH_FREQ(target_chan_freq) &&
|
||||
(phy_mode == eCSR_DOT11_MODE_11a))
|
||||
phy_mode = eCSR_DOT11_MODE_11g;
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: phy_mode: %d, target_channel: %d new phy_mode: %d",
|
||||
"%s: phy_mode: %d, target_channel freq: %d new phy_mode: %d",
|
||||
__func__, sap_ctx->csr_roamProfile.phyMode,
|
||||
target_channel, phy_mode);
|
||||
target_chan_freq, phy_mode);
|
||||
sap_ctx->csr_roamProfile.phyMode = phy_mode;
|
||||
|
||||
if (sap_ctx->csr_roamProfile.ChannelInfo.numOfChannels == 0 ||
|
||||
@ -1906,22 +1892,21 @@ QDF_STATUS wlansap_channel_change_request(struct sap_context *sap_ctx,
|
||||
FL("Invalid channel list"));
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
sap_ctx->csr_roamProfile.ChannelInfo.freq_list[0] =
|
||||
wlan_reg_chan_to_freq(mac_ctx->pdev, target_channel);
|
||||
sap_ctx->csr_roamProfile.ChannelInfo.freq_list[0] = target_chan_freq;
|
||||
|
||||
/*
|
||||
* We are getting channel bonding mode from sapDfsInfor structure
|
||||
* because we've implemented channel width fallback mechanism for DFS
|
||||
* which will result in channel width changing dynamically.
|
||||
*/
|
||||
ch_params = &mac_ctx->sap.SapDfsInfo.new_ch_params;
|
||||
wlan_reg_set_channel_params(mac_ctx->pdev, target_channel,
|
||||
wlan_reg_set_channel_params_for_freq(mac_ctx->pdev, target_chan_freq,
|
||||
0, ch_params);
|
||||
sap_ctx->ch_params = *ch_params;
|
||||
/* Update the channel as this will be used to
|
||||
* send event to supplicant
|
||||
*/
|
||||
sap_ctx->chan_freq = wlan_reg_chan_to_freq(mac_ctx->pdev,
|
||||
target_channel);
|
||||
sap_ctx->chan_freq = target_chan_freq;
|
||||
wlansap_get_sec_channel(ch_params->sec_ch_offset, sap_ctx->chan_freq,
|
||||
&sap_ctx->sec_ch_freq);
|
||||
sap_ctx->csr_roamProfile.ch_params.ch_width = ch_params->ch_width;
|
||||
@ -2002,20 +1987,20 @@ QDF_STATUS wlansap_dfs_send_csa_ie_request(struct sap_context *sap_ctx)
|
||||
|
||||
mac->sap.SapDfsInfo.new_ch_params.ch_width =
|
||||
mac->sap.SapDfsInfo.new_chanWidth;
|
||||
wlan_reg_set_channel_params(mac->pdev,
|
||||
mac->sap.SapDfsInfo.target_channel,
|
||||
wlan_reg_set_channel_params_for_freq(mac->pdev,
|
||||
mac->sap.SapDfsInfo.target_chan_freq,
|
||||
0, &mac->sap.SapDfsInfo.new_ch_params);
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
|
||||
"%s: chan:%d req:%d width:%d off:%d",
|
||||
__func__, mac->sap.SapDfsInfo.target_channel,
|
||||
"%s: chan freq:%d req:%d width:%d off:%d",
|
||||
__func__, mac->sap.SapDfsInfo.target_chan_freq,
|
||||
mac->sap.SapDfsInfo.csaIERequired,
|
||||
mac->sap.SapDfsInfo.new_ch_params.ch_width,
|
||||
mac->sap.SapDfsInfo.new_ch_params.sec_ch_offset);
|
||||
|
||||
return sme_roam_csa_ie_request(MAC_HANDLE(mac),
|
||||
sap_ctx->bssid,
|
||||
mac->sap.SapDfsInfo.target_channel,
|
||||
mac->sap.SapDfsInfo.target_chan_freq,
|
||||
mac->sap.SapDfsInfo.csaIERequired,
|
||||
&mac->sap.SapDfsInfo.new_ch_params);
|
||||
}
|
||||
@ -2163,7 +2148,7 @@ wlansap_set_dfs_preferred_channel_location(mac_handle_t mac_handle)
|
||||
}
|
||||
|
||||
QDF_STATUS wlansap_set_dfs_target_chnl(mac_handle_t mac_handle,
|
||||
uint8_t target_channel)
|
||||
uint32_t target_chan_freq)
|
||||
{
|
||||
struct mac_context *mac = NULL;
|
||||
|
||||
@ -2174,11 +2159,11 @@ QDF_STATUS wlansap_set_dfs_target_chnl(mac_handle_t mac_handle,
|
||||
"%s: Invalid mac_handle pointer", __func__);
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
if (target_channel > 0) {
|
||||
mac->sap.SapDfsInfo.user_provided_target_channel =
|
||||
target_channel;
|
||||
if (target_chan_freq > 0) {
|
||||
mac->sap.SapDfsInfo.user_provided_target_chan_freq =
|
||||
target_chan_freq;
|
||||
} else {
|
||||
mac->sap.SapDfsInfo.user_provided_target_channel = 0;
|
||||
mac->sap.SapDfsInfo.user_provided_target_chan_freq = 0;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
@ -1053,7 +1053,7 @@ QDF_STATUS csr_roam_start_beacon_req(struct mac_context *mac,
|
||||
|
||||
QDF_STATUS csr_roam_send_chan_sw_ie_request(struct mac_context *mac,
|
||||
struct qdf_mac_addr bssid,
|
||||
uint8_t targetChannel,
|
||||
uint32_t target_chan_freq,
|
||||
uint8_t csaIeReqd,
|
||||
struct ch_params *ch_params);
|
||||
QDF_STATUS csr_roam_modify_add_ies(struct mac_context *mac,
|
||||
|
@ -1210,9 +1210,12 @@ QDF_STATUS sme_roam_start_beacon_req(mac_handle_t mac_handle,
|
||||
uint8_t dfsCacWaitStatus);
|
||||
|
||||
/**
|
||||
* sme_csa_restart() - request CSA IE transmission from PE
|
||||
* @mac_ctx: mac context
|
||||
* @session_id: SAP session id
|
||||
* sme_roam_csa_ie_request() - request CSA IE transmission from PE
|
||||
* @mac_handle: handle returned by mac_open
|
||||
* @bssid: SAP bssid
|
||||
* @target_chan_freq: target channel frequency information
|
||||
* @csaIeReqd: CSA IE Request
|
||||
* @ch_params: channel information
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
@ -1220,7 +1223,7 @@ QDF_STATUS sme_csa_restart(struct mac_context *mac_ctx, uint8_t session_id);
|
||||
|
||||
QDF_STATUS sme_roam_csa_ie_request(mac_handle_t mac_handle,
|
||||
struct qdf_mac_addr bssid,
|
||||
uint8_t targetChannel, uint8_t csaIeReqd,
|
||||
uint32_t target_chan_freq, uint8_t csaIeReqd,
|
||||
struct ch_params *ch_params);
|
||||
|
||||
/**
|
||||
@ -1774,7 +1777,7 @@ void sme_update_tgt_services(mac_handle_t mac_handle,
|
||||
struct wma_tgt_services *cfg);
|
||||
|
||||
bool sme_validate_sap_channel_switch(mac_handle_t mac_handle,
|
||||
uint16_t sap_ch, eCsrPhyMode sap_phy_mode,
|
||||
uint32_t sap_ch_freq, eCsrPhyMode sap_phy_mode,
|
||||
uint8_t cc_switch_mode,
|
||||
uint8_t session_id);
|
||||
|
||||
|
@ -9129,19 +9129,9 @@ QDF_STATUS sme_csa_restart(struct mac_context *mac_ctx, uint8_t session_id)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* sme_roam_csa_ie_request() - request CSA IE transmission from PE
|
||||
* @mac_handle: handle returned by mac_open
|
||||
* @bssid: SAP bssid
|
||||
* @targetChannel: target channel information
|
||||
* @csaIeReqd: CSA IE Request
|
||||
* @ch_params: channel information
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS sme_roam_csa_ie_request(mac_handle_t mac_handle,
|
||||
struct qdf_mac_addr bssid,
|
||||
uint8_t targetChannel, uint8_t csaIeReqd,
|
||||
uint32_t target_chan_freq, uint8_t csaIeReqd,
|
||||
struct ch_params *ch_params)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
@ -9150,7 +9140,7 @@ QDF_STATUS sme_roam_csa_ie_request(mac_handle_t mac_handle,
|
||||
status = sme_acquire_global_lock(&mac->sme);
|
||||
if (QDF_IS_STATUS_SUCCESS(status)) {
|
||||
status = csr_roam_send_chan_sw_ie_request(mac, bssid,
|
||||
targetChannel, csaIeReqd, ch_params);
|
||||
target_chan_freq, csaIeReqd, ch_params);
|
||||
sme_release_global_lock(&mac->sme);
|
||||
}
|
||||
return status;
|
||||
@ -10985,7 +10975,7 @@ QDF_STATUS sme_enable_dfs_chan_scan(mac_handle_t mac_handle, uint8_t dfs_flag)
|
||||
* Return: true if there is no channel interference else return false
|
||||
*/
|
||||
bool sme_validate_sap_channel_switch(mac_handle_t mac_handle,
|
||||
uint16_t sap_ch,
|
||||
uint32_t sap_ch_freq,
|
||||
eCsrPhyMode sap_phy_mode,
|
||||
uint8_t cc_switch_mode,
|
||||
uint8_t session_id)
|
||||
@ -11001,7 +10991,8 @@ bool sme_validate_sap_channel_switch(mac_handle_t mac_handle,
|
||||
session->ch_switch_in_progress = true;
|
||||
status = sme_acquire_global_lock(&mac->sme);
|
||||
if (QDF_IS_STATUS_SUCCESS(status)) {
|
||||
intf_channel = csr_check_concurrent_channel_overlap(mac, sap_ch,
|
||||
intf_channel = csr_check_concurrent_channel_overlap(mac,
|
||||
wlan_reg_freq_to_chan(mac->pdev, sap_ch_freq),
|
||||
sap_phy_mode,
|
||||
cc_switch_mode);
|
||||
sme_release_global_lock(&mac->sme);
|
||||
|
@ -20627,7 +20627,7 @@ QDF_STATUS csr_csa_restart(struct mac_context *mac_ctx, uint8_t session_id)
|
||||
* csr_roam_send_chan_sw_ie_request() - Request to transmit CSA IE
|
||||
* @mac_ctx: Global MAC context
|
||||
* @bssid: BSSID
|
||||
* @target_channel: Channel on which to send the IE
|
||||
* @target_chan_freq: Channel frequency on which to send the IE
|
||||
* @csa_ie_reqd: Include/Exclude CSA IE.
|
||||
* @ch_params: operating Channel related information
|
||||
*
|
||||
@ -20638,7 +20638,7 @@ QDF_STATUS csr_csa_restart(struct mac_context *mac_ctx, uint8_t session_id)
|
||||
**/
|
||||
QDF_STATUS csr_roam_send_chan_sw_ie_request(struct mac_context *mac_ctx,
|
||||
struct qdf_mac_addr bssid,
|
||||
uint8_t target_channel,
|
||||
uint32_t target_chan_freq,
|
||||
uint8_t csa_ie_reqd,
|
||||
struct ch_params *ch_params)
|
||||
{
|
||||
@ -20652,7 +20652,7 @@ QDF_STATUS csr_roam_send_chan_sw_ie_request(struct mac_context *mac_ctx,
|
||||
msg->msgType = eWNI_SME_DFS_BEACON_CHAN_SW_IE_REQ;
|
||||
msg->msgLen = sizeof(tSirDfsCsaIeRequest);
|
||||
|
||||
msg->targetChannel = target_channel;
|
||||
msg->target_chan_freq = target_chan_freq;
|
||||
msg->csaIeRequired = csa_ie_reqd;
|
||||
msg->ch_switch_beacon_cnt =
|
||||
mac_ctx->sap.SapDfsInfo.sap_ch_switch_beacon_cnt;
|
||||
|
Loading…
Reference in New Issue
Block a user