diff options
author | David S. Miller <davem@davemloft.net> | 2010-06-17 17:19:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-17 17:19:06 -0400 |
commit | bb9c03d8a6893517737b16fdbeb54be3c73b3023 (patch) | |
tree | 35fa0d1defaaf94641963a49126d7bb475ffa4c6 /net/wireless | |
parent | 4de57826810fd2cfeb2ab5c7d003ff9116b8f7ee (diff) | |
parent | abf52f86aa0a49a7377350cafa8f218c4cd227e7 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/mlme.c | 5 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 55 |
2 files changed, 56 insertions, 4 deletions
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index f69ae19f497f..9f95354f859f 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c | |||
@@ -846,8 +846,9 @@ int cfg80211_mlme_action(struct cfg80211_registered_device *rdev, | |||
846 | if (!wdev->current_bss || | 846 | if (!wdev->current_bss || |
847 | memcmp(wdev->current_bss->pub.bssid, mgmt->bssid, | 847 | memcmp(wdev->current_bss->pub.bssid, mgmt->bssid, |
848 | ETH_ALEN) != 0 || | 848 | ETH_ALEN) != 0 || |
849 | memcmp(wdev->current_bss->pub.bssid, mgmt->da, | 849 | (wdev->iftype == NL80211_IFTYPE_STATION && |
850 | ETH_ALEN) != 0) | 850 | memcmp(wdev->current_bss->pub.bssid, mgmt->da, |
851 | ETH_ALEN) != 0)) | ||
851 | return -ENOTCONN; | 852 | return -ENOTCONN; |
852 | } | 853 | } |
853 | 854 | ||
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 3a7b8a2f2d5a..6b41d15c4a05 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3955,6 +3955,55 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info) | |||
3955 | } | 3955 | } |
3956 | } | 3956 | } |
3957 | 3957 | ||
3958 | if (info->attrs[NL80211_ATTR_BSS_BASIC_RATES]) { | ||
3959 | u8 *rates = | ||
3960 | nla_data(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]); | ||
3961 | int n_rates = | ||
3962 | nla_len(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]); | ||
3963 | struct ieee80211_supported_band *sband = | ||
3964 | wiphy->bands[ibss.channel->band]; | ||
3965 | int i, j; | ||
3966 | |||
3967 | if (n_rates == 0) { | ||
3968 | err = -EINVAL; | ||
3969 | goto out; | ||
3970 | } | ||
3971 | |||
3972 | for (i = 0; i < n_rates; i++) { | ||
3973 | int rate = (rates[i] & 0x7f) * 5; | ||
3974 | bool found = false; | ||
3975 | |||
3976 | for (j = 0; j < sband->n_bitrates; j++) { | ||
3977 | if (sband->bitrates[j].bitrate == rate) { | ||
3978 | found = true; | ||
3979 | ibss.basic_rates |= BIT(j); | ||
3980 | break; | ||
3981 | } | ||
3982 | } | ||
3983 | if (!found) { | ||
3984 | err = -EINVAL; | ||
3985 | goto out; | ||
3986 | } | ||
3987 | } | ||
3988 | } else { | ||
3989 | /* | ||
3990 | * If no rates were explicitly configured, | ||
3991 | * use the mandatory rate set for 11b or | ||
3992 | * 11a for maximum compatibility. | ||
3993 | */ | ||
3994 | struct ieee80211_supported_band *sband = | ||
3995 | wiphy->bands[ibss.channel->band]; | ||
3996 | int j; | ||
3997 | u32 flag = ibss.channel->band == IEEE80211_BAND_5GHZ ? | ||
3998 | IEEE80211_RATE_MANDATORY_A : | ||
3999 | IEEE80211_RATE_MANDATORY_B; | ||
4000 | |||
4001 | for (j = 0; j < sband->n_bitrates; j++) { | ||
4002 | if (sband->bitrates[j].flags & flag) | ||
4003 | ibss.basic_rates |= BIT(j); | ||
4004 | } | ||
4005 | } | ||
4006 | |||
3958 | err = cfg80211_join_ibss(rdev, dev, &ibss, connkeys); | 4007 | err = cfg80211_join_ibss(rdev, dev, &ibss, connkeys); |
3959 | 4008 | ||
3960 | out: | 4009 | out: |
@@ -4653,7 +4702,8 @@ static int nl80211_register_action(struct sk_buff *skb, struct genl_info *info) | |||
4653 | if (err) | 4702 | if (err) |
4654 | goto unlock_rtnl; | 4703 | goto unlock_rtnl; |
4655 | 4704 | ||
4656 | if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION) { | 4705 | if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION && |
4706 | dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC) { | ||
4657 | err = -EOPNOTSUPP; | 4707 | err = -EOPNOTSUPP; |
4658 | goto out; | 4708 | goto out; |
4659 | } | 4709 | } |
@@ -4703,7 +4753,8 @@ static int nl80211_action(struct sk_buff *skb, struct genl_info *info) | |||
4703 | goto out; | 4753 | goto out; |
4704 | } | 4754 | } |
4705 | 4755 | ||
4706 | if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION) { | 4756 | if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION && |
4757 | dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC) { | ||
4707 | err = -EOPNOTSUPP; | 4758 | err = -EOPNOTSUPP; |
4708 | goto out; | 4759 | goto out; |
4709 | } | 4760 | } |