Use IEEE80211_IS_CHAN_PASSIVE - merge from DFS branch
[madwifi/.git] / net80211 / if_athproto.h
1 /*
2  * Copyright (c) 2004 Atheros Communications Inc.  All rights reserved.
3  *
4  * $Id$
5  */
6
7 #ifndef _NET_IF_ATH_PROTO_H_
8 #define _NET_IF_ATH_PROTO_H_
9
10 /*
11  * Atheros proprietary protocol info.
12  */
13
14 /*
15  * Atheros RSSI, Signal, Noise, etc.
16  */
17
18 #define ATH_DEFAULT_NOISE       -95     /* dBm */
19
20 /*
21  * Atheros proprietary SuperG defines.
22  */
23
24 #define ATH_ETH_TYPE            0x88bd
25 #define ATH_SNAP_ORGCODE_0      0x00
26 #define ATH_SNAP_ORGCODE_1      0x03
27 #define ATH_SNAP_ORGCODE_2      0x7f
28
29 struct athl2p_tunnel_hdr {
30 #if (_BYTE_ORDER == _LITTLE_ENDIAN)
31         u_int32_t offset:11,
32         seqNum:11,
33         optHdrLen32:2,
34         frameType:2,
35         proto:6;
36 #else /* big endian */
37         u_int32_t proto:6,
38         frameType:2,
39         optHdrLen32:2,
40         seqNum:11,
41         offset:11;
42 #endif
43 } __packed;
44
45 /*
46  * The following defines control compiling Atheros-specific features
47  * (see BuildCaps.inc):
48  *
49  *   ATH_SUPERG_FF 
50  *      set to 1 for fast-frame
51  */
52
53 #define ATH_L2TUNNEL_PROTO_FF 0
54 /* FF max payload: 
55  * 802.2 + FFHDR + HPAD + 802.3 + 802.2 + 1500 + SPAD + 802.3 + 802.2 + 1500:
56  *   8   +   4   +  4   +   14  +   8   + 1500 +  6   +   14  +   8   + 1500
57  * = 3066
58  */
59 #define ATH_FF_MAX_HDR_PAD      4
60 #define ATH_FF_MAX_SEP_PAD      6
61 #define ATH_FF_MAX_HDR          30
62 #define ATH_FF_MAX_PAYLOAD      3066
63 #define ATH_FF_MAX_LEN (ATH_FF_MAX_PAYLOAD + IEEE80211_CRC_LEN + \
64         (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN))
65
66 /*
67  * Store a magic number in skb->cb[] area to indicate FF within driver.
68  * Offset of 8B into cb[] is used to preserve vlan tag info.
69  */
70 #define ATH_FF_MAGIC_PUT(_skb) \
71         (SKB_CB(_skb)->flags |= M_FF)
72 #define ATH_FF_MAGIC_CLR(_skb) \
73         (SKB_CB(_skb)->flags &= ~M_FF)
74 #define ATH_FF_MAGIC_PRESENT(_skb) \
75         ((SKB_CB(_skb)->flags & M_FF) != 0)
76
77 /*
78  * default value for the minimum txq depth required for an ath_buf to be
79  * placed on the FF staging queue. this value should be >=3 due to interaction
80  * with HW compression.
81  */
82 #define ATH_FF_TXQMIN           3
83
84 /* 
85  * default maximum age an ath_buf is allowed to remain on the staging queue.
86  * When this number of ath_bufs have been queued on the txq, after an ath_buf
87  * was placed on the staging queue, that ath_buf on the staging queue will be
88  * flushed.
89  */
90 #define ATH_FF_STAGEQAGEMAX     5
91
92 /*
93  * Reserve enough buffer header length to avoid reallocation on fast-frame
94  * rx and tx.
95  */
96 #define USE_HEADERLEN_RESV      1
97
98 #endif /* _NET_IF_ATH_PROTO_H_ */