Search Linux Wireless

Re: [PATCH wireless-next v6 5/5] wifi: mac80211: set tx power per radio in a wiphy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +++ b/net/mac80211/cfg.c
> @@ -3080,6 +3080,7 @@ static int ieee80211_set_tx_power(struct wiphy *wiphy,
>  	struct ieee80211_local *local = wiphy_priv(wiphy);
>  	struct ieee80211_sub_if_data *sdata;
>  	enum nl80211_tx_power_setting txp_type = type;
> +	struct ieee80211_chanctx_conf *conf;
>  	bool update_txp_type = false;
>  	bool has_monitor = false;
>  	int user_power_level;
> @@ -3155,6 +3156,12 @@ static int ieee80211_set_tx_power(struct wiphy *wiphy,
>  			if (!link)
>  				continue;
>  
> +			if (radio_id >= 0 && radio_id < wiphy->n_radio) {
> +				conf = wiphy_dereference(wiphy, link->conf->chanctx_conf);
> +				if (!conf || conf->radio_idx != radio_id)
> +					continue;
> +			}
> +
>  			link->user_power_level = local->user_power_level;
>  			if (txp_type != link->conf->txpower_type)
>  				update_txp_type = true;
> @@ -3175,6 +3182,12 @@ static int ieee80211_set_tx_power(struct wiphy *wiphy,
>  			if (!link)
>  				continue;
>  
> +			if (radio_id >= 0 && radio_id < wiphy->n_radio) {
> +				conf = wiphy_dereference(wiphy, link->conf->chanctx_conf);
> +				if (!conf || conf->radio_idx != radio_id)
> +					continue;
> +			}
> +
> 


Hmm. Is this really enough? What if the link gets disabled and re-
enabled on a whole different chanctx on a different radio? Or other
things like that?

Seems like we may need to change how the TX power is stored in mac80211,
rather than just paper over it like this?

johannes





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux