Re: [PATCH v2] mac80211: reject/clear user rate mask if not usable

2020-11-13 Thread Johannes Berg
> > Yes but you have to iterate all the stations and check they belong to > > the interface and all that I think? > > > Maybe not need. > if NL80211_IFTYPE_STATION and NON-WLAN_STA_TDLS_PEER, it has only 1 > station for the ieee80211_vif > by my understand. Well, yes, but there's no counter.

Re: [PATCH v2] mac80211: reject/clear user rate mask if not usable

2020-11-13 Thread Wen Gong
On 2020-11-13 17:10, Johannes Berg wrote: On Fri, 2020-11-13 at 17:09 +0800, Wen Gong wrote: On 2020-11-13 16:51, Johannes Berg wrote: > On Fri, 2020-11-13 at 16:51 +0800, Wen Gong wrote: > > > yes. > > It can add check with supp_rates[band] of ieee80211_sta for > > NL80211_IFTYPE_STATION type.

Re: [PATCH v2] mac80211: reject/clear user rate mask if not usable

2020-11-13 Thread Johannes Berg
On Fri, 2020-11-13 at 17:09 +0800, Wen Gong wrote: > On 2020-11-13 16:51, Johannes Berg wrote: > > On Fri, 2020-11-13 at 16:51 +0800, Wen Gong wrote: > > > > > yes. > > > It can add check with supp_rates[band] of ieee80211_sta for > > > NL80211_IFTYPE_STATION type. > > > for others, check with

Re: [PATCH v2] mac80211: reject/clear user rate mask if not usable

2020-11-13 Thread Wen Gong
On 2020-11-13 16:51, Johannes Berg wrote: On Fri, 2020-11-13 at 16:51 +0800, Wen Gong wrote: yes. It can add check with supp_rates[band] of ieee80211_sta for NL80211_IFTYPE_STATION type. for others, check with sdata->vif.bss_conf.basic_rates Right. Though, might need to check that only if

Re: [PATCH v2] mac80211: reject/clear user rate mask if not usable

2020-11-13 Thread Wen Gong
On 2020-11-13 16:35, Johannes Berg wrote: On Fri, 2020-11-13 at 16:35 +0800, Wen Gong wrote: > I guess if we really want to redefine the user rate mask to not apply > to > control frames, then we can relax this? > Yes, for AP mode, it is hard to calculate the usable rates over all stations.

Re: [PATCH v2] mac80211: reject/clear user rate mask if not usable

2020-11-13 Thread Johannes Berg
On Fri, 2020-11-13 at 16:51 +0800, Wen Gong wrote: > yes. > It can add check with supp_rates[band] of ieee80211_sta for > NL80211_IFTYPE_STATION type. > for others, check with sdata->vif.bss_conf.basic_rates Right. Though, might need to check that only if there's no TDLS station or something?

Re: [PATCH v2] mac80211: reject/clear user rate mask if not usable

2020-11-13 Thread Johannes Berg
On Fri, 2020-11-13 at 16:35 +0800, Wen Gong wrote: > > > I guess if we really want to redefine the user rate mask to not apply > > to > > control frames, then we can relax this? > > > Yes, for AP mode, it is hard to calculate the usable rates over all > stations. > But for STATION mode, it can

Re: [PATCH v2] mac80211: reject/clear user rate mask if not usable

2020-11-13 Thread Wen Gong
On 2020-11-13 16:16, Johannes Berg wrote: On Fri, 2020-11-13 at 16:14 +0800, Wen Gong wrote: On 2020-11-13 15:38, Johannes Berg wrote: > On Fri, 2020-11-13 at 10:08 +0800, Wen Gong wrote: > > > Which was the intent of this change, wasn't it? > > Indeed. Permitting this leads to warnings later.

Re: [PATCH v2] mac80211: reject/clear user rate mask if not usable

2020-11-13 Thread Johannes Berg
On Fri, 2020-11-13 at 16:14 +0800, Wen Gong wrote: > On 2020-11-13 15:38, Johannes Berg wrote: > > On Fri, 2020-11-13 at 10:08 +0800, Wen Gong wrote: > > > > Which was the intent of this change, wasn't it? > > > > Indeed. Permitting this leads to warnings later. > > > > > We need to set the tx

Re: [PATCH v2] mac80211: reject/clear user rate mask if not usable

2020-11-13 Thread Wen Gong
On 2020-11-13 15:38, Johannes Berg wrote: On Fri, 2020-11-13 at 10:08 +0800, Wen Gong wrote: > Which was the intent of this change, wasn't it? Indeed. Permitting this leads to warnings later. We need to set the tx rate to fixed at a single rate, e.g., 54M/48M/36M... for a test case. I do

Re: [PATCH v2] mac80211: reject/clear user rate mask if not usable

2020-11-12 Thread Johannes Berg
On Fri, 2020-11-13 at 10:08 +0800, Wen Gong wrote: > > > Which was the intent of this change, wasn't it? Indeed. Permitting this leads to warnings later. > We need to set the tx rate to fixed at a single rate, e.g., > 54M/48M/36M... for a test case. > I do not want a clear error message, I

Re: [PATCH v2] mac80211: reject/clear user rate mask if not usable

2020-11-12 Thread Wen Gong
On 2020-11-12 20:49, Arend Van Spriel wrote: On 11/12/2020 11:55 AM, Wen Gong wrote: On 2017-03-08 21:20, Johannes Berg wrote: From: Johannes Berg [...] @@ -2685,6 +2686,21 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy, return ret; } +    /* + * If

Re: [PATCH v2] mac80211: reject/clear user rate mask if not usable

2020-11-12 Thread Arend Van Spriel
On 11/12/2020 11:55 AM, Wen Gong wrote: On 2017-03-08 21:20, Johannes Berg wrote: From: Johannes Berg [...] @@ -2685,6 +2686,21 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy, return ret; } +    /* + * If active validate the setting and reject it if it

Re: [PATCH v2] mac80211: reject/clear user rate mask if not usable

2020-11-12 Thread Wen Gong
On 2017-03-08 21:20, Johannes Berg wrote: From: Johannes Berg If the user rate mask results in no (basic) rates being usable, clear it. Also, if we're already operating when it's set, reject it instead. Technically, selecting basic rates as the criterion is a bit too restrictive, but