diff options
author | Abhijeet Kolekar <abhijeet.kolekar@intel.com> | 2008-11-20 13:20:31 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-25 16:13:08 -0500 |
commit | 3dd3b79aeadc6f6abc5cc78724d7df3dfcc1bd0b (patch) | |
tree | 831eabe86c67c079f1cae81338530e43429009e5 /net | |
parent | e91af0af8677198346d5d29f09ab39bb3b0e3faf (diff) |
mac80211 : Fix setting ad-hoc mode and non-ibss channel
Patch fixes the kernel trace when user tries to set
ad-hoc mode on non IBSS channel.
e.g iwconfig wlan0 chan 36 mode ad-hoc
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/wext.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index 742f811ca416..ab4ddba874be 100644 --- a/net/mac80211/wext.c +++ b/net/mac80211/wext.c | |||
@@ -271,6 +271,7 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev, | |||
271 | __u32 *mode, char *extra) | 271 | __u32 *mode, char *extra) |
272 | { | 272 | { |
273 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 273 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
274 | struct ieee80211_local *local = sdata->local; | ||
274 | int type; | 275 | int type; |
275 | 276 | ||
276 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) | 277 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) |
@@ -281,6 +282,13 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev, | |||
281 | type = NL80211_IFTYPE_STATION; | 282 | type = NL80211_IFTYPE_STATION; |
282 | break; | 283 | break; |
283 | case IW_MODE_ADHOC: | 284 | case IW_MODE_ADHOC: |
285 | /* Setting ad-hoc mode on non ibss channel is not | ||
286 | * supported. | ||
287 | */ | ||
288 | if (local->oper_channel && | ||
289 | (local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS)) | ||
290 | return -EOPNOTSUPP; | ||
291 | |||
284 | type = NL80211_IFTYPE_ADHOC; | 292 | type = NL80211_IFTYPE_ADHOC; |
285 | break; | 293 | break; |
286 | case IW_MODE_REPEAT: | 294 | case IW_MODE_REPEAT: |