diff options
author | Paul Mackerras <paulus@samba.org> | 2008-06-29 20:16:50 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-06-29 20:16:50 -0400 |
commit | e9a4b6a3f6592862a67837e80aad3f50468857a6 (patch) | |
tree | 087420cf91ac922c7e99757c4490a605ec7b10f2 /net/mac80211 | |
parent | 441dbb500b4344a8e3125e5aabab4f9dbf72514f (diff) | |
parent | 1702b52092e9a6d05398d3f9581ddc050ef00d06 (diff) |
Merge branch 'linux-2.6'
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 2 | ||||
-rw-r--r-- | net/mac80211/main.c | 1 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 18 | ||||
-rw-r--r-- | net/mac80211/tx.c | 13 | ||||
-rw-r--r-- | net/mac80211/wext.c | 18 | ||||
-rw-r--r-- | net/mac80211/wme.c | 2 |
6 files changed, 36 insertions, 18 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index c7314bf4bec..006486b2672 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -899,7 +899,7 @@ extern const struct iw_handler_def ieee80211_iw_handler_def; | |||
899 | 899 | ||
900 | 900 | ||
901 | /* ieee80211_ioctl.c */ | 901 | /* ieee80211_ioctl.c */ |
902 | int ieee80211_set_freq(struct ieee80211_local *local, int freq); | 902 | int ieee80211_set_freq(struct net_device *dev, int freq); |
903 | /* ieee80211_sta.c */ | 903 | /* ieee80211_sta.c */ |
904 | void ieee80211_sta_timer(unsigned long data); | 904 | void ieee80211_sta_timer(unsigned long data); |
905 | void ieee80211_sta_work(struct work_struct *work); | 905 | void ieee80211_sta_work(struct work_struct *work); |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 5c876450b14..98c0b5e56ec 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -511,6 +511,7 @@ static int ieee80211_stop(struct net_device *dev) | |||
511 | case IEEE80211_IF_TYPE_STA: | 511 | case IEEE80211_IF_TYPE_STA: |
512 | case IEEE80211_IF_TYPE_IBSS: | 512 | case IEEE80211_IF_TYPE_IBSS: |
513 | sdata->u.sta.state = IEEE80211_DISABLED; | 513 | sdata->u.sta.state = IEEE80211_DISABLED; |
514 | memset(sdata->u.sta.bssid, 0, ETH_ALEN); | ||
514 | del_timer_sync(&sdata->u.sta.timer); | 515 | del_timer_sync(&sdata->u.sta.timer); |
515 | /* | 516 | /* |
516 | * When we get here, the interface is marked down. | 517 | * When we get here, the interface is marked down. |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 841278f1df8..4d2b582dd05 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -44,7 +44,7 @@ | |||
44 | #define IEEE80211_RETRY_AUTH_INTERVAL (1 * HZ) | 44 | #define IEEE80211_RETRY_AUTH_INTERVAL (1 * HZ) |
45 | #define IEEE80211_SCAN_INTERVAL (2 * HZ) | 45 | #define IEEE80211_SCAN_INTERVAL (2 * HZ) |
46 | #define IEEE80211_SCAN_INTERVAL_SLOW (15 * HZ) | 46 | #define IEEE80211_SCAN_INTERVAL_SLOW (15 * HZ) |
47 | #define IEEE80211_IBSS_JOIN_TIMEOUT (20 * HZ) | 47 | #define IEEE80211_IBSS_JOIN_TIMEOUT (7 * HZ) |
48 | 48 | ||
49 | #define IEEE80211_PROBE_DELAY (HZ / 33) | 49 | #define IEEE80211_PROBE_DELAY (HZ / 33) |
50 | #define IEEE80211_CHANNEL_TIME (HZ / 33) | 50 | #define IEEE80211_CHANNEL_TIME (HZ / 33) |
@@ -2336,6 +2336,7 @@ static int ieee80211_sta_join_ibss(struct net_device *dev, | |||
2336 | u8 *pos; | 2336 | u8 *pos; |
2337 | struct ieee80211_sub_if_data *sdata; | 2337 | struct ieee80211_sub_if_data *sdata; |
2338 | struct ieee80211_supported_band *sband; | 2338 | struct ieee80211_supported_band *sband; |
2339 | union iwreq_data wrqu; | ||
2339 | 2340 | ||
2340 | sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; | 2341 | sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; |
2341 | 2342 | ||
@@ -2358,13 +2359,10 @@ static int ieee80211_sta_join_ibss(struct net_device *dev, | |||
2358 | sdata->drop_unencrypted = bss->capability & | 2359 | sdata->drop_unencrypted = bss->capability & |
2359 | WLAN_CAPABILITY_PRIVACY ? 1 : 0; | 2360 | WLAN_CAPABILITY_PRIVACY ? 1 : 0; |
2360 | 2361 | ||
2361 | res = ieee80211_set_freq(local, bss->freq); | 2362 | res = ieee80211_set_freq(dev, bss->freq); |
2362 | 2363 | ||
2363 | if (local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS) { | 2364 | if (res) |
2364 | printk(KERN_DEBUG "%s: IBSS not allowed on frequency " | 2365 | return res; |
2365 | "%d MHz\n", dev->name, local->oper_channel->center_freq); | ||
2366 | return -1; | ||
2367 | } | ||
2368 | 2366 | ||
2369 | /* Set beacon template */ | 2367 | /* Set beacon template */ |
2370 | skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400); | 2368 | skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400); |
@@ -2479,6 +2477,10 @@ static int ieee80211_sta_join_ibss(struct net_device *dev, | |||
2479 | ifsta->state = IEEE80211_IBSS_JOINED; | 2477 | ifsta->state = IEEE80211_IBSS_JOINED; |
2480 | mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL); | 2478 | mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL); |
2481 | 2479 | ||
2480 | memset(&wrqu, 0, sizeof(wrqu)); | ||
2481 | memcpy(wrqu.ap_addr.sa_data, bss->bssid, ETH_ALEN); | ||
2482 | wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL); | ||
2483 | |||
2482 | return res; | 2484 | return res; |
2483 | } | 2485 | } |
2484 | 2486 | ||
@@ -3486,7 +3488,7 @@ static int ieee80211_sta_config_auth(struct net_device *dev, | |||
3486 | spin_unlock_bh(&local->sta_bss_lock); | 3488 | spin_unlock_bh(&local->sta_bss_lock); |
3487 | 3489 | ||
3488 | if (selected) { | 3490 | if (selected) { |
3489 | ieee80211_set_freq(local, selected->freq); | 3491 | ieee80211_set_freq(dev, selected->freq); |
3490 | if (!(ifsta->flags & IEEE80211_STA_SSID_SET)) | 3492 | if (!(ifsta->flags & IEEE80211_STA_SSID_SET)) |
3491 | ieee80211_sta_set_ssid(dev, selected->ssid, | 3493 | ieee80211_sta_set_ssid(dev, selected->ssid, |
3492 | selected->ssid_len); | 3494 | selected->ssid_len); |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 1d7dd54aace..c80d5899f27 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1132,7 +1132,7 @@ static int ieee80211_tx(struct net_device *dev, struct sk_buff *skb, | |||
1132 | ieee80211_tx_handler *handler; | 1132 | ieee80211_tx_handler *handler; |
1133 | struct ieee80211_tx_data tx; | 1133 | struct ieee80211_tx_data tx; |
1134 | ieee80211_tx_result res = TX_DROP, res_prepare; | 1134 | ieee80211_tx_result res = TX_DROP, res_prepare; |
1135 | int ret, i; | 1135 | int ret, i, retries = 0; |
1136 | 1136 | ||
1137 | WARN_ON(__ieee80211_queue_pending(local, control->queue)); | 1137 | WARN_ON(__ieee80211_queue_pending(local, control->queue)); |
1138 | 1138 | ||
@@ -1216,6 +1216,13 @@ retry: | |||
1216 | if (!__ieee80211_queue_stopped(local, control->queue)) { | 1216 | if (!__ieee80211_queue_stopped(local, control->queue)) { |
1217 | clear_bit(IEEE80211_LINK_STATE_PENDING, | 1217 | clear_bit(IEEE80211_LINK_STATE_PENDING, |
1218 | &local->state[control->queue]); | 1218 | &local->state[control->queue]); |
1219 | retries++; | ||
1220 | /* | ||
1221 | * Driver bug, it's rejecting packets but | ||
1222 | * not stopping queues. | ||
1223 | */ | ||
1224 | if (WARN_ON_ONCE(retries > 5)) | ||
1225 | goto drop; | ||
1219 | goto retry; | 1226 | goto retry; |
1220 | } | 1227 | } |
1221 | memcpy(&store->control, control, | 1228 | memcpy(&store->control, control, |
@@ -1562,13 +1569,13 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1562 | * be cloned. This could happen, e.g., with Linux bridge code passing | 1569 | * be cloned. This could happen, e.g., with Linux bridge code passing |
1563 | * us broadcast frames. */ | 1570 | * us broadcast frames. */ |
1564 | 1571 | ||
1565 | if (head_need > 0 || skb_header_cloned(skb)) { | 1572 | if (head_need > 0 || skb_cloned(skb)) { |
1566 | #if 0 | 1573 | #if 0 |
1567 | printk(KERN_DEBUG "%s: need to reallocate buffer for %d bytes " | 1574 | printk(KERN_DEBUG "%s: need to reallocate buffer for %d bytes " |
1568 | "of headroom\n", dev->name, head_need); | 1575 | "of headroom\n", dev->name, head_need); |
1569 | #endif | 1576 | #endif |
1570 | 1577 | ||
1571 | if (skb_header_cloned(skb)) | 1578 | if (skb_cloned(skb)) |
1572 | I802_DEBUG_INC(local->tx_expand_skb_head_cloned); | 1579 | I802_DEBUG_INC(local->tx_expand_skb_head_cloned); |
1573 | else | 1580 | else |
1574 | I802_DEBUG_INC(local->tx_expand_skb_head); | 1581 | I802_DEBUG_INC(local->tx_expand_skb_head); |
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index 8311bb24f9f..6106cb79060 100644 --- a/net/mac80211/wext.c +++ b/net/mac80211/wext.c | |||
@@ -290,14 +290,22 @@ static int ieee80211_ioctl_giwmode(struct net_device *dev, | |||
290 | return 0; | 290 | return 0; |
291 | } | 291 | } |
292 | 292 | ||
293 | int ieee80211_set_freq(struct ieee80211_local *local, int freqMHz) | 293 | int ieee80211_set_freq(struct net_device *dev, int freqMHz) |
294 | { | 294 | { |
295 | int ret = -EINVAL; | 295 | int ret = -EINVAL; |
296 | struct ieee80211_channel *chan; | 296 | struct ieee80211_channel *chan; |
297 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | ||
298 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
297 | 299 | ||
298 | chan = ieee80211_get_channel(local->hw.wiphy, freqMHz); | 300 | chan = ieee80211_get_channel(local->hw.wiphy, freqMHz); |
299 | 301 | ||
300 | if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { | 302 | if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { |
303 | if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && | ||
304 | chan->flags & IEEE80211_CHAN_NO_IBSS) { | ||
305 | printk(KERN_DEBUG "%s: IBSS not allowed on frequency " | ||
306 | "%d MHz\n", dev->name, chan->center_freq); | ||
307 | return ret; | ||
308 | } | ||
301 | local->oper_channel = chan; | 309 | local->oper_channel = chan; |
302 | 310 | ||
303 | if (local->sta_sw_scanning || local->sta_hw_scanning) | 311 | if (local->sta_sw_scanning || local->sta_hw_scanning) |
@@ -315,7 +323,6 @@ static int ieee80211_ioctl_siwfreq(struct net_device *dev, | |||
315 | struct iw_request_info *info, | 323 | struct iw_request_info *info, |
316 | struct iw_freq *freq, char *extra) | 324 | struct iw_freq *freq, char *extra) |
317 | { | 325 | { |
318 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | ||
319 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 326 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
320 | 327 | ||
321 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA) | 328 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA) |
@@ -329,14 +336,14 @@ static int ieee80211_ioctl_siwfreq(struct net_device *dev, | |||
329 | IEEE80211_STA_AUTO_CHANNEL_SEL; | 336 | IEEE80211_STA_AUTO_CHANNEL_SEL; |
330 | return 0; | 337 | return 0; |
331 | } else | 338 | } else |
332 | return ieee80211_set_freq(local, | 339 | return ieee80211_set_freq(dev, |
333 | ieee80211_channel_to_frequency(freq->m)); | 340 | ieee80211_channel_to_frequency(freq->m)); |
334 | } else { | 341 | } else { |
335 | int i, div = 1000000; | 342 | int i, div = 1000000; |
336 | for (i = 0; i < freq->e; i++) | 343 | for (i = 0; i < freq->e; i++) |
337 | div /= 10; | 344 | div /= 10; |
338 | if (div > 0) | 345 | if (div > 0) |
339 | return ieee80211_set_freq(local, freq->m / div); | 346 | return ieee80211_set_freq(dev, freq->m / div); |
340 | else | 347 | else |
341 | return -EINVAL; | 348 | return -EINVAL; |
342 | } | 349 | } |
@@ -489,7 +496,8 @@ static int ieee80211_ioctl_giwap(struct net_device *dev, | |||
489 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 496 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
490 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA || | 497 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA || |
491 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | 498 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { |
492 | if (sdata->u.sta.state == IEEE80211_ASSOCIATED) { | 499 | if (sdata->u.sta.state == IEEE80211_ASSOCIATED || |
500 | sdata->u.sta.state == IEEE80211_IBSS_JOINED) { | ||
493 | ap_addr->sa_family = ARPHRD_ETHER; | 501 | ap_addr->sa_family = ARPHRD_ETHER; |
494 | memcpy(&ap_addr->sa_data, sdata->u.sta.bssid, ETH_ALEN); | 502 | memcpy(&ap_addr->sa_data, sdata->u.sta.bssid, ETH_ALEN); |
495 | return 0; | 503 | return 0; |
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index dc1598b8600..635b996c8c3 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c | |||
@@ -673,7 +673,7 @@ int ieee80211_ht_agg_queue_add(struct ieee80211_local *local, | |||
673 | #ifdef CONFIG_MAC80211_HT_DEBUG | 673 | #ifdef CONFIG_MAC80211_HT_DEBUG |
674 | if (net_ratelimit()) | 674 | if (net_ratelimit()) |
675 | printk(KERN_DEBUG "allocated aggregation queue" | 675 | printk(KERN_DEBUG "allocated aggregation queue" |
676 | " %d tid %d addr %s pool=0x%lX", | 676 | " %d tid %d addr %s pool=0x%lX\n", |
677 | i, tid, print_mac(mac, sta->addr), | 677 | i, tid, print_mac(mac, sta->addr), |
678 | q->qdisc_pool[0]); | 678 | q->qdisc_pool[0]); |
679 | #endif /* CONFIG_MAC80211_HT_DEBUG */ | 679 | #endif /* CONFIG_MAC80211_HT_DEBUG */ |