diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index f7171fb29289..606236fc58a8 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -211,7 +211,7 @@ struct pe_session { tSirMacRateSet rateSet; tSirMacRateSet extRateSet; tSirMacHTOperatingMode htOperMode; - uint32_t curr_op_freq; + qdf_freq_t curr_op_freq; uint32_t curr_req_chan_freq; uint8_t LimRxedBeaconCntDuringHB; diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index 87dda14a5ee9..63d5b440d83a 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -1599,8 +1599,7 @@ lim_detect_change_in_ap_capabilities(struct mac_context *mac, lim_send_probe_req_mgmt_frame( mac, &pe_session->ssId, pe_session->bssId, - wlan_reg_freq_to_chan( - mac->pdev, pe_session->curr_op_freq), + pe_session->curr_op_freq, pe_session->self_mac_addr, pe_session->dot11mode, NULL, NULL); diff --git a/core/mac/src/pe/lim/lim_link_monitoring_algo.c b/core/mac/src/pe/lim/lim_link_monitoring_algo.c index b25e744de371..7d7f3765d3db 100644 --- a/core/mac/src/pe/lim/lim_link_monitoring_algo.c +++ b/core/mac/src/pe/lim/lim_link_monitoring_algo.c @@ -511,14 +511,14 @@ void lim_handle_heart_beat_failure(struct mac_context *mac_ctx, scan_ie = &session->lim_join_req->addIEScan; lim_send_probe_req_mgmt_frame(mac_ctx, &session->ssId, - session->bssId, curr_chan, + session->bssId, session->curr_op_freq, session->self_mac_addr, session->dot11mode, &scan_ie->length, scan_ie->addIEdata); } else { lim_send_probe_req_mgmt_frame(mac_ctx, &session->ssId, - session->bssId, curr_chan, + session->bssId, session->curr_op_freq, session->self_mac_addr, session->dot11mode, NULL, NULL); } diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c index bd85b8548ac5..9d05db18473d 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c @@ -1617,8 +1617,7 @@ static void lim_process_periodic_join_probe_req_timer(struct mac_context *mac_ct ssid.length = session->ssId.length; lim_send_probe_req_mgmt_frame(mac_ctx, &ssid, session->pLimMlmJoinReq->bssDescription.bssId, - wlan_reg_freq_to_chan(mac_ctx->pdev, - session->curr_op_freq), + session->curr_op_freq, session->self_mac_addr, session->dot11mode, &session->lim_join_req->addIEScan.length, session->lim_join_req->addIEScan.addIEdata); diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index 2de58a329c9f..ba19d10fda51 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -2781,8 +2781,7 @@ static void lim_process_switch_channel_join_req( /* include additional IE if there is */ lim_send_probe_req_mgmt_frame(mac_ctx, &ssId, session_entry->pLimMlmJoinReq->bssDescription.bssId, - wlan_reg_freq_to_chan(mac_ctx->pdev, - session_entry->curr_op_freq), + session_entry->curr_op_freq, session_entry->self_mac_addr, session_entry->dot11mode, &session_entry->lim_join_req->addIEScan.length, diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index 0cc40c625144..46149e1836d4 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -144,7 +144,7 @@ void lim_populate_mac_header(struct mac_context *mac_ctx, uint8_t *buf, * @mac_ctx: Pointer to Global MAC structure * @ssid: SSID to be sent in Probe Request frame * @bssid: BSSID to be sent in Probe Request frame - * @channel: Channel # on which the Probe Request is going out + * @chan_freq: Channel frequency on which the Probe Request is going out * @self_macaddr: self MAC address * @dot11mode: self dotllmode * @additional_ielen: if non-zero, include additional_ie in the Probe Request @@ -167,7 +167,7 @@ QDF_STATUS lim_send_probe_req_mgmt_frame(struct mac_context *mac_ctx, tSirMacSSid *ssid, tSirMacAddr bssid, - uint8_t channel, + qdf_freq_t chan_freq, tSirMacAddr self_macaddr, uint32_t dot11mode, uint16_t *additional_ielen, @@ -190,11 +190,12 @@ lim_send_probe_req_mgmt_frame(struct mac_context *mac_ctx, tDot11fIEExtCap extracted_ext_cap; QDF_STATUS sir_status; const uint8_t *qcn_ie = NULL; - uint32_t chan_freq; + uint8_t channel; if (additional_ielen) addn_ielen = *additional_ielen; + channel = wlan_reg_freq_to_chan(mac_ctx->pdev, chan_freq); /* * The probe req should not send 11ac capabilities if band is * 2.4GHz, unless gEnableVhtFor24GHzBand is enabled in INI. So @@ -266,14 +267,15 @@ lim_send_probe_req_mgmt_frame(struct mac_context *mac_ctx, txPower = (uint8_t) rrm_get_mgmt_tx_power(mac_ctx, pesession); populate_dot11f_wfatpc(mac_ctx, &pr.WFATPC, txPower, 0); - if (pesession) { pesession->htCapability = IS_DOT11_MODE_HT(dot11mode); /* Include HT Capability IE */ - if (pesession->htCapability) + if (pesession->htCapability && + !(WLAN_REG_IS_6GHZ_CHAN_FREQ(chan_freq))) populate_dot11f_ht_caps(mac_ctx, pesession, &pr.HTCaps); } else { /* !pesession */ - if (IS_DOT11_MODE_HT(dot11mode)) + if (IS_DOT11_MODE_HT(dot11mode) && + !(WLAN_REG_IS_6GHZ_CHAN_FREQ(chan_freq))) populate_dot11f_ht_caps(mac_ctx, NULL, &pr.HTCaps); } @@ -281,7 +283,8 @@ lim_send_probe_req_mgmt_frame(struct mac_context *mac_ctx, * Set channelbonding information as "disabled" when tunned to a * 2.4 GHz channel */ - if (channel <= SIR_11B_CHANNEL_END) { + if (channel <= SIR_11B_CHANNEL_END && + !(WLAN_REG_IS_6GHZ_CHAN_FREQ(chan_freq))) { if (mac_ctx->roam.configParam.channelBondingMode24GHz == PHY_SINGLE_CHANNEL_CENTERED) { pr.HTCaps.supportedChannelWidthSet = @@ -295,13 +298,15 @@ lim_send_probe_req_mgmt_frame(struct mac_context *mac_ctx, if (pesession) { pesession->vhtCapability = IS_DOT11_MODE_VHT(dot11mode); /* Include VHT Capability IE */ - if (pesession->vhtCapability) { + if (pesession->vhtCapability && + !(WLAN_REG_IS_6GHZ_CHAN_FREQ(chan_freq))) { populate_dot11f_vht_caps(mac_ctx, pesession, &pr.VHTCaps); is_vht_enabled = true; } } else { - if (IS_DOT11_MODE_VHT(dot11mode)) { + if (IS_DOT11_MODE_VHT(dot11mode) && + !(WLAN_REG_IS_6GHZ_CHAN_FREQ(chan_freq))) { populate_dot11f_vht_caps(mac_ctx, pesession, &pr.VHTCaps); is_vht_enabled = true; @@ -407,8 +412,6 @@ lim_send_probe_req_mgmt_frame(struct mac_context *mac_ctx, payload += addn_ielen; } - chan_freq = wlan_reg_chan_to_freq(mac_ctx->pdev, channel); - /* If this probe request is sent during P2P Search State, then we need * to send it at OFDM rate. */ diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index 0d025e60342c..5a536f90e7bb 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -488,8 +488,8 @@ void lim_process_action_frame_no_session(struct mac_context *mac, uint8_t *pRxMe void lim_populate_mac_header(struct mac_context *, uint8_t *, uint8_t, uint8_t, tSirMacAddr, tSirMacAddr); QDF_STATUS lim_send_probe_req_mgmt_frame(struct mac_context *, tSirMacSSid *, - tSirMacAddr, uint8_t, tSirMacAddr, - uint32_t, uint16_t *, uint8_t *); + tSirMacAddr, qdf_freq_t, tSirMacAddr, + uint32_t, uint16_t *, uint8_t *); /** * lim_send_probe_rsp_mgmt_frame() - Send probe response diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index a2c2d42d1b15..e00314d90ba7 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -908,8 +908,7 @@ static void __sch_beacon_process_for_session(struct mac_context *mac_ctx, */ if (sendProbeReq) lim_send_probe_req_mgmt_frame(mac_ctx, &session->ssId, - session->bssId, wlan_reg_freq_to_chan( - mac_ctx->pdev, session->curr_op_freq), + session->bssId, session->curr_op_freq, session->self_mac_addr, session->dot11mode, NULL, NULL); if ((false == mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running)