qcacld-3.0: For channel switch fill proper freq0 and freq1

When STA switch channel the freq0 and freq1 are channel number
and not frequency in hdd_chan_change_notify. Thus the freq0 and
freq1 validation fails in nl80211_send_chandef and thus the
channel change is not notified to supplicant.

Fix this by filling freq instead of channel in freq0 and freq1 in
hdd_chan_change_notify.

Change-Id: I03d3a2afcbb812e6da7ec2be9887dd185e754a44
CRs-Fixed: 2655979
This commit is contained in:
gaurank kathpalia 2020-04-02 16:33:56 +05:30 • committed by nshrivas
commit f3e208b797
3 changed files with 35 additions and 6 deletions

View file

@ -4588,6 +4588,7 @@ static void hdd_roam_channel_switch_handler(struct hdd_adapter *adapter,
QDF_STATUS status;
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
mac_handle_t mac_handle = hdd_adapter_get_mac_handle(adapter);
struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
/* Enable Roaming on STA interface which was disabled before CSA */
if (adapter->device_mode == QDF_STA_MODE)
@ -4605,6 +4606,10 @@ static void hdd_roam_channel_switch_handler(struct hdd_adapter *adapter,
chan_change.chan_params.mhz_freq_seg1 =
roam_info->chan_info.band_center_freq2;
/* Flush AP on old channel before adding it again */
wlan_hdd_cfg80211_unlink_bss(adapter, sta_ctx->conn_info.bssid.bytes,
sta_ctx->conn_info.ssid.SSID.ssId,
sta_ctx->conn_info.ssid.SSID.length);
bss = wlan_hdd_cfg80211_update_bss_db(adapter, roam_info);
if (!bss)
hdd_err("%s: unable to create BSS entry", adapter->dev->name);

View file

@ -2188,6 +2188,8 @@ void lim_switch_channel_cback(struct mac_context *mac, QDF_STATUS status,
{
struct scheduler_msg mmhMsg = { 0 };
struct switch_channel_ind *pSirSmeSwitchChInd;
enum reg_wifi_band band;
uint8_t band_mask;
pe_session->curr_op_freq = pe_session->curr_req_chan_freq;
/* We need to restore pre-channelSwitch state on the STA */
@ -2214,6 +2216,19 @@ void lim_switch_channel_cback(struct mac_context *mac, QDF_STATUS status,
pe_session->gLimChannelSwitch.ch_center_freq_seg0;
pSirSmeSwitchChInd->chan_params.center_freq_seg1 =
pe_session->gLimChannelSwitch.ch_center_freq_seg1;
band = wlan_reg_freq_to_band(pSirSmeSwitchChInd->freq);
band_mask = 1 << band;
if (pe_session->gLimChannelSwitch.ch_center_freq_seg0)
pSirSmeSwitchChInd->chan_params.mhz_freq_seg0 =
wlan_reg_chan_band_to_freq(mac->pdev,
pe_session->gLimChannelSwitch.ch_center_freq_seg0,
band_mask);
if (pe_session->gLimChannelSwitch.ch_center_freq_seg1)
pSirSmeSwitchChInd->chan_params.mhz_freq_seg1 =
wlan_reg_chan_band_to_freq(mac->pdev,
pe_session->gLimChannelSwitch.ch_center_freq_seg1,
band_mask);
pSirSmeSwitchChInd->status = status;
qdf_mem_copy(pSirSmeSwitchChInd->bssid.bytes, pe_session->bssId,

View file

@ -12233,16 +12233,25 @@ csr_roam_chk_lnk_swt_ch_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
roam_info->chan_info.sec_ch_offset =
pSwitchChnInd->chan_params.sec_ch_offset;
roam_info->chan_info.band_center_freq1 =
pSwitchChnInd->chan_params.center_freq_seg0;
pSwitchChnInd->chan_params.mhz_freq_seg0;
roam_info->chan_info.band_center_freq2 =
pSwitchChnInd->chan_params.center_freq_seg1;
pSwitchChnInd->chan_params.mhz_freq_seg1;
if (CSR_IS_PHY_MODE_11ac(mac_ctx->roam.configParam.phyMode))
roam_info->mode = SIR_SME_PHY_MODE_VHT;
else if (CSR_IS_PHY_MODE_11n(mac_ctx->roam.configParam.phyMode))
switch (session->bssParams.uCfgDot11Mode) {
case eCSR_CFG_DOT11_MODE_11N:
case eCSR_CFG_DOT11_MODE_11N_ONLY:
roam_info->mode = SIR_SME_PHY_MODE_HT;
else
break;
case eCSR_CFG_DOT11_MODE_11AC:
case eCSR_CFG_DOT11_MODE_11AC_ONLY:
case eCSR_CFG_DOT11_MODE_11AX:
case eCSR_CFG_DOT11_MODE_11AX_ONLY:
roam_info->mode = SIR_SME_PHY_MODE_VHT;
break;
default:
roam_info->mode = SIR_SME_PHY_MODE_LEGACY;
break;
}
status = csr_roam_call_callback(mac_ctx, sessionId, roam_info, 0,
eCSR_ROAM_STA_CHANNEL_SWITCH,