Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved. |
| 3 | * |
| 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 |
| 7 | * more details. |
| 8 | * |
| 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 |
| 12 | * |
| 13 | * The full GNU General Public License is included in this distribution in the |
| 14 | * file called LICENSE. |
| 15 | * |
| 16 | * Contact Information: |
| 17 | * wlanfae <wlanfae@realtek.com> |
| 18 | ******************************************************************************/ |
| 19 | #ifndef __INC_QOS_TYPE_H |
| 20 | #define __INC_QOS_TYPE_H |
| 21 | |
| 22 | #include "rtllib_endianfree.h" |
| 23 | |
| 24 | #define BIT0 0x00000001 |
| 25 | #define BIT1 0x00000002 |
| 26 | #define BIT2 0x00000004 |
| 27 | #define BIT3 0x00000008 |
| 28 | #define BIT4 0x00000010 |
| 29 | #define BIT5 0x00000020 |
| 30 | #define BIT6 0x00000040 |
| 31 | #define BIT7 0x00000080 |
| 32 | #define BIT8 0x00000100 |
| 33 | #define BIT9 0x00000200 |
| 34 | #define BIT10 0x00000400 |
| 35 | #define BIT11 0x00000800 |
| 36 | #define BIT12 0x00001000 |
| 37 | #define BIT13 0x00002000 |
| 38 | #define BIT14 0x00004000 |
| 39 | #define BIT15 0x00008000 |
| 40 | #define BIT16 0x00010000 |
| 41 | #define BIT17 0x00020000 |
| 42 | #define BIT18 0x00040000 |
| 43 | #define BIT19 0x00080000 |
| 44 | #define BIT20 0x00100000 |
| 45 | #define BIT21 0x00200000 |
| 46 | #define BIT22 0x00400000 |
| 47 | #define BIT23 0x00800000 |
| 48 | #define BIT24 0x01000000 |
| 49 | #define BIT25 0x02000000 |
| 50 | #define BIT26 0x04000000 |
| 51 | #define BIT27 0x08000000 |
| 52 | #define BIT28 0x10000000 |
| 53 | #define BIT29 0x20000000 |
| 54 | #define BIT30 0x40000000 |
| 55 | #define BIT31 0x80000000 |
| 56 | |
Larry Finger | 42c53e7 | 2011-07-19 10:24:09 -0500 | [diff] [blame] | 57 | union qos_tsinfo { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 58 | u8 charData[3]; |
| 59 | struct { |
| 60 | u8 ucTrafficType:1; |
| 61 | u8 ucTSID:4; |
| 62 | u8 ucDirection:2; |
| 63 | u8 ucAccessPolicy:2; |
| 64 | u8 ucAggregation:1; |
| 65 | u8 ucPSB:1; |
| 66 | u8 ucUP:3; |
| 67 | u8 ucTSInfoAckPolicy:2; |
| 68 | u8 ucSchedule:1; |
| 69 | u8 ucReserved:7; |
| 70 | }field; |
Larry Finger | 42c53e7 | 2011-07-19 10:24:09 -0500 | [diff] [blame] | 71 | }; |
| 72 | |
Larry Finger | ed306e4 | 2011-07-19 10:25:55 -0500 | [diff] [blame] | 73 | union tspec_body { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 74 | u8 charData[55]; |
| 75 | |
| 76 | struct |
| 77 | { |
Larry Finger | 42c53e7 | 2011-07-19 10:24:09 -0500 | [diff] [blame] | 78 | union qos_tsinfo TSInfo; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 79 | u16 NominalMSDUsize; |
| 80 | u16 MaxMSDUsize; |
| 81 | u32 MinServiceItv; |
| 82 | u32 MaxServiceItv; |
| 83 | u32 InactivityItv; |
| 84 | u32 SuspenItv; |
| 85 | u32 ServiceStartTime; |
| 86 | u32 MinDataRate; |
| 87 | u32 MeanDataRate; |
| 88 | u32 PeakDataRate; |
| 89 | u32 MaxBurstSize; |
| 90 | u32 DelayBound; |
| 91 | u32 MinPhyRate; |
| 92 | u16 SurplusBandwidthAllowance; |
| 93 | u16 MediumTime; |
| 94 | } f; |
Larry Finger | ed306e4 | 2011-07-19 10:25:55 -0500 | [diff] [blame] | 95 | }; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 96 | |
Larry Finger | 95ce5fc | 2011-07-18 21:55:05 -0500 | [diff] [blame] | 97 | struct wmm_tspec { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 98 | u8 ID; |
| 99 | u8 Length; |
| 100 | u8 OUI[3]; |
| 101 | u8 OUI_Type; |
| 102 | u8 OUI_SubType; |
| 103 | u8 Version; |
Larry Finger | ed306e4 | 2011-07-19 10:25:55 -0500 | [diff] [blame] | 104 | union tspec_body Body; |
Larry Finger | 95ce5fc | 2011-07-18 21:55:05 -0500 | [diff] [blame] | 105 | }; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 106 | |
Larry Finger | 8310b6c0 | 2011-07-18 21:57:13 -0500 | [diff] [blame] | 107 | struct octet_string { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 108 | u8 *Octet; |
| 109 | u16 Length; |
Larry Finger | d3b2c17 | 2011-07-19 12:50:41 -0500 | [diff] [blame] | 110 | }; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 111 | #define MAX_WMMELE_LENGTH 64 |
| 112 | |
| 113 | typedef u32 QOS_MODE, *PQOS_MODE; |
| 114 | #define QOS_DISABLE 0 |
| 115 | #define QOS_WMM 1 |
| 116 | #define QOS_WMMSA 2 |
| 117 | #define QOS_EDCA 4 |
| 118 | #define QOS_HCCA 8 |
| 119 | #define QOS_WMM_UAPSD 16 |
| 120 | |
| 121 | #define WMM_PARAM_ELE_BODY_LEN 18 |
| 122 | |
| 123 | #define MAX_STA_TS_COUNT 16 |
| 124 | #define MAX_AP_TS_COUNT 32 |
| 125 | #define QOS_TSTREAM_KEY_SIZE 13 |
| 126 | |
| 127 | #define WMM_ACTION_CATEGORY_CODE 17 |
| 128 | #define WMM_PARAM_ELE_BODY_LEN 18 |
| 129 | |
| 130 | #define MAX_TSPEC_TSID 15 |
| 131 | #define SESSION_REJECT_TSID 0xfe |
| 132 | #define DEFAULT_TSID 0xff |
| 133 | |
| 134 | #define ADDTS_TIME_SLOT 100 |
| 135 | |
| 136 | #define ACM_TIMEOUT 1000 |
| 137 | #define SESSION_REJECT_TIMEOUT 60000 |
| 138 | |
Larry Finger | 4164e4d | 2011-07-19 19:24:06 -0500 | [diff] [blame] | 139 | enum ack_policy { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 140 | eAckPlc0_ACK = 0x00, |
| 141 | eAckPlc1_NoACK = 0x01, |
Larry Finger | 4164e4d | 2011-07-19 19:24:06 -0500 | [diff] [blame] | 142 | }; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 143 | |
| 144 | |
| 145 | #define SET_WMM_QOS_INFO_FIELD(_pStart, _val) WriteEF1Byte(_pStart, _val) |
| 146 | |
| 147 | #define GET_WMM_QOS_INFO_FIELD_PARAMETERSET_COUNT(_pStart) LE_BITS_TO_1BYTE(_pStart, 0, 4) |
| 148 | #define SET_WMM_QOS_INFO_FIELD_PARAMETERSET_COUNT(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 0, 4, _val) |
| 149 | |
| 150 | #define GET_WMM_QOS_INFO_FIELD_AP_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 7, 1) |
| 151 | #define SET_WMM_QOS_INFO_FIELD_AP_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 7, 1, _val) |
| 152 | |
| 153 | #define GET_WMM_QOS_INFO_FIELD_STA_AC_VO_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 0, 1) |
| 154 | #define SET_WMM_QOS_INFO_FIELD_STA_AC_VO_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 0, 1, _val) |
| 155 | |
| 156 | #define GET_WMM_QOS_INFO_FIELD_STA_AC_VI_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 1, 1) |
| 157 | #define SET_WMM_QOS_INFO_FIELD_STA_AC_VI_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 1, 1, _val) |
| 158 | |
| 159 | #define GET_WMM_QOS_INFO_FIELD_STA_AC_BE_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 2, 1) |
| 160 | #define SET_WMM_QOS_INFO_FIELD_STA_AC_BE_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 2, 1, _val) |
| 161 | |
| 162 | #define GET_WMM_QOS_INFO_FIELD_STA_AC_BK_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 3, 1) |
| 163 | #define SET_WMM_QOS_INFO_FIELD_STA_AC_BK_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 3, 1, _val) |
| 164 | |
| 165 | #define GET_WMM_QOS_INFO_FIELD_STA_MAX_SP_LEN(_pStart) LE_BITS_TO_1BYTE(_pStart, 5, 2) |
| 166 | #define SET_WMM_QOS_INFO_FIELD_STA_MAX_SP_LEN(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 5, 2, _val) |
| 167 | |
Larry Finger | f58a1cd | 2011-07-19 19:27:05 -0500 | [diff] [blame^] | 168 | enum qos_ie_source { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 169 | QOSIE_SRC_ADDTSREQ, |
| 170 | QOSIE_SRC_ADDTSRSP, |
| 171 | QOSIE_SRC_REASOCREQ, |
| 172 | QOSIE_SRC_REASOCRSP, |
| 173 | QOSIE_SRC_DELTS, |
Larry Finger | f58a1cd | 2011-07-19 19:27:05 -0500 | [diff] [blame^] | 174 | }; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 175 | |
| 176 | |
| 177 | typedef u32 AC_CODING; |
| 178 | #define AC0_BE 0 |
| 179 | #define AC1_BK 1 |
| 180 | #define AC2_VI 2 |
| 181 | #define AC3_VO 3 |
| 182 | #define AC_MAX 4 |
| 183 | |
| 184 | |
| 185 | #define AC_PARAM_SIZE 4 |
| 186 | |
| 187 | #define GET_WMM_AC_PARAM_AIFSN(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 0, 4) ) |
| 188 | #define SET_WMM_AC_PARAM_AIFSN(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 0, 4, _val) |
| 189 | |
| 190 | #define GET_WMM_AC_PARAM_ACM(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 4, 1) ) |
| 191 | #define SET_WMM_AC_PARAM_ACM(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 4, 1, _val) |
| 192 | |
| 193 | #define GET_WMM_AC_PARAM_ACI(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 5, 2) ) |
| 194 | #define SET_WMM_AC_PARAM_ACI(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 5, 2, _val) |
| 195 | |
| 196 | #define GET_WMM_AC_PARAM_ACI_AIFSN(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 0, 8) ) |
| 197 | #define SET_WMM_AC_PARAM_ACI_AIFSN(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 0, 8, _val) |
| 198 | |
| 199 | #define GET_WMM_AC_PARAM_ECWMIN(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 8, 4) ) |
| 200 | #define SET_WMM_AC_PARAM_ECWMIN(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 8, 4, _val) |
| 201 | |
| 202 | #define GET_WMM_AC_PARAM_ECWMAX(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 12, 4) ) |
| 203 | #define SET_WMM_AC_PARAM_ECWMAX(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 12, 4, _val) |
| 204 | |
| 205 | #define GET_WMM_AC_PARAM_TXOP_LIMIT(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 16, 16) ) |
| 206 | #define SET_WMM_AC_PARAM_TXOP_LIMIT(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 16, 16, _val) |
| 207 | |
| 208 | |
| 209 | |
| 210 | #define WMM_PARAM_ELEMENT_SIZE (8+(4*AC_PARAM_SIZE)) |
| 211 | |
Larry Finger | f58a1cd | 2011-07-19 19:27:05 -0500 | [diff] [blame^] | 212 | enum qos_ele_subtype { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 213 | QOSELE_TYPE_INFO = 0x00, |
| 214 | QOSELE_TYPE_PARAM = 0x01, |
Larry Finger | f58a1cd | 2011-07-19 19:27:05 -0500 | [diff] [blame^] | 215 | }; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 216 | |
| 217 | |
| 218 | typedef enum _DIRECTION_VALUE{ |
| 219 | DIR_UP = 0, |
| 220 | DIR_DOWN = 1, |
| 221 | DIR_DIRECT = 2, |
| 222 | DIR_BI_DIR = 3, |
Larry Finger | d3b2c17 | 2011-07-19 12:50:41 -0500 | [diff] [blame] | 223 | } DIRECTION_VALUE,*PDIRECTION_VALUE; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 224 | |
| 225 | typedef enum _ACM_METHOD{ |
| 226 | eAcmWay0_SwAndHw = 0, |
| 227 | eAcmWay1_HW = 1, |
| 228 | eAcmWay2_SW = 2, |
Larry Finger | d3b2c17 | 2011-07-19 12:50:41 -0500 | [diff] [blame] | 229 | } ACM_METHOD,*PACM_METHOD; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 230 | |
| 231 | |
Larry Finger | b0d7de7 | 2011-07-18 22:21:17 -0500 | [diff] [blame] | 232 | struct acm { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 233 | u64 UsedTime; |
| 234 | u64 MediumTime; |
| 235 | u8 HwAcmCtl; |
Larry Finger | d3b2c17 | 2011-07-19 12:50:41 -0500 | [diff] [blame] | 236 | }; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 237 | |
| 238 | |
| 239 | |
| 240 | typedef u8 AC_UAPSD, *PAC_UAPSD; |
| 241 | |
| 242 | #define GET_VO_UAPSD(_apsd) ((_apsd) & BIT0) |
| 243 | #define SET_VO_UAPSD(_apsd) ((_apsd) |= BIT0) |
| 244 | |
| 245 | #define GET_VI_UAPSD(_apsd) ((_apsd) & BIT1) |
| 246 | #define SET_VI_UAPSD(_apsd) ((_apsd) |= BIT1) |
| 247 | |
| 248 | #define GET_BK_UAPSD(_apsd) ((_apsd) & BIT2) |
| 249 | #define SET_BK_UAPSD(_apsd) ((_apsd) |= BIT2) |
| 250 | |
| 251 | #define GET_BE_UAPSD(_apsd) ((_apsd) & BIT3) |
| 252 | #define SET_BE_UAPSD(_apsd) ((_apsd) |= BIT3) |
| 253 | |
Larry Finger | 626f951 | 2011-07-19 10:27:46 -0500 | [diff] [blame] | 254 | union qos_tclas { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 255 | |
| 256 | struct _TYPE_GENERAL{ |
| 257 | u8 Priority; |
| 258 | u8 ClassifierType; |
| 259 | u8 Mask; |
| 260 | } TYPE_GENERAL; |
| 261 | |
| 262 | struct _TYPE0_ETH{ |
| 263 | u8 Priority; |
| 264 | u8 ClassifierType; |
| 265 | u8 Mask; |
| 266 | u8 SrcAddr[6]; |
| 267 | u8 DstAddr[6]; |
| 268 | u16 Type; |
| 269 | } TYPE0_ETH; |
| 270 | |
| 271 | struct _TYPE1_IPV4{ |
| 272 | u8 Priority; |
| 273 | u8 ClassifierType; |
| 274 | u8 Mask; |
| 275 | u8 Version; |
| 276 | u8 SrcIP[4]; |
| 277 | u8 DstIP[4]; |
| 278 | u16 SrcPort; |
| 279 | u16 DstPort; |
| 280 | u8 DSCP; |
| 281 | u8 Protocol; |
| 282 | u8 Reserved; |
| 283 | } TYPE1_IPV4; |
| 284 | |
| 285 | struct _TYPE1_IPV6{ |
| 286 | u8 Priority; |
| 287 | u8 ClassifierType; |
| 288 | u8 Mask; |
| 289 | u8 Version; |
| 290 | u8 SrcIP[16]; |
| 291 | u8 DstIP[16]; |
| 292 | u16 SrcPort; |
| 293 | u16 DstPort; |
| 294 | u8 FlowLabel[3]; |
| 295 | } TYPE1_IPV6; |
| 296 | |
| 297 | struct _TYPE2_8021Q{ |
| 298 | u8 Priority; |
| 299 | u8 ClassifierType; |
| 300 | u8 Mask; |
| 301 | u16 TagType; |
| 302 | } TYPE2_8021Q; |
Larry Finger | 626f951 | 2011-07-19 10:27:46 -0500 | [diff] [blame] | 303 | }; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 304 | |
Larry Finger | 1d2a55f | 2011-07-18 21:58:49 -0500 | [diff] [blame] | 305 | struct qos_tstream { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 306 | |
| 307 | bool bUsed; |
| 308 | u16 MsduLifetime; |
| 309 | bool bEstablishing; |
| 310 | u8 TimeSlotCount; |
| 311 | u8 DialogToken; |
Larry Finger | 95ce5fc | 2011-07-18 21:55:05 -0500 | [diff] [blame] | 312 | struct wmm_tspec TSpec; |
| 313 | struct wmm_tspec OutStandingTSpec; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 314 | u8 NominalPhyRate; |
Larry Finger | 1d2a55f | 2011-07-18 21:58:49 -0500 | [diff] [blame] | 315 | }; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 316 | |
Larry Finger | 0db4279 | 2011-07-18 22:01:50 -0500 | [diff] [blame] | 317 | struct sta_qos { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 318 | u8 WMMIEBuf[MAX_WMMELE_LENGTH]; |
| 319 | u8* WMMIE; |
| 320 | |
| 321 | QOS_MODE QosCapability; |
| 322 | QOS_MODE CurrentQosMode; |
| 323 | |
| 324 | AC_UAPSD b4ac_Uapsd; |
| 325 | AC_UAPSD Curr4acUapsd; |
| 326 | u8 bInServicePeriod; |
| 327 | u8 MaxSPLength; |
| 328 | int NumBcnBeforeTrigger; |
| 329 | |
| 330 | u8 * pWMMInfoEle; |
| 331 | u8 WMMParamEle[WMM_PARAM_ELEMENT_SIZE]; |
| 332 | |
Larry Finger | b0d7de7 | 2011-07-18 22:21:17 -0500 | [diff] [blame] | 333 | struct acm acm[4]; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 334 | ACM_METHOD AcmMethod; |
| 335 | |
Larry Finger | 1d2a55f | 2011-07-18 21:58:49 -0500 | [diff] [blame] | 336 | struct qos_tstream StaTsArray[MAX_STA_TS_COUNT]; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 337 | u8 DialogToken; |
Larry Finger | 95ce5fc | 2011-07-18 21:55:05 -0500 | [diff] [blame] | 338 | struct wmm_tspec TSpec; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 339 | |
| 340 | u8 QBssWirelessMode; |
| 341 | |
| 342 | bool bNoAck; |
| 343 | |
| 344 | bool bEnableRxImmBA; |
| 345 | |
Larry Finger | d3b2c17 | 2011-07-19 12:50:41 -0500 | [diff] [blame] | 346 | }; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 347 | |
| 348 | #define QBSS_LOAD_SIZE 5 |
| 349 | #define GET_QBSS_LOAD_STA_COUNT(__pStart) ReadEF2Byte(__pStart) |
| 350 | #define SET_QBSS_LOAD_STA_COUNT(__pStart, __Value) WriteEF2Byte(__pStart, __Value) |
| 351 | #define GET_QBSS_LOAD_CHNL_UTILIZATION(__pStart) ReadEF1Byte((u8*)(__pStart) + 2) |
| 352 | #define SET_QBSS_LOAD_CHNL_UTILIZATION(__pStart, __Value) WriteEF1Byte((u8*)(__pStart) + 2, __Value) |
| 353 | #define GET_QBSS_LOAD_AVAILABLE_CAPACITY(__pStart) ReadEF2Byte((u8*)(__pStart) + 3) |
| 354 | #define SET_QBSS_LOAD_AVAILABLE_CAPACITY(__pStart, __Value) WriteEF2Byte((u8*)(__pStart) + 3, __Value) |
| 355 | |
Larry Finger | 0157d2e | 2011-07-18 20:04:31 -0500 | [diff] [blame] | 356 | struct bss_qos { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 357 | |
| 358 | QOS_MODE bdQoSMode; |
| 359 | u8 bdWMMIEBuf[MAX_WMMELE_LENGTH]; |
Larry Finger | 8310b6c0 | 2011-07-18 21:57:13 -0500 | [diff] [blame] | 360 | struct octet_string bdWMMIE; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 361 | |
Larry Finger | f58a1cd | 2011-07-19 19:27:05 -0500 | [diff] [blame^] | 362 | enum qos_ele_subtype EleSubType; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 363 | |
| 364 | u8* pWMMInfoEle; |
| 365 | u8* pWMMParamEle; |
| 366 | |
| 367 | u8 QBssLoad[QBSS_LOAD_SIZE]; |
| 368 | bool bQBssLoadValid; |
Larry Finger | d3b2c17 | 2011-07-19 12:50:41 -0500 | [diff] [blame] | 369 | }; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 370 | |
| 371 | #define sQoSCtlLng 2 |
| 372 | #define QOS_CTRL_LEN(_QosMode) ( (_QosMode > QOS_DISABLE)? sQoSCtlLng : 0 ) |
| 373 | |
| 374 | |
| 375 | #define IsACValid(ac) ( ( ac>=0 && ac<=7 )? true : false ) |
| 376 | |
| 377 | |
Larry Finger | 44a4004 | 2011-07-19 10:29:41 -0500 | [diff] [blame] | 378 | union aci_aifsn { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 379 | u8 charData; |
| 380 | |
| 381 | struct |
| 382 | { |
| 383 | u8 AIFSN:4; |
Larry Finger | b0d7de7 | 2011-07-18 22:21:17 -0500 | [diff] [blame] | 384 | u8 acm:1; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 385 | u8 ACI:2; |
| 386 | u8 Reserved:1; |
| 387 | }f; |
Larry Finger | 44a4004 | 2011-07-19 10:29:41 -0500 | [diff] [blame] | 388 | }; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 389 | |
Larry Finger | a33be1e | 2011-07-19 10:31:43 -0500 | [diff] [blame] | 390 | union ecw { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 391 | u8 charData; |
| 392 | struct |
| 393 | { |
| 394 | u8 ECWmin:4; |
| 395 | u8 ECWmax:4; |
| 396 | }f; |
Larry Finger | a33be1e | 2011-07-19 10:31:43 -0500 | [diff] [blame] | 397 | }; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 398 | |
Larry Finger | eb85e46 | 2011-07-19 10:35:19 -0500 | [diff] [blame] | 399 | union ac_param { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 400 | u32 longData; |
| 401 | u8 charData[4]; |
| 402 | |
| 403 | struct |
| 404 | { |
Larry Finger | 44a4004 | 2011-07-19 10:29:41 -0500 | [diff] [blame] | 405 | union aci_aifsn AciAifsn; |
Larry Finger | a33be1e | 2011-07-19 10:31:43 -0500 | [diff] [blame] | 406 | union ecw Ecw; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 407 | u16 TXOPLimit; |
| 408 | }f; |
Larry Finger | eb85e46 | 2011-07-19 10:35:19 -0500 | [diff] [blame] | 409 | }; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 410 | |
| 411 | #endif |