Search Linux Wireless

Re: [RFC] cfg80211: let's wmm_rule be part of reg_rule structure

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

 



Given the code simplification, and that we even allocate n_channels *
WMM rule anyway in e.g. iwlwifi, this seems like a good idea. I think I
was initially against it because of the duplication, but for the most
part we have few rules, and if we have many like in iwlwifi we already
don't take advantage of it to save memory ...

I think, however, that we should get away without doing a userspace API
modification:

> --- a/include/uapi/linux/nl80211.h
> +++ b/include/uapi/linux/nl80211.h
> @@ -3598,6 +3598,7 @@ enum nl80211_reg_rule_flags {
>  	NL80211_RRF_NO_HT40PLUS		= 1<<14,
>  	NL80211_RRF_NO_80MHZ		= 1<<15,
>  	NL80211_RRF_NO_160MHZ		= 1<<16,
> +	NL80211_RRF_HAS_WMM		= 1<<17,
>  };

We can store this flag in a kernel-only boolean instead?

> -	if (IS_ERR_OR_NULL(rrule) || !rrule->wmm_rule) {
> +	if (IS_ERR_OR_NULL(rrule) || !(rrule->flags & NL80211_RRF_HAS_WMM)) {

and then just use "rrule->has_wmm" or so here (and in other places that
check).

>  	for (i = 0; i < src_regd->n_reg_rules; i++) {
>  		memcpy(&regd->reg_rules[i], &src_regd->reg_rules[i],
>  		       sizeof(struct ieee80211_reg_rule));
> -		if (!src_regd->reg_rules[i].wmm_rule)
> -			continue;
> -
> -		regd->reg_rules[i].wmm_rule = d_wmm +
> -			(src_regd->reg_rules[i].wmm_rule - s_wmm) /
> -			sizeof(struct ieee80211_wmm_rule);
>  	}

could drop the braces now

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