diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-28 12:05:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-28 12:05:25 -0400 |
commit | e5dfa9282f3db461a896a6692b529e1823ba98c6 (patch) | |
tree | 574d23cebc57c657373b0e1b6692c047aba8dd6e /include | |
parent | 5dd962494f76fb3ef1196cd420b5d6260d7a3766 (diff) | |
parent | b2ab040db85835e54c7559533df7f85902617926 (diff) |
Merge branch 'upstream' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-mips/sgi/hpc3.h | 40 | ||||
-rw-r--r-- | include/linux/cyclomx.h | 2 | ||||
-rw-r--r-- | include/linux/cycx_drv.h | 1 | ||||
-rw-r--r-- | include/linux/ibmtr.h | 4 | ||||
-rw-r--r-- | include/linux/if_arp.h | 1 | ||||
-rw-r--r-- | include/linux/mii.h | 1 | ||||
-rw-r--r-- | include/linux/netdevice.h | 6 | ||||
-rw-r--r-- | include/linux/sdladrv.h | 4 | ||||
-rw-r--r-- | include/linux/wanpipe.h | 9 | ||||
-rw-r--r-- | include/net/ieee80211.h | 525 | ||||
-rw-r--r-- | include/net/ieee80211_crypt.h | 38 | ||||
-rw-r--r-- | include/net/ieee80211_radiotap.h | 231 | ||||
-rw-r--r-- | include/net/syncppp.h | 1 |
13 files changed, 684 insertions, 179 deletions
diff --git a/include/asm-mips/sgi/hpc3.h b/include/asm-mips/sgi/hpc3.h index ac3dfc7af5b0..fcec52bafb25 100644 --- a/include/asm-mips/sgi/hpc3.h +++ b/include/asm-mips/sgi/hpc3.h | |||
@@ -128,26 +128,26 @@ struct hpc3_ethregs { | |||
128 | volatile u32 rx_gfptr; /* current GIO fifo ptr */ | 128 | volatile u32 rx_gfptr; /* current GIO fifo ptr */ |
129 | volatile u32 rx_dfptr; /* current device fifo ptr */ | 129 | volatile u32 rx_dfptr; /* current device fifo ptr */ |
130 | u32 _unused1; /* padding */ | 130 | u32 _unused1; /* padding */ |
131 | volatile u32 rx_reset; /* reset register */ | 131 | volatile u32 reset; /* reset register */ |
132 | #define HPC3_ERXRST_CRESET 0x1 /* Reset dma channel and external controller */ | 132 | #define HPC3_ERST_CRESET 0x1 /* Reset dma channel and external controller */ |
133 | #define HPC3_ERXRST_CLRIRQ 0x2 /* Clear channel interrupt */ | 133 | #define HPC3_ERST_CLRIRQ 0x2 /* Clear channel interrupt */ |
134 | #define HPC3_ERXRST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */ | 134 | #define HPC3_ERST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */ |
135 | 135 | ||
136 | volatile u32 rx_dconfig; /* DMA configuration register */ | 136 | volatile u32 dconfig; /* DMA configuration register */ |
137 | #define HPC3_ERXDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */ | 137 | #define HPC3_EDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */ |
138 | #define HPC3_ERXDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */ | 138 | #define HPC3_EDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */ |
139 | #define HPC3_ERXDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */ | 139 | #define HPC3_EDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */ |
140 | #define HPC3_ERXDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */ | 140 | #define HPC3_EDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */ |
141 | #define HPC3_ERXDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */ | 141 | #define HPC3_EDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */ |
142 | #define HPC3_ERXDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */ | 142 | #define HPC3_EDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */ |
143 | #define HPC3_ERXDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */ | 143 | #define HPC3_EDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */ |
144 | #define HPC3_ERXDCFG_PTO 0x30000 /* Programmed timeout value for above two */ | 144 | #define HPC3_EDCFG_PTO 0x30000 /* Programmed timeout value for above two */ |
145 | 145 | ||
146 | volatile u32 rx_pconfig; /* PIO configuration register */ | 146 | volatile u32 pconfig; /* PIO configuration register */ |
147 | #define HPC3_ERXPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */ | 147 | #define HPC3_EPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */ |
148 | #define HPC3_ERXPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */ | 148 | #define HPC3_EPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */ |
149 | #define HPC3_ERXPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */ | 149 | #define HPC3_EPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */ |
150 | #define HPC3_ERXPCFG_TST 0x1000 /* Diagnistic ram test feature bit */ | 150 | #define HPC3_EPCFG_TST 0x1000 /* Diagnistic ram test feature bit */ |
151 | 151 | ||
152 | u32 _unused2[0x1000/4 - 8]; /* padding */ | 152 | u32 _unused2[0x1000/4 - 8]; /* padding */ |
153 | 153 | ||
diff --git a/include/linux/cyclomx.h b/include/linux/cyclomx.h index 04fa7dff079c..300d704bdb9a 100644 --- a/include/linux/cyclomx.h +++ b/include/linux/cyclomx.h | |||
@@ -37,8 +37,6 @@ | |||
37 | #include <linux/cycx_x25.h> | 37 | #include <linux/cycx_x25.h> |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | #define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0) | ||
41 | |||
42 | /* Adapter Data Space. | 40 | /* Adapter Data Space. |
43 | * This structure is needed because we handle multiple cards, otherwise | 41 | * This structure is needed because we handle multiple cards, otherwise |
44 | * static data would do it. | 42 | * static data would do it. |
diff --git a/include/linux/cycx_drv.h b/include/linux/cycx_drv.h index 6621df86a748..12fe6b0bfcff 100644 --- a/include/linux/cycx_drv.h +++ b/include/linux/cycx_drv.h | |||
@@ -60,6 +60,5 @@ extern int cycx_peek(struct cycx_hw *hw, u32 addr, void *buf, u32 len); | |||
60 | extern int cycx_poke(struct cycx_hw *hw, u32 addr, void *buf, u32 len); | 60 | extern int cycx_poke(struct cycx_hw *hw, u32 addr, void *buf, u32 len); |
61 | extern int cycx_exec(void __iomem *addr); | 61 | extern int cycx_exec(void __iomem *addr); |
62 | 62 | ||
63 | extern void cycx_inten(struct cycx_hw *hw); | ||
64 | extern void cycx_intr(struct cycx_hw *hw); | 63 | extern void cycx_intr(struct cycx_hw *hw); |
65 | #endif /* _CYCX_DRV_H */ | 64 | #endif /* _CYCX_DRV_H */ |
diff --git a/include/linux/ibmtr.h b/include/linux/ibmtr.h index 2ef0b21517fb..1c7a0dd5536a 100644 --- a/include/linux/ibmtr.h +++ b/include/linux/ibmtr.h | |||
@@ -7,8 +7,8 @@ | |||
7 | /* ported to the Alpha architecture 02/20/96 (just used the HZ macro) */ | 7 | /* ported to the Alpha architecture 02/20/96 (just used the HZ macro) */ |
8 | 8 | ||
9 | #define TR_RETRY_INTERVAL (30*HZ) /* 500 on PC = 5 s */ | 9 | #define TR_RETRY_INTERVAL (30*HZ) /* 500 on PC = 5 s */ |
10 | #define TR_RST_TIME (HZ/20) /* 5 on PC = 50 ms */ | 10 | #define TR_RST_TIME (msecs_to_jiffies(50)) /* 5 on PC = 50 ms */ |
11 | #define TR_BUSY_INTERVAL (HZ/5) /* 5 on PC = 200 ms */ | 11 | #define TR_BUSY_INTERVAL (msecs_to_jiffies(200)) /* 5 on PC = 200 ms */ |
12 | #define TR_SPIN_INTERVAL (3*HZ) /* 3 seconds before init timeout */ | 12 | #define TR_SPIN_INTERVAL (3*HZ) /* 3 seconds before init timeout */ |
13 | 13 | ||
14 | #define TR_ISA 1 | 14 | #define TR_ISA 1 |
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index 0856548a2a08..a8b1a2071838 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h | |||
@@ -84,6 +84,7 @@ | |||
84 | #define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */ | 84 | #define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */ |
85 | #define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ | 85 | #define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ |
86 | #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ | 86 | #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ |
87 | #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ | ||
87 | 88 | ||
88 | #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ | 89 | #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ |
89 | #define ARPHRD_NONE 0xFFFE /* zero header length */ | 90 | #define ARPHRD_NONE 0xFFFE /* zero header length */ |
diff --git a/include/linux/mii.h b/include/linux/mii.h index 9b8d0476988a..68f5a0f392dd 100644 --- a/include/linux/mii.h +++ b/include/linux/mii.h | |||
@@ -158,6 +158,7 @@ extern int mii_link_ok (struct mii_if_info *mii); | |||
158 | extern int mii_nway_restart (struct mii_if_info *mii); | 158 | extern int mii_nway_restart (struct mii_if_info *mii); |
159 | extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); | 159 | extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); |
160 | extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); | 160 | extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); |
161 | extern int mii_check_gmii_support(struct mii_if_info *mii); | ||
161 | extern void mii_check_link (struct mii_if_info *mii); | 162 | extern void mii_check_link (struct mii_if_info *mii); |
162 | extern unsigned int mii_check_media (struct mii_if_info *mii, | 163 | extern unsigned int mii_check_media (struct mii_if_info *mii, |
163 | unsigned int ok_to_print, | 164 | unsigned int ok_to_print, |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 368e4c825ff1..a9281b24c40b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -873,11 +873,9 @@ static inline void netif_rx_complete(struct net_device *dev) | |||
873 | 873 | ||
874 | static inline void netif_poll_disable(struct net_device *dev) | 874 | static inline void netif_poll_disable(struct net_device *dev) |
875 | { | 875 | { |
876 | while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) { | 876 | while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) |
877 | /* No hurry. */ | 877 | /* No hurry. */ |
878 | current->state = TASK_INTERRUPTIBLE; | 878 | schedule_timeout_interruptible(1); |
879 | schedule_timeout(1); | ||
880 | } | ||
881 | } | 879 | } |
882 | 880 | ||
883 | static inline void netif_poll_enable(struct net_device *dev) | 881 | static inline void netif_poll_enable(struct net_device *dev) |
diff --git a/include/linux/sdladrv.h b/include/linux/sdladrv.h index 78f634007fc6..c85e103d5e7b 100644 --- a/include/linux/sdladrv.h +++ b/include/linux/sdladrv.h | |||
@@ -52,12 +52,8 @@ typedef struct sdlahw | |||
52 | 52 | ||
53 | extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len); | 53 | extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len); |
54 | extern int sdla_down (sdlahw_t* hw); | 54 | extern int sdla_down (sdlahw_t* hw); |
55 | extern int sdla_inten (sdlahw_t* hw); | ||
56 | extern int sdla_intde (sdlahw_t* hw); | ||
57 | extern int sdla_intack (sdlahw_t* hw); | ||
58 | extern void S514_intack (sdlahw_t* hw, u32 int_status); | 55 | extern void S514_intack (sdlahw_t* hw, u32 int_status); |
59 | extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status); | 56 | extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status); |
60 | extern int sdla_intr (sdlahw_t* hw); | ||
61 | extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr); | 57 | extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr); |
62 | extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf, | 58 | extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf, |
63 | unsigned len); | 59 | unsigned len); |
diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h index 167d956c492b..dae9860091dd 100644 --- a/include/linux/wanpipe.h +++ b/include/linux/wanpipe.h | |||
@@ -265,15 +265,6 @@ typedef struct { | |||
265 | #include <linux/tty_driver.h> | 265 | #include <linux/tty_driver.h> |
266 | #include <linux/tty_flip.h> | 266 | #include <linux/tty_flip.h> |
267 | 267 | ||
268 | |||
269 | #define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0) | ||
270 | #define is_alpha(ch) ((((ch)>=(unsigned)'a'&&(ch)<=(unsigned)'z')||\ | ||
271 | ((ch)>=(unsigned)'A'&&(ch)<=(unsigned)'Z'))?1:0) | ||
272 | #define is_hex_digit(ch) ((((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')||\ | ||
273 | ((ch)>=(unsigned)'a'&&(ch)<=(unsigned)'f')||\ | ||
274 | ((ch)>=(unsigned)'A'&&(ch)<=(unsigned)'F'))?1:0) | ||
275 | |||
276 | |||
277 | /****** Data Structures *****************************************************/ | 268 | /****** Data Structures *****************************************************/ |
278 | 269 | ||
279 | /* Adapter Data Space. | 270 | /* Adapter Data Space. |
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index dc36b1be6745..5e38dca1d082 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -11,19 +11,26 @@ | |||
11 | * | 11 | * |
12 | * Adaption to a generic IEEE 802.11 stack by James Ketrenos | 12 | * Adaption to a generic IEEE 802.11 stack by James Ketrenos |
13 | * <jketreno@linux.intel.com> | 13 | * <jketreno@linux.intel.com> |
14 | * Copyright (c) 2004, Intel Corporation | 14 | * Copyright (c) 2004-2005, Intel Corporation |
15 | * | 15 | * |
16 | * This program is free software; you can redistribute it and/or modify | 16 | * This program is free software; you can redistribute it and/or modify |
17 | * it under the terms of the GNU General Public License version 2 as | 17 | * it under the terms of the GNU General Public License version 2 as |
18 | * published by the Free Software Foundation. See README and COPYING for | 18 | * published by the Free Software Foundation. See README and COPYING for |
19 | * more details. | 19 | * more details. |
20 | * | ||
21 | * API Version History | ||
22 | * 1.0.x -- Initial version | ||
23 | * 1.1.x -- Added radiotap, QoS, TIM, ieee80211_geo APIs, | ||
24 | * various structure changes, and crypto API init method | ||
20 | */ | 25 | */ |
21 | #ifndef IEEE80211_H | 26 | #ifndef IEEE80211_H |
22 | #define IEEE80211_H | 27 | #define IEEE80211_H |
23 | #include <linux/if_ether.h> /* ETH_ALEN */ | 28 | #include <linux/if_ether.h> /* ETH_ALEN */ |
24 | #include <linux/kernel.h> /* ARRAY_SIZE */ | 29 | #include <linux/kernel.h> /* ARRAY_SIZE */ |
25 | #include <linux/wireless.h> | 30 | #include <linux/wireless.h> |
26 | 31 | ||
32 | #define IEEE80211_VERSION "git-1.1.6" | ||
33 | |||
27 | #define IEEE80211_DATA_LEN 2304 | 34 | #define IEEE80211_DATA_LEN 2304 |
28 | /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section | 35 | /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section |
29 | 6.2.1.1.2. | 36 | 6.2.1.1.2. |
@@ -33,34 +40,13 @@ | |||
33 | represents the 2304 bytes of real data, plus a possible 8 bytes of | 40 | represents the 2304 bytes of real data, plus a possible 8 bytes of |
34 | WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ | 41 | WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ |
35 | 42 | ||
36 | |||
37 | #define IEEE80211_HLEN 30 | ||
38 | #define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) | ||
39 | |||
40 | struct ieee80211_hdr { | ||
41 | __le16 frame_ctl; | ||
42 | __le16 duration_id; | ||
43 | u8 addr1[ETH_ALEN]; | ||
44 | u8 addr2[ETH_ALEN]; | ||
45 | u8 addr3[ETH_ALEN]; | ||
46 | __le16 seq_ctl; | ||
47 | u8 addr4[ETH_ALEN]; | ||
48 | } __attribute__ ((packed)); | ||
49 | |||
50 | struct ieee80211_hdr_3addr { | ||
51 | __le16 frame_ctl; | ||
52 | __le16 duration_id; | ||
53 | u8 addr1[ETH_ALEN]; | ||
54 | u8 addr2[ETH_ALEN]; | ||
55 | u8 addr3[ETH_ALEN]; | ||
56 | __le16 seq_ctl; | ||
57 | } __attribute__ ((packed)); | ||
58 | |||
59 | #define IEEE80211_1ADDR_LEN 10 | 43 | #define IEEE80211_1ADDR_LEN 10 |
60 | #define IEEE80211_2ADDR_LEN 16 | 44 | #define IEEE80211_2ADDR_LEN 16 |
61 | #define IEEE80211_3ADDR_LEN 24 | 45 | #define IEEE80211_3ADDR_LEN 24 |
62 | #define IEEE80211_4ADDR_LEN 30 | 46 | #define IEEE80211_4ADDR_LEN 30 |
63 | #define IEEE80211_FCS_LEN 4 | 47 | #define IEEE80211_FCS_LEN 4 |
48 | #define IEEE80211_HLEN (IEEE80211_4ADDR_LEN) | ||
49 | #define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) | ||
64 | 50 | ||
65 | #define MIN_FRAG_THRESHOLD 256U | 51 | #define MIN_FRAG_THRESHOLD 256U |
66 | #define MAX_FRAG_THRESHOLD 2346U | 52 | #define MAX_FRAG_THRESHOLD 2346U |
@@ -113,11 +99,11 @@ struct ieee80211_hdr_3addr { | |||
113 | #define IEEE80211_STYPE_CFACK 0x0050 | 99 | #define IEEE80211_STYPE_CFACK 0x0050 |
114 | #define IEEE80211_STYPE_CFPOLL 0x0060 | 100 | #define IEEE80211_STYPE_CFPOLL 0x0060 |
115 | #define IEEE80211_STYPE_CFACKPOLL 0x0070 | 101 | #define IEEE80211_STYPE_CFACKPOLL 0x0070 |
102 | #define IEEE80211_STYPE_QOS_DATA 0x0080 | ||
116 | 103 | ||
117 | #define IEEE80211_SCTL_FRAG 0x000F | 104 | #define IEEE80211_SCTL_FRAG 0x000F |
118 | #define IEEE80211_SCTL_SEQ 0xFFF0 | 105 | #define IEEE80211_SCTL_SEQ 0xFFF0 |
119 | 106 | ||
120 | |||
121 | /* debug macros */ | 107 | /* debug macros */ |
122 | 108 | ||
123 | #ifdef CONFIG_IEEE80211_DEBUG | 109 | #ifdef CONFIG_IEEE80211_DEBUG |
@@ -128,8 +114,7 @@ do { if (ieee80211_debug_level & (level)) \ | |||
128 | in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) | 114 | in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) |
129 | #else | 115 | #else |
130 | #define IEEE80211_DEBUG(level, fmt, args...) do {} while (0) | 116 | #define IEEE80211_DEBUG(level, fmt, args...) do {} while (0) |
131 | #endif /* CONFIG_IEEE80211_DEBUG */ | 117 | #endif /* CONFIG_IEEE80211_DEBUG */ |
132 | |||
133 | 118 | ||
134 | /* debug macros not dependent on CONFIG_IEEE80211_DEBUG */ | 119 | /* debug macros not dependent on CONFIG_IEEE80211_DEBUG */ |
135 | 120 | ||
@@ -140,7 +125,6 @@ do { if (ieee80211_debug_level & (level)) \ | |||
140 | * messages. It should never be used for passing essid to user space. */ | 125 | * messages. It should never be used for passing essid to user space. */ |
141 | const char *escape_essid(const char *essid, u8 essid_len); | 126 | const char *escape_essid(const char *essid, u8 essid_len); |
142 | 127 | ||
143 | |||
144 | /* | 128 | /* |
145 | * To use the debug system: | 129 | * To use the debug system: |
146 | * | 130 | * |
@@ -177,6 +161,7 @@ const char *escape_essid(const char *essid, u8 essid_len); | |||
177 | 161 | ||
178 | #define IEEE80211_DL_TX (1<<8) | 162 | #define IEEE80211_DL_TX (1<<8) |
179 | #define IEEE80211_DL_RX (1<<9) | 163 | #define IEEE80211_DL_RX (1<<9) |
164 | #define IEEE80211_DL_QOS (1<<31) | ||
180 | 165 | ||
181 | #define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a) | 166 | #define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a) |
182 | #define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a) | 167 | #define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a) |
@@ -190,9 +175,10 @@ const char *escape_essid(const char *essid, u8 essid_len); | |||
190 | #define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a) | 175 | #define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a) |
191 | #define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a) | 176 | #define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a) |
192 | #define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a) | 177 | #define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a) |
178 | #define IEEE80211_DEBUG_QOS(f, a...) IEEE80211_DEBUG(IEEE80211_DL_QOS, f, ## a) | ||
193 | #include <linux/netdevice.h> | 179 | #include <linux/netdevice.h> |
194 | #include <linux/wireless.h> | 180 | #include <linux/wireless.h> |
195 | #include <linux/if_arp.h> /* ARPHRD_ETHER */ | 181 | #include <linux/if_arp.h> /* ARPHRD_ETHER */ |
196 | 182 | ||
197 | #ifndef WIRELESS_SPY | 183 | #ifndef WIRELESS_SPY |
198 | #define WIRELESS_SPY /* enable iwspy support */ | 184 | #define WIRELESS_SPY /* enable iwspy support */ |
@@ -200,10 +186,10 @@ const char *escape_essid(const char *essid, u8 essid_len); | |||
200 | #include <net/iw_handler.h> /* new driver API */ | 186 | #include <net/iw_handler.h> /* new driver API */ |
201 | 187 | ||
202 | #ifndef ETH_P_PAE | 188 | #ifndef ETH_P_PAE |
203 | #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ | 189 | #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ |
204 | #endif /* ETH_P_PAE */ | 190 | #endif /* ETH_P_PAE */ |
205 | 191 | ||
206 | #define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */ | 192 | #define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */ |
207 | 193 | ||
208 | #ifndef ETH_P_80211_RAW | 194 | #ifndef ETH_P_80211_RAW |
209 | #define ETH_P_80211_RAW (ETH_P_ECONET + 1) | 195 | #define ETH_P_80211_RAW (ETH_P_ECONET + 1) |
@@ -215,10 +201,10 @@ const char *escape_essid(const char *essid, u8 essid_len); | |||
215 | 201 | ||
216 | struct ieee80211_snap_hdr { | 202 | struct ieee80211_snap_hdr { |
217 | 203 | ||
218 | u8 dsap; /* always 0xAA */ | 204 | u8 dsap; /* always 0xAA */ |
219 | u8 ssap; /* always 0xAA */ | 205 | u8 ssap; /* always 0xAA */ |
220 | u8 ctrl; /* always 0x03 */ | 206 | u8 ctrl; /* always 0x03 */ |
221 | u8 oui[P80211_OUI_LEN]; /* organizational universal id */ | 207 | u8 oui[P80211_OUI_LEN]; /* organizational universal id */ |
222 | 208 | ||
223 | } __attribute__ ((packed)); | 209 | } __attribute__ ((packed)); |
224 | 210 | ||
@@ -246,8 +232,9 @@ struct ieee80211_snap_hdr { | |||
246 | #define WLAN_CAPABILITY_PBCC (1<<6) | 232 | #define WLAN_CAPABILITY_PBCC (1<<6) |
247 | #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) | 233 | #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) |
248 | #define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) | 234 | #define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) |
235 | #define WLAN_CAPABILITY_QOS (1<<9) | ||
249 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) | 236 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) |
250 | #define WLAN_CAPABILITY_OSSS_OFDM (1<<13) | 237 | #define WLAN_CAPABILITY_DSSS_OFDM (1<<13) |
251 | 238 | ||
252 | /* Status codes */ | 239 | /* Status codes */ |
253 | enum ieee80211_statuscode { | 240 | enum ieee80211_statuscode { |
@@ -312,14 +299,12 @@ enum ieee80211_reasoncode { | |||
312 | WLAN_REASON_CIPHER_SUITE_REJECTED = 24, | 299 | WLAN_REASON_CIPHER_SUITE_REJECTED = 24, |
313 | }; | 300 | }; |
314 | 301 | ||
315 | |||
316 | #define IEEE80211_STATMASK_SIGNAL (1<<0) | 302 | #define IEEE80211_STATMASK_SIGNAL (1<<0) |
317 | #define IEEE80211_STATMASK_RSSI (1<<1) | 303 | #define IEEE80211_STATMASK_RSSI (1<<1) |
318 | #define IEEE80211_STATMASK_NOISE (1<<2) | 304 | #define IEEE80211_STATMASK_NOISE (1<<2) |
319 | #define IEEE80211_STATMASK_RATE (1<<3) | 305 | #define IEEE80211_STATMASK_RATE (1<<3) |
320 | #define IEEE80211_STATMASK_WEMASK 0x7 | 306 | #define IEEE80211_STATMASK_WEMASK 0x7 |
321 | 307 | ||
322 | |||
323 | #define IEEE80211_CCK_MODULATION (1<<0) | 308 | #define IEEE80211_CCK_MODULATION (1<<0) |
324 | #define IEEE80211_OFDM_MODULATION (1<<1) | 309 | #define IEEE80211_OFDM_MODULATION (1<<1) |
325 | 310 | ||
@@ -377,9 +362,6 @@ enum ieee80211_reasoncode { | |||
377 | #define IEEE80211_NUM_CCK_RATES 4 | 362 | #define IEEE80211_NUM_CCK_RATES 4 |
378 | #define IEEE80211_OFDM_SHIFT_MASK_A 4 | 363 | #define IEEE80211_OFDM_SHIFT_MASK_A 4 |
379 | 364 | ||
380 | |||
381 | |||
382 | |||
383 | /* NOTE: This data is for statistical purposes; not all hardware provides this | 365 | /* NOTE: This data is for statistical purposes; not all hardware provides this |
384 | * information for frames received. Not setting these will not cause | 366 | * information for frames received. Not setting these will not cause |
385 | * any adverse affects. */ | 367 | * any adverse affects. */ |
@@ -388,7 +370,7 @@ struct ieee80211_rx_stats { | |||
388 | s8 rssi; | 370 | s8 rssi; |
389 | u8 signal; | 371 | u8 signal; |
390 | u8 noise; | 372 | u8 noise; |
391 | u16 rate; /* in 100 kbps */ | 373 | u16 rate; /* in 100 kbps */ |
392 | u8 received_channel; | 374 | u8 received_channel; |
393 | u8 control; | 375 | u8 control; |
394 | u8 mask; | 376 | u8 mask; |
@@ -439,38 +421,44 @@ struct ieee80211_device; | |||
439 | 421 | ||
440 | #include "ieee80211_crypt.h" | 422 | #include "ieee80211_crypt.h" |
441 | 423 | ||
442 | #define SEC_KEY_1 (1<<0) | 424 | #define SEC_KEY_1 (1<<0) |
443 | #define SEC_KEY_2 (1<<1) | 425 | #define SEC_KEY_2 (1<<1) |
444 | #define SEC_KEY_3 (1<<2) | 426 | #define SEC_KEY_3 (1<<2) |
445 | #define SEC_KEY_4 (1<<3) | 427 | #define SEC_KEY_4 (1<<3) |
446 | #define SEC_ACTIVE_KEY (1<<4) | 428 | #define SEC_ACTIVE_KEY (1<<4) |
447 | #define SEC_AUTH_MODE (1<<5) | 429 | #define SEC_AUTH_MODE (1<<5) |
448 | #define SEC_UNICAST_GROUP (1<<6) | 430 | #define SEC_UNICAST_GROUP (1<<6) |
449 | #define SEC_LEVEL (1<<7) | 431 | #define SEC_LEVEL (1<<7) |
450 | #define SEC_ENABLED (1<<8) | 432 | #define SEC_ENABLED (1<<8) |
451 | 433 | #define SEC_ENCRYPT (1<<9) | |
452 | #define SEC_LEVEL_0 0 /* None */ | 434 | |
453 | #define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */ | 435 | #define SEC_LEVEL_0 0 /* None */ |
454 | #define SEC_LEVEL_2 2 /* Level 1 + TKIP */ | 436 | #define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */ |
455 | #define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */ | 437 | #define SEC_LEVEL_2 2 /* Level 1 + TKIP */ |
456 | #define SEC_LEVEL_3 4 /* Level 2 + CCMP */ | 438 | #define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */ |
457 | 439 | #define SEC_LEVEL_3 4 /* Level 2 + CCMP */ | |
458 | #define WEP_KEYS 4 | 440 | |
459 | #define WEP_KEY_LEN 13 | 441 | #define SEC_ALG_NONE 0 |
442 | #define SEC_ALG_WEP 1 | ||
443 | #define SEC_ALG_TKIP 2 | ||
444 | #define SEC_ALG_CCMP 3 | ||
445 | |||
446 | #define WEP_KEYS 4 | ||
447 | #define WEP_KEY_LEN 13 | ||
448 | #define SCM_KEY_LEN 32 | ||
449 | #define SCM_TEMPORAL_KEY_LENGTH 16 | ||
460 | 450 | ||
461 | struct ieee80211_security { | 451 | struct ieee80211_security { |
462 | u16 active_key:2, | 452 | u16 active_key:2, |
463 | enabled:1, | 453 | enabled:1, |
464 | auth_mode:2, | 454 | auth_mode:2, auth_algo:4, unicast_uses_group:1, encrypt:1; |
465 | auth_algo:4, | 455 | u8 encode_alg[WEP_KEYS]; |
466 | unicast_uses_group:1; | ||
467 | u8 key_sizes[WEP_KEYS]; | 456 | u8 key_sizes[WEP_KEYS]; |
468 | u8 keys[WEP_KEYS][WEP_KEY_LEN]; | 457 | u8 keys[WEP_KEYS][SCM_KEY_LEN]; |
469 | u8 level; | 458 | u8 level; |
470 | u16 flags; | 459 | u16 flags; |
471 | } __attribute__ ((packed)); | 460 | } __attribute__ ((packed)); |
472 | 461 | ||
473 | |||
474 | /* | 462 | /* |
475 | 463 | ||
476 | 802.11 data frame from AP | 464 | 802.11 data frame from AP |
@@ -494,7 +482,7 @@ enum ieee80211_mfie { | |||
494 | MFIE_TYPE_RATES = 1, | 482 | MFIE_TYPE_RATES = 1, |
495 | MFIE_TYPE_FH_SET = 2, | 483 | MFIE_TYPE_FH_SET = 2, |
496 | MFIE_TYPE_DS_SET = 3, | 484 | MFIE_TYPE_DS_SET = 3, |
497 | MFIE_TYPE_CF_SET = 4, | 485 | MFIE_TYPE_CF_SET = 4, |
498 | MFIE_TYPE_TIM = 5, | 486 | MFIE_TYPE_TIM = 5, |
499 | MFIE_TYPE_IBSS_SET = 6, | 487 | MFIE_TYPE_IBSS_SET = 6, |
500 | MFIE_TYPE_COUNTRY = 7, | 488 | MFIE_TYPE_COUNTRY = 7, |
@@ -516,11 +504,75 @@ enum ieee80211_mfie { | |||
516 | MFIE_TYPE_RSN = 48, | 504 | MFIE_TYPE_RSN = 48, |
517 | MFIE_TYPE_RATES_EX = 50, | 505 | MFIE_TYPE_RATES_EX = 50, |
518 | MFIE_TYPE_GENERIC = 221, | 506 | MFIE_TYPE_GENERIC = 221, |
507 | MFIE_TYPE_QOS_PARAMETER = 222, | ||
519 | }; | 508 | }; |
520 | 509 | ||
521 | struct ieee80211_info_element_hdr { | 510 | /* Minimal header; can be used for passing 802.11 frames with sufficient |
522 | u8 id; | 511 | * information to determine what type of underlying data type is actually |
523 | u8 len; | 512 | * stored in the data. */ |
513 | struct ieee80211_hdr { | ||
514 | __le16 frame_ctl; | ||
515 | __le16 duration_id; | ||
516 | u8 payload[0]; | ||
517 | } __attribute__ ((packed)); | ||
518 | |||
519 | struct ieee80211_hdr_1addr { | ||
520 | __le16 frame_ctl; | ||
521 | __le16 duration_id; | ||
522 | u8 addr1[ETH_ALEN]; | ||
523 | u8 payload[0]; | ||
524 | } __attribute__ ((packed)); | ||
525 | |||
526 | struct ieee80211_hdr_2addr { | ||
527 | __le16 frame_ctl; | ||
528 | __le16 duration_id; | ||
529 | u8 addr1[ETH_ALEN]; | ||
530 | u8 addr2[ETH_ALEN]; | ||
531 | u8 payload[0]; | ||
532 | } __attribute__ ((packed)); | ||
533 | |||
534 | struct ieee80211_hdr_3addr { | ||
535 | __le16 frame_ctl; | ||
536 | __le16 duration_id; | ||
537 | u8 addr1[ETH_ALEN]; | ||
538 | u8 addr2[ETH_ALEN]; | ||
539 | u8 addr3[ETH_ALEN]; | ||
540 | __le16 seq_ctl; | ||
541 | u8 payload[0]; | ||
542 | } __attribute__ ((packed)); | ||
543 | |||
544 | struct ieee80211_hdr_4addr { | ||
545 | __le16 frame_ctl; | ||
546 | __le16 duration_id; | ||
547 | u8 addr1[ETH_ALEN]; | ||
548 | u8 addr2[ETH_ALEN]; | ||
549 | u8 addr3[ETH_ALEN]; | ||
550 | __le16 seq_ctl; | ||
551 | u8 addr4[ETH_ALEN]; | ||
552 | u8 payload[0]; | ||
553 | } __attribute__ ((packed)); | ||
554 | |||
555 | struct ieee80211_hdr_3addrqos { | ||
556 | __le16 frame_ctl; | ||
557 | __le16 duration_id; | ||
558 | u8 addr1[ETH_ALEN]; | ||
559 | u8 addr2[ETH_ALEN]; | ||
560 | u8 addr3[ETH_ALEN]; | ||
561 | __le16 seq_ctl; | ||
562 | u8 payload[0]; | ||
563 | __le16 qos_ctl; | ||
564 | } __attribute__ ((packed)); | ||
565 | |||
566 | struct ieee80211_hdr_4addrqos { | ||
567 | __le16 frame_ctl; | ||
568 | __le16 duration_id; | ||
569 | u8 addr1[ETH_ALEN]; | ||
570 | u8 addr2[ETH_ALEN]; | ||
571 | u8 addr3[ETH_ALEN]; | ||
572 | __le16 seq_ctl; | ||
573 | u8 addr4[ETH_ALEN]; | ||
574 | u8 payload[0]; | ||
575 | __le16 qos_ctl; | ||
524 | } __attribute__ ((packed)); | 576 | } __attribute__ ((packed)); |
525 | 577 | ||
526 | struct ieee80211_info_element { | 578 | struct ieee80211_info_element { |
@@ -546,49 +598,77 @@ struct ieee80211_info_element { | |||
546 | u16 status; | 598 | u16 status; |
547 | */ | 599 | */ |
548 | 600 | ||
549 | struct ieee80211_authentication { | 601 | struct ieee80211_auth { |
550 | struct ieee80211_hdr_3addr header; | 602 | struct ieee80211_hdr_3addr header; |
551 | __le16 algorithm; | 603 | __le16 algorithm; |
552 | __le16 transaction; | 604 | __le16 transaction; |
553 | __le16 status; | 605 | __le16 status; |
554 | struct ieee80211_info_element info_element; | 606 | /* challenge */ |
607 | struct ieee80211_info_element info_element[0]; | ||
555 | } __attribute__ ((packed)); | 608 | } __attribute__ ((packed)); |
556 | 609 | ||
610 | struct ieee80211_disassoc { | ||
611 | struct ieee80211_hdr_3addr header; | ||
612 | __le16 reason; | ||
613 | } __attribute__ ((packed)); | ||
614 | |||
615 | /* Alias deauth for disassoc */ | ||
616 | #define ieee80211_deauth ieee80211_disassoc | ||
617 | |||
618 | struct ieee80211_probe_request { | ||
619 | struct ieee80211_hdr_3addr header; | ||
620 | /* SSID, supported rates */ | ||
621 | struct ieee80211_info_element info_element[0]; | ||
622 | } __attribute__ ((packed)); | ||
557 | 623 | ||
558 | struct ieee80211_probe_response { | 624 | struct ieee80211_probe_response { |
559 | struct ieee80211_hdr_3addr header; | 625 | struct ieee80211_hdr_3addr header; |
560 | u32 time_stamp[2]; | 626 | u32 time_stamp[2]; |
561 | __le16 beacon_interval; | 627 | __le16 beacon_interval; |
562 | __le16 capability; | 628 | __le16 capability; |
563 | struct ieee80211_info_element info_element; | 629 | /* SSID, supported rates, FH params, DS params, |
630 | * CF params, IBSS params, TIM (if beacon), RSN */ | ||
631 | struct ieee80211_info_element info_element[0]; | ||
564 | } __attribute__ ((packed)); | 632 | } __attribute__ ((packed)); |
565 | 633 | ||
566 | struct ieee80211_assoc_request_frame { | 634 | /* Alias beacon for probe_response */ |
635 | #define ieee80211_beacon ieee80211_probe_response | ||
636 | |||
637 | struct ieee80211_assoc_request { | ||
638 | struct ieee80211_hdr_3addr header; | ||
639 | __le16 capability; | ||
640 | __le16 listen_interval; | ||
641 | /* SSID, supported rates, RSN */ | ||
642 | struct ieee80211_info_element info_element[0]; | ||
643 | } __attribute__ ((packed)); | ||
644 | |||
645 | struct ieee80211_reassoc_request { | ||
646 | struct ieee80211_hdr_3addr header; | ||
567 | __le16 capability; | 647 | __le16 capability; |
568 | __le16 listen_interval; | 648 | __le16 listen_interval; |
569 | u8 current_ap[ETH_ALEN]; | 649 | u8 current_ap[ETH_ALEN]; |
570 | struct ieee80211_info_element info_element; | 650 | struct ieee80211_info_element info_element[0]; |
571 | } __attribute__ ((packed)); | 651 | } __attribute__ ((packed)); |
572 | 652 | ||
573 | struct ieee80211_assoc_response_frame { | 653 | struct ieee80211_assoc_response { |
574 | struct ieee80211_hdr_3addr header; | 654 | struct ieee80211_hdr_3addr header; |
575 | __le16 capability; | 655 | __le16 capability; |
576 | __le16 status; | 656 | __le16 status; |
577 | __le16 aid; | 657 | __le16 aid; |
578 | struct ieee80211_info_element info_element; /* supported rates */ | 658 | /* supported rates */ |
659 | struct ieee80211_info_element info_element[0]; | ||
579 | } __attribute__ ((packed)); | 660 | } __attribute__ ((packed)); |
580 | 661 | ||
581 | |||
582 | struct ieee80211_txb { | 662 | struct ieee80211_txb { |
583 | u8 nr_frags; | 663 | u8 nr_frags; |
584 | u8 encrypted; | 664 | u8 encrypted; |
585 | u16 reserved; | 665 | u8 rts_included; |
586 | u16 frag_size; | 666 | u8 reserved; |
587 | u16 payload_size; | 667 | __le16 frag_size; |
668 | __le16 payload_size; | ||
588 | struct sk_buff *fragments[0]; | 669 | struct sk_buff *fragments[0]; |
589 | }; | 670 | }; |
590 | 671 | ||
591 | |||
592 | /* SWEEP TABLE ENTRIES NUMBER */ | 672 | /* SWEEP TABLE ENTRIES NUMBER */ |
593 | #define MAX_SWEEP_TAB_ENTRIES 42 | 673 | #define MAX_SWEEP_TAB_ENTRIES 42 |
594 | #define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7 | 674 | #define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7 |
@@ -604,9 +684,68 @@ struct ieee80211_txb { | |||
604 | 684 | ||
605 | #define MAX_WPA_IE_LEN 64 | 685 | #define MAX_WPA_IE_LEN 64 |
606 | 686 | ||
607 | #define NETWORK_EMPTY_ESSID (1<<0) | 687 | #define NETWORK_EMPTY_ESSID (1<<0) |
608 | #define NETWORK_HAS_OFDM (1<<1) | 688 | #define NETWORK_HAS_OFDM (1<<1) |
609 | #define NETWORK_HAS_CCK (1<<2) | 689 | #define NETWORK_HAS_CCK (1<<2) |
690 | |||
691 | /* QoS structure */ | ||
692 | #define NETWORK_HAS_QOS_PARAMETERS (1<<3) | ||
693 | #define NETWORK_HAS_QOS_INFORMATION (1<<4) | ||
694 | #define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | NETWORK_HAS_QOS_INFORMATION) | ||
695 | |||
696 | #define QOS_QUEUE_NUM 4 | ||
697 | #define QOS_OUI_LEN 3 | ||
698 | #define QOS_OUI_TYPE 2 | ||
699 | #define QOS_ELEMENT_ID 221 | ||
700 | #define QOS_OUI_INFO_SUB_TYPE 0 | ||
701 | #define QOS_OUI_PARAM_SUB_TYPE 1 | ||
702 | #define QOS_VERSION_1 1 | ||
703 | #define QOS_AIFSN_MIN_VALUE 2 | ||
704 | |||
705 | struct ieee80211_qos_information_element { | ||
706 | u8 elementID; | ||
707 | u8 length; | ||
708 | u8 qui[QOS_OUI_LEN]; | ||
709 | u8 qui_type; | ||
710 | u8 qui_subtype; | ||
711 | u8 version; | ||
712 | u8 ac_info; | ||
713 | } __attribute__ ((packed)); | ||
714 | |||
715 | struct ieee80211_qos_ac_parameter { | ||
716 | u8 aci_aifsn; | ||
717 | u8 ecw_min_max; | ||
718 | __le16 tx_op_limit; | ||
719 | } __attribute__ ((packed)); | ||
720 | |||
721 | struct ieee80211_qos_parameter_info { | ||
722 | struct ieee80211_qos_information_element info_element; | ||
723 | u8 reserved; | ||
724 | struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM]; | ||
725 | } __attribute__ ((packed)); | ||
726 | |||
727 | struct ieee80211_qos_parameters { | ||
728 | __le16 cw_min[QOS_QUEUE_NUM]; | ||
729 | __le16 cw_max[QOS_QUEUE_NUM]; | ||
730 | u8 aifs[QOS_QUEUE_NUM]; | ||
731 | u8 flag[QOS_QUEUE_NUM]; | ||
732 | __le16 tx_op_limit[QOS_QUEUE_NUM]; | ||
733 | } __attribute__ ((packed)); | ||
734 | |||
735 | struct ieee80211_qos_data { | ||
736 | struct ieee80211_qos_parameters parameters; | ||
737 | int active; | ||
738 | int supported; | ||
739 | u8 param_count; | ||
740 | u8 old_param_count; | ||
741 | }; | ||
742 | |||
743 | struct ieee80211_tim_parameters { | ||
744 | u8 tim_count; | ||
745 | u8 tim_period; | ||
746 | } __attribute__ ((packed)); | ||
747 | |||
748 | /*******************************************************/ | ||
610 | 749 | ||
611 | struct ieee80211_network { | 750 | struct ieee80211_network { |
612 | /* These entries are used to identify a unique network */ | 751 | /* These entries are used to identify a unique network */ |
@@ -616,6 +755,8 @@ struct ieee80211_network { | |||
616 | u8 ssid[IW_ESSID_MAX_SIZE + 1]; | 755 | u8 ssid[IW_ESSID_MAX_SIZE + 1]; |
617 | u8 ssid_len; | 756 | u8 ssid_len; |
618 | 757 | ||
758 | struct ieee80211_qos_data qos_data; | ||
759 | |||
619 | /* These are network statistics */ | 760 | /* These are network statistics */ |
620 | struct ieee80211_rx_stats stats; | 761 | struct ieee80211_rx_stats stats; |
621 | u16 capability; | 762 | u16 capability; |
@@ -631,10 +772,12 @@ struct ieee80211_network { | |||
631 | u16 beacon_interval; | 772 | u16 beacon_interval; |
632 | u16 listen_interval; | 773 | u16 listen_interval; |
633 | u16 atim_window; | 774 | u16 atim_window; |
775 | u8 erp_value; | ||
634 | u8 wpa_ie[MAX_WPA_IE_LEN]; | 776 | u8 wpa_ie[MAX_WPA_IE_LEN]; |
635 | size_t wpa_ie_len; | 777 | size_t wpa_ie_len; |
636 | u8 rsn_ie[MAX_WPA_IE_LEN]; | 778 | u8 rsn_ie[MAX_WPA_IE_LEN]; |
637 | size_t rsn_ie_len; | 779 | size_t rsn_ie_len; |
780 | struct ieee80211_tim_parameters tim; | ||
638 | struct list_head list; | 781 | struct list_head list; |
639 | }; | 782 | }; |
640 | 783 | ||
@@ -651,17 +794,52 @@ enum ieee80211_state { | |||
651 | #define DEFAULT_MAX_SCAN_AGE (15 * HZ) | 794 | #define DEFAULT_MAX_SCAN_AGE (15 * HZ) |
652 | #define DEFAULT_FTS 2346 | 795 | #define DEFAULT_FTS 2346 |
653 | 796 | ||
654 | |||
655 | #define CFG_IEEE80211_RESERVE_FCS (1<<0) | 797 | #define CFG_IEEE80211_RESERVE_FCS (1<<0) |
656 | #define CFG_IEEE80211_COMPUTE_FCS (1<<1) | 798 | #define CFG_IEEE80211_COMPUTE_FCS (1<<1) |
799 | #define CFG_IEEE80211_RTS (1<<2) | ||
800 | |||
801 | #define IEEE80211_24GHZ_MIN_CHANNEL 1 | ||
802 | #define IEEE80211_24GHZ_MAX_CHANNEL 14 | ||
803 | #define IEEE80211_24GHZ_CHANNELS 14 | ||
804 | |||
805 | #define IEEE80211_52GHZ_MIN_CHANNEL 36 | ||
806 | #define IEEE80211_52GHZ_MAX_CHANNEL 165 | ||
807 | #define IEEE80211_52GHZ_CHANNELS 32 | ||
808 | |||
809 | enum { | ||
810 | IEEE80211_CH_PASSIVE_ONLY = (1 << 0), | ||
811 | IEEE80211_CH_B_ONLY = (1 << 2), | ||
812 | IEEE80211_CH_NO_IBSS = (1 << 3), | ||
813 | IEEE80211_CH_UNIFORM_SPREADING = (1 << 4), | ||
814 | IEEE80211_CH_RADAR_DETECT = (1 << 5), | ||
815 | IEEE80211_CH_INVALID = (1 << 6), | ||
816 | }; | ||
817 | |||
818 | struct ieee80211_channel { | ||
819 | u32 freq; | ||
820 | u8 channel; | ||
821 | u8 flags; | ||
822 | u8 max_power; | ||
823 | }; | ||
824 | |||
825 | struct ieee80211_geo { | ||
826 | u8 name[4]; | ||
827 | u8 bg_channels; | ||
828 | u8 a_channels; | ||
829 | struct ieee80211_channel bg[IEEE80211_24GHZ_CHANNELS]; | ||
830 | struct ieee80211_channel a[IEEE80211_52GHZ_CHANNELS]; | ||
831 | }; | ||
657 | 832 | ||
658 | struct ieee80211_device { | 833 | struct ieee80211_device { |
659 | struct net_device *dev; | 834 | struct net_device *dev; |
835 | struct ieee80211_security sec; | ||
660 | 836 | ||
661 | /* Bookkeeping structures */ | 837 | /* Bookkeeping structures */ |
662 | struct net_device_stats stats; | 838 | struct net_device_stats stats; |
663 | struct ieee80211_stats ieee_stats; | 839 | struct ieee80211_stats ieee_stats; |
664 | 840 | ||
841 | struct ieee80211_geo geo; | ||
842 | |||
665 | /* Probe / Beacon management */ | 843 | /* Probe / Beacon management */ |
666 | struct list_head network_free_list; | 844 | struct list_head network_free_list; |
667 | struct list_head network_list; | 845 | struct list_head network_list; |
@@ -669,62 +847,102 @@ struct ieee80211_device { | |||
669 | int scans; | 847 | int scans; |
670 | int scan_age; | 848 | int scan_age; |
671 | 849 | ||
672 | int iw_mode; /* operating mode (IW_MODE_*) */ | 850 | int iw_mode; /* operating mode (IW_MODE_*) */ |
851 | struct iw_spy_data spy_data; /* iwspy support */ | ||
673 | 852 | ||
674 | spinlock_t lock; | 853 | spinlock_t lock; |
675 | 854 | ||
676 | int tx_headroom; /* Set to size of any additional room needed at front | 855 | int tx_headroom; /* Set to size of any additional room needed at front |
677 | * of allocated Tx SKBs */ | 856 | * of allocated Tx SKBs */ |
678 | u32 config; | 857 | u32 config; |
679 | 858 | ||
680 | /* WEP and other encryption related settings at the device level */ | 859 | /* WEP and other encryption related settings at the device level */ |
681 | int open_wep; /* Set to 1 to allow unencrypted frames */ | 860 | int open_wep; /* Set to 1 to allow unencrypted frames */ |
682 | 861 | ||
683 | int reset_on_keychange; /* Set to 1 if the HW needs to be reset on | 862 | int reset_on_keychange; /* Set to 1 if the HW needs to be reset on |
684 | * WEP key changes */ | 863 | * WEP key changes */ |
685 | 864 | ||
686 | /* If the host performs {en,de}cryption, then set to 1 */ | 865 | /* If the host performs {en,de}cryption, then set to 1 */ |
687 | int host_encrypt; | 866 | int host_encrypt; |
867 | int host_encrypt_msdu; | ||
688 | int host_decrypt; | 868 | int host_decrypt; |
689 | int ieee802_1x; /* is IEEE 802.1X used */ | 869 | /* host performs multicast decryption */ |
870 | int host_mc_decrypt; | ||
871 | |||
872 | int host_open_frag; | ||
873 | int host_build_iv; | ||
874 | int ieee802_1x; /* is IEEE 802.1X used */ | ||
690 | 875 | ||
691 | /* WPA data */ | 876 | /* WPA data */ |
692 | int wpa_enabled; | 877 | int wpa_enabled; |
693 | int drop_unencrypted; | 878 | int drop_unencrypted; |
694 | int tkip_countermeasures; | ||
695 | int privacy_invoked; | 879 | int privacy_invoked; |
696 | size_t wpa_ie_len; | 880 | size_t wpa_ie_len; |
697 | u8 *wpa_ie; | 881 | u8 *wpa_ie; |
698 | 882 | ||
699 | struct list_head crypt_deinit_list; | 883 | struct list_head crypt_deinit_list; |
700 | struct ieee80211_crypt_data *crypt[WEP_KEYS]; | 884 | struct ieee80211_crypt_data *crypt[WEP_KEYS]; |
701 | int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */ | 885 | int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */ |
702 | struct timer_list crypt_deinit_timer; | 886 | struct timer_list crypt_deinit_timer; |
887 | int crypt_quiesced; | ||
703 | 888 | ||
704 | int bcrx_sta_key; /* use individual keys to override default keys even | 889 | int bcrx_sta_key; /* use individual keys to override default keys even |
705 | * with RX of broad/multicast frames */ | 890 | * with RX of broad/multicast frames */ |
706 | 891 | ||
707 | /* Fragmentation structures */ | 892 | /* Fragmentation structures */ |
708 | struct ieee80211_frag_entry frag_cache[IEEE80211_FRAG_CACHE_LEN]; | 893 | struct ieee80211_frag_entry frag_cache[IEEE80211_FRAG_CACHE_LEN]; |
709 | unsigned int frag_next_idx; | 894 | unsigned int frag_next_idx; |
710 | u16 fts; /* Fragmentation Threshold */ | 895 | u16 fts; /* Fragmentation Threshold */ |
896 | u16 rts; /* RTS threshold */ | ||
711 | 897 | ||
712 | /* Association info */ | 898 | /* Association info */ |
713 | u8 bssid[ETH_ALEN]; | 899 | u8 bssid[ETH_ALEN]; |
714 | 900 | ||
715 | enum ieee80211_state state; | 901 | enum ieee80211_state state; |
716 | 902 | ||
717 | int mode; /* A, B, G */ | 903 | int mode; /* A, B, G */ |
718 | int modulation; /* CCK, OFDM */ | 904 | int modulation; /* CCK, OFDM */ |
719 | int freq_band; /* 2.4Ghz, 5.2Ghz, Mixed */ | 905 | int freq_band; /* 2.4Ghz, 5.2Ghz, Mixed */ |
720 | int abg_ture; /* ABG flag */ | 906 | int abg_true; /* ABG flag */ |
907 | |||
908 | int perfect_rssi; | ||
909 | int worst_rssi; | ||
721 | 910 | ||
722 | /* Callback functions */ | 911 | /* Callback functions */ |
723 | void (*set_security)(struct net_device *dev, | 912 | void (*set_security) (struct net_device * dev, |
724 | struct ieee80211_security *sec); | 913 | struct ieee80211_security * sec); |
725 | int (*hard_start_xmit)(struct ieee80211_txb *txb, | 914 | int (*hard_start_xmit) (struct ieee80211_txb * txb, |
726 | struct net_device *dev); | 915 | struct net_device * dev, int pri); |
727 | int (*reset_port)(struct net_device *dev); | 916 | int (*reset_port) (struct net_device * dev); |
917 | int (*is_queue_full) (struct net_device * dev, int pri); | ||
918 | |||
919 | int (*handle_management) (struct net_device * dev, | ||
920 | struct ieee80211_network * network, u16 type); | ||
921 | |||
922 | /* Typical STA methods */ | ||
923 | int (*handle_auth) (struct net_device * dev, | ||
924 | struct ieee80211_auth * auth); | ||
925 | int (*handle_deauth) (struct net_device * dev, | ||
926 | struct ieee80211_auth * auth); | ||
927 | int (*handle_disassoc) (struct net_device * dev, | ||
928 | struct ieee80211_disassoc * assoc); | ||
929 | int (*handle_beacon) (struct net_device * dev, | ||
930 | struct ieee80211_beacon * beacon, | ||
931 | struct ieee80211_network * network); | ||
932 | int (*handle_probe_response) (struct net_device * dev, | ||
933 | struct ieee80211_probe_response * resp, | ||
934 | struct ieee80211_network * network); | ||
935 | int (*handle_probe_request) (struct net_device * dev, | ||
936 | struct ieee80211_probe_request * req, | ||
937 | struct ieee80211_rx_stats * stats); | ||
938 | int (*handle_assoc_response) (struct net_device * dev, | ||
939 | struct ieee80211_assoc_response * resp, | ||
940 | struct ieee80211_network * network); | ||
941 | |||
942 | /* Typical AP methods */ | ||
943 | int (*handle_assoc_request) (struct net_device * dev); | ||
944 | int (*handle_reassoc_request) (struct net_device * dev, | ||
945 | struct ieee80211_reassoc_request * req); | ||
728 | 946 | ||
729 | /* This must be the last item so that it points to the data | 947 | /* This must be the last item so that it points to the data |
730 | * allocated beyond this structure by alloc_ieee80211 */ | 948 | * allocated beyond this structure by alloc_ieee80211 */ |
@@ -736,12 +954,12 @@ struct ieee80211_device { | |||
736 | #define IEEE_G (1<<2) | 954 | #define IEEE_G (1<<2) |
737 | #define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) | 955 | #define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) |
738 | 956 | ||
739 | extern inline void *ieee80211_priv(struct net_device *dev) | 957 | static inline void *ieee80211_priv(struct net_device *dev) |
740 | { | 958 | { |
741 | return ((struct ieee80211_device *)netdev_priv(dev))->priv; | 959 | return ((struct ieee80211_device *)netdev_priv(dev))->priv; |
742 | } | 960 | } |
743 | 961 | ||
744 | extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) | 962 | static inline int ieee80211_is_empty_essid(const char *essid, int essid_len) |
745 | { | 963 | { |
746 | /* Single white space is for Linksys APs */ | 964 | /* Single white space is for Linksys APs */ |
747 | if (essid_len == 1 && essid[0] == ' ') | 965 | if (essid_len == 1 && essid[0] == ' ') |
@@ -757,7 +975,8 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) | |||
757 | return 1; | 975 | return 1; |
758 | } | 976 | } |
759 | 977 | ||
760 | extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode) | 978 | static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, |
979 | int mode) | ||
761 | { | 980 | { |
762 | /* | 981 | /* |
763 | * It is possible for both access points and our device to support | 982 | * It is possible for both access points and our device to support |
@@ -783,14 +1002,17 @@ extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mod | |||
783 | return 0; | 1002 | return 0; |
784 | } | 1003 | } |
785 | 1004 | ||
786 | extern inline int ieee80211_get_hdrlen(u16 fc) | 1005 | static inline int ieee80211_get_hdrlen(u16 fc) |
787 | { | 1006 | { |
788 | int hdrlen = IEEE80211_3ADDR_LEN; | 1007 | int hdrlen = IEEE80211_3ADDR_LEN; |
1008 | u16 stype = WLAN_FC_GET_STYPE(fc); | ||
789 | 1009 | ||
790 | switch (WLAN_FC_GET_TYPE(fc)) { | 1010 | switch (WLAN_FC_GET_TYPE(fc)) { |
791 | case IEEE80211_FTYPE_DATA: | 1011 | case IEEE80211_FTYPE_DATA: |
792 | if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) | 1012 | if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) |
793 | hdrlen = IEEE80211_4ADDR_LEN; | 1013 | hdrlen = IEEE80211_4ADDR_LEN; |
1014 | if (stype & IEEE80211_STYPE_QOS_DATA) | ||
1015 | hdrlen += 2; | ||
794 | break; | 1016 | break; |
795 | case IEEE80211_FTYPE_CTL: | 1017 | case IEEE80211_FTYPE_CTL: |
796 | switch (WLAN_FC_GET_STYPE(fc)) { | 1018 | switch (WLAN_FC_GET_STYPE(fc)) { |
@@ -808,7 +1030,48 @@ extern inline int ieee80211_get_hdrlen(u16 fc) | |||
808 | return hdrlen; | 1030 | return hdrlen; |
809 | } | 1031 | } |
810 | 1032 | ||
1033 | static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr) | ||
1034 | { | ||
1035 | switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) { | ||
1036 | case IEEE80211_1ADDR_LEN: | ||
1037 | return ((struct ieee80211_hdr_1addr *)hdr)->payload; | ||
1038 | case IEEE80211_2ADDR_LEN: | ||
1039 | return ((struct ieee80211_hdr_2addr *)hdr)->payload; | ||
1040 | case IEEE80211_3ADDR_LEN: | ||
1041 | return ((struct ieee80211_hdr_3addr *)hdr)->payload; | ||
1042 | case IEEE80211_4ADDR_LEN: | ||
1043 | return ((struct ieee80211_hdr_4addr *)hdr)->payload; | ||
1044 | } | ||
1045 | |||
1046 | } | ||
1047 | |||
1048 | static inline int ieee80211_is_ofdm_rate(u8 rate) | ||
1049 | { | ||
1050 | switch (rate & ~IEEE80211_BASIC_RATE_MASK) { | ||
1051 | case IEEE80211_OFDM_RATE_6MB: | ||
1052 | case IEEE80211_OFDM_RATE_9MB: | ||
1053 | case IEEE80211_OFDM_RATE_12MB: | ||
1054 | case IEEE80211_OFDM_RATE_18MB: | ||
1055 | case IEEE80211_OFDM_RATE_24MB: | ||
1056 | case IEEE80211_OFDM_RATE_36MB: | ||
1057 | case IEEE80211_OFDM_RATE_48MB: | ||
1058 | case IEEE80211_OFDM_RATE_54MB: | ||
1059 | return 1; | ||
1060 | } | ||
1061 | return 0; | ||
1062 | } | ||
811 | 1063 | ||
1064 | static inline int ieee80211_is_cck_rate(u8 rate) | ||
1065 | { | ||
1066 | switch (rate & ~IEEE80211_BASIC_RATE_MASK) { | ||
1067 | case IEEE80211_CCK_RATE_1MB: | ||
1068 | case IEEE80211_CCK_RATE_2MB: | ||
1069 | case IEEE80211_CCK_RATE_5MB: | ||
1070 | case IEEE80211_CCK_RATE_11MB: | ||
1071 | return 1; | ||
1072 | } | ||
1073 | return 0; | ||
1074 | } | ||
812 | 1075 | ||
813 | /* ieee80211.c */ | 1076 | /* ieee80211.c */ |
814 | extern void free_ieee80211(struct net_device *dev); | 1077 | extern void free_ieee80211(struct net_device *dev); |
@@ -817,18 +1080,30 @@ extern struct net_device *alloc_ieee80211(int sizeof_priv); | |||
817 | extern int ieee80211_set_encryption(struct ieee80211_device *ieee); | 1080 | extern int ieee80211_set_encryption(struct ieee80211_device *ieee); |
818 | 1081 | ||
819 | /* ieee80211_tx.c */ | 1082 | /* ieee80211_tx.c */ |
820 | extern int ieee80211_xmit(struct sk_buff *skb, | 1083 | extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev); |
821 | struct net_device *dev); | ||
822 | extern void ieee80211_txb_free(struct ieee80211_txb *); | 1084 | extern void ieee80211_txb_free(struct ieee80211_txb *); |
823 | 1085 | extern int ieee80211_tx_frame(struct ieee80211_device *ieee, | |
1086 | struct ieee80211_hdr *frame, int len); | ||
824 | 1087 | ||
825 | /* ieee80211_rx.c */ | 1088 | /* ieee80211_rx.c */ |
826 | extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | 1089 | extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, |
827 | struct ieee80211_rx_stats *rx_stats); | 1090 | struct ieee80211_rx_stats *rx_stats); |
828 | extern void ieee80211_rx_mgt(struct ieee80211_device *ieee, | 1091 | extern void ieee80211_rx_mgt(struct ieee80211_device *ieee, |
829 | struct ieee80211_hdr *header, | 1092 | struct ieee80211_hdr_4addr *header, |
830 | struct ieee80211_rx_stats *stats); | 1093 | struct ieee80211_rx_stats *stats); |
831 | 1094 | ||
1095 | /* ieee80211_geo.c */ | ||
1096 | extern const struct ieee80211_geo *ieee80211_get_geo(struct ieee80211_device | ||
1097 | *ieee); | ||
1098 | extern int ieee80211_set_geo(struct ieee80211_device *ieee, | ||
1099 | const struct ieee80211_geo *geo); | ||
1100 | |||
1101 | extern int ieee80211_is_valid_channel(struct ieee80211_device *ieee, | ||
1102 | u8 channel); | ||
1103 | extern int ieee80211_channel_to_index(struct ieee80211_device *ieee, | ||
1104 | u8 channel); | ||
1105 | extern u8 ieee80211_freq_to_channel(struct ieee80211_device *ieee, u32 freq); | ||
1106 | |||
832 | /* ieee80211_wx.c */ | 1107 | /* ieee80211_wx.c */ |
833 | extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee, | 1108 | extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee, |
834 | struct iw_request_info *info, | 1109 | struct iw_request_info *info, |
@@ -839,17 +1114,21 @@ extern int ieee80211_wx_set_encode(struct ieee80211_device *ieee, | |||
839 | extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee, | 1114 | extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee, |
840 | struct iw_request_info *info, | 1115 | struct iw_request_info *info, |
841 | union iwreq_data *wrqu, char *key); | 1116 | union iwreq_data *wrqu, char *key); |
842 | 1117 | extern int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee, | |
843 | 1118 | struct iw_request_info *info, | |
844 | extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee) | 1119 | union iwreq_data *wrqu, char *extra); |
1120 | extern int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee, | ||
1121 | struct iw_request_info *info, | ||
1122 | union iwreq_data *wrqu, char *extra); | ||
1123 | |||
1124 | static inline void ieee80211_increment_scans(struct ieee80211_device *ieee) | ||
845 | { | 1125 | { |
846 | ieee->scans++; | 1126 | ieee->scans++; |
847 | } | 1127 | } |
848 | 1128 | ||
849 | extern inline int ieee80211_get_scans(struct ieee80211_device *ieee) | 1129 | static inline int ieee80211_get_scans(struct ieee80211_device *ieee) |
850 | { | 1130 | { |
851 | return ieee->scans; | 1131 | return ieee->scans; |
852 | } | 1132 | } |
853 | 1133 | ||
854 | 1134 | #endif /* IEEE80211_H */ | |
855 | #endif /* IEEE80211_H */ | ||
diff --git a/include/net/ieee80211_crypt.h b/include/net/ieee80211_crypt.h index b58a3bcc0dc0..0a1c2d82ca4b 100644 --- a/include/net/ieee80211_crypt.h +++ b/include/net/ieee80211_crypt.h | |||
@@ -25,16 +25,22 @@ | |||
25 | 25 | ||
26 | #include <linux/skbuff.h> | 26 | #include <linux/skbuff.h> |
27 | 27 | ||
28 | enum { | ||
29 | IEEE80211_CRYPTO_TKIP_COUNTERMEASURES = (1 << 0), | ||
30 | }; | ||
31 | |||
28 | struct ieee80211_crypto_ops { | 32 | struct ieee80211_crypto_ops { |
29 | const char *name; | 33 | const char *name; |
30 | 34 | ||
31 | /* init new crypto context (e.g., allocate private data space, | 35 | /* init new crypto context (e.g., allocate private data space, |
32 | * select IV, etc.); returns NULL on failure or pointer to allocated | 36 | * select IV, etc.); returns NULL on failure or pointer to allocated |
33 | * private data on success */ | 37 | * private data on success */ |
34 | void * (*init)(int keyidx); | 38 | void *(*init) (int keyidx); |
35 | 39 | ||
36 | /* deinitialize crypto context and free allocated private data */ | 40 | /* deinitialize crypto context and free allocated private data */ |
37 | void (*deinit)(void *priv); | 41 | void (*deinit) (void *priv); |
42 | |||
43 | int (*build_iv) (struct sk_buff * skb, int hdr_len, void *priv); | ||
38 | 44 | ||
39 | /* encrypt/decrypt return < 0 on error or >= 0 on success. The return | 45 | /* encrypt/decrypt return < 0 on error or >= 0 on success. The return |
40 | * value from decrypt_mpdu is passed as the keyidx value for | 46 | * value from decrypt_mpdu is passed as the keyidx value for |
@@ -42,34 +48,39 @@ struct ieee80211_crypto_ops { | |||
42 | * encryption; if not, error will be returned; these functions are | 48 | * encryption; if not, error will be returned; these functions are |
43 | * called for all MPDUs (i.e., fragments). | 49 | * called for all MPDUs (i.e., fragments). |
44 | */ | 50 | */ |
45 | int (*encrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv); | 51 | int (*encrypt_mpdu) (struct sk_buff * skb, int hdr_len, void *priv); |
46 | int (*decrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv); | 52 | int (*decrypt_mpdu) (struct sk_buff * skb, int hdr_len, void *priv); |
47 | 53 | ||
48 | /* These functions are called for full MSDUs, i.e. full frames. | 54 | /* These functions are called for full MSDUs, i.e. full frames. |
49 | * These can be NULL if full MSDU operations are not needed. */ | 55 | * These can be NULL if full MSDU operations are not needed. */ |
50 | int (*encrypt_msdu)(struct sk_buff *skb, int hdr_len, void *priv); | 56 | int (*encrypt_msdu) (struct sk_buff * skb, int hdr_len, void *priv); |
51 | int (*decrypt_msdu)(struct sk_buff *skb, int keyidx, int hdr_len, | 57 | int (*decrypt_msdu) (struct sk_buff * skb, int keyidx, int hdr_len, |
52 | void *priv); | 58 | void *priv); |
53 | 59 | ||
54 | int (*set_key)(void *key, int len, u8 *seq, void *priv); | 60 | int (*set_key) (void *key, int len, u8 * seq, void *priv); |
55 | int (*get_key)(void *key, int len, u8 *seq, void *priv); | 61 | int (*get_key) (void *key, int len, u8 * seq, void *priv); |
56 | 62 | ||
57 | /* procfs handler for printing out key information and possible | 63 | /* procfs handler for printing out key information and possible |
58 | * statistics */ | 64 | * statistics */ |
59 | char * (*print_stats)(char *p, void *priv); | 65 | char *(*print_stats) (char *p, void *priv); |
66 | |||
67 | /* Crypto specific flag get/set for configuration settings */ | ||
68 | unsigned long (*get_flags) (void *priv); | ||
69 | unsigned long (*set_flags) (unsigned long flags, void *priv); | ||
60 | 70 | ||
61 | /* maximum number of bytes added by encryption; encrypt buf is | 71 | /* maximum number of bytes added by encryption; encrypt buf is |
62 | * allocated with extra_prefix_len bytes, copy of in_buf, and | 72 | * allocated with extra_prefix_len bytes, copy of in_buf, and |
63 | * extra_postfix_len; encrypt need not use all this space, but | 73 | * extra_postfix_len; encrypt need not use all this space, but |
64 | * the result must start at the beginning of the buffer and correct | 74 | * the result must start at the beginning of the buffer and correct |
65 | * length must be returned */ | 75 | * length must be returned */ |
66 | int extra_prefix_len, extra_postfix_len; | 76 | int extra_mpdu_prefix_len, extra_mpdu_postfix_len; |
77 | int extra_msdu_prefix_len, extra_msdu_postfix_len; | ||
67 | 78 | ||
68 | struct module *owner; | 79 | struct module *owner; |
69 | }; | 80 | }; |
70 | 81 | ||
71 | struct ieee80211_crypt_data { | 82 | struct ieee80211_crypt_data { |
72 | struct list_head list; /* delayed deletion list */ | 83 | struct list_head list; /* delayed deletion list */ |
73 | struct ieee80211_crypto_ops *ops; | 84 | struct ieee80211_crypto_ops *ops; |
74 | void *priv; | 85 | void *priv; |
75 | atomic_t refcnt; | 86 | atomic_t refcnt; |
@@ -77,10 +88,11 @@ struct ieee80211_crypt_data { | |||
77 | 88 | ||
78 | int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops); | 89 | int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops); |
79 | int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops); | 90 | int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops); |
80 | struct ieee80211_crypto_ops * ieee80211_get_crypto_ops(const char *name); | 91 | struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const char *name); |
81 | void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int); | 92 | void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int); |
82 | void ieee80211_crypt_deinit_handler(unsigned long); | 93 | void ieee80211_crypt_deinit_handler(unsigned long); |
83 | void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee, | 94 | void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee, |
84 | struct ieee80211_crypt_data **crypt); | 95 | struct ieee80211_crypt_data **crypt); |
96 | void ieee80211_crypt_quiescing(struct ieee80211_device *ieee); | ||
85 | 97 | ||
86 | #endif | 98 | #endif |
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h new file mode 100644 index 000000000000..429b73892a5f --- /dev/null +++ b/include/net/ieee80211_radiotap.h | |||
@@ -0,0 +1,231 @@ | |||
1 | /* $FreeBSD: src/sys/net80211/ieee80211_radiotap.h,v 1.5 2005/01/22 20:12:05 sam Exp $ */ | ||
2 | /* $NetBSD: ieee80211_radiotap.h,v 1.11 2005/06/22 06:16:02 dyoung Exp $ */ | ||
3 | |||
4 | /*- | ||
5 | * Copyright (c) 2003, 2004 David Young. All rights reserved. | ||
6 | * | ||
7 | * Redistribution and use in source and binary forms, with or without | ||
8 | * modification, are permitted provided that the following conditions | ||
9 | * are met: | ||
10 | * 1. Redistributions of source code must retain the above copyright | ||
11 | * notice, this list of conditions and the following disclaimer. | ||
12 | * 2. Redistributions in binary form must reproduce the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer in the | ||
14 | * documentation and/or other materials provided with the distribution. | ||
15 | * 3. The name of David Young may not be used to endorse or promote | ||
16 | * products derived from this software without specific prior | ||
17 | * written permission. | ||
18 | * | ||
19 | * THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``AS IS'' AND ANY | ||
20 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
21 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | ||
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID | ||
23 | * YOUNG BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED | ||
25 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
27 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY | ||
30 | * OF SUCH DAMAGE. | ||
31 | */ | ||
32 | |||
33 | /* | ||
34 | * Modifications to fit into the linux IEEE 802.11 stack, | ||
35 | * Mike Kershaw (dragorn@kismetwireless.net) | ||
36 | */ | ||
37 | |||
38 | #ifndef IEEE80211RADIOTAP_H | ||
39 | #define IEEE80211RADIOTAP_H | ||
40 | |||
41 | #include <linux/if_ether.h> | ||
42 | #include <linux/kernel.h> | ||
43 | |||
44 | /* Radiotap header version (from official NetBSD feed) */ | ||
45 | #define IEEE80211RADIOTAP_VERSION "1.5" | ||
46 | /* Base version of the radiotap packet header data */ | ||
47 | #define PKTHDR_RADIOTAP_VERSION 0 | ||
48 | |||
49 | /* A generic radio capture format is desirable. There is one for | ||
50 | * Linux, but it is neither rigidly defined (there were not even | ||
51 | * units given for some fields) nor easily extensible. | ||
52 | * | ||
53 | * I suggest the following extensible radio capture format. It is | ||
54 | * based on a bitmap indicating which fields are present. | ||
55 | * | ||
56 | * I am trying to describe precisely what the application programmer | ||
57 | * should expect in the following, and for that reason I tell the | ||
58 | * units and origin of each measurement (where it applies), or else I | ||
59 | * use sufficiently weaselly language ("is a monotonically nondecreasing | ||
60 | * function of...") that I cannot set false expectations for lawyerly | ||
61 | * readers. | ||
62 | */ | ||
63 | |||
64 | /* XXX tcpdump/libpcap do not tolerate variable-length headers, | ||
65 | * yet, so we pad every radiotap header to 64 bytes. Ugh. | ||
66 | */ | ||
67 | #define IEEE80211_RADIOTAP_HDRLEN 64 | ||
68 | |||
69 | /* The radio capture header precedes the 802.11 header. */ | ||
70 | struct ieee80211_radiotap_header { | ||
71 | u8 it_version; /* Version 0. Only increases | ||
72 | * for drastic changes, | ||
73 | * introduction of compatible | ||
74 | * new fields does not count. | ||
75 | */ | ||
76 | u8 it_pad; | ||
77 | u16 it_len; /* length of the whole | ||
78 | * header in bytes, including | ||
79 | * it_version, it_pad, | ||
80 | * it_len, and data fields. | ||
81 | */ | ||
82 | u32 it_present; /* A bitmap telling which | ||
83 | * fields are present. Set bit 31 | ||
84 | * (0x80000000) to extend the | ||
85 | * bitmap by another 32 bits. | ||
86 | * Additional extensions are made | ||
87 | * by setting bit 31. | ||
88 | */ | ||
89 | }; | ||
90 | |||
91 | /* Name Data type Units | ||
92 | * ---- --------- ----- | ||
93 | * | ||
94 | * IEEE80211_RADIOTAP_TSFT u64 microseconds | ||
95 | * | ||
96 | * Value in microseconds of the MAC's 64-bit 802.11 Time | ||
97 | * Synchronization Function timer when the first bit of the | ||
98 | * MPDU arrived at the MAC. For received frames, only. | ||
99 | * | ||
100 | * IEEE80211_RADIOTAP_CHANNEL 2 x u16 MHz, bitmap | ||
101 | * | ||
102 | * Tx/Rx frequency in MHz, followed by flags (see below). | ||
103 | * | ||
104 | * IEEE80211_RADIOTAP_FHSS u16 see below | ||
105 | * | ||
106 | * For frequency-hopping radios, the hop set (first byte) | ||
107 | * and pattern (second byte). | ||
108 | * | ||
109 | * IEEE80211_RADIOTAP_RATE u8 500kb/s | ||
110 | * | ||
111 | * Tx/Rx data rate | ||
112 | * | ||
113 | * IEEE80211_RADIOTAP_DBM_ANTSIGNAL int8_t decibels from | ||
114 | * one milliwatt (dBm) | ||
115 | * | ||
116 | * RF signal power at the antenna, decibel difference from | ||
117 | * one milliwatt. | ||
118 | * | ||
119 | * IEEE80211_RADIOTAP_DBM_ANTNOISE int8_t decibels from | ||
120 | * one milliwatt (dBm) | ||
121 | * | ||
122 | * RF noise power at the antenna, decibel difference from one | ||
123 | * milliwatt. | ||
124 | * | ||
125 | * IEEE80211_RADIOTAP_DB_ANTSIGNAL u8 decibel (dB) | ||
126 | * | ||
127 | * RF signal power at the antenna, decibel difference from an | ||
128 | * arbitrary, fixed reference. | ||
129 | * | ||
130 | * IEEE80211_RADIOTAP_DB_ANTNOISE u8 decibel (dB) | ||
131 | * | ||
132 | * RF noise power at the antenna, decibel difference from an | ||
133 | * arbitrary, fixed reference point. | ||
134 | * | ||
135 | * IEEE80211_RADIOTAP_LOCK_QUALITY u16 unitless | ||
136 | * | ||
137 | * Quality of Barker code lock. Unitless. Monotonically | ||
138 | * nondecreasing with "better" lock strength. Called "Signal | ||
139 | * Quality" in datasheets. (Is there a standard way to measure | ||
140 | * this?) | ||
141 | * | ||
142 | * IEEE80211_RADIOTAP_TX_ATTENUATION u16 unitless | ||
143 | * | ||
144 | * Transmit power expressed as unitless distance from max | ||
145 | * power set at factory calibration. 0 is max power. | ||
146 | * Monotonically nondecreasing with lower power levels. | ||
147 | * | ||
148 | * IEEE80211_RADIOTAP_DB_TX_ATTENUATION u16 decibels (dB) | ||
149 | * | ||
150 | * Transmit power expressed as decibel distance from max power | ||
151 | * set at factory calibration. 0 is max power. Monotonically | ||
152 | * nondecreasing with lower power levels. | ||
153 | * | ||
154 | * IEEE80211_RADIOTAP_DBM_TX_POWER int8_t decibels from | ||
155 | * one milliwatt (dBm) | ||
156 | * | ||
157 | * Transmit power expressed as dBm (decibels from a 1 milliwatt | ||
158 | * reference). This is the absolute power level measured at | ||
159 | * the antenna port. | ||
160 | * | ||
161 | * IEEE80211_RADIOTAP_FLAGS u8 bitmap | ||
162 | * | ||
163 | * Properties of transmitted and received frames. See flags | ||
164 | * defined below. | ||
165 | * | ||
166 | * IEEE80211_RADIOTAP_ANTENNA u8 antenna index | ||
167 | * | ||
168 | * Unitless indication of the Rx/Tx antenna for this packet. | ||
169 | * The first antenna is antenna 0. | ||
170 | * | ||
171 | * IEEE80211_RADIOTAP_FCS u32 data | ||
172 | * | ||
173 | * FCS from frame in network byte order. | ||
174 | */ | ||
175 | enum ieee80211_radiotap_type { | ||
176 | IEEE80211_RADIOTAP_TSFT = 0, | ||
177 | IEEE80211_RADIOTAP_FLAGS = 1, | ||
178 | IEEE80211_RADIOTAP_RATE = 2, | ||
179 | IEEE80211_RADIOTAP_CHANNEL = 3, | ||
180 | IEEE80211_RADIOTAP_FHSS = 4, | ||
181 | IEEE80211_RADIOTAP_DBM_ANTSIGNAL = 5, | ||
182 | IEEE80211_RADIOTAP_DBM_ANTNOISE = 6, | ||
183 | IEEE80211_RADIOTAP_LOCK_QUALITY = 7, | ||
184 | IEEE80211_RADIOTAP_TX_ATTENUATION = 8, | ||
185 | IEEE80211_RADIOTAP_DB_TX_ATTENUATION = 9, | ||
186 | IEEE80211_RADIOTAP_DBM_TX_POWER = 10, | ||
187 | IEEE80211_RADIOTAP_ANTENNA = 11, | ||
188 | IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12, | ||
189 | IEEE80211_RADIOTAP_DB_ANTNOISE = 13, | ||
190 | IEEE80211_RADIOTAP_EXT = 31, | ||
191 | }; | ||
192 | |||
193 | /* Channel flags. */ | ||
194 | #define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */ | ||
195 | #define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */ | ||
196 | #define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */ | ||
197 | #define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */ | ||
198 | #define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */ | ||
199 | #define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ | ||
200 | #define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ | ||
201 | #define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ | ||
202 | |||
203 | /* For IEEE80211_RADIOTAP_FLAGS */ | ||
204 | #define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received | ||
205 | * during CFP | ||
206 | */ | ||
207 | #define IEEE80211_RADIOTAP_F_SHORTPRE 0x02 /* sent/received | ||
208 | * with short | ||
209 | * preamble | ||
210 | */ | ||
211 | #define IEEE80211_RADIOTAP_F_WEP 0x04 /* sent/received | ||
212 | * with WEP encryption | ||
213 | */ | ||
214 | #define IEEE80211_RADIOTAP_F_FRAG 0x08 /* sent/received | ||
215 | * with fragmentation | ||
216 | */ | ||
217 | #define IEEE80211_RADIOTAP_F_FCS 0x10 /* frame includes FCS */ | ||
218 | #define IEEE80211_RADIOTAP_F_DATAPAD 0x20 /* frame has padding between | ||
219 | * 802.11 header and payload | ||
220 | * (to 32-bit boundary) | ||
221 | */ | ||
222 | |||
223 | /* Ugly macro to convert literal channel numbers into their mhz equivalents | ||
224 | * There are certianly some conditions that will break this (like feeding it '30') | ||
225 | * but they shouldn't arise since nothing talks on channel 30. */ | ||
226 | #define ieee80211chan2mhz(x) \ | ||
227 | (((x) <= 14) ? \ | ||
228 | (((x) == 14) ? 2484 : ((x) * 5) + 2407) : \ | ||
229 | ((x) + 1000) * 5) | ||
230 | |||
231 | #endif /* IEEE80211_RADIOTAP_H */ | ||
diff --git a/include/net/syncppp.h b/include/net/syncppp.h index 614cb6ba564e..877efa434700 100644 --- a/include/net/syncppp.h +++ b/include/net/syncppp.h | |||
@@ -86,7 +86,6 @@ static inline struct sppp *sppp_of(struct net_device *dev) | |||
86 | 86 | ||
87 | void sppp_attach (struct ppp_device *pd); | 87 | void sppp_attach (struct ppp_device *pd); |
88 | void sppp_detach (struct net_device *dev); | 88 | void sppp_detach (struct net_device *dev); |
89 | void sppp_input (struct net_device *dev, struct sk_buff *m); | ||
90 | int sppp_do_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd); | 89 | int sppp_do_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd); |
91 | struct sk_buff *sppp_dequeue (struct net_device *dev); | 90 | struct sk_buff *sppp_dequeue (struct net_device *dev); |
92 | int sppp_isempty (struct net_device *dev); | 91 | int sppp_isempty (struct net_device *dev); |