Enable additional channels for use
Subsystems (2)
v2 cover Enable additional channels for use
Hi Luis,
I'm resending this patch set. Any chance you could review it?
Thanks in advance,
Ilan.
-----
Sorry for the big delay between the previous series and this one ... seems that I was too hasty with the previous one ... hope I did a better work this time :)
As before, this series addresses the option of enabling additional channels for use based on the following relaxations:
1. Indoor operation, where a device can use channels requiring indoor operation, subject to that it can guarantee indoor operation.
2. Concurrent GO operation, where devices may instantiate a P2P GO while they are under the guidance of an authorized master.
The series includes:
* Some clarification (mainly in documentation) about the intended usage of channels marked as INDOOR_ONLY and CONCURRENT GO.
* Mapping of NL80211_RFF_NO_OUTDOOR to NL80211_CHAN_INDOOR_ONLY
* Support for a user hint that the platform is operating in an indoor environment, i.e., channel marked as INDOOR_ONLY can be used.
* Allow initiating radiation on channel marked with INDOOR_ONLY also for scanning an frame injection in monitor mode.
* Some additional fixes for comments I got.
Following is an example of a possible channel map that can be used to allow the INDOOR_ONLY and CONCURRENT_GO relaxations. Note that:
* Channels 12,13 are marked as Concurrent GO, so even in the lack of exact information about the current regulatory domain, these channels can be used for GO instantiation based on the concurrent GO relaxation.
* The above is also true for channels 149-165 (a.k.a U-NII 3).
* Channels 36-48 (a.k.a thee U-NII 1), are marked both with Concurrent GO and indoor only. While the Concurrent GO can be used as described above, the indoor only setting allows to use these channels given the platform is identified as an indoor one, i.e., media server.
2412 MHz [1] (16.0 dBm)
2417 MHz [2] (16.0 dBm)
2422 MHz [3] (16.0 dBm)
2427 MHz [4] (16.0 dBm)
2432 MHz [5] (16.0 dBm)
2437 MHz [6] (16.0 dBm)
2442 MHz [7] (16.0 dBm)
2447 MHz [8] (16.0 dBm)
2452 MHz [9] (16.0 dBm)
2457 MHz [10] (16.0 dBm)
2462 MHz [11] (16.0 dBm)
2467 MHz [12] (16.0 dBm) (no IR, Concurrent GO) 2472 MHz [13] (16.0 dBm) (no IR, Concurrent GO) 5180 MHz [36] (16.0 dBm) (no IR, Indoor Only, Concurrent GO) 5200 MHz [40] (16.0 dBm) (no IR, Indoor Only, Concurrent GO) 5220 MHz [44] (16.0 dBm) (no IR, Indoor Only, Concurrent GO) 5240 MHz [48] (16.0 dBm) (no IR, Indoor Only, Concurrent GO) 5260 MHz [52] (16.0 dBm) (no IR, radar detection) 5280 MHz [56] (16.0 dBm) (no IR, radar detection) 5300 MHz [60] (16.0 dBm) (no IR, radar detection) 5320 MHz [64] (16.0 dBm) (no IR, radar detection) 5500 MHz [100] (16.0 dBm) (no IR, radar detection) 5520 MHz [104] (16.0 dBm) (no IR, radar detection) 5540 MHz [108] (16.0 dBm) (no IR, radar detection) 5560 MHz [112] (16.0 dBm) (no IR, radar detection) 5580 MHz [116] (16.0 dBm) (no IR, radar detection) 5600 MHz [120] (16.0 dBm) (no IR, radar detection) 5620 MHz [124] (16.0 dBm) (no IR, radar detection) 5640 MHz [128] (16.0 dBm) (no IR, radar detection) 5660 MHz [132] (16.0 dBm) (no IR, radar detection) 5680 MHz [136] (16.0 dBm) (no IR, radar detection) 5700 MHz [140] (16.0 dBm) (no IR, radar detection) 5720 MHz [144] (16.0 dBm) (no IR, radar detection) 5745 MHz [149] (16.0 dBm) (no IR, Concurrent GO) 5765 MHz [153] (16.0 dBm) (no IR, Concurrent GO) 5785 MHz [157] (16.0 dBm) (no IR, Concurrent GO) 5805 MHz [161] (16.0 dBm) (no IR, Concurrent GO) 5825 MHz [165] (16.0 dBm) (no IR, Concurrent GO)
Thanks in advance,
Ilan.
David Spinadel (1):
cfg80211: Add indoor only and GO concurrent channel attributes
Ilan Peer (5):
cfg80211: Add Kconfig option for cellular BS hints
cfg80211: Enable GO operation on additional channels
cfg80211: Add an option to hint indoor operation
cfg80211: Enable GO operation on indoor channels
mac80211: Enable initiating radiation on indoor channels
include/net/cfg80211.h | 39 +++++++++++++++++++- include/uapi/linux/nl80211.h | 10 +++++ net/mac80211/ibss.c | 9 +++-- net/mac80211/scan.c | 8 ++-- net/mac80211/tx.c | 2 +- net/wireless/Kconfig | 16 ++++++++ net/wireless/chan.c | 73 +++++++++++++++++++++++++++++++++++-- net/wireless/mesh.c | 3 +- net/wireless/nl80211.c | 35 +++++++++++------- net/wireless/reg.c | 83 ++++++++++++++++++++++++++++++++++++++++-- net/wireless/reg.h | 13 +++++++ net/wireless/trace.h | 11 ++++-- 12 files changed, 266 insertions(+), 36 deletions(-)
Signature · 1 line
1.7.10.4
PATCH v2 1/6 cfg80211: Add indoor only and GO concurrent channel attributes
From: David Spinadel <[email protected]>
The FCC are clarifying some soft configuration requirements, which among other include the following:
1. Indoor operation, where a device can use channels requiring indoor operation, subject to that it can guarantee indoor operation, i.e., the device is connected to AC Power or the device is under the control of a local master that is acting as an AP and is connected to AC Power.
2. Concurrent GO operation, where devices may instantiate a P2P GO while they are under the guidance of an authorized master. For example, on a channel on which a BSS is connected to an authorized master, i.e., with DFS and radar detection capability in the UNII band.
See https://apps.fcc.gov/eas/comments/GetPublishedDocument.html?id=327&tn=528122
Add support for advertising Indoor-only and GO-Concurrent channel properties.
--- include/net/cfg80211.h | 23 +++++++++++++++++++++++ include/uapi/linux/nl80211.h | 7 +++++++ net/wireless/nl80211.c | 6 ++++++ net/wireless/reg.c | 2 ++ 4 files changed, 38 insertions(+)
include/net/cfg80211.h +23 -0
@@ -109,6 +109,27 @@ enum ieee80211_band {* channel as the control or any of the secondary channels. * This may be due to the driver or due to regulatory bandwidth * restrictions. +* @IEEE80211_CHAN_INDOOR_ONLY: Only indoor use is permitted on this channel. +* A channel marked with IEEE80211_CHAN_INDOOR_ONLY can only be used when +* there is a clear assessment that the device is operating in an indoor +* surroundings, i.e., it is connected to AC power (and not through +* portable DC inverters) or is under the control of a master that is +* acting as an AP and is connected to AC power. +* @IEEE80211_CHAN_GO_CONCURRENT: GO operation is allowed on this channel if +* it's connected concurrently to a BSS on the same channel on 2.4 or +* to a channel in the same UNII band on 5.2. +* Instantiating a GO on a channel marked with IEEE80211_CHAN_GO_CONCURRENT +* can be done when there is a clear assessment that the device is +* operating under the guidance of an authorized master, i.e., setting up a +* GO while the device is also connected to an AP with DFS and radar +* detection on the UNII band (however, this example does not imply that +* all channels marked with IEEE80211_CHAN_RADAR must also be marked with +* IEEE80211_CHAN_GO_CONCURRENT and vise versa). +* +* See https://apps.fcc.gov/eas/comments/GetPublishedDocument.html?id=327&tn=528122 +* for more information on the FCC description of the relaxations allowed +* by IEEE80211_CHAN_INDOOR_ONLY and IEEE80211_CHAN_GO_CONCURRENT. +* */ enum ieee80211_channel_flags {IEEE80211_CHAN_DISABLED =1 <<0 ,
@@ -120,6 +141,8 @@ enum ieee80211_channel_flags {IEEE80211_CHAN_NO_OFDM =1 <<6 ,IEEE80211_CHAN_NO_80MHZ =1 <<7 ,IEEE80211_CHAN_NO_160MHZ =1 <<8 , +IEEE80211_CHAN_INDOOR_ONLY =1 <<9 , + IEEE80211_CHAN_GO_CONCURRENT = 1<<10, };#define IEEE80211_CHAN_NO_HT40 \
include/uapi/linux/nl80211.h +7 -0
@@ -2260,6 +2260,11 @@ enum nl80211_band_attr {* @NL80211_FREQUENCY_ATTR_NO_160MHZ: any 160 MHz (but not 80+80) channel * using this channel as the primary or any of the secondary channels * isn't possible +* @NL80211_FREQUENCY_ATTR_INDOOR_ONLY: Indoor only use is permitted +* on this channel in current regulatory domain. +* @NL80211_FREQUENCY_ATTR_GO_CONCURRENT: GO operation is allowed on this +* channel if it's connected concurrently to a BSS on the same channel on +* 2.4 or to a channel in the same UNII band on 5.2. * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number * currently defined * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
@@ -2278,6 +2283,8 @@ enum nl80211_frequency_attr {NL80211_FREQUENCY_ATTR_NO_HT40_PLUS ,NL80211_FREQUENCY_ATTR_NO_80MHZ ,NL80211_FREQUENCY_ATTR_NO_160MHZ , +NL80211_FREQUENCY_ATTR_INDOOR_ONLY , +NL80211_FREQUENCY_ATTR_GO_CONCURRENT ,/* keep last */ __NL80211_FREQUENCY_ATTR_AFTER_LAST,
net/wireless/nl80211.c +6 -0
@@ -600,6 +600,12 @@ static int nl80211_msg_put_channel(struct sk_buff *msg,if ((chan->flags &IEEE80211_CHAN_NO_160MHZ ) &&nla_put_flag (msg,NL80211_FREQUENCY_ATTR_NO_160MHZ )) goto nla_put_failure; +if ((chan->flags &IEEE80211_CHAN_INDOOR_ONLY ) && +nla_put_flag (msg,NL80211_FREQUENCY_ATTR_INDOOR_ONLY )) + goto nla_put_failure; +if ((chan->flags &IEEE80211_CHAN_GO_CONCURRENT ) && +nla_put_flag (msg,NL80211_FREQUENCY_ATTR_GO_CONCURRENT )) + goto nla_put_failure; } if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
net/wireless/reg.c +2 -0
@@ -749,6 +749,8 @@ static u32 map_regdom_flags(u32 rd_flags) channel_flags |=IEEE80211_CHAN_RADAR ;if (rd_flags &NL80211_RRF_NO_OFDM ) channel_flags |=IEEE80211_CHAN_NO_OFDM ; +if (rd_flags &NL80211_RRF_NO_OUTDOOR ) + channel_flags |=IEEE80211_CHAN_INDOOR_ONLY ;return channel_flags; }
Signature · 1 line
1.7.10.4
PATCH v2 2/6 cfg80211: Add Kconfig option for cellular BS hints
In reply to Ilan PeerMove the regulatory cellular base station hints support under a specific configuration option and make the option depend on CFG80211_CERTIFICATION_ONUS.
--- net/wireless/Kconfig | 7 +++++++ net/wireless/reg.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-)
net/wireless/Kconfig +7 -0
@@ -95,6 +95,13 @@ config CFG80211_CERTIFICATION_ONUS you are a wireless researcher and are working in a controlled and approved environment by your local regulatory agency. +config CFG80211_REG_CELLULAR_HINTS + bool "cfg80211 regulatory support for cellular base station hints" + depends on CFG80211_CERTIFICATION_ONUS + ---help--- + This option adds support for drivers that can receive regulatory + hints from cellular base stations + config CFG80211_DEFAULT_PS bool "enable powersave by default" depends on CFG80211
net/wireless/reg.c +1 -1
@@ -992,7 +992,7 @@ bool reg_last_request_cell_base(void)return reg_request_cell_base (get_last_request ()); } -#ifdef CONFIG_CFG80211_CERTIFICATION_ONUS +#ifdef CONFIG_CFG80211_REG_CELLULAR_HINTS /* Core specific check */ static enum reg_request_treatment reg_ignore_cell_hint (struct regulatory_request *pending_request)
Signature · 1 line
1.7.10.4
PATCH v2 3/6 cfg80211: Enable GO operation on additional channels
In reply to Ilan PeerAllow GO operation on a channel marked with IEEE80211_CHAN_GO_CONCURRENT iff there is an active station interface that is associated to an AP operating on the same channel in 2.4 or the same UNII band in 5.2 (assuming that the AP is an authorized master)
Note that this is a permissive approach to the FCC definitions, that require a clear assessment that the device operating the AP is an authorized master, i.e., with radar detection and DFS capabilities.
It is assumed that such restrictions are enforced by user space. Furthermore, it is assumed, that if the conditions that allowed for the operation of the GO on such a channel change, i.e., the station interface disconnected from the AP, it is the responsibility of user space to evacuate the GO from the channel.
--- include/net/cfg80211.h | 4 ++- net/mac80211/ibss.c | 9 ++++--- net/wireless/Kconfig | 9 +++++++ net/wireless/chan.c | 68 +++++++++++++++++++++++++++++++++++++++++++++--- net/wireless/mesh.c | 3 ++- net/wireless/nl80211.c | 11 +++++--- net/wireless/reg.c | 22 ++++++++++++++++ net/wireless/reg.h | 12 +++++++++ net/wireless/trace.h | 11 +++++--- 9 files changed, 133 insertions(+), 16 deletions(-)
include/net/cfg80211.h +3 -1
@@ -4297,12 +4297,14 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy,* cfg80211_reg_can_beacon - check if beaconing is allowed * @wiphy: the wiphy * @chandef: the channel definition +* @iftype: interface type * * Return: %true if there is no secondary channel or the secondary channel(s) * can be used for beaconing (i.e. is not a radar channel etc.) */ bool cfg80211_reg_can_beacon (struct wiphy *wiphy, -struct cfg80211_chan_def *chandef); +struct cfg80211_chan_def *chandef, +enum nl80211_iftype iftype);/* * cfg80211_ch_switch_notify - update wdev channel and notify userspace
net/mac80211/ibss.c +6 -3
@@ -263,7 +263,8 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,/* make a copy of the chandef, it could be modified below. */ chandef = *req_chandef; chan = chandef.chan; -if (!cfg80211_reg_can_beacon (local->hw.wiphy, &chandef)) { +if (!cfg80211_reg_can_beacon (local->hw.wiphy, &chandef, +NL80211_IFTYPE_ADHOC )) { if (chandef.width == NL80211_CHAN_WIDTH_5 || chandef.width == NL80211_CHAN_WIDTH_10 || chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
@@ -275,7 +276,8 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, chandef.width =NL80211_CHAN_WIDTH_20 ; chandef.center_freq1 = chan->center_freq;/* check again for downgraded chandef */ -if (!cfg80211_reg_can_beacon (local->hw.wiphy, &chandef)) { +if (!cfg80211_reg_can_beacon (local->hw.wiphy, &chandef, +NL80211_IFTYPE_ADHOC )) {sdata_info (sdata,"Failed to join IBSS, beacons forbidden\n" );return ;
@@ -865,7 +867,8 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata, goto disconnect; } -if (!cfg80211_reg_can_beacon (sdata->local->hw.wiphy, ¶ms.chandef)) { +if (!cfg80211_reg_can_beacon (sdata->local->hw.wiphy, ¶ms.chandef, +NL80211_IFTYPE_ADHOC )) { sdata_info(sdata, "IBSS %pM switches to unsupported channel (%d MHz, width:%d, CF1/2: %d/%d MHz), disconnecting\n", ifibss->bssid,
net/wireless/Kconfig +9 -0
@@ -102,6 +102,15 @@ config CFG80211_REG_CELLULAR_HINTS This option adds support for drivers that can receive regulatory hints from cellular base stations +config CFG80211_REG_SOFT_CONFIGURATIONS + bool "cfg80211 support for GO operation on additional channels" + depends on CFG80211_CERTIFICATION_ONUS + ---help--- + This option enables the operation of a P2P group owner on + additional channels, if there is an additional BSS interface + which is connected to an AP which is assumed to be an authorized + master, i.e., with radar detection support and DFS capabilities + config CFG80211_DEFAULT_PS bool "enable powersave by default" depends on CFG80211
net/wireless/chan.c +65 -3
80 lines not on this page · raw message
net/wireless/mesh.c +2 -1
@@ -174,7 +174,8 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, scan_width); } -if (!cfg80211_reg_can_beacon (&rdev->wiphy, &setup->chandef)) +if (!cfg80211_reg_can_beacon (&rdev->wiphy, &setup->chandef, +NL80211_IFTYPE_MESH_POINT ))return -EINVAL ; err = cfg80211_can_use_chan(rdev, wdev, setup->chandef.chan,
net/wireless/nl80211.c +7 -4
@@ -1870,7 +1870,7 @@ static int __nl80211_set_channel(struct cfg80211_registered_device *rdev, result = -EBUSY ;break ; } -if (!cfg80211_reg_can_beacon (&rdev->wiphy, &chandef)) { +if (!cfg80211_reg_can_beacon (&rdev->wiphy, &chandef, iftype)) { result = -EINVAL ;break ; }
@@ -3219,7 +3219,8 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) }else if (!nl80211_get_ap_channel (rdev, ¶ms))return -EINVAL ; -if (!cfg80211_reg_can_beacon (&rdev->wiphy, ¶ms.chandef)) +if (!cfg80211_reg_can_beacon (&rdev->wiphy, ¶ms.chandef, + wdev->iftype))return -EINVAL ; err =cfg80211_chandef_dfs_required (wdev->wiphy, ¶ms.chandef);
@@ -5806,7 +5807,8 @@ skip_beacons:if (err)return err; -if (!cfg80211_reg_can_beacon (&rdev->wiphy, ¶ms.chandef)) +if (!cfg80211_reg_can_beacon (&rdev->wiphy, ¶ms.chandef, + wdev->iftype))return -EINVAL ; if (dev->ieee80211_ptr->iftype == NL80211_IFTYPE_AP ||
@@ -6577,7 +6579,8 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)if (err)return err; -if (!cfg80211_reg_can_beacon (&rdev->wiphy, &ibss.chandef)) +if (!cfg80211_reg_can_beacon (&rdev->wiphy, &ibss.chandef, +NL80211_IFTYPE_ADHOC ))return -EINVAL ;switch (ibss.chandef.width) {
net/wireless/reg.c +22 -0
@@ -2460,6 +2460,28 @@ static void reg_timeout_work(struct work_struct *work)rtnl_unlock (); } +int cfg80211_get_unii (int freq) +{ +/* UNII-1 */ +if (freq >=5150 && freq <=5250 ) +return 0 ; + +/* UNII-2 */ +if (freq >5250 && freq <=5350 ) +return 1 ; + +/* UNII-2E */ +if (freq >=5470 && freq <=5725 ) +return 2 ; + +/* UNII-3 */ +if (freq >5725 && freq <=5825 ) +return 3 ; + +WARN_ON (1 ); +return -EINVAL ; +} +int __init regulatory_init (void ) {int err =0 ;
net/wireless/reg.h +12 -0
@@ -102,4 +102,16 @@ void regulatory_hint_country_ie(struct wiphy *wiphy,*/ void regulatory_hint_disconnect (void ); +/** +* cfg80211_get_unii - get a value specifying the U-NII band the frequency +* belongs too. +* @freq: the frequency for which we want to get the UNII band. + +* U-NII bands are defined by the FCC in C.F.R 47 part 15. +* +* Returns -EINVAL if freq is invalid, 1 for UNII-1, 2 for UNII-2, +* 3 for UNII-2e, 4 for UNII-3. +*/ +int cfg80211_get_unii (int freq); +#endif /* __NET_WIRELESS_REG_H */
net/wireless/trace.h +7 -4
@@ -2149,18 +2149,21 @@ TRACE_EVENT(cfg80211_cqm_rssi_notify, );TRACE_EVENT (cfg80211_reg_can_beacon, - TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef), -TP_ARGS (wiphy, chandef), + TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef, + enum nl80211_iftype iftype), +TP_ARGS (wiphy, chandef, iftype),TP_STRUCT__entry ( WIPHY_ENTRY CHAN_DEF_ENTRY + __field(enum nl80211_iftype, iftype) ),TP_fast_assign ( WIPHY_ASSIGN; CHAN_DEF_ASSIGN(chandef); + __entry->iftype = iftype; ), -TP_printk (WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT , -WIPHY_PR_ARG ,CHAN_DEF_PR_ARG ) +TP_printk (WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", iftype=%d" , +WIPHY_PR_ARG ,CHAN_DEF_PR_ARG , __entry->iftype) ); TRACE_EVENT(cfg80211_chandef_dfs_required,
Signature · 1 line
1.7.10.4
Re: [PATCH v2 3/6] cfg80211: Enable GO operation on additional channels
Quoted 9 lines · Ilan Peer
Allow GO operation on a channel marked with
IEEE80211_CHAN_GO_CONCURRENTiff there is an active station interface that is associated to an AP operating on the same channel in 2.4 or the same UNII band in 5.2 (assuming that the AP is an authorized master)Note that this is a permissive approach to the FCC definitions, that require a clear assessment that the device operating the AP is an authorized master, i.e., with radar detection and DFS capabilities.
Quoted 5 lines
It is assumed that such restrictions are enforced by user space. Furthermore, it is assumed, that if the conditions that allowed for the operation of the GO on such a channel change, i.e., the station interface disconnected from the AP, it is the responsibility of user space to evacuate the GO from the channel.
You may be interested in perhaps picking up my regulatory quiescing patch. Can you check and let me know?
net/wireless/Kconfig config CFG80211_REG_CELLULAR_HINTS · line 105
Quoted 9 lines
net/wireless/Kconfig +1
-0@@ -102,6 +102,15 @@ config CFG80211_REG_CELLULAR_HINTS This option adds support for drivers that can receive regulatory hints from cellular base stations +config CFG80211_REG_SOFT_CONFIGURATIONS
Please use something specific to P2P, maybe CFG80211_REG_P2P_RELAX or something. It would be good to also provide a reference to a URL on wireless.kernel.org on documentation about an example userspace instance or effort that is doing this.
net/wireless/chan.c bool cfg80211_chandef_usable(struct wiphy *wiphy, · line 608
Quoted 9 lines
net/wireless/chan.c +1
-0@@ -605,15 +605,77 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy, }EXPORT_SYMBOL (cfg80211_chandef_usable); +#ifdef CONFIG_CFG80211_REG_SOFT_CONFIGURATIONS
Please use config_enabled(CONFIG_FOO) check to simplify this.
net/wireless/chan.c bool cfg80211_chandef_usable(struct wiphy *wiphy, · line 614
Quoted 6 lines
net/wireless/chan.c +6
-0+/* For GO only, check if the channel can be used under permissive conditions +* mandated by the some regulatory bodies, i.e., the channel is marked with +* IEEE80211_CHAN_GO_CONCURRENT and there is an additional station interface +* associated to an AP on the same channel or on the same UNII band +* (assuming that the AP is an authorized master). +*/
Comments go like this:
/*
* somet suff
* bladsf
*/
Quoted 7 lines
net/wireless/chan.c +7
-0+static bool cfg80211_go_permissive_chan (struct cfg80211_registered_device *rdev, +struct ieee80211_channel *chan) +{ +struct wireless_dev *wdev_iter; + +ASSERT_RTNL (); +
net/wireless/chan.c bool cfg80211_chandef_usable(struct wiphy *wiphy, · line 631
Quoted 10 lines
net/wireless/chan.c +10
-0+if (!(chan->flags &IEEE80211_CHAN_GO_CONCURRENT )) +return false; + +list_for_each_entry (wdev_iter, &rdev->wdev_list, list) { +struct ieee80211_channel *other_chan =NULL ; + +if (wdev_iter->iftype !=NL80211_IFTYPE_STATION || + !netif_running (wdev_iter->netdev)) +continue ; +
<--
net/wireless/chan.c bool cfg80211_chandef_usable(struct wiphy *wiphy, · line 635
Quoted 4 lines
net/wireless/chan.c +4
-0+wdev_lock (wdev_iter); +if (wdev_iter->current_bss) + other_chan = wdev_iter->current_bss->pub.channel; +wdev_unlock (wdev_iter);
-->
This is begging to be added as a helper.
net/wireless/chan.c bool cfg80211_chandef_usable(struct wiphy *wiphy, · line 641
Quoted 6 lines
net/wireless/chan.c +6
-0+ +if (!other_chan) +continue ; + +if (chan == other_chan) { +return true;
No need to use braces for one liners and since you are returning no need to indent the code below, as the else is implicit. This in practice helps reduce general code identation.
Likeywise you can follow by a check for ! 5 GHz and bail if, and save yourself the identation on the negative.
net/wireless/chan.c bool cfg80211_chandef_usable(struct wiphy *wiphy, · line 658
Quoted 6 lines
net/wireless/chan.c +6
-0+static bool cfg80211_go_permissive_chan (struct cfg80211_registered_device *rdev, +struct ieee80211_channel *chan) +{ +return false; +} +#endif /* CONFIG_CFG80211_REG_SOFT_CONFIGURATIONS */
Please review chan.c well and make a call (you decide) if this belongs on chan.c or reg.c.
Quoted 9 lines
net/wireless/chan.c +4
-1+bool cfg80211_reg_can_beacon (struct wiphy *wiphy, -struct cfg80211_chan_def *chandef) +struct cfg80211_chan_def *chandef, +enum nl80211_iftype iftype) { +struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy);bool res; u32 prohibited_flags = IEEE80211_CHAN_DISABLED |
net/wireless/chan.c bool cfg80211_chandef_usable(struct wiphy *wiphy, · line 674
Quoted 10 lines
net/wireless/chan.c +6
-2-IEEE80211_CHAN_NO_IR |IEEE80211_CHAN_RADAR ; -trace_cfg80211_reg_can_beacon (wiphy, chandef); +trace_cfg80211_reg_can_beacon (wiphy, chandef, iftype); + +/* Under certain conditions suggested by the some regulatory bodies +* a GO can operate on channels marked with IEEE80211_NO_IR +* so set this flag only if such relaxations are not enabled and +* the conditions are not met.
Comment style.
net/wireless/chan.c bool cfg80211_chandef_usable(struct wiphy *wiphy, · line 678
Quoted 4 lines
net/wireless/chan.c +4
-0+*/ +if (iftype !=NL80211_IFTYPE_P2P_GO || + !cfg80211_go_permissive_chan (rdev, chandef->chan)) + prohibited_flags |=IEEE80211_CHAN_NO_IR ;
Please add a wiphy regulatory feature flag here that allows device drivers to disable this, this can be enabled by default. Practice shows regulatory stuff varies and I can imagine other vendors wanting to consider disabling for some customers or builds for whatever unestablished reasons.
net/wireless/reg.h void regulatory_hint_country_ie(struct wiphy *wiphy, · line 107
Quoted 11 lines
net/wireless/reg.h +3
-0@@ -102,4 +102,16 @@ void regulatory_hint_country_ie(struct wiphy *wiphy,*/ void regulatory_hint_disconnect (void ); +/** +* cfg80211_get_unii - get a value specifying the U-NII band the frequency +* belongs too.
One liners for top description on kdoc IIRC.
net/wireless/reg.h void regulatory_hint_country_ie(struct wiphy *wiphy, · line 113
Quoted 6 lines
net/wireless/reg.h +6
-0+* @freq: the frequency for which we want to get the UNII band. + +* U-NII bands are defined by the FCC in C.F.R 47 part 15. +* +* Returns -EINVAL if freq is invalid, 1 for UNII-1, 2 for UNII-2, +* 3 for UNII-2e, 4 for UNII-3.
What's your source for UNII definition? Can you provide a URL?
Luis
RE: [PATCH v2 3/6] cfg80211: Enable GO operation on additional channels
Hi Luis,
Thanks for your comments.
Ilan.
Quoted 9 lines
From: Luis R. Rodriguez [mailto:[email protected]] On Behalf Of Luis R. Rodriguez
Sent: Saturday, January 25, 2014 02:09
To: Peer, Ilan
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v2 3/6] cfg80211: Enable GO operation on additional channels
Quoted 9 lines
Quoted 5 lines
It is assumed that such restrictions are enforced by user space. Furthermore, it is assumed, that if the conditions that allowed for the operation of the GO on such a channel change, i.e., the station interface disconnected from the AP, it is the responsibility of user space to evacuate the GO from the channel.
You may be interested in perhaps picking up my regulatory quiescing patch. Can you check and let me know?
Sure. Will have a look.
Quoted 7 lines
Quoted 1 line
+config
CFG80211_REG_SOFT_CONFIGURATIONSPlease use something specific to P2P, maybe
CFG80211_REG_P2P_RELAXor something. It would be good to also provide a reference to a URL on wireless.kernel.org on documentation about an example userspace instance or effort that is doing this.
Will change the config name. As for the documentation, do you mean something like what I've added to the cover letter? Anyway, I will handle this once these patches are accepted.
Quoted 4 lines
Quoted 2 lines
+#ifdef
CONFIG_CFG80211_REG_SOFT_CONFIGURATIONSPlease use
config_enabled(CONFIG_FOO)check to simplify this.
Sure.
Quoted 13 lines
Review
Quoted 10 lines
(quoted diff) +9
-0+/* For GO only, check if the channel can be used under permissive +conditions + * mandated by the some regulatory bodies, i.e., the channel is +marked with + * IEEE80211_CHAN_GO_CONCURRENT and there is an additional station +interface + * associated to an AP on the same channel or on the same UNII band + * (assuming that the AP is an authorized master). + */Comments go like this:
Quoted 5 lines
/*
* somet suff
* bladsf
*/
I thought I was following the networking comment style :) anyway .. fixing.
Quoted 11 lines
<--
net/wireless/chan.c bool cfg80211_chandef_usable(struct wiphy *wiphy, · line 635
Quoted 5 lines
net/wireless/chan.c +3
-0+wdev_lock (wdev_iter); +if (wdev_iter->current_bss) + other_chan = wdev_iter->current_bss-pub.channel;
net/wireless/chan.c +1
-0+wdev_unlock (wdev_iter);-->
Quoted 2 lines
This is begging to be added as a helper.
Sure.
Quoted 11 lines
net/wireless/chan.c bool cfg80211_chandef_usable(struct wiphy *wiphy, · line 641
Quoted 6 lines
net/wireless/chan.c +6
-0+ +if (!other_chan) +continue ; + +if (chan == other_chan) { +return true;No need to use braces for one liners and since you are returning no need to indent the code below, as the else is implicit. This in practice helps reduce general code identation.
Quoted 3 lines
Likeywise you can follow by a check for ! 5 GHz and bail if, and save yourself the identation on the negative.
Fixing
Quoted 11 lines
Quoted 1 line
+static bool cfg80211_go_permissive_chan(struct
cfg80211_registered_device*rdev,net/wireless/chan.c bool cfg80211_chandef_usable(struct wiphy *wiphy, · line 658
Quoted 5 lines
net/wireless/chan.c +5
-0+ struct ieee80211_channel *chan) +{ +return false; +} +#endif /* CONFIG_CFG80211_REG_SOFT_CONFIGURATIONS */ Please review
chan.cwell and make a call (you decide) if this belongs onchan.correg.c.
I think that it is more suited in chan.c (similar to dfs handling ...).
Quoted 6 lines
net/wireless/chan.c bool cfg80211_chandef_usable(struct wiphy *wiphy, · line 674
Quoted 4 lines
net/wireless/chan.c +4
-0+/* Under certain conditions suggested by the some regulatory bodies +* a GO can operate on channels marked with IEEE80211_NO_IR +* so set this flag only if such relaxations are not enabled and +* the conditions are not met. Comment style.
Fixing ...
Quoted 12 lines
net/wireless/chan.c bool cfg80211_chandef_usable(struct wiphy *wiphy, · line 678
Quoted 5 lines
net/wireless/chan.c +4
-0+*/ +if (iftype !=NL80211_IFTYPE_P2P_GO || + !cfg80211_go_permissive_chan (rdev, chandef->chan)) + prohibited_flags |=IEEE80211_CHAN_NO_IR ;Please add a wiphy regulatory feature flag here that allows device drivers to disable this, this can be enabled by default.
Practice shows regulatory stuff varies and I can imagine other vendors wanting to consider disabling for some customers or builds for whatever unestablished reasons.
Sure.
Quoted 7 lines
net/wireless/reg.h void regulatory_hint_country_ie(struct wiphy *wiphy, · line 107
Quoted 4 lines
net/wireless/reg.h +4
-0+/** +* cfg80211_get_unii - get a value specifying the U-NII band the +frequency +* belongs too. One liners for top description on kdoc IIRC.
Fixing.
Quoted 9 lines
Quoted 6 lines
+ * @freq: the frequency for which we want to get the UNII band. +
+ * U-NII bands are defined by the FCC in C.F.R 47 part 15.
+ *
+ * Returns-EINVALif freq is invalid, 1 for UNII-1, 2 for UNII-2,
+ * 3 for UNII-2e, 4 for UNII-3.What's your source for UNII definition? Can you provide a URL?
FCC in C.F.R 47 part 15 ... WIP to get the URL.
RE: [PATCH v2 3/6] cfg80211: Enable GO operation on additional channels
In reply to Luis R. RodriguezQuoted 20 lines
-----Original Message-----
From: Luis R. Rodriguez [mailto:[email protected]] On Behalf Of Luis R. Rodriguez
Sent: Saturday, January 25, 2014 02:09
To: Peer, Ilan
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v2 3/6] cfg80211: Enable GO operation on additional channels<--
net/wireless/chan.c bool cfg80211_chandef_usable(struct wiphy *wiphy, · line 635
Quoted 5 lines
net/wireless/chan.c +3
-0+wdev_lock (wdev_iter); +if (wdev_iter->current_bss) + other_chan = wdev_iter->current_bss-pub.channel;
net/wireless/chan.c +1
-0+wdev_unlock (wdev_iter);-->
Quoted 1 line
This is begging to be added as a helper.
Rethinking this ... currently this is not really used by other code paths other than the wext ones. Do u still want the helper function?
Ilan.
RE: [PATCH v2 3/6] cfg80211: Enable GO operation on additional channels
In reply to Luis R. RodriguezHi Luis,
Adding the link to the latest definitions of FCC's 5GHz unlicensed spectrum.
Regards,
Ilan.
Quoted 9 lines
-----Original Message-----
From: Luis R. Rodriguez [mailto:[email protected]] On Behalf Of Luis R. Rodriguez
Sent: Saturday, January 25, 2014 02:09
To: Peer, Ilan
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v2 3/6] cfg80211: Enable GO operation on additional channels
...
Quoted 9 lines
Quoted 6 lines
+ * @freq: the frequency for which we want to get the UNII band. +
+ * U-NII bands are defined by the FCC in C.F.R 47 part 15.
+ *
+ * Returns-EINVALif freq is invalid, 1 for UNII-1, 2 for UNII-2,
+ * 3 for UNII-2e, 4 for UNII-3.What's your source for UNII definition? Can you provide a URL?
http://www.fcc.gov/document/5-ghz-unlicensed-spectrum-unii
http://hraunfoss.fcc.gov/edocs_public/attachmatch/FCC-13-22A1.pdf
PATCH v2 4/6 cfg80211: Add an option to hint indoor operation
In reply to Ilan PeerAdd the option to hint the wireless core that it is operating in an indoor environment.
In addition add regulatory_ir_allowed(), that can be used to test if initiation radiation is allowed based on the channel flags and the wireless core indoor hint.
--- include/net/cfg80211.h | 12 +++++++++ include/uapi/linux/nl80211.h | 3 +++ net/wireless/nl80211.c | 18 ++++++------- net/wireless/reg.c | 57 +++++++++++++++++++++++++++++++++++++++--- net/wireless/reg.h | 1 + 5 files changed, 78 insertions(+), 13 deletions(-)
include/net/cfg80211.h +12 -0
@@ -3534,6 +3534,18 @@ const struct ieee80211_reg_rule *freq_reg_info(struct wiphy *wiphy,*/ const char *reg_initiator_name (enum nl80211_reg_initiator initiator); +/** +* regulatory_ir_allowed - is it allowed to initiate radiation on the channel. +* @chan: the channel +* +* Generally, it is not allowed to initiate radiation on a channel marked with +* IEEE80211_CHAN_NO_IR. The exception is operation on channels marked with +* IEEE80211_CHAN_INDOOR_ONLY. For such channels, initiating radiation is +* allowed iff the wireless core was notified that it operates in an indoor +* environment. +*/ +bool regulatory_ir_allowed (struct ieee80211_channel *chan); +/* * callbacks for asynchronous cfg80211 methods, notification * functions and BSS handling helpers
include/uapi/linux/nl80211.h +3 -0
@@ -2489,10 +2489,13 @@ enum nl80211_dfs_regions {* present has been registered with the wireless core that * has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a * supported feature. +* @NL80211_USER_REG_HINT_INDOOR: a user sent an hint indicating that the +* platform is operating in an indoor environment. */ enum nl80211_user_reg_hint_type {NL80211_USER_REG_HINT_USER =0 ,NL80211_USER_REG_HINT_CELL_BASE =1 , +NL80211_USER_REG_HINT_INDOOR =2 , };/**
net/wireless/nl80211.c +8 -10
@@ -4614,7 +4614,6 @@ static int parse_reg_rule(struct nlattr *tb[],static int nl80211_req_set_reg (struct sk_buff *skb,struct genl_info *info) { -int r;char *data =NULL ;enum nl80211_user_reg_hint_type user_reg_hint_type;
@@ -4627,11 +4626,6 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)if (unlikely (!rcu_access_pointer (cfg80211_regdomain)))return -EINPROGRESS ; -if (!info->attrs[NL80211_ATTR_REG_ALPHA2 ]) -return -EINVAL ; - - data =nla_data (info->attrs[NL80211_ATTR_REG_ALPHA2 ]); -if (info->attrs[NL80211_ATTR_USER_REG_HINT_TYPE ]) user_reg_hint_type =nla_get_u32 (info->attrs[NL80211_ATTR_USER_REG_HINT_TYPE ]);
@@ -4641,14 +4635,18 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)switch (user_reg_hint_type) {case NL80211_USER_REG_HINT_USER :case NL80211_USER_REG_HINT_CELL_BASE : -break ; +if (!info->attrs[NL80211_ATTR_REG_ALPHA2 ]) +return -EINVAL ; + + data =nla_data (info->attrs[NL80211_ATTR_REG_ALPHA2 ]); +return regulatory_hint_user (data, user_reg_hint_type); +case NL80211_USER_REG_HINT_INDOOR : +return regulatory_hint_indoor_user ();default :return -EINVAL ; } - r =regulatory_hint_user (data, user_reg_hint_type); - -return r; +return 0 ; } static int nl80211_get_mesh_config(struct sk_buff *skb,
net/wireless/reg.c +54 -3
105 lines not on this page · raw message
net/wireless/reg.h +1 -0
@@ -24,6 +24,7 @@ bool reg_supported_dfs_region(enum nl80211_dfs_regions dfs_region);int regulatory_hint_user (const char *alpha2,enum nl80211_user_reg_hint_type user_reg_hint_type); +int regulatory_hint_indoor_user (void );int reg_device_uevent (struct device *dev,struct kobj_uevent_env *env);void wiphy_regulatory_register (struct wiphy *wiphy);
Signature · 1 line
1.7.10.4
Re: [PATCH v2 4/6] cfg80211: Add an option to hint indoor operation
Quoted 6 lines · Ilan Peer
net/wireless/reg.c +0
-0@@ -110,6 +110,14 @@ const struct ieee80211_regdomain __rcu *cfg80211_regdomain;*/
net/wireless/reg.c const struct ieee80211_regdomain __rcu *cfg80211_regdomain; · line 120
Quoted 10 lines
net/wireless/reg.c +8
-0static int reg_num_devs_support_basehint; +/* +* State variable indicating if the platform on which the devices +* are attached is operating in an indoor environment. The state variable +* is relevant for all registered devices. +* Note: currently not protected by any synchronization primitive. +*/ +static bool reg_is_indoor; +
See if it makes sense to instead start building up a single reg data structure that has a slew of members. That's welcomed as a separate patch later...
net/wireless/reg.c reg_process_hint_user(struct regulatory_request *user_request) · line 1500
Quoted 9 lines
net/wireless/reg.c +5
-0@@ -1475,6 +1493,11 @@ reg_process_hint_user(struct regulatory_request *user_request)return treatment; } +if (reg_request_indoor (user_request) && treatment ==REG_REQ_OK ) { + reg_is_indoor = true; +return REG_REQ_OK ; + } +
Are you setting this to false when we disconnect (reset regulatory)? You should.
net/wireless/reg.c static void reg_process_hint(struct regulatory_request *reg_request) · line 1663
Quoted 7 lines
net/wireless/reg.c +0
-3@@ -1658,9 +1681,6 @@ static void reg_process_hint(struct regulatory_request *reg_request)struct wiphy *wiphy =NULL ;enum reg_request_treatment treatment; -if (WARN_ON (!reg_request->alpha2)) -return ; -
last_request checks for the alpha2 are abundent... you'd have to go review such use cases... One strategy might be to not treat this as a pure regulatory request but rather a hint of information, ie, not override last_request for this type of request.
net/wireless/reg.c int cfg80211_get_unii(int freq) · line 2526
Quoted 10 lines
net/wireless/reg.c +6
-0@@ -2482,6 +2518,19 @@ int cfg80211_get_unii(int freq)return -EINVAL ; } +bool regulatory_ir_allowed (struct ieee80211_channel *chan) +{ +#ifdef CONFIG_CFG80211_REG_SOFT_CONFIGURATIONS +if (reg_is_indoor && (chan->flags &IEEE80211_CHAN_INDOOR_ONLY )) +return true; +#endif /* CONFIG_CFG80211_REG_SOFT_CONFIGURATIONS */
config_enabled() would make this look sexier.
net/wireless/reg.c int __init regulatory_init(void) · line 2554
Quoted 5 lines
net/wireless/reg.c +1
-0@@ -2502,6 +2551,8 @@ int __init regulatory_init(void) user_alpha2[0 ] ='9' ; user_alpha2[1 ] ='7' ; + reg_is_indoor = false;
Yeah this is not needed as during init this will be false, but you do want to ensure you set this to flase during reset of regulatory.
Luis
RE: [PATCH v2 4/6] cfg80211: Add an option to hint indoor operation
Thanks again,
Ilan.
Quoted 4 lines
Quoted 4 lines
net/wireless/reg.c +4
-0+/* +* State variable indicating if the platform on which the devices +* are attached is operating in an indoor environment. The state +variable
Quoted 9 lines
net/wireless/reg.c const struct ieee80211_regdomain __rcu *cfg80211_regdomain; · line 120
Quoted 5 lines
+ * is relevant for all registered devices.
+ * Note: currently not protected by any synchronization primitive.
+ */net/wireless/reg.c +2
-0+static bool reg_is_indoor; +See if it makes sense to instead start building up a single reg data structure that has a slew of members. That's welcomed as a separate patch later...
Sure. Will have a look at this.
Quoted 7 lines
Review reg_process_hint_user(struct
Quoted 1 line
(quoted diff) +0
-0@@ -1475,6 +1493,11 @@ reg_process_hint_user(struct
regulatory_request*user_request)net/wireless/reg.c reg_process_hint_user(struct regulatory_request *user_request)
Quoted 4 lines
net/wireless/reg.c +1
-0return treatment; } + if (reg_request_indoor(user_request) && treatment ==
REG_REQ_OK) {
Quoted 8 lines
net/wireless/reg.c reg_process_hint_user(struct regulatory_request *user_request) · line 1500
Quoted 4 lines
net/wireless/reg.c +4
-0+ reg_is_indoor = true; +return REG_REQ_OK ; + } +Are you setting this to false when we disconnect (reset regulatory)? You should.
I wasn't. Fixing.
Quoted 5 lines
Review static void reg_process_hint(struct
Quoted 1 line
(quoted diff) +0
-0@@ -1658,9 +1681,6 @@ static void reg_process_hint(struct
regulatory_request*reg_request)Quoted 3 lines
net/wireless/reg.c +0
-0struct wiphy *wiphy =NULL ;enum reg_request_treatment treatment;
Quoted 8 lines
net/wireless/reg.c static void reg_process_hint(struct regulatory_request *reg_request) · line 1663
Quoted 3 lines
net/wireless/reg.c +0
-3-if (WARN_ON (!reg_request->alpha2)) -return ; -
last_requestchecks for the alpha2 are abundent... you'd have to go review such use cases... One strategy might be to not treat this as a pure regulatory request but rather a hint of information, ie, not overridelast_requestfor this type of request.
Actually, when the hint is processed, REG_REQ_ALREADY_SET is returned, so the request is immedialty freed, and the last request is not updated. I thought that this should suffice. Do you see any other issue with this?
Quoted 3 lines
net/wireless/reg.c int cfg80211_get_unii(int freq) · line 2526
Quoted 1 line
net/wireless/reg.c +1
-0+#endif /* CONFIG_CFG80211_REG_SOFT_CONFIGURATIONS */
config_enabled()would make this look sexier.
Fixing ..
Quoted 11 lines
net/wireless/reg.c int __init regulatory_init(void) · line 2554
Quoted 6 lines
net/wireless/reg.c +1
-0@@ -2502,6 +2551,8 @@ int __init regulatory_init(void) user_alpha2[0 ] ='9' ; user_alpha2[1 ] ='7' ; + reg_is_indoor = false;Yeah this is not needed as during init this will be false, but you do want to ensure you set this to flase during reset of regulatory.
Luis
Re: [PATCH v2 4/6] cfg80211: Add an option to hint indoor operation
Quoted 1 line · Ilan
Actually, when the hint is processed,
REG_REQ_ALREADY_SETis returned, so the request is immedialty freed, and the last request is not updated. I thought that this should suffice. Do you see any other issue with this?
Yeah that seems hackish -- please add another enum entry and document it to allow further hints of similar kind to be added.
Luis
PATCH v2 5/6 cfg80211: Enable GO operation on indoor channels
In reply to Ilan Peer--- net/wireless/chan.c | 5 +++++ 1 file changed, 5 insertions(+)
net/wireless/chan.c +5 -0
@@ -611,6 +611,8 @@ EXPORT_SYMBOL(cfg80211_chandef_usable);* IEEE80211_CHAN_GO_CONCURRENT and there is an additional station interface * associated to an AP on the same channel or on the same UNII band * (assuming that the AP is an authorized master). +* In addition allow the GO to operate on a channel on which indoor operation is +* allowed, iff we are currently operating in an indoor environment. */ static bool cfg80211_go_permissive_chan (struct cfg80211_registered_device *rdev,struct ieee80211_channel *chan)
@@ -619,6 +621,9 @@ static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev,ASSERT_RTNL (); +if (regulatory_ir_allowed (chan)) +return true; +if (!(chan->flags &IEEE80211_CHAN_GO_CONCURRENT ))return false;
Signature · 1 line
1.7.10.4
PATCH v2 6/6 mac80211: Enable initiating radiation on indoor channels
In reply to Ilan PeerAllow active scanning and frame injection on channels marked with IEEE80211_CHAN_NO_IR iff the channel is also marked with IEEE80211_CHAN_INDOOR_ONLY and the wireless core thinks that it operates in an indoor environment.
--- net/mac80211/scan.c | 8 +++----- net/mac80211/tx.c | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-)
net/mac80211/scan.c +3 -5
@@ -525,8 +525,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,/* We need to ensure power level is at max for scanning. */ ieee80211_hw_config (local,0 ); -if ((req->channels[0 ]->flags & -IEEE80211_CHAN_NO_IR ) || +if (!regulatory_ir_allowed (req->channels[0 ]) || !local->scan_req->n_ssids) { next_delay =IEEE80211_PASSIVE_CHANNEL_TIME ; }else {
@@ -572,7 +571,7 @@ ieee80211_scan_get_channel_time(struct ieee80211_channel *chan)* TODO: channel switching also consumes quite some time, * add that delay as well to get a better estimation */ -if (chan->flags &IEEE80211_CHAN_NO_IR ) +if (!regulatory_ir_allowed (chan))return IEEE80211_PASSIVE_CHANNEL_TIME ;return IEEE80211_PROBE_DELAY +IEEE80211_CHANNEL_TIME ; }
@@ -696,8 +695,7 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,* * In any case, it is not necessary for a passive scan. */ -if (chan->flags &IEEE80211_CHAN_NO_IR || - !local->scan_req->n_ssids) { +if (!regulatory_ir_allowed (chan) || !local->scan_req->n_ssids) { *next_delay =IEEE80211_PASSIVE_CHANNEL_TIME ; local->next_scan_state =SCAN_DECISION ;return ;
net/mac80211/tx.c +1 -1
@@ -1727,7 +1727,7 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,* radar detection by itself. We can do that later by adding a * monitor flag interfaces used for AP support. */ -if ((chan->flags & (IEEE80211_CHAN_NO_IR |IEEE80211_CHAN_RADAR ))) +if (!regulatory_ir_allowed (chan) || chan->flags &IEEE80211_CHAN_RADAR ) goto fail_rcu;ieee80211_xmit (sdata, skb, chan->band);
Signature · 1 line
1.7.10.4
Re: [PATCH v2 6/6] mac80211: Enable initiating radiation on indoor channels
net/mac80211/scan.c static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata, · line 528
Quoted 1 line · Ilan Peer
net/mac80211/scan.c +1
-0+ if (!regulatory_ir_allowed(req->channels[0]) ||
Please keep in mind that the feature flag on the wiphy would be used in your regulatory_ir_allowed() routine.
Luis
Quoted 3 lines · Ilan Peer
Hi Luis,
I'm resending this patch set. Any chance you could review it?
Looks good but needs a bit of work. In particular the biggest concern I have is the last_request thing, and the feature flag on the wiphy. Other than that, tons of cleanup and one last
requirement: please document this on the wireless wiki on the regulatory page, once accepted.
http://wireless.kernel.org/en/developers/Regulatory/processing_rules
Luis
Quoted 10 lines
Looks good but needs a bit of work. In particular the biggest concern I have is the
last_requestthing, and the feature flag on the wiphy. Other than that, tons of cleanup and one last
requirement: please document this on the wireless wiki on the regulatory page, once accepted.http://wireless.kernel.org/en/developers/Regulatory/processing_rules
Sure :)