[PATCH v2 8/8] mac80211: save transmit power envelope element and power constraint

Wen Gong wgong at codeaurora.org
Thu Aug 26 03:50:35 PDT 2021


On 2021-08-26 16:29, Johannes Berg wrote:
> On Fri, 2021-08-20 at 08:20 -0400, Wen Gong wrote:
>> 
>>  	if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE)) {
>>  		const struct cfg80211_bss_ies *ies;
>> +		struct ieee80211_bss_conf *bss_conf;
> 
> am I missing where you set this?
sorry, i lost it in v2 patch.
bss_conf = &sdata->vif.bss_conf;
> 
>> +		if (is_6ghz) {
>> +			struct ieee802_11_elems elems;
> 
> This is pretty big, not sure we want it on the stack (causes warnings
> for me in build). Also, if we're doing this anyway, then we can change
> the code above (perhaps as a separate patch) to not do
> cfg80211_find_ext_ie() but rather take it out of the parsed.
will change it.
> 
>> +			u8 i, j = 0;
>> +
>> +			ieee802_11_parse_elems(ies->data, ies->len, false, &elems,
> 
> (line too long)
> 
>> +					       NULL, NULL);
>> +
>> +			if (elems.pwr_constr_elem)
>> +				bss_conf->pwr_reduction = *elems.pwr_constr_elem;
> 
> before using it?
> 
>> +
>> +			BUILD_BUG_ON(ARRAY_SIZE(bss_conf->tx_pwr_env) !=
>> +				     ARRAY_SIZE(elems.tx_pwr_env));
>> +
>> +			for (i = 0; i < elems.tx_pwr_env_num; i++) {
>> +				if (elems.tx_pwr_env_len[i] >
>> +				    sizeof(bss_conf->tx_pwr_env[j]))
>> +					continue;
> 
> I did that in the parsing itself.
> 
>> +
>> +				bss_conf->tx_pwr_env_num++;
>> +				memcpy(&bss_conf->tx_pwr_env[j], elems.tx_pwr_env[i],
>> +				       elems.tx_pwr_env_len[i]);
> 
> You're never resetting any of this for the next connection (if it's not
> 6 GHz for example, or doesn't have any data) - should probably memset
> all the new members to 0 before the "if (is_6ghz)" or so?
> 
it is memset here i this patch:
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -721,6 +721,15 @@ static int ieee80211_assign_vif_chanctx(struct 
ieee80211_sub_if_data *sdata,
                                          
lockdep_is_held(&local->chanctx_mtx));

         if (conf) {
+               if (conf->def.chan->band == NL80211_BAND_6GHZ) {
+                       struct ieee80211_bss_conf *bss_conf;
+
+                       bss_conf = &sdata->vif.bss_conf;
+                       bss_conf->pwr_reduction = 0;
+                       bss_conf->tx_pwr_env_num = 0;
+                       memset(bss_conf->tx_pwr_env, 0, 
sizeof(bss_conf->tx_pwr_env));
+               }
+
                 curr_ctx = container_of(conf, struct ieee80211_chanctx, 
conf);

                 drv_unassign_vif_chanctx(local, sdata, curr_ctx);

> johannes



More information about the ath11k mailing list