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:
@@ -4118,9 +4118,6 @@ int wlan_hdd_cfg80211_update_apies(struct hdd_adapter *adapter)
|
||||
|
||||
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 */
|
||||
wlan_hdd_add_extra_ie(adapter, genie, &total_ielen,
|
||||
WLAN_EID_EXT_CAPABILITY);
|
||||
|
@@ -3547,6 +3547,8 @@ FRAME Beacon2
|
||||
OPTIE P2PBeacon;
|
||||
OPTIE VHTCaps;
|
||||
OPTIE VHTOperation;
|
||||
OPTIE vht_transmit_power_env;
|
||||
OPTIE ChannelSwitchWrapper;
|
||||
OPTIE VHTExtBssLoad;
|
||||
OPTIE ExtCap;
|
||||
OPTIE OperatingMode;
|
||||
@@ -3557,7 +3559,6 @@ FRAME Beacon2
|
||||
OPTIE vendor_vht_ie;
|
||||
OPTIE Vendor3IE;
|
||||
OPTIE hs20vendor_ie;
|
||||
OPTIE ChannelSwitchWrapper;
|
||||
OPTIE QComVendorIE;
|
||||
OPTIE ESEVersion;
|
||||
OPTIE QCN_IE;
|
||||
|
@@ -26,7 +26,7 @@
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -9781,6 +9781,8 @@ typedef struct sDot11fBeacon2{
|
||||
tDot11fIEP2PBeacon P2PBeacon;
|
||||
tDot11fIEVHTCaps VHTCaps;
|
||||
tDot11fIEVHTOperation VHTOperation;
|
||||
tDot11fIEvht_transmit_power_env vht_transmit_power_env;
|
||||
tDot11fIEChannelSwitchWrapper ChannelSwitchWrapper;
|
||||
tDot11fIEVHTExtBssLoad VHTExtBssLoad;
|
||||
tDot11fIEExtCap ExtCap;
|
||||
tDot11fIEOperatingMode OperatingMode;
|
||||
@@ -9791,7 +9793,6 @@ typedef struct sDot11fBeacon2{
|
||||
tDot11fIEvendor_vht_ie vendor_vht_ie;
|
||||
tDot11fIEVendor3IE Vendor3IE;
|
||||
tDot11fIEhs20vendor_ie hs20vendor_ie;
|
||||
tDot11fIEChannelSwitchWrapper ChannelSwitchWrapper;
|
||||
tDot11fIEQComVendorIE QComVendorIE;
|
||||
tDot11fIEESEVersion ESEVersion;
|
||||
tDot11fIEQCN_IE QCN_IE;
|
||||
|
@@ -695,6 +695,10 @@ populate_dot_11_f_ext_chann_switch_ann(struct mac_context *mac_ptr,
|
||||
tDot11fIEext_chan_switch_ann *dot_11_ptr,
|
||||
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 */
|
||||
void
|
||||
populate_dot11f_chan_switch_wrapper(struct mac_context *mac,
|
||||
|
@@ -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_tx_power_env(mac_ctx,
|
||||
&bcn_2->vht_transmit_power_env,
|
||||
session->ch_width,
|
||||
session->currentOperChannel);
|
||||
}
|
||||
|
||||
if (lim_is_session_he_capable(session)) {
|
||||
|
@@ -24,7 +24,7 @@
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -10302,6 +10302,14 @@ static const tIEDefn IES_Beacon2[] = {
|
||||
{ offsetof(tDot11fBeacon2, VHTOperation), offsetof(tDot11fIEVHTOperation,
|
||||
present), 0, "VHTOperation", 0, 7, 7, SigIeVHTOperation, {0, 0, 0, 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(tDot11fIEVHTExtBssLoad, present), 0, "VHTExtBssLoad",
|
||||
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",
|
||||
0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 16, 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,
|
||||
present), 0, "QComVendorIE", 0, 7, 7, SigIeQComVendorIE,
|
||||
{0, 160, 198, 0, 0}, 3, DOT11F_EID_QCOMVENDORIE, 0, 0, },
|
||||
|
@@ -260,13 +260,69 @@ populate_dot11_supp_operating_classes(struct mac_context *mac_ptr,
|
||||
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
|
||||
populate_dot11f_chan_switch_wrapper(struct mac_context *mac,
|
||||
tDot11fIEChannelSwitchWrapper *pDot11f,
|
||||
struct pe_session *pe_session)
|
||||
{
|
||||
const uint8_t *ie_ptr = NULL;
|
||||
|
||||
/*
|
||||
* The new country subelement is present only when
|
||||
* 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.
|
||||
*/
|
||||
ie_ptr = wlan_get_ie_ptr_from_eid(
|
||||
DOT11F_EID_VHT_TRANSMIT_POWER_ENV,
|
||||
pe_session->add_ie_params.probeRespBCNData_buff,
|
||||
pe_session->add_ie_params.probeRespBCNDataLen);
|
||||
if (ie_ptr) {
|
||||
/* 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);
|
||||
if (pe_session->vhtCapability) {
|
||||
populate_dot11f_vht_tx_power_env(mac,
|
||||
&pDot11f->vht_transmit_power_env,
|
||||
pe_session->gLimChannelSwitch.ch_width,
|
||||
pe_session->gLimChannelSwitch.primaryChannel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
|
||||
|
Reference in New Issue
Block a user