diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-13 17:50:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-13 17:50:18 -0500 |
commit | d89b218b801fd93ea95880f1c7fde348cbcc51c5 (patch) | |
tree | cd3c34e1811f9b2bc10ecfb957bf26cbd04c677e /net/mac80211 | |
parent | 80a186074e72e2cd61f6716d90cf32ce54981a56 (diff) | |
parent | bec68ff1637ca00bb1585a03a7be8a13380084de (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (108 commits)
bridge: ensure to unlock in error path in br_multicast_query().
drivers/net/tulip/eeprom.c: fix bogus "(null)" in tulip init messages
sky2: Avoid rtnl_unlock without rtnl_lock
ipv6: Send netlink notification when DAD fails
drivers/net/tg3.c: change the field used with the TG3_FLAG_10_100_ONLY constant
ipconfig: Handle devices which take some time to come up.
mac80211: Fix memory leak in ieee80211_if_write()
mac80211: Fix (dynamic) power save entry
ipw2200: use kmalloc for large local variables
ath5k: read eeprom IQ calibration values correctly for G mode
ath5k: fix I/Q calibration (for real)
ath5k: fix TSF reset
ath5k: use fixed antenna for tx descriptors
libipw: split ieee->networks into small pieces
mac80211: Fix sta_mtx unlocking on insert STA failure path
rt2x00: remove KSEG1ADDR define from rt2x00soc.h
net: add ColdFire support to the smc91x driver
asix: fix setting mac address for AX88772
ipv6 ip6_tunnel: eliminate unused recursion field from ip6_tnl{}.
net: Fix dev_mc_add()
...
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/debugfs_netdev.c | 10 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 32 | ||||
-rw-r--r-- | net/mac80211/rate.h | 5 | ||||
-rw-r--r-- | net/mac80211/sta_info.c | 1 |
4 files changed, 35 insertions, 13 deletions
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index 9affe2cd185f..b4ddb2f83914 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
@@ -48,20 +48,24 @@ static ssize_t ieee80211_if_write( | |||
48 | ssize_t (*write)(struct ieee80211_sub_if_data *, const char *, int)) | 48 | ssize_t (*write)(struct ieee80211_sub_if_data *, const char *, int)) |
49 | { | 49 | { |
50 | u8 *buf; | 50 | u8 *buf; |
51 | ssize_t ret = -ENODEV; | 51 | ssize_t ret; |
52 | 52 | ||
53 | buf = kzalloc(count, GFP_KERNEL); | 53 | buf = kmalloc(count, GFP_KERNEL); |
54 | if (!buf) | 54 | if (!buf) |
55 | return -ENOMEM; | 55 | return -ENOMEM; |
56 | 56 | ||
57 | ret = -EFAULT; | ||
57 | if (copy_from_user(buf, userbuf, count)) | 58 | if (copy_from_user(buf, userbuf, count)) |
58 | return -EFAULT; | 59 | goto freebuf; |
59 | 60 | ||
61 | ret = -ENODEV; | ||
60 | rtnl_lock(); | 62 | rtnl_lock(); |
61 | if (sdata->dev->reg_state == NETREG_REGISTERED) | 63 | if (sdata->dev->reg_state == NETREG_REGISTERED) |
62 | ret = (*write)(sdata, buf, count); | 64 | ret = (*write)(sdata, buf, count); |
63 | rtnl_unlock(); | 65 | rtnl_unlock(); |
64 | 66 | ||
67 | freebuf: | ||
68 | kfree(buf); | ||
65 | return ret; | 69 | return ret; |
66 | } | 70 | } |
67 | 71 | ||
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 41812a15eea0..be5f723d643a 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -177,7 +177,8 @@ static u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata, | |||
177 | sta = sta_info_get(sdata, bssid); | 177 | sta = sta_info_get(sdata, bssid); |
178 | if (sta) | 178 | if (sta) |
179 | rate_control_rate_update(local, sband, sta, | 179 | rate_control_rate_update(local, sband, sta, |
180 | IEEE80211_RC_HT_CHANGED); | 180 | IEEE80211_RC_HT_CHANGED, |
181 | local->oper_channel_type); | ||
181 | rcu_read_unlock(); | 182 | rcu_read_unlock(); |
182 | } | 183 | } |
183 | 184 | ||
@@ -435,10 +436,12 @@ static void ieee80211_enable_ps(struct ieee80211_local *local, | |||
435 | if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) | 436 | if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) |
436 | ieee80211_send_nullfunc(local, sdata, 1); | 437 | ieee80211_send_nullfunc(local, sdata, 1); |
437 | 438 | ||
438 | if (!(local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)) { | 439 | if ((local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) && |
439 | conf->flags |= IEEE80211_CONF_PS; | 440 | (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)) |
440 | ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); | 441 | return; |
441 | } | 442 | |
443 | conf->flags |= IEEE80211_CONF_PS; | ||
444 | ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); | ||
442 | } | 445 | } |
443 | } | 446 | } |
444 | 447 | ||
@@ -557,7 +560,8 @@ void ieee80211_dynamic_ps_enable_work(struct work_struct *work) | |||
557 | (!(ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED))) | 560 | (!(ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED))) |
558 | ieee80211_send_nullfunc(local, sdata, 1); | 561 | ieee80211_send_nullfunc(local, sdata, 1); |
559 | 562 | ||
560 | if (!(local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) || | 563 | if (!((local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) && |
564 | (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK)) || | ||
561 | (ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)) { | 565 | (ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)) { |
562 | ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED; | 566 | ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED; |
563 | local->hw.conf.flags |= IEEE80211_CONF_PS; | 567 | local->hw.conf.flags |= IEEE80211_CONF_PS; |
@@ -1893,8 +1897,20 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, | |||
1893 | 1897 | ||
1894 | mutex_lock(&ifmgd->mtx); | 1898 | mutex_lock(&ifmgd->mtx); |
1895 | if (ifmgd->associated) { | 1899 | if (ifmgd->associated) { |
1896 | mutex_unlock(&ifmgd->mtx); | 1900 | if (!req->prev_bssid || |
1897 | return -EALREADY; | 1901 | memcmp(req->prev_bssid, ifmgd->associated->bssid, |
1902 | ETH_ALEN)) { | ||
1903 | /* | ||
1904 | * We are already associated and the request was not a | ||
1905 | * reassociation request from the current BSS, so | ||
1906 | * reject it. | ||
1907 | */ | ||
1908 | mutex_unlock(&ifmgd->mtx); | ||
1909 | return -EALREADY; | ||
1910 | } | ||
1911 | |||
1912 | /* Trying to reassociate - clear previous association state */ | ||
1913 | ieee80211_set_disassoc(sdata); | ||
1898 | } | 1914 | } |
1899 | mutex_unlock(&ifmgd->mtx); | 1915 | mutex_unlock(&ifmgd->mtx); |
1900 | 1916 | ||
diff --git a/net/mac80211/rate.h b/net/mac80211/rate.h index b6108bca96d4..065a96190e32 100644 --- a/net/mac80211/rate.h +++ b/net/mac80211/rate.h | |||
@@ -66,7 +66,8 @@ static inline void rate_control_rate_init(struct sta_info *sta) | |||
66 | 66 | ||
67 | static inline void rate_control_rate_update(struct ieee80211_local *local, | 67 | static inline void rate_control_rate_update(struct ieee80211_local *local, |
68 | struct ieee80211_supported_band *sband, | 68 | struct ieee80211_supported_band *sband, |
69 | struct sta_info *sta, u32 changed) | 69 | struct sta_info *sta, u32 changed, |
70 | enum nl80211_channel_type oper_chan_type) | ||
70 | { | 71 | { |
71 | struct rate_control_ref *ref = local->rate_ctrl; | 72 | struct rate_control_ref *ref = local->rate_ctrl; |
72 | struct ieee80211_sta *ista = &sta->sta; | 73 | struct ieee80211_sta *ista = &sta->sta; |
@@ -74,7 +75,7 @@ static inline void rate_control_rate_update(struct ieee80211_local *local, | |||
74 | 75 | ||
75 | if (ref && ref->ops->rate_update) | 76 | if (ref && ref->ops->rate_update) |
76 | ref->ops->rate_update(ref->priv, sband, ista, | 77 | ref->ops->rate_update(ref->priv, sband, ista, |
77 | priv_sta, changed); | 78 | priv_sta, changed, oper_chan_type); |
78 | } | 79 | } |
79 | 80 | ||
80 | static inline void *rate_control_alloc_sta(struct rate_control_ref *ref, | 81 | static inline void *rate_control_alloc_sta(struct rate_control_ref *ref, |
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 211c475f73c6..56422d894351 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -434,6 +434,7 @@ int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU) | |||
434 | /* check if STA exists already */ | 434 | /* check if STA exists already */ |
435 | if (sta_info_get_bss(sdata, sta->sta.addr)) { | 435 | if (sta_info_get_bss(sdata, sta->sta.addr)) { |
436 | spin_unlock_irqrestore(&local->sta_lock, flags); | 436 | spin_unlock_irqrestore(&local->sta_lock, flags); |
437 | mutex_unlock(&local->sta_mtx); | ||
437 | rcu_read_lock(); | 438 | rcu_read_lock(); |
438 | err = -EEXIST; | 439 | err = -EEXIST; |
439 | goto out_free; | 440 | goto out_free; |