]> git.karo-electronics.de Git - mv-sheeva.git/blob - drivers/staging/brcm80211/include/proto/802.11.h
2f32b6cad2b9f4235d17a489a325b162630ba52a
[mv-sheeva.git] / drivers / staging / brcm80211 / include / proto / 802.11.h
1 /*
2  * Copyright (c) 2010 Broadcom Corporation
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16
17 #ifndef _802_11_H_
18 #define _802_11_H_
19
20 #define MCSSET_LEN      16
21 #define DOT11_BSSTYPE_ANY                       2
22 #define DOT11_MAX_DEFAULT_KEYS  4
23 #define WPA_OUI                 "\x00\x50\xF2"
24 #define BRCM_OUI                "\x00\x10\x18"
25 #define DOT11_MNG_RSN_ID                        48
26 #define DOT11_MNG_WPA_ID                        221
27 #define DOT11_DEFAULT_RTS_LEN           2347
28 #define DOT11_DEFAULT_FRAG_LEN          2346
29 #define DOT11_OUI_LEN                   3
30
31 #define AC_COUNT                4
32
33 #define AC_BITMAP_TST(ab, ac)   (((ab) & (1 << (ac))) != 0)
34
35 typedef u8 ac_bitmap_t;
36
37 struct edcf_acparam {
38         u8 ACI;
39         u8 ECW;
40         u16 TXOP;
41 } __attribute__((packed));
42 typedef struct edcf_acparam edcf_acparam_t;
43
44 struct wme_param_ie {
45         u8 oui[3];
46         u8 type;
47         u8 subtype;
48         u8 version;
49         u8 qosinfo;
50         u8 rsvd;
51         edcf_acparam_t acparam[AC_COUNT];
52 } __attribute__((packed));
53 typedef struct wme_param_ie wme_param_ie_t;
54
55 #define DOT11_MAC_HDR_LEN               24
56 #define DOT11_ACK_LEN           10
57 #define DOT11_ICV_AES_LEN               8
58 #define DOT11_A4_HDR_LEN                30
59 #define DOT11_QOS_LEN                   2
60 #define DOT11_IV_MAX_LEN                8
61 #define DOT11_BA_LEN            4
62 #define DOT11_OFDM_SIGNAL_EXTENSION     6
63 #define DOT11_MIN_FRAG_LEN              256
64 #define DOT11_RTS_LEN           16
65 #define DOT11_CTS_LEN           10
66 #define DOT11_BA_BITMAP_LEN             128
67 #define DOT11_MIN_BEACON_PERIOD         1
68 #define DOT11_MAX_BEACON_PERIOD         0xFFFF
69 #define DOT11_MAXNUMFRAGS       16
70 #define DOT11_MAX_FRAG_LEN              2346
71
72 #define SEQNUM_SHIFT            4
73 #define AMPDU_DELIMITER_LEN     4
74 #define SEQNUM_MAX              0x1000
75
76 #define APHY_SLOT_TIME          9
77 #define BPHY_SLOT_TIME          20
78 #define APHY_CWMIN              15
79 #define PHY_CWMAX               1023
80
81 #define EDCF_AIFSN_MIN               1
82 #define BPHY_PLCP_TIME          192
83
84 #define APHY_SYMBOL_TIME        4
85 #define APHY_PREAMBLE_TIME      16
86 #define APHY_SIGNAL_TIME        4
87 #define APHY_SIFS_TIME          16
88 #define APHY_SERVICE_NBITS      16
89 #define APHY_TAIL_NBITS         6
90 #define BPHY_SIFS_TIME          10
91 #define BPHY_PLCP_SHORT_TIME    96
92
93 #define PREN_PREAMBLE           24
94 #define PREN_MM_EXT             12
95 #define PREN_PREAMBLE_EXT       4
96
97 #define FRAGNUM_MASK            0xF
98
99 #define RIFS_11N_TIME           2
100
101 #define HT_CAP_RX_STBC_NO               0x0
102
103 #define EDCF_ACI_MASK                0x60
104 #define EDCF_ACI_SHIFT               5
105 #define EDCF_ECWMIN_MASK             0x0f
106 #define EDCF_ECWMAX_SHIFT            4
107 #define EDCF_AIFSN_MASK              0x0f
108 #define EDCF_AIFSN_MAX               15
109 #define EDCF_ECWMAX_MASK             0xf0
110
111 #define EDCF_AC_BE_TXOP_STA          0x0000
112 #define EDCF_AC_BK_TXOP_STA          0x0000
113 #define EDCF_AC_VO_ACI_STA           0x62
114 #define EDCF_AC_VO_ECW_STA           0x32
115 #define EDCF_AC_VI_ACI_STA           0x42
116 #define EDCF_AC_VI_ECW_STA           0x43
117 #define EDCF_AC_BK_ECW_STA           0xA4
118 #define EDCF_AC_VI_TXOP_STA          0x005e
119 #define EDCF_AC_VO_TXOP_STA          0x002f
120 #define EDCF_AC_BE_ACI_STA           0x03
121 #define EDCF_AC_BE_ECW_STA           0xA4
122 #define EDCF_AC_BK_ACI_STA           0x27
123 #define EDCF_AC_VO_TXOP_AP           0x002f
124
125 #define EDCF_TXOP2USEC(txop)         ((txop) << 5)
126 #define EDCF_ECW2CW(exp)             ((1 << (exp)) - 1)
127
128 #define WME_VER                 1
129 #define WME_SUBTYPE_PARAM_IE    1
130 #define WME_TYPE                2
131 #define WME_OUI                 "\x00\x50\xf2"
132
133 #define AC_BE                   0
134 #define AC_BK                   1
135 #define AC_VI                   2
136 #define AC_VO                   3
137
138 #define HT_CAP_RX_STBC_ONE_STREAM       0x1
139
140 #endif                          /* _802_11_H_ */