History

cfg80211: change GO_CONCURRENT to IR_CONCURRENT for STA

The GO_CONCURRENT regulatory definition can be extended to station interfaces requesting to IR as part of TDLS off-channel operations. Rename the GO_CONCURRENT flag to IR_CONCURRENT and allow the added use-case. Change internal users of GO_CONCURRENT to use the new definition.

Arik Nemtsov committed 11 years ago

Commit 06f207f1 parent 8aca9b26 files · +45 −35Browse files

Unified · Split

6 files
  1. drivers/net/wireless/iwlwifi/iwl-nvm-parse.c +1 −1
  2. include/net/cfg80211.h +2 −2
  3. include/uapi/linux/nl80211.h +16 −12
  4. net/wireless/chan.c +22 −16
  5. net/wireless/nl80211.c +2 −2
  6. net/wireless/reg.c +2 −2
drivers/net/wireless/iwlwifi/iwl-nvm-parse.c+1−1
@@ -248,7 +248,7 @@ static u32 iwl_get_channel_flags(u8 ch_num, int ch_idx, bool is_5ghz, · 247 unmodified lines
248248 */
249249 if ((nvm_flags & NVM_CHANNEL_GO_CONCURRENT) &&
250250 (flags & IEEE80211_CHAN_NO_IR))
251− flags |= IEEE80211_CHAN_GO_CONCURRENT;
251+ flags |= IEEE80211_CHAN_IR_CONCURRENT;
252252
253253 return flags;
254254 }
include/net/cfg80211.h+2−2
@@ -111,7 +111,7 @@ enum ieee80211_band { · 110 unmodified lines
111111 * This may be due to the driver or due to regulatory bandwidth
112112 * restrictions.
113113 * @IEEE80211_CHAN_INDOOR_ONLY: see %NL80211_FREQUENCY_ATTR_INDOOR_ONLY
114− * @IEEE80211_CHAN_GO_CONCURRENT: see %NL80211_FREQUENCY_ATTR_GO_CONCURRENT
114+ * @IEEE80211_CHAN_IR_CONCURRENT: see %NL80211_FREQUENCY_ATTR_IR_CONCURRENT
115115 * @IEEE80211_CHAN_NO_20MHZ: 20 MHz bandwidth is not permitted
116116 * on this channel.
117117 * @IEEE80211_CHAN_NO_10MHZ: 10 MHz bandwidth is not permitted
@@ -129,7 +129,7 @@ enum ieee80211_channel_flags { · 11 unmodified lines
129129 IEEE80211_CHAN_NO_80MHZ = 1<<7,
130130 IEEE80211_CHAN_NO_160MHZ = 1<<8,
131131 IEEE80211_CHAN_INDOOR_ONLY = 1<<9,
132− IEEE80211_CHAN_GO_CONCURRENT = 1<<10,
132+ IEEE80211_CHAN_IR_CONCURRENT = 1<<10,
133133 IEEE80211_CHAN_NO_20MHZ = 1<<11,
134134 IEEE80211_CHAN_NO_10MHZ = 1<<12,
135135 };
include/uapi/linux/nl80211.h+16−12
@@ -2620,16 +2620,17 @@ enum nl80211_band_attr { · 2619 unmodified lines
26202620 * an indoor surroundings, i.e., it is connected to AC power (and not
26212621 * through portable DC inverters) or is under the control of a master
26222622 * that is acting as an AP and is connected to AC power.
2623− * @NL80211_FREQUENCY_ATTR_GO_CONCURRENT: GO operation is allowed on this
2623+ * @NL80211_FREQUENCY_ATTR_IR_CONCURRENT: IR operation is allowed on this
26242624 * channel if it's connected concurrently to a BSS on the same channel on
26252625 * the 2 GHz band or to a channel in the same UNII band (on the 5 GHz
2626− * band), and IEEE80211_CHAN_RADAR is not set. Instantiating a GO on a
2627− * channel that has the GO_CONCURRENT attribute set can be done when there
2628− * is a clear assessment that the device is operating under the guidance of
2629− * an authorized master, i.e., setting up a GO while the device is also
2630− * connected to an AP with DFS and radar detection on the UNII band (it is
2631− * up to user-space, i.e., wpa_supplicant to perform the required
2632− * verifications)
2626+ * band), and IEEE80211_CHAN_RADAR is not set. Instantiating a GO or TDLS
2627+ * off-channel on a channel that has the IR_CONCURRENT attribute set can be
2628+ * done when there is a clear assessment that the device is operating under
2629+ * the guidance of an authorized master, i.e., setting up a GO or TDLS
2630+ * off-channel while the device is also connected to an AP with DFS and
2631+ * radar detection on the UNII band (it is up to user-space, i.e.,
2632+ * wpa_supplicant to perform the required verifications). Using this
2633+ * attribute for IR is disallowed for master interfaces (IBSS, AP).
26332634 * @NL80211_FREQUENCY_ATTR_NO_20MHZ: 20 MHz operation is not allowed
26342635 * on this channel in current regulatory domain.
26352636 * @NL80211_FREQUENCY_ATTR_NO_10MHZ: 10 MHz operation is not allowed
@@ -2641,7 +2642,7 @@ enum nl80211_band_attr { · 5 unmodified lines
26412642 * See https://apps.fcc.gov/eas/comments/GetPublishedDocument.html?id=327&tn=528122
26422643 * for more information on the FCC description of the relaxations allowed
26432644 * by NL80211_FREQUENCY_ATTR_INDOOR_ONLY and
2644− * NL80211_FREQUENCY_ATTR_GO_CONCURRENT.
2645+ * NL80211_FREQUENCY_ATTR_IR_CONCURRENT.
26452646 */
26462647 enum nl80211_frequency_attr {
26472648 __NL80211_FREQUENCY_ATTR_INVALID,
@@ -2659,7 +2660,7 @@ enum nl80211_frequency_attr { · 11 unmodified lines
26592660 NL80211_FREQUENCY_ATTR_NO_160MHZ,
26602661 NL80211_FREQUENCY_ATTR_DFS_CAC_TIME,
26612662 NL80211_FREQUENCY_ATTR_INDOOR_ONLY,
2662− NL80211_FREQUENCY_ATTR_GO_CONCURRENT,
2663+ NL80211_FREQUENCY_ATTR_IR_CONCURRENT,
26632664 NL80211_FREQUENCY_ATTR_NO_20MHZ,
26642665 NL80211_FREQUENCY_ATTR_NO_10MHZ,
26652666
@@ -2672,6 +2673,8 @@ enum nl80211_frequency_attr { · 6 unmodified lines
26722673 #define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR
26732674 #define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR
26742675 #define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR
2676+#define NL80211_FREQUENCY_ATTR_GO_CONCURRENT \
2677+ NL80211_FREQUENCY_ATTR_IR_CONCURRENT
26752678
26762679 /**
26772680 * enum nl80211_bitrate_attr - bitrate attributes
@@ -2830,7 +2833,7 @@ enum nl80211_sched_scan_match_attr { · 152 unmodified lines
28302833 * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated
28312834 * base on contiguous rules and wider channels will be allowed to cross
28322835 * multiple contiguous/overlapping frequency ranges.
2833− * @NL80211_RRF_GO_CONCURRENT: See &NL80211_FREQUENCY_ATTR_GO_CONCURRENT
2836+ * @NL80211_RRF_IR_CONCURRENT: See &NL80211_FREQUENCY_ATTR_IR_CONCURRENT
28342837 * @NL80211_RRF_NO_HT40MINUS: channels can't be used in HT40- operation
28352838 * @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation
28362839 * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed
@@ -2847,7 +2850,7 @@ enum nl80211_reg_rule_flags { · 10 unmodified lines
28472850 NL80211_RRF_NO_IR = 1<<7,
28482851 __NL80211_RRF_NO_IBSS = 1<<8,
28492852 NL80211_RRF_AUTO_BW = 1<<11,
2850− NL80211_RRF_GO_CONCURRENT = 1<<12,
2853+ NL80211_RRF_IR_CONCURRENT = 1<<12,
28512854 NL80211_RRF_NO_HT40MINUS = 1<<13,
28522855 NL80211_RRF_NO_HT40PLUS = 1<<14,
28532856 NL80211_RRF_NO_80MHZ = 1<<15,
@@ -2859,6 +2862,7 @@ enum nl80211_reg_rule_flags { · 5 unmodified lines
28592862 #define NL80211_RRF_NO_IR NL80211_RRF_NO_IR
28602863 #define NL80211_RRF_NO_HT40 (NL80211_RRF_NO_HT40MINUS |\
28612864 NL80211_RRF_NO_HT40PLUS)
2865+#define NL80211_RRF_GO_CONCURRENT NL80211_RRF_IR_CONCURRENT
28622866
28632867 /* For backport compatibility with older userspace */
28642868 #define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)
net/wireless/chan.c+22−16
@@ -698,19 +698,20 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy, · 697 unmodified lines
698698 EXPORT_SYMBOL(cfg80211_chandef_usable);
699699
700700 /*
701− * For GO only, check if the channel can be used under permissive conditions
702− * mandated by the some regulatory bodies, i.e., the channel is marked with
703− * IEEE80211_CHAN_GO_CONCURRENT and there is an additional station interface
701+ * Check if the channel can be used under permissive conditions mandated by
702+ * some regulatory bodies, i.e., the channel is marked with
703+ * IEEE80211_CHAN_IR_CONCURRENT and there is an additional station interface
704704 * associated to an AP on the same channel or on the same UNII band
705705 * (assuming that the AP is an authorized master).
706− * In addition allow the GO to operate on a channel on which indoor operation is
706+ * In addition allow operation on a channel on which indoor operation is
707707 * allowed, iff we are currently operating in an indoor environment.
708708 */
709−static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev,
709+static bool cfg80211_ir_permissive_chan(struct wiphy *wiphy,
710+ enum nl80211_iftype iftype,
710711 struct ieee80211_channel *chan)
711712 {
712713 struct wireless_dev *wdev;
713− struct wiphy *wiphy = wiphy_idx_to_wiphy(rdev->wiphy_idx);
714+ struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
714715
715716 ASSERT_RTNL();
716717
@@ -718,16 +719,22 @@ static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev, · 1 unmodified line
718719 !(wiphy->regulatory_flags & REGULATORY_ENABLE_RELAX_NO_IR))
719720 return false;
720721
722+ /* only valid for GO and TDLS off-channel (station/p2p-CL) */
723+ if (iftype != NL80211_IFTYPE_P2P_GO &&
724+ iftype != NL80211_IFTYPE_STATION &&
725+ iftype != NL80211_IFTYPE_P2P_CLIENT)
726+ return false;
727+
721728 if (regulatory_indoor_allowed() &&
722729 (chan->flags & IEEE80211_CHAN_INDOOR_ONLY))
723730 return true;
724731
725− if (!(chan->flags & IEEE80211_CHAN_GO_CONCURRENT))
732+ if (!(chan->flags & IEEE80211_CHAN_IR_CONCURRENT))
726733 return false;
727734
728735 /*
729736 * Generally, it is possible to rely on another device/driver to allow
730− * the GO concurrent relaxation, however, since the device can further
737+ * the IR concurrent relaxation, however, since the device can further
731738 * enforce the relaxation (by doing a similar verifications as this),
732739 * and thus fail the GO instantiation, consider only the interfaces of
733740 * the current registered device.
@@ -748,7 +755,8 @@ static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev, · 14 unmodified lines
748755 * GO_CONCURRENT is disconnected now. But then we must make sure
749756 * we're not outdoor on an indoor-only channel.
750757 */
751− if (wdev->iftype == NL80211_IFTYPE_P2P_GO &&
758+ if (iftype == NL80211_IFTYPE_P2P_GO &&
759+ wdev->iftype == NL80211_IFTYPE_P2P_GO &&
752760 wdev->beacon_interval &&
753761 !(chan->flags & IEEE80211_CHAN_INDOOR_ONLY))
754762 other_chan = wdev->chandef.chan;
@@ -793,7 +801,6 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy, · 38 unmodified lines
793801 struct cfg80211_chan_def *chandef,
794802 enum nl80211_iftype iftype)
795803 {
796− struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
797804 bool res;
798805 u32 prohibited_flags = IEEE80211_CHAN_DISABLED |
799806 IEEE80211_CHAN_RADAR;
@@ -801,13 +808,12 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy, · 1 unmodified line
801808 trace_cfg80211_reg_can_beacon(wiphy, chandef, iftype);
802809
803810 /*
804− * Under certain conditions suggested by the some regulatory bodies
805− * a GO can operate on channels marked with IEEE80211_NO_IR
806− * so set this flag only if such relaxations are not enabled and
807− * the conditions are not met.
811+ * Under certain conditions suggested by some regulatory bodies a
812+ * GO/STA can IR on channels marked with IEEE80211_NO_IR. Set this flag
813+ * only if such relaxations are not enabled and the conditions are not
814+ * met.
808815 */
809− if (iftype != NL80211_IFTYPE_P2P_GO ||
810− !cfg80211_go_permissive_chan(rdev, chandef->chan))
816+ if (!cfg80211_ir_permissive_chan(wiphy, iftype, chandef->chan))
811817 prohibited_flags |= IEEE80211_CHAN_NO_IR;
812818
813819 if (cfg80211_chandef_dfs_required(wiphy, chandef, iftype) > 0 &&
net/wireless/nl80211.c+2−2
@@ -639,8 +639,8 @@ static int nl80211_msg_put_channel(struct sk_buff *msg, · 638 unmodified lines
639639 if ((chan->flags & IEEE80211_CHAN_INDOOR_ONLY) &&
640640 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_INDOOR_ONLY))
641641 goto nla_put_failure;
642− if ((chan->flags & IEEE80211_CHAN_GO_CONCURRENT) &&
643− nla_put_flag(msg, NL80211_FREQUENCY_ATTR_GO_CONCURRENT))
642+ if ((chan->flags & IEEE80211_CHAN_IR_CONCURRENT) &&
643+ nla_put_flag(msg, NL80211_FREQUENCY_ATTR_IR_CONCURRENT))
644644 goto nla_put_failure;
645645 if ((chan->flags & IEEE80211_CHAN_NO_20MHZ) &&
646646 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_20MHZ))
net/wireless/reg.c+2−2
@@ -989,8 +989,8 @@ static u32 map_regdom_flags(u32 rd_flags) · 988 unmodified lines
989989 channel_flags |= IEEE80211_CHAN_NO_OFDM;
990990 if (rd_flags & NL80211_RRF_NO_OUTDOOR)
991991 channel_flags |= IEEE80211_CHAN_INDOOR_ONLY;
992− if (rd_flags & NL80211_RRF_GO_CONCURRENT)
993− channel_flags |= IEEE80211_CHAN_GO_CONCURRENT;
992+ if (rd_flags & NL80211_RRF_IR_CONCURRENT)
993+ channel_flags |= IEEE80211_CHAN_IR_CONCURRENT;
994994 if (rd_flags & NL80211_RRF_NO_HT40MINUS)
995995 channel_flags |= IEEE80211_CHAN_NO_HT40MINUS;
996996 if (rd_flags & NL80211_RRF_NO_HT40PLUS)