aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/zd1211rw/zd_mac.h
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2008-09-10 02:19:49 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-15 16:48:19 -0400
commite83a1070a1167eac1bf8844b9f08df5e9ea1b5bc (patch)
treeeedd67417236e38bc63e09a735362938459fd1f7 /drivers/net/wireless/zd1211rw/zd_mac.h
parentb2e1b30290539b344cbaff0d9da38012e03aa347 (diff)
zd1211rw: make use of new regulatory_hint()
This cleans up zd1211rw's own regulatory work, and makes use of the new cfg80211 regulatory_hint(). Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/zd1211rw/zd_mac.h')
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.h65
1 files changed, 64 insertions, 1 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.h b/drivers/net/wireless/zd1211rw/zd_mac.h
index 18c1d56d3dd7..4c05d3ee4c37 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.h
+++ b/drivers/net/wireless/zd1211rw/zd_mac.h
@@ -25,7 +25,6 @@
25#include <net/mac80211.h> 25#include <net/mac80211.h>
26 26
27#include "zd_chip.h" 27#include "zd_chip.h"
28#include "zd_ieee80211.h"
29 28
30struct zd_ctrlset { 29struct zd_ctrlset {
31 u8 modulation; 30 u8 modulation;
@@ -187,6 +186,70 @@ struct zd_mac {
187 unsigned int pass_ctrl:1; 186 unsigned int pass_ctrl:1;
188}; 187};
189 188
189#define ZD_REGDOMAIN_FCC 0x10
190#define ZD_REGDOMAIN_IC 0x20
191#define ZD_REGDOMAIN_ETSI 0x30
192#define ZD_REGDOMAIN_SPAIN 0x31
193#define ZD_REGDOMAIN_FRANCE 0x32
194#define ZD_REGDOMAIN_JAPAN_ADD 0x40
195#define ZD_REGDOMAIN_JAPAN 0x41
196
197enum {
198 MIN_CHANNEL24 = 1,
199 MAX_CHANNEL24 = 14,
200};
201
202#define ZD_PLCP_SERVICE_LENGTH_EXTENSION 0x80
203
204struct ofdm_plcp_header {
205 u8 prefix[3];
206 __le16 service;
207} __attribute__((packed));
208
209static inline u8 zd_ofdm_plcp_header_rate(const struct ofdm_plcp_header *header)
210{
211 return header->prefix[0] & 0xf;
212}
213
214/* The following defines give the encoding of the 4-bit rate field in the
215 * OFDM (802.11a/802.11g) PLCP header. Notify that these values are used to
216 * define the zd-rate values for OFDM.
217 *
218 * See the struct zd_ctrlset definition in zd_mac.h.
219 */
220#define ZD_OFDM_PLCP_RATE_6M 0xb
221#define ZD_OFDM_PLCP_RATE_9M 0xf
222#define ZD_OFDM_PLCP_RATE_12M 0xa
223#define ZD_OFDM_PLCP_RATE_18M 0xe
224#define ZD_OFDM_PLCP_RATE_24M 0x9
225#define ZD_OFDM_PLCP_RATE_36M 0xd
226#define ZD_OFDM_PLCP_RATE_48M 0x8
227#define ZD_OFDM_PLCP_RATE_54M 0xc
228
229struct cck_plcp_header {
230 u8 signal;
231 u8 service;
232 __le16 length;
233 __le16 crc16;
234} __attribute__((packed));
235
236static inline u8 zd_cck_plcp_header_signal(const struct cck_plcp_header *header)
237{
238 return header->signal;
239}
240
241/* These defines give the encodings of the signal field in the 802.11b PLCP
242 * header. The signal field gives the bit rate of the following packet. Even
243 * if technically wrong we use CCK here also for the 1 MBit/s and 2 MBit/s
244 * rate to stay consistent with Zydas and our use of the term.
245 *
246 * Notify that these values are *not* used in the zd-rates.
247 */
248#define ZD_CCK_PLCP_SIGNAL_1M 0x0a
249#define ZD_CCK_PLCP_SIGNAL_2M 0x14
250#define ZD_CCK_PLCP_SIGNAL_5M5 0x37
251#define ZD_CCK_PLCP_SIGNAL_11M 0x6e
252
190static inline struct zd_mac *zd_hw_mac(struct ieee80211_hw *hw) 253static inline struct zd_mac *zd_hw_mac(struct ieee80211_hw *hw)
191{ 254{
192 return hw->priv; 255 return hw->priv;