diff options
author | David S. Miller <davem@davemloft.net> | 2008-11-25 14:27:58 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-25 14:27:58 -0800 |
commit | d7713ccc7bec64fbe0e4e39f93b17dfec711db7f (patch) | |
tree | 586afddc7e21ecaa82fc9af369778e53de93fb4e /net | |
parent | 11c6dd2c723a9ff9bdd4ee11b2798a08abc94e98 (diff) | |
parent | 020cf6ba7a91ccc5db359f91e9abba175fd3a0aa (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/wext.c | 8 | ||||
-rw-r--r-- | net/wireless/reg.c | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index 742f811ca41..ab4ddba874b 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: diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 626dbb68849..eb3b1a9f9b1 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -343,9 +343,9 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, return 0; return -EALREADY; } - if (WARN_ON(!is_alpha2_set(alpha2) || !is_an_alpha2(alpha2)), + if (WARN(!is_alpha2_set(alpha2) || !is_an_alpha2(alpha2), "Invalid Country IE regulatory hint passed " - "to the wireless core\n") + "to the wireless core\n")) return -EINVAL; /* We ignore Country IE hints for now, as we haven't yet * added the dot11MultiDomainCapabilityEnabled flag |