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
248 */248 */
249 if ((nvm_flags & NVM_CHANNEL_GO_CONCURRENT) &&249 if ((nvm_flags & NVM_CHANNEL_GO_CONCURRENT) &&
250 (flags & IEEE80211_CHAN_NO_IR))250 (flags & IEEE80211_CHAN_NO_IR))
251 flags |= IEEE80211_CHAN_GO_CONCURRENT;251 flags |= IEEE80211_CHAN_IR_CONCURRENT;
252 252
253 return flags;253 return flags;
254}254}
include/net/cfg80211.h+2−2
@@ -111,7 +111,7 @@ enum ieee80211_band { · 110 unmodified lines
111 * This may be due to the driver or due to regulatory bandwidth111 * This may be due to the driver or due to regulatory bandwidth
112 * restrictions.112 * restrictions.
113 * @IEEE80211_CHAN_INDOOR_ONLY: see %NL80211_FREQUENCY_ATTR_INDOOR_ONLY113 * @IEEE80211_CHAN_INDOOR_ONLY: see %NL80211_FREQUENCY_ATTR_INDOOR_ONLY
114 * @IEEE80211_CHAN_GO_CONCURRENT: see %NL80211_FREQUENCY_ATTR_GO_CONCURRENT114 * @IEEE80211_CHAN_IR_CONCURRENT: see %NL80211_FREQUENCY_ATTR_IR_CONCURRENT
115 * @IEEE80211_CHAN_NO_20MHZ: 20 MHz bandwidth is not permitted115 * @IEEE80211_CHAN_NO_20MHZ: 20 MHz bandwidth is not permitted
116 * on this channel.116 * on this channel.
117 * @IEEE80211_CHAN_NO_10MHZ: 10 MHz bandwidth is not permitted117 * @IEEE80211_CHAN_NO_10MHZ: 10 MHz bandwidth is not permitted
@@ -129,7 +129,7 @@ enum ieee80211_channel_flags { · 11 unmodified lines
129 IEEE80211_CHAN_NO_80MHZ = 1<<7,129 IEEE80211_CHAN_NO_80MHZ = 1<<7,
130 IEEE80211_CHAN_NO_160MHZ = 1<<8,130 IEEE80211_CHAN_NO_160MHZ = 1<<8,
131 IEEE80211_CHAN_INDOOR_ONLY = 1<<9,131 IEEE80211_CHAN_INDOOR_ONLY = 1<<9,
132 IEEE80211_CHAN_GO_CONCURRENT = 1<<10,132 IEEE80211_CHAN_IR_CONCURRENT = 1<<10,
133 IEEE80211_CHAN_NO_20MHZ = 1<<11,133 IEEE80211_CHAN_NO_20MHZ = 1<<11,
134 IEEE80211_CHAN_NO_10MHZ = 1<<12,134 IEEE80211_CHAN_NO_10MHZ = 1<<12,
135};135};
include/uapi/linux/nl80211.h+16−12
@@ -2620,16 +2620,17 @@ enum nl80211_band_attr { · 2619 unmodified lines
2620 * an indoor surroundings, i.e., it is connected to AC power (and not2620 * an indoor surroundings, i.e., it is connected to AC power (and not
2621 * through portable DC inverters) or is under the control of a master2621 * through portable DC inverters) or is under the control of a master
2622 * that is acting as an AP and is connected to AC power.2622 * that is acting as an AP and is connected to AC power.
2623 * @NL80211_FREQUENCY_ATTR_GO_CONCURRENT: GO operation is allowed on this2623 * @NL80211_FREQUENCY_ATTR_IR_CONCURRENT: IR operation is allowed on this
2624 * channel if it's connected concurrently to a BSS on the same channel on2624 * channel if it's connected concurrently to a BSS on the same channel on
2625 * the 2 GHz band or to a channel in the same UNII band (on the 5 GHz2625 * 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 a2626 * band), and IEEE80211_CHAN_RADAR is not set. Instantiating a GO or TDLS
2627 * channel that has the GO_CONCURRENT attribute set can be done when there2627 * off-channel on a channel that has the IR_CONCURRENT attribute set can be
2628 * is a clear assessment that the device is operating under the guidance of2628 * done when there is a clear assessment that the device is operating under
2629 * an authorized master, i.e., setting up a GO while the device is also2629 * the guidance of an authorized master, i.e., setting up a GO or TDLS
2630 * connected to an AP with DFS and radar detection on the UNII band (it is2630 * off-channel while the device is also connected to an AP with DFS and
2631 * up to user-space, i.e., wpa_supplicant to perform the required2631 * radar detection on the UNII band (it is up to user-space, i.e.,
2632 * verifications)2632 * wpa_supplicant to perform the required verifications). Using this
2633 * attribute for IR is disallowed for master interfaces (IBSS, AP).
2633 * @NL80211_FREQUENCY_ATTR_NO_20MHZ: 20 MHz operation is not allowed2634 * @NL80211_FREQUENCY_ATTR_NO_20MHZ: 20 MHz operation is not allowed
2634 * on this channel in current regulatory domain.2635 * on this channel in current regulatory domain.
2635 * @NL80211_FREQUENCY_ATTR_NO_10MHZ: 10 MHz operation is not allowed2636 * @NL80211_FREQUENCY_ATTR_NO_10MHZ: 10 MHz operation is not allowed
@@ -2641,7 +2642,7 @@ enum nl80211_band_attr { · 5 unmodified lines
2641 * See https://apps.fcc.gov/eas/comments/GetPublishedDocument.html?id=327&tn=5281222642 * See https://apps.fcc.gov/eas/comments/GetPublishedDocument.html?id=327&tn=528122
2642 * for more information on the FCC description of the relaxations allowed2643 * for more information on the FCC description of the relaxations allowed
2643 * by NL80211_FREQUENCY_ATTR_INDOOR_ONLY and2644 * by NL80211_FREQUENCY_ATTR_INDOOR_ONLY and
2644 * NL80211_FREQUENCY_ATTR_GO_CONCURRENT.2645 * NL80211_FREQUENCY_ATTR_IR_CONCURRENT.
2645 */2646 */
2646enum nl80211_frequency_attr {2647enum nl80211_frequency_attr {
2647 __NL80211_FREQUENCY_ATTR_INVALID,2648 __NL80211_FREQUENCY_ATTR_INVALID,
@@ -2659,7 +2660,7 @@ enum nl80211_frequency_attr { · 11 unmodified lines
2659 NL80211_FREQUENCY_ATTR_NO_160MHZ,2660 NL80211_FREQUENCY_ATTR_NO_160MHZ,
2660 NL80211_FREQUENCY_ATTR_DFS_CAC_TIME,2661 NL80211_FREQUENCY_ATTR_DFS_CAC_TIME,
2661 NL80211_FREQUENCY_ATTR_INDOOR_ONLY,2662 NL80211_FREQUENCY_ATTR_INDOOR_ONLY,
2662 NL80211_FREQUENCY_ATTR_GO_CONCURRENT,2663 NL80211_FREQUENCY_ATTR_IR_CONCURRENT,
2663 NL80211_FREQUENCY_ATTR_NO_20MHZ,2664 NL80211_FREQUENCY_ATTR_NO_20MHZ,
2664 NL80211_FREQUENCY_ATTR_NO_10MHZ,2665 NL80211_FREQUENCY_ATTR_NO_10MHZ,
2665 2666
@@ -2672,6 +2673,8 @@ enum nl80211_frequency_attr { · 6 unmodified lines
2672#define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR2673#define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR
2673#define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR2674#define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR
2674#define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR2675#define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR
2676#define NL80211_FREQUENCY_ATTR_GO_CONCURRENT \
2677 NL80211_FREQUENCY_ATTR_IR_CONCURRENT
2675 2678
2676/**2679/**
2677 * enum nl80211_bitrate_attr - bitrate attributes2680 * enum nl80211_bitrate_attr - bitrate attributes
@@ -2830,7 +2833,7 @@ enum nl80211_sched_scan_match_attr { · 152 unmodified lines
2830 * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated2833 * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated
2831 * base on contiguous rules and wider channels will be allowed to cross2834 * base on contiguous rules and wider channels will be allowed to cross
2832 * multiple contiguous/overlapping frequency ranges.2835 * multiple contiguous/overlapping frequency ranges.
2833 * @NL80211_RRF_GO_CONCURRENT: See &NL80211_FREQUENCY_ATTR_GO_CONCURRENT2836 * @NL80211_RRF_IR_CONCURRENT: See &NL80211_FREQUENCY_ATTR_IR_CONCURRENT
2834 * @NL80211_RRF_NO_HT40MINUS: channels can't be used in HT40- operation2837 * @NL80211_RRF_NO_HT40MINUS: channels can't be used in HT40- operation
2835 * @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation2838 * @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation
2836 * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed2839 * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed
@@ -2847,7 +2850,7 @@ enum nl80211_reg_rule_flags { · 10 unmodified lines
2847 NL80211_RRF_NO_IR = 1<<7,2850 NL80211_RRF_NO_IR = 1<<7,
2848 __NL80211_RRF_NO_IBSS = 1<<8,2851 __NL80211_RRF_NO_IBSS = 1<<8,
2849 NL80211_RRF_AUTO_BW = 1<<11,2852 NL80211_RRF_AUTO_BW = 1<<11,
2850 NL80211_RRF_GO_CONCURRENT = 1<<12,2853 NL80211_RRF_IR_CONCURRENT = 1<<12,
2851 NL80211_RRF_NO_HT40MINUS = 1<<13,2854 NL80211_RRF_NO_HT40MINUS = 1<<13,
2852 NL80211_RRF_NO_HT40PLUS = 1<<14,2855 NL80211_RRF_NO_HT40PLUS = 1<<14,
2853 NL80211_RRF_NO_80MHZ = 1<<15,2856 NL80211_RRF_NO_80MHZ = 1<<15,
@@ -2859,6 +2862,7 @@ enum nl80211_reg_rule_flags { · 5 unmodified lines
2859#define NL80211_RRF_NO_IR NL80211_RRF_NO_IR2862#define NL80211_RRF_NO_IR NL80211_RRF_NO_IR
2860#define NL80211_RRF_NO_HT40 (NL80211_RRF_NO_HT40MINUS |\2863#define NL80211_RRF_NO_HT40 (NL80211_RRF_NO_HT40MINUS |\
2861 NL80211_RRF_NO_HT40PLUS)2864 NL80211_RRF_NO_HT40PLUS)
2865#define NL80211_RRF_GO_CONCURRENT NL80211_RRF_IR_CONCURRENT
2862 2866
2863/* For backport compatibility with older userspace */2867/* For backport compatibility with older userspace */
2864#define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)2868#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
698EXPORT_SYMBOL(cfg80211_chandef_usable);698EXPORT_SYMBOL(cfg80211_chandef_usable);
699 699
700/*700/*
701 * For GO only, check if the channel can be used under permissive conditions701 * Check if the channel can be used under permissive conditions mandated by
702 * mandated by the some regulatory bodies, i.e., the channel is marked with702 * some regulatory bodies, i.e., the channel is marked with
703 * IEEE80211_CHAN_GO_CONCURRENT and there is an additional station interface703 * IEEE80211_CHAN_IR_CONCURRENT and there is an additional station interface
704 * associated to an AP on the same channel or on the same UNII band704 * associated to an AP on the same channel or on the same UNII band
705 * (assuming that the AP is an authorized master).705 * (assuming that the AP is an authorized master).
706 * In addition allow the GO to operate on a channel on which indoor operation is706 * In addition allow operation on a channel on which indoor operation is
707 * allowed, iff we are currently operating in an indoor environment.707 * allowed, iff we are currently operating in an indoor environment.
708 */708 */
709static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev,709static bool cfg80211_ir_permissive_chan(struct wiphy *wiphy,
710 enum nl80211_iftype iftype,
710 struct ieee80211_channel *chan)711 struct ieee80211_channel *chan)
711{712{
712 struct wireless_dev *wdev;713 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);
714 715
715 ASSERT_RTNL();716 ASSERT_RTNL();
716 717
@@ -718,16 +719,22 @@ static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev, · 1 unmodified line
718 !(wiphy->regulatory_flags & REGULATORY_ENABLE_RELAX_NO_IR))719 !(wiphy->regulatory_flags & REGULATORY_ENABLE_RELAX_NO_IR))
719 return false;720 return false;
720 721
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
721 if (regulatory_indoor_allowed() &&728 if (regulatory_indoor_allowed() &&
722 (chan->flags & IEEE80211_CHAN_INDOOR_ONLY))729 (chan->flags & IEEE80211_CHAN_INDOOR_ONLY))
723 return true;730 return true;
724 731
725 if (!(chan->flags & IEEE80211_CHAN_GO_CONCURRENT))732 if (!(chan->flags & IEEE80211_CHAN_IR_CONCURRENT))
726 return false;733 return false;
727 734
728 /*735 /*
729 * Generally, it is possible to rely on another device/driver to allow736 * Generally, it is possible to rely on another device/driver to allow
730 * the GO concurrent relaxation, however, since the device can further737 * the IR concurrent relaxation, however, since the device can further
731 * enforce the relaxation (by doing a similar verifications as this),738 * enforce the relaxation (by doing a similar verifications as this),
732 * and thus fail the GO instantiation, consider only the interfaces of739 * and thus fail the GO instantiation, consider only the interfaces of
733 * the current registered device.740 * the current registered device.
@@ -748,7 +755,8 @@ static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev, · 14 unmodified lines
748 * GO_CONCURRENT is disconnected now. But then we must make sure755 * GO_CONCURRENT is disconnected now. But then we must make sure
749 * we're not outdoor on an indoor-only channel.756 * we're not outdoor on an indoor-only channel.
750 */757 */
751 if (wdev->iftype == NL80211_IFTYPE_P2P_GO &&758 if (iftype == NL80211_IFTYPE_P2P_GO &&
759 wdev->iftype == NL80211_IFTYPE_P2P_GO &&
752 wdev->beacon_interval &&760 wdev->beacon_interval &&
753 !(chan->flags & IEEE80211_CHAN_INDOOR_ONLY))761 !(chan->flags & IEEE80211_CHAN_INDOOR_ONLY))
754 other_chan = wdev->chandef.chan;762 other_chan = wdev->chandef.chan;
@@ -793,7 +801,6 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy, · 38 unmodified lines
793 struct cfg80211_chan_def *chandef,801 struct cfg80211_chan_def *chandef,
794 enum nl80211_iftype iftype)802 enum nl80211_iftype iftype)
795{803{
796 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
797 bool res;804 bool res;
798 u32 prohibited_flags = IEEE80211_CHAN_DISABLED |805 u32 prohibited_flags = IEEE80211_CHAN_DISABLED |
799 IEEE80211_CHAN_RADAR;806 IEEE80211_CHAN_RADAR;
@@ -801,13 +808,12 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy, · 1 unmodified line
801 trace_cfg80211_reg_can_beacon(wiphy, chandef, iftype);808 trace_cfg80211_reg_can_beacon(wiphy, chandef, iftype);
802 809
803 /*810 /*
804 * Under certain conditions suggested by the some regulatory bodies811 * Under certain conditions suggested by some regulatory bodies a
805 * a GO can operate on channels marked with IEEE80211_NO_IR812 * GO/STA can IR on channels marked with IEEE80211_NO_IR. Set this flag
806 * so set this flag only if such relaxations are not enabled and813 * only if such relaxations are not enabled and the conditions are not
807 * the conditions are not met.814 * met.
808 */815 */
809 if (iftype != NL80211_IFTYPE_P2P_GO ||816 if (!cfg80211_ir_permissive_chan(wiphy, iftype, chandef->chan))
810 !cfg80211_go_permissive_chan(rdev, chandef->chan))
811 prohibited_flags |= IEEE80211_CHAN_NO_IR;817 prohibited_flags |= IEEE80211_CHAN_NO_IR;
812 818
813 if (cfg80211_chandef_dfs_required(wiphy, chandef, iftype) > 0 &&819 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
639 if ((chan->flags & IEEE80211_CHAN_INDOOR_ONLY) &&639 if ((chan->flags & IEEE80211_CHAN_INDOOR_ONLY) &&
640 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_INDOOR_ONLY))640 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_INDOOR_ONLY))
641 goto nla_put_failure;641 goto nla_put_failure;
642 if ((chan->flags & IEEE80211_CHAN_GO_CONCURRENT) &&642 if ((chan->flags & IEEE80211_CHAN_IR_CONCURRENT) &&
643 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_GO_CONCURRENT))643 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_IR_CONCURRENT))
644 goto nla_put_failure;644 goto nla_put_failure;
645 if ((chan->flags & IEEE80211_CHAN_NO_20MHZ) &&645 if ((chan->flags & IEEE80211_CHAN_NO_20MHZ) &&
646 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_20MHZ))646 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
989 channel_flags |= IEEE80211_CHAN_NO_OFDM;989 channel_flags |= IEEE80211_CHAN_NO_OFDM;
990 if (rd_flags & NL80211_RRF_NO_OUTDOOR)990 if (rd_flags & NL80211_RRF_NO_OUTDOOR)
991 channel_flags |= IEEE80211_CHAN_INDOOR_ONLY;991 channel_flags |= IEEE80211_CHAN_INDOOR_ONLY;
992 if (rd_flags & NL80211_RRF_GO_CONCURRENT)992 if (rd_flags & NL80211_RRF_IR_CONCURRENT)
993 channel_flags |= IEEE80211_CHAN_GO_CONCURRENT;993 channel_flags |= IEEE80211_CHAN_IR_CONCURRENT;
994 if (rd_flags & NL80211_RRF_NO_HT40MINUS)994 if (rd_flags & NL80211_RRF_NO_HT40MINUS)
995 channel_flags |= IEEE80211_CHAN_NO_HT40MINUS;995 channel_flags |= IEEE80211_CHAN_NO_HT40MINUS;
996 if (rd_flags & NL80211_RRF_NO_HT40PLUS)996 if (rd_flags & NL80211_RRF_NO_HT40PLUS)