Search Linux Wireless

[RFC] nl80211: don't require netdev UP for wdev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It seems as long as we have a netdev, a wdev is available as well.
Remove the restriction that netdev must be up before a wdev can be
obtained in nl80211, or changing channels in cfg80211.

Signed-off-by: Thomas Pedersen <thomas@xxxxxxxxxxx>

---
Hi list,

This was encountered while implementing an interface for setting
BSSBasicRateSet in mesh. The wdev->channel is needed in nl80211.c for
rate verification, but prior to this patch not available.  This doesn't
seem right since the following sequence of commands would fail:

iw wlan0 set type mp
iw wlan0 set channel n
ip link set wlan0 up
iw wlan0 mesh join meshid basic-rate 1,2

Also, 'iw set channel' is met with an -EBUSY if doing this after the
link is up for fixed channel modes (mesh) anyway.

Comments? Any idea why this was required initially?

Thanks,
Thomas

 net/wireless/chan.c    |    6 +-----
 net/wireless/nl80211.c |    3 +--
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index 2fcfe09..2ae6019 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -88,13 +88,9 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
 	if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR)
 		wdev = NULL;
 
-	if (wdev) {
+	if (wdev)
 		ASSERT_WDEV_LOCK(wdev);
 
-		if (!netif_running(wdev->netdev))
-			return -ENETDOWN;
-	}
-
 	if (!rdev->ops->set_channel)
 		return -EOPNOTSUPP;
 
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 140c1d2..29e5703 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1257,8 +1257,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 		result = 0;
 
 		mutex_lock(&rdev->mtx);
-	} else if (netif_running(netdev) &&
-		   nl80211_can_set_dev_channel(netdev->ieee80211_ptr))
+	} else if (nl80211_can_set_dev_channel(netdev->ieee80211_ptr))
 		wdev = netdev->ieee80211_ptr;
 	else
 		wdev = NULL;
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux