All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] nl80211: don't require netdev UP for wdev
@ 2012-04-26 22:28 Thomas Pedersen
  2012-05-09  9:15 ` Johannes Berg
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Pedersen @ 2012-04-26 22:28 UTC (permalink / raw)
  To: linux-wireless; +Cc: devel, Thomas Pedersen, johannes, linville

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@cozybit.com>

---
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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-05-10 19:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-26 22:28 [RFC] nl80211: don't require netdev UP for wdev Thomas Pedersen
2012-05-09  9:15 ` Johannes Berg
2012-05-09  9:41   ` Michal Kazior
2012-05-09  9:50     ` Johannes Berg
2012-05-09 10:16       ` Michal Kazior
2012-05-09 11:40         ` Johannes Berg
2012-05-10 18:06   ` Thomas Pedersen
2012-05-10 18:12     ` Johannes Berg
2012-05-10 19:47       ` Thomas Pedersen
2012-05-10 19:52         ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.