1 /**************************************************************************** 2 **+-----------------------------------------------------------------------+** 3 **| |** 4 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |** 5 **| All rights reserved. |** 6 **| |** 7 **| Redistribution and use in source and binary forms, with or without |** 8 **| modification, are permitted provided that the following conditions |** 9 **| are met: |** 10 **| |** 11 **| * Redistributions of source code must retain the above copyright |** 12 **| notice, this list of conditions and the following disclaimer. |** 13 **| * Redistributions in binary form must reproduce the above copyright |** 14 **| notice, this list of conditions and the following disclaimer in |** 15 **| the documentation and/or other materials provided with the |** 16 **| distribution. |** 17 **| * Neither the name Texas Instruments nor the names of its |** 18 **| contributors may be used to endorse or promote products derived |** 19 **| from this software without specific prior written permission. |** 20 **| |** 21 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |** 22 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |** 23 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |** 24 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |** 25 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |** 26 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |** 27 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |** 28 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |** 29 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |** 30 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |** 31 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |** 32 **| |** 33 **+-----------------------------------------------------------------------+** 34 ****************************************************************************/ 35 36 /*--------------------------------------------------------------------------*/ 37 /* Module: tiQosTypes.h*/ 38 /**/ 39 /* Purpose: */ 40 /**/ 41 /*--------------------------------------------------------------------------*/ 42 43 #if !defined TI_QOS_TYPES_H 44 #define TI_QOS_TYPES_H 45 46 47 #define TI_WLAN_QOS_RETURN_CODES \ 48 NOT_CONNECTED,\ 49 TRAFIC_ADM_PENDING,\ 50 NO_QOS_AP,\ 51 ADM_CTRL_DISABLE,\ 52 AC_ALREADY_IN_USE,\ 53 USER_PRIORITY_NOT_ADMITTED\ 54 /* 55 NOT_CONNECTED - Not connected to AP 56 TRAFIC_ADM_PENDING - TSPEC request sent - awaiting response 57 NO_QOS_AP - primary AP does not support QOS (WME) 58 ADM_CTRL_DISABLE - Admission control disabled 59 AC_ALREADY_IN_USE - A TSPEC has already been sent on this specific AC 60 USER_PRIORITY_NOT_ADMITTED - User priority is not admitted (TSPEC not sent) 61 */ 62 63 64 typedef enum{ 65 QOS_AC_BE = 0, 66 QOS_AC_BK, 67 QOS_AC_VI, 68 QOS_AC_VO, 69 QOS_HIGHEST_AC_INDEX = QOS_AC_VO, 70 71 }acTrfcType_e; /* for TI_HANDLE hAcTrfcCtrl */ 72 73 #define MAX_NUM_OF_AC ( QOS_HIGHEST_AC_INDEX+1 ) 74 #define FIRST_AC_INDEX QOS_AC_BE 75 #define MAX_NUM_OF_802_1d_TAGS 8 76 77 #define AC_PARAMS_MAX_TSID 15 78 #define MAX_APSD_CONF 0xffff 79 80 81 /* 82 * this enum defines FW PS policing modes 83 */ 84 typedef struct _OS_802_11_QOS_PARAMS 85 { 86 tiUINT32 acID; 87 tiUINT32 MaxLifeTime; 88 tiUINT32 VoiceDeliveryProtocol; 89 tiUINT32 PSDeliveryProtocol; 90 } OS_802_11_QOS_PARAMS; 91 92 typedef struct { 93 tiUINT32 psPoll; 94 tiUINT32 UPSD; 95 } OS_802_11_QOS_RX_TIMEOUT_PARAMS; 96 97 typedef struct _OS_802_11_AC_QOS_PARAMS 98 { 99 tiUINT32 uAC; 100 tiUINT32 uAssocAdmissionCtrlFlag; 101 tiUINT32 uAIFS; 102 tiUINT32 uCwMin; 103 tiUINT32 uCwMax; 104 tiUINT32 uTXOPLimit; 105 } OS_802_11_AC_QOS_PARAMS; 106 107 typedef struct _OS_802_11_AP_QOS_CAPABILITIES_PARAMS 108 { 109 tiUINT32 uQOSFlag; 110 tiUINT32 uAPSDFlag; 111 } OS_802_11_AP_QOS_CAPABILITIES_PARAMS; 112 113 typedef struct _OS_802_11_QOS_TSPEC_PARAMS 114 { 115 tiUINT32 uUserPriority; 116 tiUINT32 uNominalMSDUsize; /* in bytes */ 117 tiUINT32 uMeanDataRate; /* bits per second */ 118 tiUINT32 uMinimumPHYRate; /* 1,2,5,6,9,11,12,18,......*/ 119 tiUINT32 uSurplusBandwidthAllowance; 120 tiUINT32 uAPSDFlag; 121 tiUINT32 uMediumTime; 122 tiUINT32 uReasonCode; 123 } OS_802_11_QOS_TSPEC_PARAMS; 124 125 typedef struct _OS_802_11_QOS_DELETE_TSPEC_PARAMS 126 { 127 tiUINT32 uUserPriority; 128 tiUINT32 uReasonCode; 129 } OS_802_11_QOS_DELETE_TSPEC_PARAMS; 130 131 typedef struct _OS_802_11_QOS_DESIRED_PS_MODE 132 { 133 tiUINT32 uDesiredPsMode; 134 tiUINT32 uDesiredWmeAcPsMode[MAX_NUM_OF_AC]; 135 } OS_802_11_QOS_DESIRED_PS_MODE; 136 137 138 139 /* When this value is added to reason code in TSPEC events, it indicates a TSPEC response which was unexpected at the time */ 140 /* For example, a TSPEC response arrives after a TSPEC timeout */ 141 #define TSPEC_RESPONSE_UNEXPECTED 0x1000 142 143 typedef enum{ 144 ADDTS_RESPONSE_ACCEPT = 0, 145 /* ADDTS_RESPONSE_REJECT, - according to the standard*/ 146 ADDTS_RESPONSE_AP_PARAM_INVALID = 253, 147 ADDTS_RESPONSE_TIMEOUT = 254, 148 TSPEC_DELETED_BY_AP = 255, 149 } tspec_status_e; 150 151 typedef struct _OS_802_11_AC_UPSD_STATUS_PARAMS 152 { 153 tiUINT32 uAC; 154 tiUINT32 uCurrentUAPSDStatus; 155 tiUINT32 pCurrentAdmissionStatus; 156 } OS_802_11_AC_UPSD_STATUS_PARAMS; 157 158 typedef struct _OS_802_11_THRESHOLD_CROSS_PARAMS 159 { 160 tiUINT32 uAC; 161 tiUINT32 uHighThreshold; 162 tiUINT32 uLowThreshold; 163 } OS_802_11_THRESHOLD_CROSS_PARAMS; 164 165 typedef struct OS_802_11_THRESHOLD_CROSS_INDICATION_PARAMS 166 { 167 tiUINT32 uAC; 168 tiUINT32 uHighOrLowThresholdFlag; /* According to thresholdCross_e enum */ 169 tiUINT32 uAboveOrBelowFlag; /* According to thresholdCrossDirection_e enum */ 170 } OS_802_11_THRESHOLD_CROSS_INDICATION_PARAMS; 171 172 typedef enum{ 173 HIGH_THRESHOLD_CROSS, 174 LOW_THRESHOLD_CROSS, 175 } thresholdCross_e; 176 177 typedef enum{ 178 CROSS_ABOVE, 179 CROSS_BELOW, 180 } thresholdCrossDirection_e; 181 182 typedef struct _STREAM_TRAFFIC_PROPERTIES{ 183 UINT32 dstIpAddress; 184 UINT32 dstPort; 185 UINT32 PktTag; 186 UINT32 userPriority; 187 } STREAM_TRAFFIC_PROPERTIES; 188 189 190 typedef enum{ 191 AC_NOT_ADMITTED, 192 AC_WAIT_ADMISSION, 193 AC_ADMITTED 194 } trafficAdmState_e; 195 196 typedef enum{ 197 UPLINK_DIRECTION = 0, 198 DOWNLINK_DIRECTION = 1, 199 RESERVED_DIRECTION = 2, 200 BI_DIRECTIONAL = 3, 201 } streamDirection_e; 202 203 204 /* classification algorithms: 205 0) D-tag to D-tag 206 1) DSCP to D-tag 207 2) Destination port number to D-tag 208 3) Destination IP&Port to D-tag 209 */ 210 typedef enum{ 211 D_TAG_CLSFR = 0, 212 DSCP_CLSFR =1, 213 PORT_CLSFR =2, 214 IPPORT_CLSFR =3, 215 CLSFR_TYPE_MAX = IPPORT_CLSFR, 216 } clsfr_type_e; 217 218 typedef struct clsfrTypeAndSupport 219 { 220 ULONG ClsfrType; 221 UINT8 oldVersionSupport; 222 } clsfrTypeAndSupport; 223 224 225 /*************************/ 226 /* classifier params */ 227 /*************************/ 228 229 /* This type represents a pair of 230 destination IP address and destination port number. */ 231 typedef struct 232 { 233 UINT32 DstIPAddress; 234 UINT16 DstPortNum; 235 } IP_Port_t; 236 237 /* Classification mapping 238 table. 239 */ 240 typedef struct 241 { 242 union 243 { 244 IP_Port_t DstIPPort; /* for destination IP&Port classifier*/ 245 UINT16 DstPortNum; /* for destination Port classifier*/ 246 UINT8 CodePoint; /* for DSCP classifier*/ 247 }Dscp; 248 UINT8 DTag; 249 } clsfr_tableEntry_t; 250 251 /* Classifier parameters */ 252 253 /* number of classifier entries in the classification table */ 254 #define NUM_OF_CLSFR_TABLE_ENTRIES 16 255 256 typedef struct 257 { 258 clsfr_type_e clsfrType; /* The type of the classifier: D-tag, DSCP, Port or IP&Port */ 259 UINT8 NumOfActiveEntries; /* The number of active entries in the classification table */ 260 clsfr_tableEntry_t 261 ClsfrTable[NUM_OF_CLSFR_TABLE_ENTRIES]; /* Classification table - size changed from 15 to 16*/ 262 } clsfr_Params_t; 263 264 /* This type is use by setParam to insert classifier table entries */ 265 typedef struct 266 { 267 UINT8 EntriesNum; 268 UINT32 *BufferPtr; 269 } clsfr_insertEntry_t; 270 271 #endif /* TI_QOS_TYPES_H */ 272 273