Skip to contentSkip to conversation

mac80211: allow mode change if IBSS is not allowed

PATCH In review Pavel Roskin 3 participants 4 messages Dec 22, 2008 – Dec 23, 2008 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: allow mode change if IBSS is not allowed

Changing mode on an interface is not allowed if IBSS is disabled for the current channel. That restriction should only apply when switching to the ad-hoc mode, as it was prior to db17d8c4.

---
 net/mac80211/iface.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/mac80211/iface.c +2 -1
index 5abbc3f..b907482 100644
@@ -699,7 +699,8 @@ int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
 		return 0;
 
 	/* Setting ad-hoc mode on non-IBSS channel is not supported. */
-	if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS)
+	if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS &&
+	    type == NL80211_IFTYPE_ADHOC)
 		return -EOPNOTSUPP;
 
 	/*
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Pavel Roskin

Changing mode on an interface is not allowed if IBSS is disabled for the current channel. That restriction should only apply when switching to the ad-hoc mode, as it was prior to db17d8c4.

Thanks Pavel.

Quoted 23 lines
---
 net/mac80211/iface.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/mac80211/iface.c +2 -2
index 5abbc3f..b907482 100644
@@ -699,7 +699,8 @@ int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
 		return 0;
 
 	/* Setting ad-hoc mode on non-IBSS channel is not supported. */
-	if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS)
+	if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS &&
+	    type == NL80211_IFTYPE_ADHOC)
 		return -EOPNOTSUPP;
 
 	/*
--

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

#2 lore raw
Quoted 10 lines · Johannes Berg
Quoted 5 lines · Pavel Roskin

Changing mode on an interface is not allowed if IBSS is disabled for the current channel. That restriction should only apply when switching to the ad-hoc mode, as it was prior to db17d8c4.

Thanks Pavel.

Doesn't this need to account for the other beaconing modes?

John

Signature · 2 lines
John W. Linville		Linux should be at the core
[email protected]			of your literate lifestyle.
maintainer
#3 lore raw
Quoted 6 lines · John W. Linville
Quoted 5 lines · Johannes Berg
Quoted 4 lines · Pavel Roskin

Changing mode on an interface is not allowed if IBSS is disabled for the current channel. That restriction should only apply when switching to the ad-hoc mode, as it was prior to db17d8c4.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Thanks Pavel.

Doesn't this need to account for the other beaconing modes?

Well, for now this fixes the regression I introduced, and how the other modes should be handled we haven't really defined yet. But yeah, it might make some sense for mesh too...

johannes