diff options
author | David S. Miller <davem@davemloft.net> | 2008-06-30 16:18:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-30 16:18:53 -0400 |
commit | 2a64cc4b793f8a84969401afe5a28bd08bc20c9b (patch) | |
tree | 8a0233feae22b5c7e49bc6526579207f333922aa | |
parent | aebb6a849cfe7d89bcacaaecc20a480dfc1180e7 (diff) | |
parent | 23976efedd5ecb420b87455787c537eb4aed1981 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6
-rw-r--r-- | drivers/net/wireless/hostap/hostap_80211_rx.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ap.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_cs.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_hw.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_main.c | 5 | ||||
-rw-r--r-- | include/net/mac80211.h | 9 | ||||
-rw-r--r-- | net/mac80211/wext.c | 7 |
7 files changed, 32 insertions, 17 deletions
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c index 4fd73809602e..020f450e9dba 100644 --- a/drivers/net/wireless/hostap/hostap_80211_rx.c +++ b/drivers/net/wireless/hostap/hostap_80211_rx.c | |||
@@ -64,7 +64,7 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb, | |||
64 | int hdrlen, phdrlen, head_need, tail_need; | 64 | int hdrlen, phdrlen, head_need, tail_need; |
65 | u16 fc; | 65 | u16 fc; |
66 | int prism_header, ret; | 66 | int prism_header, ret; |
67 | struct ieee80211_hdr_4addr *hdr; | 67 | struct ieee80211_hdr_4addr *fhdr; |
68 | 68 | ||
69 | iface = netdev_priv(dev); | 69 | iface = netdev_priv(dev); |
70 | local = iface->local; | 70 | local = iface->local; |
@@ -83,8 +83,8 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb, | |||
83 | phdrlen = 0; | 83 | phdrlen = 0; |
84 | } | 84 | } |
85 | 85 | ||
86 | hdr = (struct ieee80211_hdr_4addr *) skb->data; | 86 | fhdr = (struct ieee80211_hdr_4addr *) skb->data; |
87 | fc = le16_to_cpu(hdr->frame_ctl); | 87 | fc = le16_to_cpu(fhdr->frame_ctl); |
88 | 88 | ||
89 | if (type == PRISM2_RX_MGMT && (fc & IEEE80211_FCTL_VERS)) { | 89 | if (type == PRISM2_RX_MGMT && (fc & IEEE80211_FCTL_VERS)) { |
90 | printk(KERN_DEBUG "%s: dropped management frame with header " | 90 | printk(KERN_DEBUG "%s: dropped management frame with header " |
@@ -551,7 +551,7 @@ hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr_4addr *hdr, | |||
551 | hdr->addr1[2] != 0xff || hdr->addr1[3] != 0xff || | 551 | hdr->addr1[2] != 0xff || hdr->addr1[3] != 0xff || |
552 | hdr->addr1[4] != 0xff || hdr->addr1[5] != 0xff)) { | 552 | hdr->addr1[4] != 0xff || hdr->addr1[5] != 0xff)) { |
553 | /* RA (or BSSID) is not ours - drop */ | 553 | /* RA (or BSSID) is not ours - drop */ |
554 | PDEBUG(DEBUG_EXTRA, "%s: received WDS frame with " | 554 | PDEBUG(DEBUG_EXTRA2, "%s: received WDS frame with " |
555 | "not own or broadcast %s=%s\n", | 555 | "not own or broadcast %s=%s\n", |
556 | local->dev->name, | 556 | local->dev->name, |
557 | fc & IEEE80211_FCTL_FROMDS ? "RA" : "BSSID", | 557 | fc & IEEE80211_FCTL_FROMDS ? "RA" : "BSSID", |
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index 0acd9589c48c..ab981afd481d 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c | |||
@@ -1930,7 +1930,7 @@ static void handle_pspoll(local_info_t *local, | |||
1930 | PDEBUG(DEBUG_PS, " PSPOLL and AID[15:14] not set\n"); | 1930 | PDEBUG(DEBUG_PS, " PSPOLL and AID[15:14] not set\n"); |
1931 | return; | 1931 | return; |
1932 | } | 1932 | } |
1933 | aid &= ~BIT(15) & ~BIT(14); | 1933 | aid &= ~(BIT(15) | BIT(14)); |
1934 | if (aid == 0 || aid > MAX_AID_TABLE_SIZE) { | 1934 | if (aid == 0 || aid > MAX_AID_TABLE_SIZE) { |
1935 | PDEBUG(DEBUG_PS, " invalid aid=%d\n", aid); | 1935 | PDEBUG(DEBUG_PS, " invalid aid=%d\n", aid); |
1936 | return; | 1936 | return; |
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index ed4317a17cbb..80039a0ae027 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c | |||
@@ -533,10 +533,10 @@ static void prism2_detach(struct pcmcia_device *link) | |||
533 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 533 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
534 | 534 | ||
535 | #define CFG_CHECK2(fn, retf) \ | 535 | #define CFG_CHECK2(fn, retf) \ |
536 | do { int ret = (retf); \ | 536 | do { int _ret = (retf); \ |
537 | if (ret != 0) { \ | 537 | if (_ret != 0) { \ |
538 | PDEBUG(DEBUG_EXTRA, "CardServices(" #fn ") returned %d\n", ret); \ | 538 | PDEBUG(DEBUG_EXTRA, "CardServices(" #fn ") returned %d\n", _ret); \ |
539 | cs_error(link, fn, ret); \ | 539 | cs_error(link, fn, _ret); \ |
540 | goto next_entry; \ | 540 | goto next_entry; \ |
541 | } \ | 541 | } \ |
542 | } while (0) | 542 | } while (0) |
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index cdf90c40f11b..936f52e3d95c 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -2835,7 +2835,7 @@ static void hostap_passive_scan(unsigned long data) | |||
2835 | { | 2835 | { |
2836 | local_info_t *local = (local_info_t *) data; | 2836 | local_info_t *local = (local_info_t *) data; |
2837 | struct net_device *dev = local->dev; | 2837 | struct net_device *dev = local->dev; |
2838 | u16 channel; | 2838 | u16 chan; |
2839 | 2839 | ||
2840 | if (local->passive_scan_interval <= 0) | 2840 | if (local->passive_scan_interval <= 0) |
2841 | return; | 2841 | return; |
@@ -2872,11 +2872,11 @@ static void hostap_passive_scan(unsigned long data) | |||
2872 | 2872 | ||
2873 | printk(KERN_DEBUG "%s: passive scan channel %d\n", | 2873 | printk(KERN_DEBUG "%s: passive scan channel %d\n", |
2874 | dev->name, local->passive_scan_channel); | 2874 | dev->name, local->passive_scan_channel); |
2875 | channel = local->passive_scan_channel; | 2875 | chan = local->passive_scan_channel; |
2876 | local->passive_scan_state = PASSIVE_SCAN_WAIT; | 2876 | local->passive_scan_state = PASSIVE_SCAN_WAIT; |
2877 | local->passive_scan_timer.expires = jiffies + HZ / 10; | 2877 | local->passive_scan_timer.expires = jiffies + HZ / 10; |
2878 | } else { | 2878 | } else { |
2879 | channel = local->channel; | 2879 | chan = local->channel; |
2880 | local->passive_scan_state = PASSIVE_SCAN_LISTEN; | 2880 | local->passive_scan_state = PASSIVE_SCAN_LISTEN; |
2881 | local->passive_scan_timer.expires = jiffies + | 2881 | local->passive_scan_timer.expires = jiffies + |
2882 | local->passive_scan_interval * HZ; | 2882 | local->passive_scan_interval * HZ; |
@@ -2884,9 +2884,9 @@ static void hostap_passive_scan(unsigned long data) | |||
2884 | 2884 | ||
2885 | if (hfa384x_cmd_callback(dev, HFA384X_CMDCODE_TEST | | 2885 | if (hfa384x_cmd_callback(dev, HFA384X_CMDCODE_TEST | |
2886 | (HFA384X_TEST_CHANGE_CHANNEL << 8), | 2886 | (HFA384X_TEST_CHANGE_CHANNEL << 8), |
2887 | channel, NULL, 0)) | 2887 | chan, NULL, 0)) |
2888 | printk(KERN_ERR "%s: passive scan channel set %d " | 2888 | printk(KERN_ERR "%s: passive scan channel set %d " |
2889 | "failed\n", dev->name, channel); | 2889 | "failed\n", dev->name, chan); |
2890 | 2890 | ||
2891 | add_timer(&local->passive_scan_timer); | 2891 | add_timer(&local->passive_scan_timer); |
2892 | } | 2892 | } |
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c index f7aec9309d04..a38e85f334df 100644 --- a/drivers/net/wireless/hostap/hostap_main.c +++ b/drivers/net/wireless/hostap/hostap_main.c | |||
@@ -594,7 +594,8 @@ void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx) | |||
594 | } | 594 | } |
595 | 595 | ||
596 | 596 | ||
597 | int hostap_80211_header_parse(const struct sk_buff *skb, unsigned char *haddr) | 597 | static int hostap_80211_header_parse(const struct sk_buff *skb, |
598 | unsigned char *haddr) | ||
598 | { | 599 | { |
599 | struct hostap_interface *iface = netdev_priv(skb->dev); | 600 | struct hostap_interface *iface = netdev_priv(skb->dev); |
600 | local_info_t *local = iface->local; | 601 | local_info_t *local = iface->local; |
@@ -857,7 +858,6 @@ const struct header_ops hostap_80211_ops = { | |||
857 | .rebuild = eth_rebuild_header, | 858 | .rebuild = eth_rebuild_header, |
858 | .cache = eth_header_cache, | 859 | .cache = eth_header_cache, |
859 | .cache_update = eth_header_cache_update, | 860 | .cache_update = eth_header_cache_update, |
860 | |||
861 | .parse = hostap_80211_header_parse, | 861 | .parse = hostap_80211_header_parse, |
862 | }; | 862 | }; |
863 | EXPORT_SYMBOL(hostap_80211_ops); | 863 | EXPORT_SYMBOL(hostap_80211_ops); |
@@ -1150,7 +1150,6 @@ EXPORT_SYMBOL(hostap_set_roaming); | |||
1150 | EXPORT_SYMBOL(hostap_set_auth_algs); | 1150 | EXPORT_SYMBOL(hostap_set_auth_algs); |
1151 | EXPORT_SYMBOL(hostap_dump_rx_header); | 1151 | EXPORT_SYMBOL(hostap_dump_rx_header); |
1152 | EXPORT_SYMBOL(hostap_dump_tx_header); | 1152 | EXPORT_SYMBOL(hostap_dump_tx_header); |
1153 | EXPORT_SYMBOL(hostap_80211_header_parse); | ||
1154 | EXPORT_SYMBOL(hostap_80211_get_hdrlen); | 1153 | EXPORT_SYMBOL(hostap_80211_get_hdrlen); |
1155 | EXPORT_SYMBOL(hostap_get_stats); | 1154 | EXPORT_SYMBOL(hostap_get_stats); |
1156 | EXPORT_SYMBOL(hostap_setup_dev); | 1155 | EXPORT_SYMBOL(hostap_setup_dev); |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index dae3f9ec1154..bcd1623245cb 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -595,6 +595,15 @@ enum ieee80211_key_alg { | |||
595 | ALG_CCMP, | 595 | ALG_CCMP, |
596 | }; | 596 | }; |
597 | 597 | ||
598 | /** | ||
599 | * enum ieee80211_key_len - key length | ||
600 | * @WEP40: WEP 5 byte long key | ||
601 | * @WEP104: WEP 13 byte long key | ||
602 | */ | ||
603 | enum ieee80211_key_len { | ||
604 | LEN_WEP40 = 5, | ||
605 | LEN_WEP104 = 13, | ||
606 | }; | ||
598 | 607 | ||
599 | /** | 608 | /** |
600 | * enum ieee80211_key_flags - key flags | 609 | * enum ieee80211_key_flags - key flags |
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index 6106cb79060c..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)) |