]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - drivers/net/wireless/zd1211rw/zd_ieee80211.h
zd1211rw: port to mac80211
[linux-2.6-omap-h63xx.git] / drivers / net / wireless / zd1211rw / zd_ieee80211.h
1 #ifndef _ZD_IEEE80211_H
2 #define _ZD_IEEE80211_H
3
4 #include <net/mac80211.h>
5
6 /* Additional definitions from the standards.
7  */
8
9 #define ZD_REGDOMAIN_FCC        0x10
10 #define ZD_REGDOMAIN_IC         0x20
11 #define ZD_REGDOMAIN_ETSI       0x30
12 #define ZD_REGDOMAIN_SPAIN      0x31
13 #define ZD_REGDOMAIN_FRANCE     0x32
14 #define ZD_REGDOMAIN_JAPAN_ADD  0x40
15 #define ZD_REGDOMAIN_JAPAN      0x41
16
17 enum {
18         MIN_CHANNEL24 = 1,
19         MAX_CHANNEL24 = 14,
20 };
21
22 void zd_geo_init(struct ieee80211_hw *hw, u8 regdomain);
23
24 #define ZD_PLCP_SERVICE_LENGTH_EXTENSION 0x80
25
26 struct ofdm_plcp_header {
27         u8 prefix[3];
28         __le16 service;
29 } __attribute__((packed));
30
31 static inline u8 zd_ofdm_plcp_header_rate(const struct ofdm_plcp_header *header)
32 {
33         return header->prefix[0] & 0xf;
34 }
35
36 /* The following defines give the encoding of the 4-bit rate field in the
37  * OFDM (802.11a/802.11g) PLCP header. Notify that these values are used to
38  * define the zd-rate values for OFDM.
39  *
40  * See the struct zd_ctrlset definition in zd_mac.h.
41  */
42 #define ZD_OFDM_PLCP_RATE_6M    0xb
43 #define ZD_OFDM_PLCP_RATE_9M    0xf
44 #define ZD_OFDM_PLCP_RATE_12M   0xa
45 #define ZD_OFDM_PLCP_RATE_18M   0xe
46 #define ZD_OFDM_PLCP_RATE_24M   0x9
47 #define ZD_OFDM_PLCP_RATE_36M   0xd
48 #define ZD_OFDM_PLCP_RATE_48M   0x8
49 #define ZD_OFDM_PLCP_RATE_54M   0xc
50
51 struct cck_plcp_header {
52         u8 signal;
53         u8 service;
54         __le16 length;
55         __le16 crc16;
56 } __attribute__((packed));
57
58 static inline u8 zd_cck_plcp_header_signal(const struct cck_plcp_header *header)
59 {
60         return header->signal;
61 }
62
63 /* These defines give the encodings of the signal field in the 802.11b PLCP
64  * header. The signal field gives the bit rate of the following packet. Even
65  * if technically wrong we use CCK here also for the 1 MBit/s and 2 MBit/s
66  * rate to stay consistent with Zydas and our use of the term.
67  *
68  * Notify that these values are *not* used in the zd-rates.
69  */
70 #define ZD_CCK_PLCP_SIGNAL_1M   0x0a
71 #define ZD_CCK_PLCP_SIGNAL_2M   0x14
72 #define ZD_CCK_PLCP_SIGNAL_5M5  0x37
73 #define ZD_CCK_PLCP_SIGNAL_11M  0x6e
74
75 #endif /* _ZD_IEEE80211_H */