1 /******************************************************************************
2 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
4 * This program is distributed in the hope that it will be useful, but WITHOUT
5 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
9 * You should have received a copy of the GNU General Public License along with
10 * this program; if not, write to the Free Software Foundation, Inc.,
11 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
13 * The full GNU General Public License is included in this distribution in the
14 * file called LICENSE.
16 * Contact Information:
17 * wlanfae <wlanfae@realtek.com>
18 ******************************************************************************/
19 #ifndef __INC_QOS_TYPE_H
20 #define __INC_QOS_TYPE_H
22 #define BIT0 0x00000001
23 #define BIT1 0x00000002
24 #define BIT2 0x00000004
25 #define BIT3 0x00000008
26 #define BIT4 0x00000010
27 #define BIT5 0x00000020
28 #define BIT6 0x00000040
29 #define BIT7 0x00000080
30 #define BIT8 0x00000100
31 #define BIT9 0x00000200
32 #define BIT10 0x00000400
33 #define BIT11 0x00000800
34 #define BIT12 0x00001000
35 #define BIT13 0x00002000
36 #define BIT14 0x00004000
37 #define BIT15 0x00008000
38 #define BIT16 0x00010000
39 #define BIT17 0x00020000
40 #define BIT18 0x00040000
41 #define BIT19 0x00080000
42 #define BIT20 0x00100000
43 #define BIT21 0x00200000
44 #define BIT22 0x00400000
45 #define BIT23 0x00800000
46 #define BIT24 0x01000000
47 #define BIT25 0x02000000
48 #define BIT26 0x04000000
49 #define BIT27 0x08000000
50 #define BIT28 0x10000000
51 #define BIT29 0x20000000
52 #define BIT30 0x40000000
53 #define BIT31 0x80000000
65 u8 ucTSInfoAckPolicy:2;
75 union qos_tsinfo TSInfo;
89 u16 SurplusBandwidthAllowance;
101 union tspec_body Body;
104 struct octet_string {
109 #define MAX_WMMELE_LENGTH 64
113 #define QOS_DISABLE 0
118 #define QOS_WMM_UAPSD 16
120 #define WMM_PARAM_ELE_BODY_LEN 18
122 #define MAX_STA_TS_COUNT 16
123 #define MAX_AP_TS_COUNT 32
124 #define QOS_TSTREAM_KEY_SIZE 13
126 #define WMM_ACTION_CATEGORY_CODE 17
127 #define WMM_PARAM_ELE_BODY_LEN 18
129 #define MAX_TSPEC_TSID 15
130 #define SESSION_REJECT_TSID 0xfe
131 #define DEFAULT_TSID 0xff
133 #define ADDTS_TIME_SLOT 100
135 #define ACM_TIMEOUT 1000
136 #define SESSION_REJECT_TIMEOUT 60000
140 eAckPlc1_NoACK = 0x01,
144 #define SET_WMM_QOS_INFO_FIELD(_pStart, _val) \
145 WriteEF1Byte(_pStart, _val)
147 #define GET_WMM_QOS_INFO_FIELD_PARAMETERSET_COUNT(_pStart) \
148 LE_BITS_TO_1BYTE(_pStart, 0, 4)
149 #define SET_WMM_QOS_INFO_FIELD_PARAMETERSET_COUNT(_pStart, _val) \
150 SET_BITS_TO_LE_1BYTE(_pStart, 0, 4, _val)
152 #define GET_WMM_QOS_INFO_FIELD_AP_UAPSD(_pStart) \
153 LE_BITS_TO_1BYTE(_pStart, 7, 1)
154 #define SET_WMM_QOS_INFO_FIELD_AP_UAPSD(_pStart, _val) \
155 SET_BITS_TO_LE_1BYTE(_pStart, 7, 1, _val)
157 #define GET_WMM_QOS_INFO_FIELD_STA_AC_VO_UAPSD(_pStart) \
158 LE_BITS_TO_1BYTE(_pStart, 0, 1)
159 #define SET_WMM_QOS_INFO_FIELD_STA_AC_VO_UAPSD(_pStart, _val) \
160 SET_BITS_TO_LE_1BYTE(_pStart, 0, 1, _val)
162 #define GET_WMM_QOS_INFO_FIELD_STA_AC_VI_UAPSD(_pStart) \
163 LE_BITS_TO_1BYTE(_pStart, 1, 1)
164 #define SET_WMM_QOS_INFO_FIELD_STA_AC_VI_UAPSD(_pStart, _val) \
165 SET_BITS_TO_LE_1BYTE(_pStart, 1, 1, _val)
167 #define GET_WMM_QOS_INFO_FIELD_STA_AC_BE_UAPSD(_pStart) \
168 LE_BITS_TO_1BYTE(_pStart, 2, 1)
169 #define SET_WMM_QOS_INFO_FIELD_STA_AC_BE_UAPSD(_pStart, _val) \
170 SET_BITS_TO_LE_1BYTE(_pStart, 2, 1, _val)
172 #define GET_WMM_QOS_INFO_FIELD_STA_AC_BK_UAPSD(_pStart) \
173 LE_BITS_TO_1BYTE(_pStart, 3, 1)
174 #define SET_WMM_QOS_INFO_FIELD_STA_AC_BK_UAPSD(_pStart, _val) \
175 SET_BITS_TO_LE_1BYTE(_pStart, 3, 1, _val)
177 #define GET_WMM_QOS_INFO_FIELD_STA_MAX_SP_LEN(_pStart) \
178 LE_BITS_TO_1BYTE(_pStart, 5, 2)
179 #define SET_WMM_QOS_INFO_FIELD_STA_MAX_SP_LEN(_pStart, _val) \
180 SET_BITS_TO_LE_1BYTE(_pStart, 5, 2, _val)
191 #define AC_CODING u32
200 #define AC_PARAM_SIZE 4
202 #define WMM_PARAM_ELEMENT_SIZE (8+(4*AC_PARAM_SIZE))
204 enum qos_ele_subtype {
205 QOSELE_TYPE_INFO = 0x00,
206 QOSELE_TYPE_PARAM = 0x01,
210 enum direction_value {
218 eAcmWay0_SwAndHw = 0,
234 #define GET_VO_UAPSD(_apsd) ((_apsd) & BIT0)
235 #define SET_VO_UAPSD(_apsd) ((_apsd) |= BIT0)
237 #define GET_VI_UAPSD(_apsd) ((_apsd) & BIT1)
238 #define SET_VI_UAPSD(_apsd) ((_apsd) |= BIT1)
240 #define GET_BK_UAPSD(_apsd) ((_apsd) & BIT2)
241 #define SET_BK_UAPSD(_apsd) ((_apsd) |= BIT2)
243 #define GET_BE_UAPSD(_apsd) ((_apsd) & BIT3)
244 #define SET_BE_UAPSD(_apsd) ((_apsd) |= BIT3)
248 struct _TYPE_GENERAL {
289 struct _TYPE2_8021Q {
304 struct wmm_tspec TSpec;
305 struct wmm_tspec OutStandingTSpec;
310 u8 WMMIEBuf[MAX_WMMELE_LENGTH];
313 QOS_MODE QosCapability;
314 QOS_MODE CurrentQosMode;
317 AC_UAPSD Curr4acUapsd;
320 int NumBcnBeforeTrigger;
323 u8 WMMParamEle[WMM_PARAM_ELEMENT_SIZE];
326 enum acm_method AcmMethod;
328 struct qos_tstream StaTsArray[MAX_STA_TS_COUNT];
330 struct wmm_tspec TSpec;
340 #define QBSS_LOAD_SIZE 5
344 u8 bdWMMIEBuf[MAX_WMMELE_LENGTH];
345 struct octet_string bdWMMIE;
347 enum qos_ele_subtype EleSubType;
352 u8 QBssLoad[QBSS_LOAD_SIZE];
356 #define IsACValid(ac) ((ac >= 0 && ac <= 7) ? true : false)
383 union aci_aifsn AciAifsn;