summaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorDavid S. Miller2008-11-27 08:48:40 +0100
committerDavid S. Miller2008-11-27 08:48:40 +0100
commit5b9ab2ec04ec1e1e53939768805612ac191d7ba2 (patch)
tree22d29905c148d2d743b3eccb585fbe60fb91e25a /net/mac80211
parentcxgb3: Update FW loading path. (diff)
parentnetfilter: ctnetlink: fix GFP_KERNEL allocation under spinlock (diff)
downloadkernel-qcow2-linux-5b9ab2ec04ec1e1e53939768805612ac191d7ba2.tar.gz
kernel-qcow2-linux-5b9ab2ec04ec1e1e53939768805612ac191d7ba2.tar.xz
kernel-qcow2-linux-5b9ab2ec04ec1e1e53939768805612ac191d7ba2.zip
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/hp-plus.c drivers/net/wireless/ath5k/base.c drivers/net/wireless/ath9k/recv.c net/wireless/reg.c
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/wext.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index 63f36e9d1af8..b3ce28d35611 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -271,6 +271,7 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev,
__u32 *mode, char *extra)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ struct ieee80211_local *local = sdata->local;
int type;
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
@@ -281,6 +282,13 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev,
type = NL80211_IFTYPE_STATION;
break;
case IW_MODE_ADHOC:
+ /* Setting ad-hoc mode on non ibss channel is not
+ * supported.
+ */
+ if (local->oper_channel &&
+ (local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS))
+ return -EOPNOTSUPP;
+
type = NL80211_IFTYPE_ADHOC;
break;
case IW_MODE_REPEAT: