diff options
author | <jgarzik@pretzel.yyz.us> | 2005-05-27 22:57:33 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-05-27 22:57:33 -0400 |
commit | 4c925f452cfd16c690209e96821ee094e09a2404 (patch) | |
tree | 4b4ba76aa81b3627142787262fd2f8049dd3662d | |
parent | 51a730d758ae4052e10ca7e06336f10af598c4fc (diff) | |
parent | 66b04a80eea60cabf9d89fd34deb3234a740052f (diff) |
Automatic merge of /spare/repo/netdev-2.6 branch we18-ieee80211
-rw-r--r-- | drivers/net/wireless/ipw2100.h | 4 | ||||
-rw-r--r-- | drivers/usb/net/Makefile | 2 | ||||
-rw-r--r-- | drivers/usb/net/zd1201.c | 16 | ||||
-rw-r--r-- | include/net/ieee80211.h | 40 | ||||
-rw-r--r-- | net/ieee80211/Kconfig | 2 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_crypt_ccmp.c | 4 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_module.c | 16 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_rx.c | 4 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_tx.c | 4 |
9 files changed, 37 insertions, 55 deletions
diff --git a/drivers/net/wireless/ipw2100.h b/drivers/net/wireless/ipw2100.h index 0cc5746dd4f1..bb31fa03f69f 100644 --- a/drivers/net/wireless/ipw2100.h +++ b/drivers/net/wireless/ipw2100.h | |||
@@ -885,7 +885,7 @@ struct ipw2100_priv { | |||
885 | 885 | ||
886 | 886 | ||
887 | 887 | ||
888 | #define IPW_HEADER_802_11_SIZE sizeof(struct ieee80211_header_data) | 888 | #define IPW_HEADER_802_11_SIZE sizeof(struct ieee80211_hdr_3addr) |
889 | #define IPW_MAX_80211_PAYLOAD_SIZE 2304U | 889 | #define IPW_MAX_80211_PAYLOAD_SIZE 2304U |
890 | #define IPW_MAX_802_11_PAYLOAD_LENGTH 2312 | 890 | #define IPW_MAX_802_11_PAYLOAD_LENGTH 2312 |
891 | #define IPW_MAX_ACCEPTABLE_TX_FRAME_LENGTH 1536 | 891 | #define IPW_MAX_ACCEPTABLE_TX_FRAME_LENGTH 1536 |
@@ -900,7 +900,7 @@ struct ipw2100_priv { | |||
900 | IPW_802_11_FCS_LENGTH) | 900 | IPW_802_11_FCS_LENGTH) |
901 | 901 | ||
902 | #define IPW_802_11_PAYLOAD_OFFSET \ | 902 | #define IPW_802_11_PAYLOAD_OFFSET \ |
903 | (sizeof(struct ieee80211_header_data) + \ | 903 | (sizeof(struct ieee80211_hdr_3addr) + \ |
904 | sizeof(struct ieee80211_snap_hdr)) | 904 | sizeof(struct ieee80211_snap_hdr)) |
905 | 905 | ||
906 | struct ipw2100_rx { | 906 | struct ipw2100_rx { |
diff --git a/drivers/usb/net/Makefile b/drivers/usb/net/Makefile index 16f352195512..fe3fd4115e1e 100644 --- a/drivers/usb/net/Makefile +++ b/drivers/usb/net/Makefile | |||
@@ -8,5 +8,3 @@ obj-$(CONFIG_USB_PEGASUS) += pegasus.o | |||
8 | obj-$(CONFIG_USB_RTL8150) += rtl8150.o | 8 | obj-$(CONFIG_USB_RTL8150) += rtl8150.o |
9 | obj-$(CONFIG_USB_USBNET) += usbnet.o | 9 | obj-$(CONFIG_USB_USBNET) += usbnet.o |
10 | obj-$(CONFIG_USB_ZD1201) += zd1201.o | 10 | obj-$(CONFIG_USB_ZD1201) += zd1201.o |
11 | |||
12 | CFLAGS_zd1201.o = -Idrivers/net/wireless/ | ||
diff --git a/drivers/usb/net/zd1201.c b/drivers/usb/net/zd1201.c index 341ae5f732dd..17b9718b8de6 100644 --- a/drivers/usb/net/zd1201.c +++ b/drivers/usb/net/zd1201.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/string.h> | 21 | #include <linux/string.h> |
22 | #include <linux/if_arp.h> | 22 | #include <linux/if_arp.h> |
23 | #include <linux/firmware.h> | 23 | #include <linux/firmware.h> |
24 | #include <ieee802_11.h> | 24 | #include <net/ieee80211.h> |
25 | #include "zd1201.h" | 25 | #include "zd1201.h" |
26 | 26 | ||
27 | static struct usb_device_id zd1201_table[] = { | 27 | static struct usb_device_id zd1201_table[] = { |
@@ -337,25 +337,25 @@ static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs) | |||
337 | goto resubmit; | 337 | goto resubmit; |
338 | } | 338 | } |
339 | 339 | ||
340 | if ((seq & IEEE802_11_SCTL_FRAG) || | 340 | if ((seq & IEEE80211_SCTL_FRAG) || |
341 | (fc & IEEE802_11_FCTL_MOREFRAGS)) { | 341 | (fc & IEEE80211_FCTL_MOREFRAGS)) { |
342 | struct zd1201_frag *frag = NULL; | 342 | struct zd1201_frag *frag = NULL; |
343 | char *ptr; | 343 | char *ptr; |
344 | 344 | ||
345 | if (datalen<14) | 345 | if (datalen<14) |
346 | goto resubmit; | 346 | goto resubmit; |
347 | if ((seq & IEEE802_11_SCTL_FRAG) == 0) { | 347 | if ((seq & IEEE80211_SCTL_FRAG) == 0) { |
348 | frag = kmalloc(sizeof(struct zd1201_frag*), | 348 | frag = kmalloc(sizeof(struct zd1201_frag*), |
349 | GFP_ATOMIC); | 349 | GFP_ATOMIC); |
350 | if (!frag) | 350 | if (!frag) |
351 | goto resubmit; | 351 | goto resubmit; |
352 | skb = dev_alloc_skb(IEEE802_11_DATA_LEN +14+2); | 352 | skb = dev_alloc_skb(IEEE80211_DATA_LEN +14+2); |
353 | if (!skb) { | 353 | if (!skb) { |
354 | kfree(frag); | 354 | kfree(frag); |
355 | goto resubmit; | 355 | goto resubmit; |
356 | } | 356 | } |
357 | frag->skb = skb; | 357 | frag->skb = skb; |
358 | frag->seq = seq & IEEE802_11_SCTL_SEQ; | 358 | frag->seq = seq & IEEE80211_SCTL_SEQ; |
359 | skb_reserve(skb, 2); | 359 | skb_reserve(skb, 2); |
360 | memcpy(skb_put(skb, 12), &data[datalen-14], 12); | 360 | memcpy(skb_put(skb, 12), &data[datalen-14], 12); |
361 | memcpy(skb_put(skb, 2), &data[6], 2); | 361 | memcpy(skb_put(skb, 2), &data[6], 2); |
@@ -364,7 +364,7 @@ static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs) | |||
364 | goto resubmit; | 364 | goto resubmit; |
365 | } | 365 | } |
366 | hlist_for_each_entry(frag, node, &zd->fraglist, fnode) | 366 | hlist_for_each_entry(frag, node, &zd->fraglist, fnode) |
367 | if(frag->seq == (seq&IEEE802_11_SCTL_SEQ)) | 367 | if(frag->seq == (seq&IEEE80211_SCTL_SEQ)) |
368 | break; | 368 | break; |
369 | if (!frag) | 369 | if (!frag) |
370 | goto resubmit; | 370 | goto resubmit; |
@@ -372,7 +372,7 @@ static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs) | |||
372 | ptr = skb_put(skb, len); | 372 | ptr = skb_put(skb, len); |
373 | if (ptr) | 373 | if (ptr) |
374 | memcpy(ptr, data+8, len); | 374 | memcpy(ptr, data+8, len); |
375 | if (fc & IEEE802_11_FCTL_MOREFRAGS) | 375 | if (fc & IEEE80211_FCTL_MOREFRAGS) |
376 | goto resubmit; | 376 | goto resubmit; |
377 | hlist_del_init(&frag->fnode); | 377 | hlist_del_init(&frag->fnode); |
378 | kfree(frag); | 378 | kfree(frag); |
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index b1bfaf1084f4..f1d9b9e9dec7 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -93,6 +93,8 @@ struct eapol { | |||
93 | u16 length; | 93 | u16 length; |
94 | } __attribute__ ((packed)); | 94 | } __attribute__ ((packed)); |
95 | 95 | ||
96 | #define IEEE80211_1ADDR_LEN 10 | ||
97 | #define IEEE80211_2ADDR_LEN 16 | ||
96 | #define IEEE80211_3ADDR_LEN 24 | 98 | #define IEEE80211_3ADDR_LEN 24 |
97 | #define IEEE80211_4ADDR_LEN 30 | 99 | #define IEEE80211_4ADDR_LEN 30 |
98 | #define IEEE80211_FCS_LEN 4 | 100 | #define IEEE80211_FCS_LEN 4 |
@@ -299,23 +301,6 @@ struct ieee80211_snap_hdr { | |||
299 | #define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9 | 301 | #define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9 |
300 | 302 | ||
301 | 303 | ||
302 | /* Information Element IDs */ | ||
303 | #define WLAN_EID_SSID 0 | ||
304 | #define WLAN_EID_SUPP_RATES 1 | ||
305 | #define WLAN_EID_FH_PARAMS 2 | ||
306 | #define WLAN_EID_DS_PARAMS 3 | ||
307 | #define WLAN_EID_CF_PARAMS 4 | ||
308 | #define WLAN_EID_TIM 5 | ||
309 | #define WLAN_EID_IBSS_PARAMS 6 | ||
310 | #define WLAN_EID_CHALLENGE 16 | ||
311 | #define WLAN_EID_RSN 48 | ||
312 | #define WLAN_EID_GENERIC 221 | ||
313 | |||
314 | #define IEEE80211_MGMT_HDR_LEN 24 | ||
315 | #define IEEE80211_DATA_HDR3_LEN 24 | ||
316 | #define IEEE80211_DATA_HDR4_LEN 30 | ||
317 | |||
318 | |||
319 | #define IEEE80211_STATMASK_SIGNAL (1<<0) | 304 | #define IEEE80211_STATMASK_SIGNAL (1<<0) |
320 | #define IEEE80211_STATMASK_RSSI (1<<1) | 305 | #define IEEE80211_STATMASK_RSSI (1<<1) |
321 | #define IEEE80211_STATMASK_NOISE (1<<2) | 306 | #define IEEE80211_STATMASK_NOISE (1<<2) |
@@ -489,15 +474,6 @@ Total: 28-2340 bytes | |||
489 | 474 | ||
490 | */ | 475 | */ |
491 | 476 | ||
492 | struct ieee80211_header_data { | ||
493 | u16 frame_ctl; | ||
494 | u16 duration_id; | ||
495 | u8 addr1[6]; | ||
496 | u8 addr2[6]; | ||
497 | u8 addr3[6]; | ||
498 | u16 seq_ctrl; | ||
499 | }; | ||
500 | |||
501 | #define BEACON_PROBE_SSID_ID_POSITION 12 | 477 | #define BEACON_PROBE_SSID_ID_POSITION 12 |
502 | 478 | ||
503 | /* Management Frame Information Element Types */ | 479 | /* Management Frame Information Element Types */ |
@@ -542,7 +518,7 @@ struct ieee80211_info_element { | |||
542 | */ | 518 | */ |
543 | 519 | ||
544 | struct ieee80211_authentication { | 520 | struct ieee80211_authentication { |
545 | struct ieee80211_header_data header; | 521 | struct ieee80211_hdr_3addr header; |
546 | u16 algorithm; | 522 | u16 algorithm; |
547 | u16 transaction; | 523 | u16 transaction; |
548 | u16 status; | 524 | u16 status; |
@@ -551,7 +527,7 @@ struct ieee80211_authentication { | |||
551 | 527 | ||
552 | 528 | ||
553 | struct ieee80211_probe_response { | 529 | struct ieee80211_probe_response { |
554 | struct ieee80211_header_data header; | 530 | struct ieee80211_hdr_3addr header; |
555 | u32 time_stamp[2]; | 531 | u32 time_stamp[2]; |
556 | u16 beacon_interval; | 532 | u16 beacon_interval; |
557 | u16 capability; | 533 | u16 capability; |
@@ -793,21 +769,21 @@ extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mod | |||
793 | 769 | ||
794 | extern inline int ieee80211_get_hdrlen(u16 fc) | 770 | extern inline int ieee80211_get_hdrlen(u16 fc) |
795 | { | 771 | { |
796 | int hdrlen = 24; | 772 | int hdrlen = IEEE80211_3ADDR_LEN; |
797 | 773 | ||
798 | switch (WLAN_FC_GET_TYPE(fc)) { | 774 | switch (WLAN_FC_GET_TYPE(fc)) { |
799 | case IEEE80211_FTYPE_DATA: | 775 | case IEEE80211_FTYPE_DATA: |
800 | if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) | 776 | if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) |
801 | hdrlen = 30; /* Addr4 */ | 777 | hdrlen = IEEE80211_4ADDR_LEN; |
802 | break; | 778 | break; |
803 | case IEEE80211_FTYPE_CTL: | 779 | case IEEE80211_FTYPE_CTL: |
804 | switch (WLAN_FC_GET_STYPE(fc)) { | 780 | switch (WLAN_FC_GET_STYPE(fc)) { |
805 | case IEEE80211_STYPE_CTS: | 781 | case IEEE80211_STYPE_CTS: |
806 | case IEEE80211_STYPE_ACK: | 782 | case IEEE80211_STYPE_ACK: |
807 | hdrlen = 10; | 783 | hdrlen = IEEE80211_1ADDR_LEN; |
808 | break; | 784 | break; |
809 | default: | 785 | default: |
810 | hdrlen = 16; | 786 | hdrlen = IEEE80211_2ADDR_LEN; |
811 | break; | 787 | break; |
812 | } | 788 | } |
813 | break; | 789 | break; |
diff --git a/net/ieee80211/Kconfig b/net/ieee80211/Kconfig index 23b23f72a9a4..961c711eda97 100644 --- a/net/ieee80211/Kconfig +++ b/net/ieee80211/Kconfig | |||
@@ -44,6 +44,7 @@ config IEEE80211_CRYPT_WEP | |||
44 | config IEEE80211_CRYPT_CCMP | 44 | config IEEE80211_CRYPT_CCMP |
45 | tristate "IEEE 802.11i CCMP support" | 45 | tristate "IEEE 802.11i CCMP support" |
46 | depends on IEEE80211 | 46 | depends on IEEE80211 |
47 | select CRYPTO | ||
47 | select CRYPTO_AES | 48 | select CRYPTO_AES |
48 | ---help--- | 49 | ---help--- |
49 | Include software based cipher suites in support of IEEE 802.11i | 50 | Include software based cipher suites in support of IEEE 802.11i |
@@ -56,6 +57,7 @@ config IEEE80211_CRYPT_CCMP | |||
56 | config IEEE80211_CRYPT_TKIP | 57 | config IEEE80211_CRYPT_TKIP |
57 | tristate "IEEE 802.11i TKIP encryption" | 58 | tristate "IEEE 802.11i TKIP encryption" |
58 | depends on IEEE80211 | 59 | depends on IEEE80211 |
60 | select CRYPTO | ||
59 | select CRYPTO_MICHAEL_MIC | 61 | select CRYPTO_MICHAEL_MIC |
60 | ---help--- | 62 | ---help--- |
61 | Include software based cipher suites in support of IEEE 802.11i | 63 | Include software based cipher suites in support of IEEE 802.11i |
diff --git a/net/ieee80211/ieee80211_crypt_ccmp.c b/net/ieee80211/ieee80211_crypt_ccmp.c index f5f412ae7f28..11d15573b26a 100644 --- a/net/ieee80211/ieee80211_crypt_ccmp.c +++ b/net/ieee80211/ieee80211_crypt_ccmp.c | |||
@@ -59,8 +59,8 @@ struct ieee80211_ccmp_data { | |||
59 | u8 rx_b0[AES_BLOCK_LEN], rx_b[AES_BLOCK_LEN], rx_a[AES_BLOCK_LEN]; | 59 | u8 rx_b0[AES_BLOCK_LEN], rx_b[AES_BLOCK_LEN], rx_a[AES_BLOCK_LEN]; |
60 | }; | 60 | }; |
61 | 61 | ||
62 | void ieee80211_ccmp_aes_encrypt(struct crypto_tfm *tfm, | 62 | static void ieee80211_ccmp_aes_encrypt(struct crypto_tfm *tfm, |
63 | const u8 pt[16], u8 ct[16]) | 63 | const u8 pt[16], u8 ct[16]) |
64 | { | 64 | { |
65 | struct scatterlist src, dst; | 65 | struct scatterlist src, dst; |
66 | 66 | ||
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c index e4ca0daaaeea..90bc50b97ea7 100644 --- a/net/ieee80211/ieee80211_module.c +++ b/net/ieee80211/ieee80211_module.c | |||
@@ -194,17 +194,23 @@ static int show_debug_level(char *page, char **start, off_t offset, | |||
194 | return snprintf(page, count, "0x%08X\n", ieee80211_debug_level); | 194 | return snprintf(page, count, "0x%08X\n", ieee80211_debug_level); |
195 | } | 195 | } |
196 | 196 | ||
197 | static int store_debug_level(struct file *file, const char *buffer, | 197 | static int store_debug_level(struct file *file, const char __user *buffer, |
198 | unsigned long count, void *data) | 198 | unsigned long count, void *data) |
199 | { | 199 | { |
200 | char buf[] = "0x00000000"; | 200 | char buf[] = "0x00000000"; |
201 | unsigned long len = min(sizeof(buf) - 1, (u32)count); | ||
202 | char *p = (char *)buf; | 201 | char *p = (char *)buf; |
203 | unsigned long val; | 202 | unsigned long val; |
204 | 203 | ||
205 | if (copy_from_user(buf, buffer, len)) | 204 | if (count > sizeof(buf) - 1) |
205 | count = sizeof(buf) - 1; | ||
206 | |||
207 | if (copy_from_user(buf, buffer, count)) | ||
206 | return count; | 208 | return count; |
207 | buf[len] = 0; | 209 | buf[count] = 0; |
210 | /* | ||
211 | * what a FPOS... What, sscanf(buf, "%i", &val) would be too | ||
212 | * scary? | ||
213 | */ | ||
208 | if (p[1] == 'x' || p[1] == 'X' || p[0] == 'x' || p[0] == 'X') { | 214 | if (p[1] == 'x' || p[1] == 'X' || p[0] == 'x' || p[0] == 'X') { |
209 | p++; | 215 | p++; |
210 | if (p[0] == 'x' || p[0] == 'X') | 216 | if (p[0] == 'x' || p[0] == 'X') |
@@ -218,7 +224,7 @@ static int store_debug_level(struct file *file, const char *buffer, | |||
218 | else | 224 | else |
219 | ieee80211_debug_level = val; | 225 | ieee80211_debug_level = val; |
220 | 226 | ||
221 | return strnlen(buf, count); | 227 | return strlen(buf); |
222 | } | 228 | } |
223 | 229 | ||
224 | static int __init ieee80211_init(void) | 230 | static int __init ieee80211_init(void) |
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c index 2bda8a174818..2ae6ab8914b0 100644 --- a/net/ieee80211/ieee80211_rx.c +++ b/net/ieee80211/ieee80211_rx.c | |||
@@ -475,7 +475,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
475 | #endif | 475 | #endif |
476 | 476 | ||
477 | /* Data frame - extract src/dst addresses */ | 477 | /* Data frame - extract src/dst addresses */ |
478 | if (skb->len < IEEE80211_DATA_HDR3_LEN) | 478 | if (skb->len < IEEE80211_3ADDR_LEN) |
479 | goto rx_dropped; | 479 | goto rx_dropped; |
480 | 480 | ||
481 | switch (fc & (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) { | 481 | switch (fc & (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) { |
@@ -488,7 +488,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
488 | memcpy(src, hdr->addr2, ETH_ALEN); | 488 | memcpy(src, hdr->addr2, ETH_ALEN); |
489 | break; | 489 | break; |
490 | case IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS: | 490 | case IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS: |
491 | if (skb->len < IEEE80211_DATA_HDR4_LEN) | 491 | if (skb->len < IEEE80211_4ADDR_LEN) |
492 | goto rx_dropped; | 492 | goto rx_dropped; |
493 | memcpy(dst, hdr->addr3, ETH_ALEN); | 493 | memcpy(dst, hdr->addr3, ETH_ALEN); |
494 | memcpy(src, hdr->addr4, ETH_ALEN); | 494 | memcpy(src, hdr->addr4, ETH_ALEN); |
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c index 308fcd9ab1e3..a3054c5c0c05 100644 --- a/net/ieee80211/ieee80211_tx.c +++ b/net/ieee80211/ieee80211_tx.c | |||
@@ -212,8 +212,8 @@ void ieee80211_txb_free(struct ieee80211_txb *txb) { | |||
212 | kfree(txb); | 212 | kfree(txb); |
213 | } | 213 | } |
214 | 214 | ||
215 | struct ieee80211_txb *ieee80211_alloc_txb(int nr_frags, int txb_size, | 215 | static struct ieee80211_txb *ieee80211_alloc_txb(int nr_frags, int txb_size, |
216 | int gfp_mask) | 216 | int gfp_mask) |
217 | { | 217 | { |
218 | struct ieee80211_txb *txb; | 218 | struct ieee80211_txb *txb; |
219 | int i; | 219 | int i; |