1 #ifndef _ZD_IEEE80211_H
2 #define _ZD_IEEE80211_H
4 #include <net/ieee80211.h>
6 /* Additional definitions from the standards.
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
22 struct channel_range {
24 u8 end; /* exclusive (channel must be less than end) */
29 int zd_geo_init(struct ieee80211_device *ieee, u8 regdomain);
31 const struct channel_range *zd_channel_range(u8 regdomain);
32 int zd_regdomain_supports_channel(u8 regdomain, u8 channel);
33 int zd_regdomain_supported(u8 regdomain);
35 /* for 2.4 GHz band */
36 int zd_channel_to_freq(struct iw_freq *freq, u8 channel);
37 int zd_find_channel(u8 *channel, const struct iw_freq *freq);
39 #define ZD_PLCP_SERVICE_LENGTH_EXTENSION 0x80
41 struct ofdm_plcp_header {
44 } __attribute__((packed));
46 static inline u8 zd_ofdm_plcp_header_rate(const struct ofdm_plcp_header *header)
48 return header->prefix[0] & 0xf;
51 /* The following defines give the encoding of the 4-bit rate field in the
52 * OFDM (802.11a/802.11g) PLCP header. Notify that these values are used to
53 * define the zd-rate values for OFDM.
55 * See the struct zd_ctrlset definition in zd_mac.h.
57 #define ZD_OFDM_PLCP_RATE_6M 0xb
58 #define ZD_OFDM_PLCP_RATE_9M 0xf
59 #define ZD_OFDM_PLCP_RATE_12M 0xa
60 #define ZD_OFDM_PLCP_RATE_18M 0xe
61 #define ZD_OFDM_PLCP_RATE_24M 0x9
62 #define ZD_OFDM_PLCP_RATE_36M 0xd
63 #define ZD_OFDM_PLCP_RATE_48M 0x8
64 #define ZD_OFDM_PLCP_RATE_54M 0xc
66 struct cck_plcp_header {
71 } __attribute__((packed));
73 static inline u8 zd_cck_plcp_header_signal(const struct cck_plcp_header *header)
75 return header->signal;
78 /* These defines give the encodings of the signal field in the 802.11b PLCP
79 * header. The signal field gives the bit rate of the following packet. Even
80 * if technically wrong we use CCK here also for the 1 MBit/s and 2 MBit/s
81 * rate to stay consistent with Zydas and our use of the term.
83 * Notify that these values are *not* used in the zd-rates.
85 #define ZD_CCK_PLCP_SIGNAL_1M 0x0a
86 #define ZD_CCK_PLCP_SIGNAL_2M 0x14
87 #define ZD_CCK_PLCP_SIGNAL_5M5 0x37
88 #define ZD_CCK_PLCP_SIGNAL_11M 0x6e
96 #endif /* _ZD_IEEE80211_H */