1 /* ZD1211 USB-WLAN driver for Linux
3 * Copyright (C) 2005-2007 Ulrich Kunitz <kune@deine-taler.de>
4 * Copyright (C) 2006-2007 Daniel Drake <dsd@gentoo.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef _ZD_IEEE80211_H
22 #define _ZD_IEEE80211_H
24 #include <net/mac80211.h>
26 /* Additional definitions from the standards.
29 #define ZD_REGDOMAIN_FCC 0x10
30 #define ZD_REGDOMAIN_IC 0x20
31 #define ZD_REGDOMAIN_ETSI 0x30
32 #define ZD_REGDOMAIN_SPAIN 0x31
33 #define ZD_REGDOMAIN_FRANCE 0x32
34 #define ZD_REGDOMAIN_JAPAN_ADD 0x40
35 #define ZD_REGDOMAIN_JAPAN 0x41
42 void zd_geo_init(struct ieee80211_hw
*hw
, u8 regdomain
);
44 #define ZD_PLCP_SERVICE_LENGTH_EXTENSION 0x80
46 struct ofdm_plcp_header
{
49 } __attribute__((packed
));
51 static inline u8
zd_ofdm_plcp_header_rate(const struct ofdm_plcp_header
*header
)
53 return header
->prefix
[0] & 0xf;
56 /* The following defines give the encoding of the 4-bit rate field in the
57 * OFDM (802.11a/802.11g) PLCP header. Notify that these values are used to
58 * define the zd-rate values for OFDM.
60 * See the struct zd_ctrlset definition in zd_mac.h.
62 #define ZD_OFDM_PLCP_RATE_6M 0xb
63 #define ZD_OFDM_PLCP_RATE_9M 0xf
64 #define ZD_OFDM_PLCP_RATE_12M 0xa
65 #define ZD_OFDM_PLCP_RATE_18M 0xe
66 #define ZD_OFDM_PLCP_RATE_24M 0x9
67 #define ZD_OFDM_PLCP_RATE_36M 0xd
68 #define ZD_OFDM_PLCP_RATE_48M 0x8
69 #define ZD_OFDM_PLCP_RATE_54M 0xc
71 struct cck_plcp_header
{
76 } __attribute__((packed
));
78 static inline u8
zd_cck_plcp_header_signal(const struct cck_plcp_header
*header
)
80 return header
->signal
;
83 /* These defines give the encodings of the signal field in the 802.11b PLCP
84 * header. The signal field gives the bit rate of the following packet. Even
85 * if technically wrong we use CCK here also for the 1 MBit/s and 2 MBit/s
86 * rate to stay consistent with Zydas and our use of the term.
88 * Notify that these values are *not* used in the zd-rates.
90 #define ZD_CCK_PLCP_SIGNAL_1M 0x0a
91 #define ZD_CCK_PLCP_SIGNAL_2M 0x14
92 #define ZD_CCK_PLCP_SIGNAL_5M5 0x37
93 #define ZD_CCK_PLCP_SIGNAL_11M 0x6e
95 #endif /* _ZD_IEEE80211_H */