qcacld-3.0: Update Max Tx Power in channel switch wrapper IE

Currently in case of CSA announcement with channel switch mode 1,
host wraps "switch wrapper IEs" of the current operating channel
for target channel. This is not expected. Driver should send
fills information about target channel in the channel switch
wrapper IEs.

Fix is to fill IE in host and ignore the IE from hostapd.

Change-Id: Ie2447fa7affdf8211a46877e0d8b0e41796f0cc3
CRs-Fixed: 2444679
This commit is contained in:
Abhinav Kumar
2019-06-01 13:30:55 +05:30
committed by nshrivas
parent beb769e8c5
commit 73a516ba32
7 changed files with 132 additions and 71 deletions

View File

@@ -4118,9 +4118,6 @@ int wlan_hdd_cfg80211_update_apies(struct hdd_adapter *adapter)
mac_handle = adapter->hdd_ctx->mac_handle; mac_handle = adapter->hdd_ctx->mac_handle;
wlan_hdd_add_extra_ie(adapter, genie, &total_ielen,
WLAN_EID_VHT_TX_POWER_ENVELOPE);
/* Extract and add the extended capabilities and interworking IE */ /* Extract and add the extended capabilities and interworking IE */
wlan_hdd_add_extra_ie(adapter, genie, &total_ielen, wlan_hdd_add_extra_ie(adapter, genie, &total_ielen,
WLAN_EID_EXT_CAPABILITY); WLAN_EID_EXT_CAPABILITY);

View File

@@ -3547,6 +3547,8 @@ FRAME Beacon2
OPTIE P2PBeacon; OPTIE P2PBeacon;
OPTIE VHTCaps; OPTIE VHTCaps;
OPTIE VHTOperation; OPTIE VHTOperation;
OPTIE vht_transmit_power_env;
OPTIE ChannelSwitchWrapper;
OPTIE VHTExtBssLoad; OPTIE VHTExtBssLoad;
OPTIE ExtCap; OPTIE ExtCap;
OPTIE OperatingMode; OPTIE OperatingMode;
@@ -3557,7 +3559,6 @@ FRAME Beacon2
OPTIE vendor_vht_ie; OPTIE vendor_vht_ie;
OPTIE Vendor3IE; OPTIE Vendor3IE;
OPTIE hs20vendor_ie; OPTIE hs20vendor_ie;
OPTIE ChannelSwitchWrapper;
OPTIE QComVendorIE; OPTIE QComVendorIE;
OPTIE ESEVersion; OPTIE ESEVersion;
OPTIE QCN_IE; OPTIE QCN_IE;

View File

