diff options
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/cfg.c | 4 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 2 | ||||
-rw-r--r-- | net/mac80211/key.c | 9 | ||||
-rw-r--r-- | net/mac80211/main.c | 3 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 45 | ||||
-rw-r--r-- | net/mac80211/rx.c | 4 | ||||
-rw-r--r-- | net/mac80211/tx.c | 13 | ||||
-rw-r--r-- | net/mac80211/util.c | 4 | ||||
-rw-r--r-- | net/mac80211/wext.c | 34 | ||||
-rw-r--r-- | net/mac80211/wme.c | 5 |
10 files changed, 82 insertions, 41 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 699d97b8de5e..a9fce4afdf21 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -672,7 +672,7 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, | |||
672 | if (params->vlan) { | 672 | if (params->vlan) { |
673 | sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); | 673 | sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); |
674 | 674 | ||
675 | if (sdata->vif.type != IEEE80211_IF_TYPE_VLAN || | 675 | if (sdata->vif.type != IEEE80211_IF_TYPE_VLAN && |
676 | sdata->vif.type != IEEE80211_IF_TYPE_AP) | 676 | sdata->vif.type != IEEE80211_IF_TYPE_AP) |
677 | return -EINVAL; | 677 | return -EINVAL; |
678 | } else | 678 | } else |
@@ -760,7 +760,7 @@ static int ieee80211_change_station(struct wiphy *wiphy, | |||
760 | if (params->vlan && params->vlan != sta->sdata->dev) { | 760 | if (params->vlan && params->vlan != sta->sdata->dev) { |
761 | vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); | 761 | vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); |
762 | 762 | ||
763 | if (vlansdata->vif.type != IEEE80211_IF_TYPE_VLAN || | 763 | if (vlansdata->vif.type != IEEE80211_IF_TYPE_VLAN && |
764 | vlansdata->vif.type != IEEE80211_IF_TYPE_AP) { | 764 | vlansdata->vif.type != IEEE80211_IF_TYPE_AP) { |
765 | rcu_read_unlock(); | 765 | rcu_read_unlock(); |
766 | return -EINVAL; | 766 | return -EINVAL; |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index c7314bf4bec2..006486b26726 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/key.c b/net/mac80211/key.c index 150d66dbda9d..220e83be3ef4 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c | |||
@@ -380,6 +380,15 @@ void ieee80211_key_free(struct ieee80211_key *key) | |||
380 | if (!key) | 380 | if (!key) |
381 | return; | 381 | return; |
382 | 382 | ||
383 | if (!key->sdata) { | ||
384 | /* The key has not been linked yet, simply free it | ||
385 | * and don't Oops */ | ||
386 | if (key->conf.alg == ALG_CCMP) | ||
387 | ieee80211_aes_key_free(key->u.ccmp.tfm); | ||
388 | kfree(key); | ||
389 | return; | ||
390 | } | ||
391 | |||
383 | spin_lock_irqsave(&key->sdata->local->key_lock, flags); | 392 | spin_lock_irqsave(&key->sdata->local->key_lock, flags); |
384 | __ieee80211_key_free(key); | 393 | __ieee80211_key_free(key); |
385 | spin_unlock_irqrestore(&key->sdata->local->key_lock, flags); | 394 | spin_unlock_irqrestore(&key->sdata->local->key_lock, flags); |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 915afadb0602..98c0b5e56ecc 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. |
@@ -1313,7 +1314,7 @@ static void ieee80211_handle_filtered_frame(struct ieee80211_local *local, | |||
1313 | /* | 1314 | /* |
1314 | * Clear the TX filter mask for this STA when sending the next | 1315 | * Clear the TX filter mask for this STA when sending the next |
1315 | * packet. If the STA went to power save mode, this will happen | 1316 | * packet. If the STA went to power save mode, this will happen |
1316 | * happen when it wakes up for the next time. | 1317 | * when it wakes up for the next time. |
1317 | */ | 1318 | */ |
1318 | sta->flags |= WLAN_STA_CLEAR_PS_FILT; | 1319 | sta->flags |= WLAN_STA_CLEAR_PS_FILT; |
1319 | 1320 | ||
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 7cfd12e0d1e2..4d2b582dd055 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) |
@@ -1325,7 +1325,7 @@ static void ieee80211_sta_process_addba_request(struct net_device *dev, | |||
1325 | 1325 | ||
1326 | /* prepare reordering buffer */ | 1326 | /* prepare reordering buffer */ |
1327 | tid_agg_rx->reorder_buf = | 1327 | tid_agg_rx->reorder_buf = |
1328 | kmalloc(buf_size * sizeof(struct sk_buf *), GFP_ATOMIC); | 1328 | kmalloc(buf_size * sizeof(struct sk_buff *), GFP_ATOMIC); |
1329 | if (!tid_agg_rx->reorder_buf) { | 1329 | if (!tid_agg_rx->reorder_buf) { |
1330 | if (net_ratelimit()) | 1330 | if (net_ratelimit()) |
1331 | printk(KERN_ERR "can not allocate reordering buffer " | 1331 | printk(KERN_ERR "can not allocate reordering buffer " |
@@ -1334,7 +1334,7 @@ static void ieee80211_sta_process_addba_request(struct net_device *dev, | |||
1334 | goto end; | 1334 | goto end; |
1335 | } | 1335 | } |
1336 | memset(tid_agg_rx->reorder_buf, 0, | 1336 | memset(tid_agg_rx->reorder_buf, 0, |
1337 | buf_size * sizeof(struct sk_buf *)); | 1337 | buf_size * sizeof(struct sk_buff *)); |
1338 | 1338 | ||
1339 | if (local->ops->ampdu_action) | 1339 | if (local->ops->ampdu_action) |
1340 | ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START, | 1340 | ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START, |
@@ -1614,7 +1614,7 @@ void sta_addba_resp_timer_expired(unsigned long data) | |||
1614 | * only one argument, and both sta_info and TID are needed, so init | 1614 | * only one argument, and both sta_info and TID are needed, so init |
1615 | * flow in sta_info_create gives the TID as data, while the timer_to_id | 1615 | * flow in sta_info_create gives the TID as data, while the timer_to_id |
1616 | * array gives the sta through container_of */ | 1616 | * array gives the sta through container_of */ |
1617 | u16 tid = *(int *)data; | 1617 | u16 tid = *(u8 *)data; |
1618 | struct sta_info *temp_sta = container_of((void *)data, | 1618 | struct sta_info *temp_sta = container_of((void *)data, |
1619 | struct sta_info, timer_to_tid[tid]); | 1619 | struct sta_info, timer_to_tid[tid]); |
1620 | 1620 | ||
@@ -1662,7 +1662,7 @@ timer_expired_exit: | |||
1662 | void sta_rx_agg_session_timer_expired(unsigned long data) | 1662 | void sta_rx_agg_session_timer_expired(unsigned long data) |
1663 | { | 1663 | { |
1664 | /* not an elegant detour, but there is no choice as the timer passes | 1664 | /* not an elegant detour, but there is no choice as the timer passes |
1665 | * only one argument, and verious sta_info are needed here, so init | 1665 | * only one argument, and various sta_info are needed here, so init |
1666 | * flow in sta_info_create gives the TID as data, while the timer_to_id | 1666 | * flow in sta_info_create gives the TID as data, while the timer_to_id |
1667 | * array gives the sta through container_of */ | 1667 | * array gives the sta through container_of */ |
1668 | u8 *ptid = (u8 *)data; | 1668 | u8 *ptid = (u8 *)data; |
@@ -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,7 +2477,9 @@ 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 | ||
2482 | ieee80211_rx_bss_put(dev, bss); | 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 | 2483 | ||
2484 | return res; | 2484 | return res; |
2485 | } | 2485 | } |
@@ -3488,7 +3488,7 @@ static int ieee80211_sta_config_auth(struct net_device *dev, | |||
3488 | spin_unlock_bh(&local->sta_bss_lock); | 3488 | spin_unlock_bh(&local->sta_bss_lock); |
3489 | 3489 | ||
3490 | if (selected) { | 3490 | if (selected) { |
3491 | ieee80211_set_freq(local, selected->freq); | 3491 | ieee80211_set_freq(dev, selected->freq); |
3492 | if (!(ifsta->flags & IEEE80211_STA_SSID_SET)) | 3492 | if (!(ifsta->flags & IEEE80211_STA_SSID_SET)) |
3493 | ieee80211_sta_set_ssid(dev, selected->ssid, | 3493 | ieee80211_sta_set_ssid(dev, selected->ssid, |
3494 | selected->ssid_len); | 3494 | selected->ssid_len); |
@@ -3523,6 +3523,7 @@ static int ieee80211_sta_create_ibss(struct net_device *dev, | |||
3523 | struct ieee80211_supported_band *sband; | 3523 | struct ieee80211_supported_band *sband; |
3524 | u8 bssid[ETH_ALEN], *pos; | 3524 | u8 bssid[ETH_ALEN], *pos; |
3525 | int i; | 3525 | int i; |
3526 | int ret; | ||
3526 | DECLARE_MAC_BUF(mac); | 3527 | DECLARE_MAC_BUF(mac); |
3527 | 3528 | ||
3528 | #if 0 | 3529 | #if 0 |
@@ -3567,7 +3568,9 @@ static int ieee80211_sta_create_ibss(struct net_device *dev, | |||
3567 | *pos++ = (u8) (rate / 5); | 3568 | *pos++ = (u8) (rate / 5); |
3568 | } | 3569 | } |
3569 | 3570 | ||
3570 | return ieee80211_sta_join_ibss(dev, ifsta, bss); | 3571 | ret = ieee80211_sta_join_ibss(dev, ifsta, bss); |
3572 | ieee80211_rx_bss_put(dev, bss); | ||
3573 | return ret; | ||
3571 | } | 3574 | } |
3572 | 3575 | ||
3573 | 3576 | ||
@@ -3615,10 +3618,13 @@ static int ieee80211_sta_find_ibss(struct net_device *dev, | |||
3615 | (bss = ieee80211_rx_bss_get(dev, bssid, | 3618 | (bss = ieee80211_rx_bss_get(dev, bssid, |
3616 | local->hw.conf.channel->center_freq, | 3619 | local->hw.conf.channel->center_freq, |
3617 | ifsta->ssid, ifsta->ssid_len))) { | 3620 | ifsta->ssid, ifsta->ssid_len))) { |
3621 | int ret; | ||
3618 | printk(KERN_DEBUG "%s: Selected IBSS BSSID %s" | 3622 | printk(KERN_DEBUG "%s: Selected IBSS BSSID %s" |
3619 | " based on configured SSID\n", | 3623 | " based on configured SSID\n", |
3620 | dev->name, print_mac(mac, bssid)); | 3624 | dev->name, print_mac(mac, bssid)); |
3621 | return ieee80211_sta_join_ibss(dev, ifsta, bss); | 3625 | ret = ieee80211_sta_join_ibss(dev, ifsta, bss); |
3626 | ieee80211_rx_bss_put(dev, bss); | ||
3627 | return ret; | ||
3622 | } | 3628 | } |
3623 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 3629 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
3624 | printk(KERN_DEBUG " did not try to join ibss\n"); | 3630 | printk(KERN_DEBUG " did not try to join ibss\n"); |
@@ -4095,18 +4101,17 @@ ieee80211_sta_scan_result(struct net_device *dev, | |||
4095 | 4101 | ||
4096 | memset(&iwe, 0, sizeof(iwe)); | 4102 | memset(&iwe, 0, sizeof(iwe)); |
4097 | iwe.cmd = SIOCGIWFREQ; | 4103 | iwe.cmd = SIOCGIWFREQ; |
4098 | iwe.u.freq.m = bss->freq; | 4104 | iwe.u.freq.m = ieee80211_frequency_to_channel(bss->freq); |
4099 | iwe.u.freq.e = 6; | 4105 | iwe.u.freq.e = 0; |
4100 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, | 4106 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, |
4101 | IW_EV_FREQ_LEN); | 4107 | IW_EV_FREQ_LEN); |
4102 | 4108 | ||
4103 | memset(&iwe, 0, sizeof(iwe)); | 4109 | memset(&iwe, 0, sizeof(iwe)); |
4104 | iwe.cmd = SIOCGIWFREQ; | 4110 | iwe.cmd = SIOCGIWFREQ; |
4105 | iwe.u.freq.m = ieee80211_frequency_to_channel(bss->freq); | 4111 | iwe.u.freq.m = bss->freq; |
4106 | iwe.u.freq.e = 0; | 4112 | iwe.u.freq.e = 6; |
4107 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, | 4113 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, |
4108 | IW_EV_FREQ_LEN); | 4114 | IW_EV_FREQ_LEN); |
4109 | |||
4110 | memset(&iwe, 0, sizeof(iwe)); | 4115 | memset(&iwe, 0, sizeof(iwe)); |
4111 | iwe.cmd = IWEVQUAL; | 4116 | iwe.cmd = IWEVQUAL; |
4112 | iwe.u.qual.qual = bss->signal; | 4117 | iwe.u.qual.qual = bss->signal; |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 1958bfb361c6..0941e5d6a522 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1091,7 +1091,7 @@ ieee80211_data_to_8023(struct ieee80211_rx_data *rx) | |||
1091 | u16 fc, hdrlen, ethertype; | 1091 | u16 fc, hdrlen, ethertype; |
1092 | u8 *payload; | 1092 | u8 *payload; |
1093 | u8 dst[ETH_ALEN]; | 1093 | u8 dst[ETH_ALEN]; |
1094 | u8 src[ETH_ALEN]; | 1094 | u8 src[ETH_ALEN] __aligned(2); |
1095 | struct sk_buff *skb = rx->skb; | 1095 | struct sk_buff *skb = rx->skb; |
1096 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1096 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1097 | DECLARE_MAC_BUF(mac); | 1097 | DECLARE_MAC_BUF(mac); |
@@ -1234,7 +1234,7 @@ ieee80211_data_to_8023(struct ieee80211_rx_data *rx) | |||
1234 | */ | 1234 | */ |
1235 | static bool ieee80211_frame_allowed(struct ieee80211_rx_data *rx) | 1235 | static bool ieee80211_frame_allowed(struct ieee80211_rx_data *rx) |
1236 | { | 1236 | { |
1237 | static const u8 pae_group_addr[ETH_ALEN] | 1237 | static const u8 pae_group_addr[ETH_ALEN] __aligned(2) |
1238 | = { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x03 }; | 1238 | = { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x03 }; |
1239 | struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data; | 1239 | struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data; |
1240 | 1240 | ||
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 1d7dd54aacef..c80d5899f279 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/util.c b/net/mac80211/util.c index 131e9e6c8a32..4e97b266f907 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -34,11 +34,11 @@ void *mac80211_wiphy_privid = &mac80211_wiphy_privid; | |||
34 | 34 | ||
35 | /* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */ | 35 | /* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */ |
36 | /* Ethernet-II snap header (RFC1042 for most EtherTypes) */ | 36 | /* Ethernet-II snap header (RFC1042 for most EtherTypes) */ |
37 | const unsigned char rfc1042_header[] = | 37 | const unsigned char rfc1042_header[] __aligned(2) = |
38 | { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; | 38 | { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; |
39 | 39 | ||
40 | /* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */ | 40 | /* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */ |
41 | const unsigned char bridge_tunnel_header[] = | 41 | const unsigned char bridge_tunnel_header[] __aligned(2) = |
42 | { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; | 42 | { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; |
43 | 43 | ||
44 | 44 | ||
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index 457ebf9e85ae..e8404212ad57 100644 --- a/net/mac80211/wext.c +++ b/net/mac80211/wext.c | |||
@@ -95,6 +95,13 @@ static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr, | |||
95 | } | 95 | } |
96 | } | 96 | } |
97 | 97 | ||
98 | if (alg == ALG_WEP && | ||
99 | key_len != LEN_WEP40 && key_len != LEN_WEP104) { | ||
100 | ieee80211_key_free(key); | ||
101 | err = -EINVAL; | ||
102 | goto out_unlock; | ||
103 | } | ||
104 | |||
98 | ieee80211_key_link(key, sdata, sta); | 105 | ieee80211_key_link(key, sdata, sta); |
99 | 106 | ||
100 | if (set_tx_key || (!sta && !sdata->default_key && key)) | 107 | if (set_tx_key || (!sta && !sdata->default_key && key)) |
@@ -290,14 +297,22 @@ static int ieee80211_ioctl_giwmode(struct net_device *dev, | |||
290 | return 0; | 297 | return 0; |
291 | } | 298 | } |
292 | 299 | ||
293 | int ieee80211_set_freq(struct ieee80211_local *local, int freqMHz) | 300 | int ieee80211_set_freq(struct net_device *dev, int freqMHz) |
294 | { | 301 | { |
295 | int ret = -EINVAL; | 302 | int ret = -EINVAL; |
296 | struct ieee80211_channel *chan; | 303 | struct ieee80211_channel *chan; |
304 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | ||
305 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
297 | 306 | ||
298 | chan = ieee80211_get_channel(local->hw.wiphy, freqMHz); | 307 | chan = ieee80211_get_channel(local->hw.wiphy, freqMHz); |
299 | 308 | ||
300 | if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { | 309 | if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { |
310 | if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && | ||
311 | chan->flags & IEEE80211_CHAN_NO_IBSS) { | ||
312 | printk(KERN_DEBUG "%s: IBSS not allowed on frequency " | ||
313 | "%d MHz\n", dev->name, chan->center_freq); | ||
314 | return ret; | ||
315 | } | ||
301 | local->oper_channel = chan; | 316 | local->oper_channel = chan; |
302 | 317 | ||
303 | if (local->sta_sw_scanning || local->sta_hw_scanning) | 318 | if (local->sta_sw_scanning || local->sta_hw_scanning) |
@@ -315,7 +330,6 @@ static int ieee80211_ioctl_siwfreq(struct net_device *dev, | |||
315 | struct iw_request_info *info, | 330 | struct iw_request_info *info, |
316 | struct iw_freq *freq, char *extra) | 331 | struct iw_freq *freq, char *extra) |
317 | { | 332 | { |
318 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | ||
319 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 333 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
320 | 334 | ||
321 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA) | 335 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA) |
@@ -329,14 +343,14 @@ static int ieee80211_ioctl_siwfreq(struct net_device *dev, | |||
329 | IEEE80211_STA_AUTO_CHANNEL_SEL; | 343 | IEEE80211_STA_AUTO_CHANNEL_SEL; |
330 | return 0; | 344 | return 0; |
331 | } else | 345 | } else |
332 | return ieee80211_set_freq(local, | 346 | return ieee80211_set_freq(dev, |
333 | ieee80211_channel_to_frequency(freq->m)); | 347 | ieee80211_channel_to_frequency(freq->m)); |
334 | } else { | 348 | } else { |
335 | int i, div = 1000000; | 349 | int i, div = 1000000; |
336 | for (i = 0; i < freq->e; i++) | 350 | for (i = 0; i < freq->e; i++) |
337 | div /= 10; | 351 | div /= 10; |
338 | if (div > 0) | 352 | if (div > 0) |
339 | return ieee80211_set_freq(local, freq->m / div); | 353 | return ieee80211_set_freq(dev, freq->m / div); |
340 | else | 354 | else |
341 | return -EINVAL; | 355 | return -EINVAL; |
342 | } | 356 | } |
@@ -489,9 +503,15 @@ static int ieee80211_ioctl_giwap(struct net_device *dev, | |||
489 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 503 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
490 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA || | 504 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA || |
491 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | 505 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { |
492 | ap_addr->sa_family = ARPHRD_ETHER; | 506 | if (sdata->u.sta.state == IEEE80211_ASSOCIATED || |
493 | memcpy(&ap_addr->sa_data, sdata->u.sta.bssid, ETH_ALEN); | 507 | sdata->u.sta.state == IEEE80211_IBSS_JOINED) { |
494 | return 0; | 508 | ap_addr->sa_family = ARPHRD_ETHER; |
509 | memcpy(&ap_addr->sa_data, sdata->u.sta.bssid, ETH_ALEN); | ||
510 | return 0; | ||
511 | } else { | ||
512 | memset(&ap_addr->sa_data, 0, ETH_ALEN); | ||
513 | return 0; | ||
514 | } | ||
495 | } else if (sdata->vif.type == IEEE80211_IF_TYPE_WDS) { | 515 | } else if (sdata->vif.type == IEEE80211_IF_TYPE_WDS) { |
496 | ap_addr->sa_family = ARPHRD_ETHER; | 516 | ap_addr->sa_family = ARPHRD_ETHER; |
497 | memcpy(&ap_addr->sa_data, sdata->u.wds.remote_addr, ETH_ALEN); | 517 | memcpy(&ap_addr->sa_data, sdata->u.wds.remote_addr, ETH_ALEN); |
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index dc1598b86004..5d09e8698b57 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c | |||
@@ -323,8 +323,7 @@ static void wme_qdiscop_destroy(struct Qdisc* qd) | |||
323 | struct ieee80211_hw *hw = &local->hw; | 323 | struct ieee80211_hw *hw = &local->hw; |
324 | int queue; | 324 | int queue; |
325 | 325 | ||
326 | tcf_destroy_chain(q->filter_list); | 326 | tcf_destroy_chain(&q->filter_list); |
327 | q->filter_list = NULL; | ||
328 | 327 | ||
329 | for (queue=0; queue < hw->queues; queue++) { | 328 | for (queue=0; queue < hw->queues; queue++) { |
330 | skb_queue_purge(&q->requeued[queue]); | 329 | skb_queue_purge(&q->requeued[queue]); |
@@ -673,7 +672,7 @@ int ieee80211_ht_agg_queue_add(struct ieee80211_local *local, | |||
673 | #ifdef CONFIG_MAC80211_HT_DEBUG | 672 | #ifdef CONFIG_MAC80211_HT_DEBUG |
674 | if (net_ratelimit()) | 673 | if (net_ratelimit()) |
675 | printk(KERN_DEBUG "allocated aggregation queue" | 674 | printk(KERN_DEBUG "allocated aggregation queue" |
676 | " %d tid %d addr %s pool=0x%lX", | 675 | " %d tid %d addr %s pool=0x%lX\n", |
677 | i, tid, print_mac(mac, sta->addr), | 676 | i, tid, print_mac(mac, sta->addr), |
678 | q->qdisc_pool[0]); | 677 | q->qdisc_pool[0]); |
679 | #endif /* CONFIG_MAC80211_HT_DEBUG */ | 678 | #endif /* CONFIG_MAC80211_HT_DEBUG */ |