wl12xx: add auto-arp support
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / net / wireless / wl12xx / wl12xx_80211.h
blob8ee0d3a8fa6ef9cd9c2ab417dfd808747684ac71
1 #ifndef __WL12XX_80211_H__
2 #define __WL12XX_80211_H__
4 #include <linux/if_ether.h> /* ETH_ALEN */
5 #include <linux/if_arp.h>
7 /* RATES */
8 #define IEEE80211_CCK_RATE_1MB 0x02
9 #define IEEE80211_CCK_RATE_2MB 0x04
10 #define IEEE80211_CCK_RATE_5MB 0x0B
11 #define IEEE80211_CCK_RATE_11MB 0x16
12 #define IEEE80211_OFDM_RATE_6MB 0x0C
13 #define IEEE80211_OFDM_RATE_9MB 0x12
14 #define IEEE80211_OFDM_RATE_12MB 0x18
15 #define IEEE80211_OFDM_RATE_18MB 0x24
16 #define IEEE80211_OFDM_RATE_24MB 0x30
17 #define IEEE80211_OFDM_RATE_36MB 0x48
18 #define IEEE80211_OFDM_RATE_48MB 0x60
19 #define IEEE80211_OFDM_RATE_54MB 0x6C
20 #define IEEE80211_BASIC_RATE_MASK 0x80
22 #define IEEE80211_CCK_RATE_1MB_MASK (1<<0)
23 #define IEEE80211_CCK_RATE_2MB_MASK (1<<1)
24 #define IEEE80211_CCK_RATE_5MB_MASK (1<<2)
25 #define IEEE80211_CCK_RATE_11MB_MASK (1<<3)
26 #define IEEE80211_OFDM_RATE_6MB_MASK (1<<4)
27 #define IEEE80211_OFDM_RATE_9MB_MASK (1<<5)
28 #define IEEE80211_OFDM_RATE_12MB_MASK (1<<6)
29 #define IEEE80211_OFDM_RATE_18MB_MASK (1<<7)
30 #define IEEE80211_OFDM_RATE_24MB_MASK (1<<8)
31 #define IEEE80211_OFDM_RATE_36MB_MASK (1<<9)
32 #define IEEE80211_OFDM_RATE_48MB_MASK (1<<10)
33 #define IEEE80211_OFDM_RATE_54MB_MASK (1<<11)
35 #define IEEE80211_CCK_RATES_MASK 0x0000000F
36 #define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \
37 IEEE80211_CCK_RATE_2MB_MASK)
38 #define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \
39 IEEE80211_CCK_RATE_5MB_MASK | \
40 IEEE80211_CCK_RATE_11MB_MASK)
42 #define IEEE80211_OFDM_RATES_MASK 0x00000FF0
43 #define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \
44 IEEE80211_OFDM_RATE_12MB_MASK | \
45 IEEE80211_OFDM_RATE_24MB_MASK)
46 #define IEEE80211_OFDM_DEFAULT_RATES_MASK (IEEE80211_OFDM_BASIC_RATES_MASK | \
47 IEEE80211_OFDM_RATE_9MB_MASK | \
48 IEEE80211_OFDM_RATE_18MB_MASK | \
49 IEEE80211_OFDM_RATE_36MB_MASK | \
50 IEEE80211_OFDM_RATE_48MB_MASK | \
51 IEEE80211_OFDM_RATE_54MB_MASK)
52 #define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \
53 IEEE80211_CCK_DEFAULT_RATES_MASK)
56 /* This really should be 8, but not for our firmware */
57 #define MAX_SUPPORTED_RATES 32
58 #define COUNTRY_STRING_LEN 3
59 #define MAX_COUNTRY_TRIPLETS 32
61 /* Headers */
62 struct ieee80211_header {
63 __le16 frame_ctl;
64 __le16 duration_id;
65 u8 da[ETH_ALEN];
66 u8 sa[ETH_ALEN];
67 u8 bssid[ETH_ALEN];
68 __le16 seq_ctl;
69 u8 payload[0];
70 } __packed;
72 struct wl12xx_ie_header {
73 u8 id;
74 u8 len;
75 } __packed;
77 /* IEs */
79 struct wl12xx_ie_ssid {
80 struct wl12xx_ie_header header;
81 char ssid[IW_ESSID_MAX_SIZE];
82 } __packed;
84 struct wl12xx_ie_rates {
85 struct wl12xx_ie_header header;
86 u8 rates[MAX_SUPPORTED_RATES];
87 } __packed;
89 struct wl12xx_ie_ds_params {
90 struct wl12xx_ie_header header;
91 u8 channel;
92 } __packed;
94 struct country_triplet {
95 u8 channel;
96 u8 num_channels;
97 u8 max_tx_power;
98 } __packed;
100 struct wl12xx_ie_country {
101 struct wl12xx_ie_header header;
102 u8 country_string[COUNTRY_STRING_LEN];
103 struct country_triplet triplets[MAX_COUNTRY_TRIPLETS];
104 } __packed;
107 /* Templates */
109 struct wl12xx_beacon_template {
110 struct ieee80211_header header;
111 __le32 time_stamp[2];
112 __le16 beacon_interval;
113 __le16 capability;
114 struct wl12xx_ie_ssid ssid;
115 struct wl12xx_ie_rates rates;
116 struct wl12xx_ie_rates ext_rates;
117 struct wl12xx_ie_ds_params ds_params;
118 struct wl12xx_ie_country country;
119 } __packed;
121 struct wl12xx_null_data_template {
122 struct ieee80211_header header;
123 } __packed;
125 struct wl12xx_ps_poll_template {
126 __le16 fc;
127 __le16 aid;
128 u8 bssid[ETH_ALEN];
129 u8 ta[ETH_ALEN];
130 } __packed;
132 struct wl12xx_qos_null_data_template {
133 struct ieee80211_header header;
134 __le16 qos_ctl;
135 } __packed;
137 struct wl12xx_probe_req_template {
138 struct ieee80211_header header;
139 struct wl12xx_ie_ssid ssid;
140 struct wl12xx_ie_rates rates;
141 struct wl12xx_ie_rates ext_rates;
142 } __packed;
144 struct wl12xx_arp_rsp_template {
145 struct ieee80211_hdr_3addr hdr;
147 u8 llc_hdr[sizeof(rfc1042_header)];
148 u16 llc_type;
150 struct arphdr arp_hdr;
151 u8 sender_hw[ETH_ALEN];
152 u32 sender_ip;
153 u8 target_hw[ETH_ALEN];
154 u32 target_ip;
155 } __packed;
158 struct wl12xx_probe_resp_template {
159 struct ieee80211_header header;
160 __le32 time_stamp[2];
161 __le16 beacon_interval;
162 __le16 capability;
163 struct wl12xx_ie_ssid ssid;
164 struct wl12xx_ie_rates rates;
165 struct wl12xx_ie_rates ext_rates;
166 struct wl12xx_ie_ds_params ds_params;
167 struct wl12xx_ie_country country;
168 } __packed;
170 #endif