diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2013-09-17 08:20:13 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-10-09 12:40:16 -0400 |
commit | f38dd58ccca0d612e62509f75e99952dcf316cb2 (patch) | |
tree | 77cc62c8ef1ab07932f95cf70433e04cded1d13c | |
parent | a754055a1296fcbe6f32de3a5eaca6efb2fd1865 (diff) |
cfg80211: don't add p2p device while in RFKILL
Since P2P device doesn't have a netdev associated to it,
we cannot prevent the user to start it when in RFKILL.
So refuse to even add it when in RFKILL.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/wireless/core.c | 2 | ||||
-rw-r--r-- | net/wireless/core.h | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index fe8d4f2be49b..aff959e5a1b3 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -958,8 +958,6 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, | |||
958 | case NETDEV_PRE_UP: | 958 | case NETDEV_PRE_UP: |
959 | if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype))) | 959 | if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype))) |
960 | return notifier_from_errno(-EOPNOTSUPP); | 960 | return notifier_from_errno(-EOPNOTSUPP); |
961 | if (rfkill_blocked(rdev->rfkill)) | ||
962 | return notifier_from_errno(-ERFKILL); | ||
963 | ret = cfg80211_can_add_interface(rdev, wdev->iftype); | 961 | ret = cfg80211_can_add_interface(rdev, wdev->iftype); |
964 | if (ret) | 962 | if (ret) |
965 | return notifier_from_errno(ret); | 963 | return notifier_from_errno(ret); |
diff --git a/net/wireless/core.h b/net/wireless/core.h index 9ad43c619c54..3159e9c284c5 100644 --- a/net/wireless/core.h +++ b/net/wireless/core.h | |||
@@ -411,6 +411,9 @@ static inline int | |||
411 | cfg80211_can_add_interface(struct cfg80211_registered_device *rdev, | 411 | cfg80211_can_add_interface(struct cfg80211_registered_device *rdev, |
412 | enum nl80211_iftype iftype) | 412 | enum nl80211_iftype iftype) |
413 | { | 413 | { |
414 | if (rfkill_blocked(rdev->rfkill)) | ||
415 | return -ERFKILL; | ||
416 | |||
414 | return cfg80211_can_change_interface(rdev, NULL, iftype); | 417 | return cfg80211_can_change_interface(rdev, NULL, iftype); |
415 | } | 418 | } |
416 | 419 | ||