@@ -26,7 +26,7 @@
* *
* *
* This file was automatically generated by 'framesc' * This file was automatically generated by 'framesc'
* Wed Apr 24 14:55:45 2019 from the following file(s): * Fri May 31 20:00:27 2019 from the following file(s):
* *
* dot11f.frms * dot11f.frms
* *
@@ -9752,54 +9752,55 @@ uint32_t dot11f_get_packed_beacon1_size(tpAniSirGlobal pCtx,
#endif /* C++ */ #endif /* C++ */
typedef struct sDot11fBeacon2{ typedef struct sDot11fBeacon2{
tDot11fIECountry Country; tDot11fIECountry Country;
tDot11fIEPowerConstraints PowerConstraints; tDot11fIEPowerConstraints PowerConstraints;
tDot11fIEChanSwitchAnn ChanSwitchAnn; tDot11fIEChanSwitchAnn ChanSwitchAnn;
tDot11fIEext_chan_switch_ann ext_chan_switch_ann; tDot11fIEext_chan_switch_ann ext_chan_switch_ann;
tDot11fIESuppOperatingClasses SuppOperatingClasses; tDot11fIESuppOperatingClasses SuppOperatingClasses;
tDot11fIEQuiet Quiet; tDot11fIEQuiet Quiet;
tDot11fIETPCReport TPCReport; tDot11fIETPCReport TPCReport;
tDot11fIEERPInfo ERPInfo; tDot11fIEERPInfo ERPInfo;
tDot11fIEExtSuppRates ExtSuppRates; tDot11fIEExtSuppRates ExtSuppRates;
tDot11fIERSNOpaque RSNOpaque; tDot11fIERSNOpaque RSNOpaque;
tDot11fIEEDCAParamSet EDCAParamSet; tDot11fIEEDCAParamSet EDCAParamSet;
tDot11fIEAPChannelReport APChannelReport; tDot11fIEAPChannelReport APChannelReport;
tDot11fIERRMEnabledCap RRMEnabledCap; tDot11fIERRMEnabledCap RRMEnabledCap;
tDot11fIEMobilityDomain MobilityDomain; tDot11fIEMobilityDomain MobilityDomain;
tDot11fIEWPA WPA; tDot11fIEWPA WPA;
tDot11fIEHTCaps HTCaps; tDot11fIEHTCaps HTCaps;
tDot11fIEHTInfo HTInfo; tDot11fIEHTInfo HTInfo;
tDot11fIEsec_chan_offset_ele sec_chan_offset_ele; tDot11fIEsec_chan_offset_ele sec_chan_offset_ele;
tDot11fIEWMMInfoAp WMMInfoAp; tDot11fIEWMMInfoAp WMMInfoAp;
tDot11fIEWMMParams WMMParams; tDot11fIEWMMParams WMMParams;
tDot11fIEWMMCaps WMMCaps; tDot11fIEWMMCaps WMMCaps;
tDot11fIEWscBeacon WscBeacon; tDot11fIEWscBeacon WscBeacon;
tDot11fIEWAPI WAPI; tDot11fIEWAPI WAPI;
tDot11fIEESERadMgmtCap ESERadMgmtCap; tDot11fIEESERadMgmtCap ESERadMgmtCap;
tDot11fIEESETrafStrmMet ESETrafStrmMet; tDot11fIEESETrafStrmMet ESETrafStrmMet;
tDot11fIEESETxmitPower ESETxmitPower; tDot11fIEESETxmitPower ESETxmitPower;
tDot11fIEP2PBeacon P2PBeacon; tDot11fIEP2PBeacon P2PBeacon;
tDot11fIEVHTCaps VHTCaps; tDot11fIEVHTCaps VHTCaps;
tDot11fIEVHTOperation VHTOperation; tDot11fIEVHTOperation VHTOperation;
tDot11fIEVHTExtBssLoad VHTExtBssLoad; tDot11fIEvht_transmit_power_env vht_transmit_power_env;
tDot11fIEExtCap ExtCap; tDot11fIEChannelSwitchWrapper ChannelSwitchWrapper;
tDot11fIEOperatingMode OperatingMode; tDot11fIEVHTExtBssLoad VHTExtBssLoad;
tDot11fIEWiderBWChanSwitchAnn WiderBWChanSwitchAnn; tDot11fIEExtCap ExtCap;
tDot11fIEOBSSScanParameters OBSSScanParameters; tDot11fIEOperatingMode OperatingMode;
tDot11fIEfils_indication fils_indication; tDot11fIEWiderBWChanSwitchAnn WiderBWChanSwitchAnn;
tDot11fIEVendor1IE Vendor1IE; tDot11fIEOBSSScanParameters OBSSScanParameters;
tDot11fIEvendor_vht_ie vendor_vht_ie; tDot11fIEfils_indication fils_indication;
tDot11fIEVendor3IE Vendor3IE; tDot11fIEVendor1IE Vendor1IE;
tDot11fIEhs20vendor_ie hs20vendor_ie; tDot11fIEvendor_vht_ie vendor_vht_ie;
tDot11fIEChannelSwitchWrapper ChannelSwitchWrapper; tDot11fIEVendor3IE Vendor3IE;
tDot11fIEQComVendorIE QComVendorIE; tDot11fIEhs20vendor_ie hs20vendor_ie;
tDot11fIEESEVersion ESEVersion; tDot11fIEQComVendorIE QComVendorIE;
tDot11fIEQCN_IE QCN_IE; tDot11fIEESEVersion ESEVersion;
tDot11fIEhe_cap he_cap; tDot11fIEQCN_IE QCN_IE;
tDot11fIEhe_op he_op; tDot11fIEhe_cap he_cap;
tDot11fIEbss_color_change bss_color_change; tDot11fIEhe_op he_op;
tDot11fIEmu_edca_param_set mu_edca_param_set; tDot11fIEbss_color_change bss_color_change;
tDot11fIEesp_information esp_information; tDot11fIEmu_edca_param_set mu_edca_param_set;
tDot11fIEesp_information esp_information;
} tDot11fBeacon2; } tDot11fBeacon2;
#define DOT11F_BEACON2 (8) #define DOT11F_BEACON2 (8)

View File

@@ -695,6 +695,10 @@ populate_dot_11_f_ext_chann_switch_ann(struct mac_context *mac_ptr,
tDot11fIEext_chan_switch_ann *dot_11_ptr, tDot11fIEext_chan_switch_ann *dot_11_ptr,
struct pe_session *session_entry); struct pe_session *session_entry);
void
populate_dot11f_vht_tx_power_env(struct mac_context *mac,
tDot11fIEvht_transmit_power_env *pDot11f,
enum phy_ch_width ch_width, uint8_t chan);
/* / Populate a tDot11fIEChannelSwitchWrapper */ /* / Populate a tDot11fIEChannelSwitchWrapper */
void void
populate_dot11f_chan_switch_wrapper(struct mac_context *mac, populate_dot11f_chan_switch_wrapper(struct mac_context *mac,

View File

@@ -455,6 +455,10 @@ sch_set_fixed_beacon_fields(struct mac_context *mac_ctx, struct pe_session *sess
/* /*
populate_dot11f_vht_ext_bss_load( mac_ctx, &bcn2.VHTExtBssLoad); populate_dot11f_vht_ext_bss_load( mac_ctx, &bcn2.VHTExtBssLoad);
*/ */
populate_dot11f_vht_tx_power_env(mac_ctx,
&bcn_2->vht_transmit_power_env,
session->ch_width,
session->currentOperChannel);
} }
if (lim_is_session_he_capable(session)) { if (lim_is_session_he_capable(session)) {

View File

@@ -24,7 +24,7 @@
* *
* *
* This file was automatically generated by 'framesc' * This file was automatically generated by 'framesc'
* Wed Apr 24 14:55:45 2019 from the following file(s): * Fri May 31 20:00:27 2019 from the following file(s):
* *
* dot11f.frms * dot11f.frms
* *
@@ -10302,6 +10302,14 @@ static const tIEDefn IES_Beacon2[] = {
{ offsetof(tDot11fBeacon2, VHTOperation), offsetof(tDot11fIEVHTOperation, { offsetof(tDot11fBeacon2, VHTOperation), offsetof(tDot11fIEVHTOperation,
present), 0, "VHTOperation", 0, 7, 7, SigIeVHTOperation, {0, 0, 0, 0, 0}, present), 0, "VHTOperation", 0, 7, 7, SigIeVHTOperation, {0, 0, 0, 0, 0},
0, DOT11F_EID_VHTOPERATION, 0, 0, }, 0, DOT11F_EID_VHTOPERATION, 0, 0, },
{ offsetof(tDot11fBeacon2, vht_transmit_power_env),
offsetof(tDot11fIEvht_transmit_power_env, present), 0,
"vht_transmit_power_env", 0, 4, 7, SigIevht_transmit_power_env,
{0, 0, 0, 0, 0}, 0, DOT11F_EID_VHT_TRANSMIT_POWER_ENV, 0, 0, },
{ offsetof(tDot11fBeacon2, ChannelSwitchWrapper),
offsetof(tDot11fIEChannelSwitchWrapper, present), 0,
"ChannelSwitchWrapper", 0, 2, 14, SigIeChannelSwitchWrapper,
{0, 0, 0, 0, 0}, 0, DOT11F_EID_CHANNELSWITCHWRAPPER, 0, 0, },
{ offsetof(tDot11fBeacon2, VHTExtBssLoad), { offsetof(tDot11fBeacon2, VHTExtBssLoad),
offsetof(tDot11fIEVHTExtBssLoad, present), 0, "VHTExtBssLoad", offsetof(tDot11fIEVHTExtBssLoad, present), 0, "VHTExtBssLoad",
0, 7, 7, SigIeVHTExtBssLoad, {0, 0, 0, 0, 0}, 0, 7, 7, SigIeVHTExtBssLoad, {0, 0, 0, 0, 0},
@@ -10339,10 +10347,6 @@ static const tIEDefn IES_Beacon2[] = {
offsetof(tDot11fIEhs20vendor_ie, present), 0, "hs20vendor_ie", offsetof(tDot11fIEhs20vendor_ie, present), 0, "hs20vendor_ie",
0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 16, 0}, 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 16, 0},
4, DOT11F_EID_HS20VENDOR_IE, 0, 0, }, 4, DOT11F_EID_HS20VENDOR_IE, 0, 0, },
{ offsetof(tDot11fBeacon2, ChannelSwitchWrapper),
offsetof(tDot11fIEChannelSwitchWrapper, present), 0,
"ChannelSwitchWrapper", 0, 2, 14, SigIeChannelSwitchWrapper,
{0, 0, 0, 0, 0}, 0, DOT11F_EID_CHANNELSWITCHWRAPPER, 0, 0, },
{ offsetof(tDot11fBeacon2, QComVendorIE), offsetof(tDot11fIEQComVendorIE, { offsetof(tDot11fBeacon2, QComVendorIE), offsetof(tDot11fIEQComVendorIE,
present), 0, "QComVendorIE", 0, 7, 7, SigIeQComVendorIE, present), 0, "QComVendorIE", 0, 7, 7, SigIeQComVendorIE,
{0, 160, 198, 0, 0}, 3, DOT11F_EID_QCOMVENDORIE, 0, 0, }, {0, 160, 198, 0, 0}, 3, DOT11F_EID_QCOMVENDORIE, 0, 0, },

View File

@@ -260,13 +260,69 @@ populate_dot11_supp_operating_classes(struct mac_context *mac_ptr,
dot_11_ptr->present = 1; dot_11_ptr->present = 1;
} }
void
populate_dot11f_vht_tx_power_env(struct mac_context *mac,
tDot11fIEvht_transmit_power_env *pDot11f,
enum phy_ch_width ch_width, uint8_t chan)
{
uint8_t num_tx_power, i, tx_power;
int reg_max;
switch (ch_width) {
case CH_WIDTH_20MHZ:
/* Max Transmit Power count = 0 (20 MHz) */
num_tx_power = 0;
break;
case CH_WIDTH_40MHZ:
/* Max Transmit Power count = 1 (20, 40 MHz) */
num_tx_power = 1;
break;
case CH_WIDTH_80MHZ:
/* Max Transmit Power count = 2 (20, 40, and 80 MHz) */
num_tx_power = 2;
break;
case CH_WIDTH_160MHZ:
case CH_WIDTH_80P80MHZ:
/* Max Transmit Power count = 3 (20, 40, 80, 160/80+80 MHz) */
num_tx_power = 3;
break;
default:
return;
}
reg_max = lim_get_regulatory_max_transmit_power(mac, chan);
/* in 0.5 dB steps */
reg_max *= 2;
if (reg_max > 127)
/* 63.5 has special meaning of 63.5 dBm or higher */
reg_max = 127;
if (reg_max < -128)
reg_max = -128;
if (reg_max < 0)
tx_power = 0x80 + reg_max + 128;
else
tx_power = reg_max;
/* Ignore EID field */
pDot11f->present = 1;
pDot11f->num_bytes = num_tx_power + 2;
/*
* Max Transmit Power count and
* Max Transmit Power units = 0 (EIRP)
*/
pDot11f->bytes[0] = num_tx_power;
for (i = 0; i <= num_tx_power; i++)
pDot11f->bytes[i + 1] = tx_power;
}
void void
populate_dot11f_chan_switch_wrapper(struct mac_context *mac, populate_dot11f_chan_switch_wrapper(struct mac_context *mac,
tDot11fIEChannelSwitchWrapper *pDot11f, tDot11fIEChannelSwitchWrapper *pDot11f,
struct pe_session *pe_session) struct pe_session *pe_session)
{ {
const uint8_t *ie_ptr = NULL;
/* /*
* The new country subelement is present only when * The new country subelement is present only when
* 1. AP performs Extended Channel switching to new country. * 1. AP performs Extended Channel switching to new country.
@@ -299,18 +355,12 @@ populate_dot11f_chan_switch_wrapper(struct mac_context *mac,
/* /*
* Add the VHT Transmit power Envelope Sublement. * Add the VHT Transmit power Envelope Sublement.
*/ */
ie_ptr = wlan_get_ie_ptr_from_eid( if (pe_session->vhtCapability) {
DOT11F_EID_VHT_TRANSMIT_POWER_ENV, populate_dot11f_vht_tx_power_env(mac,
pe_session->add_ie_params.probeRespBCNData_buff, &pDot11f->vht_transmit_power_env,
pe_session->add_ie_params.probeRespBCNDataLen); pe_session->gLimChannelSwitch.ch_width,
if (ie_ptr) { pe_session->gLimChannelSwitch.primaryChannel);
/* Ignore EID field */
pDot11f->vht_transmit_power_env.present = 1;
pDot11f->vht_transmit_power_env.num_bytes = ie_ptr[1];
qdf_mem_copy(pDot11f->vht_transmit_power_env.bytes,
&ie_ptr[2], pDot11f->vht_transmit_power_env.num_bytes);
} }
} }
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE #ifdef FEATURE_AP_MCC_CH_AVOIDANCE