aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/core.c
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@intel.com>2014-02-27 04:07:21 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-04-09 04:55:47 -0400
commitb6a550156bc08a472c9d2515631649e229fcfcef (patch)
treee47650bdbadff71e05f76c7b8e3a490347efffcd /net/wireless/core.c
parent71965c1d04b2b48ab7c56395bd1f996a56aaa592 (diff)
cfg80211/mac80211: move more combination checks to mac80211
Get rid of the cfg80211_can_add_interface() and cfg80211_can_change_interface() functions by moving that functionality to mac80211. With this patch all interface combination checks are now out of cfg80211 (except for the channel switch case which will be addressed in a future commit). Additionally, modify the ieee80211_check_combinations() function so that an undefined chandef can be passed, in order to use it before a channel is defined. Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r--net/wireless/core.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 5a63c3cbda2e..33d12e23771c 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -439,10 +439,7 @@ static int wiphy_verify_combinations(struct wiphy *wiphy)
439 for (j = 0; j < c->n_limits; j++) { 439 for (j = 0; j < c->n_limits; j++) {
440 u16 types = c->limits[j].types; 440 u16 types = c->limits[j].types;
441 441
442 /* 442 /* interface types shouldn't overlap */
443 * interface types shouldn't overlap, this is
444 * used in cfg80211_can_change_interface()
445 */
446 if (WARN_ON(types & all_iftypes)) 443 if (WARN_ON(types & all_iftypes))
447 return -EINVAL; 444 return -EINVAL;
448 all_iftypes |= types; 445 all_iftypes |= types;
@@ -840,7 +837,6 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
840 struct net_device *dev = netdev_notifier_info_to_dev(ptr); 837 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
841 struct wireless_dev *wdev = dev->ieee80211_ptr; 838 struct wireless_dev *wdev = dev->ieee80211_ptr;
842 struct cfg80211_registered_device *rdev; 839 struct cfg80211_registered_device *rdev;
843 int ret;
844 840
845 if (!wdev) 841 if (!wdev)
846 return NOTIFY_DONE; 842 return NOTIFY_DONE;
@@ -1003,9 +999,8 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
1003 case NETDEV_PRE_UP: 999 case NETDEV_PRE_UP:
1004 if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype))) 1000 if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
1005 return notifier_from_errno(-EOPNOTSUPP); 1001 return notifier_from_errno(-EOPNOTSUPP);
1006 ret = cfg80211_can_add_interface(rdev, wdev->iftype); 1002 if (rfkill_blocked(rdev->rfkill))
1007 if (ret) 1003 return notifier_from_errno(-ERFKILL);
1008 return notifier_from_errno(ret);
1009 break; 1004 break;
1010 } 1005 }
1011 1006