• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*******************************************************************************
2 **+--------------------------------------------------------------------------+**
3 **|                                                                          |**
4 **| Copyright 1998-2008 Texas Instruments, Inc. - http://www.ti.com/         |**
5 **|                                                                          |**
6 **| Licensed under the Apache License, Version 2.0 (the "License");          |**
7 **| you may not use this file except in compliance with the License.         |**
8 **| You may obtain a copy of the License at                                  |**
9 **|                                                                          |**
10 **|     http://www.apache.org/licenses/LICENSE-2.0                           |**
11 **|                                                                          |**
12 **| Unless required by applicable law or agreed to in writing, software      |**
13 **| distributed under the License is distributed on an "AS IS" BASIS,        |**
14 **| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |**
15 **| See the License for the specific language governing permissions and      |**
16 **| limitations under the License.                                           |**
17 **|                                                                          |**
18 **+--------------------------------------------------------------------------+**
19 *******************************************************************************/
20 
21 /*--------------------------------------------------------------------------*/
22 /* Module:		TI_AdapterQOS.h*/
23 /**/
24 /* Purpose:		*/
25 /**/
26 /*--------------------------------------------------------------------------*/
27 
28 #ifndef TI_ADAPTER_QOS_H
29 #define TI_ADAPTER_QOS_H
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #include "tiQosTypes.h"
36 
37 /******************************************************************************
38 
39     Name:	TI_SetQosParameters
40     Desc:	This function commands the driver to set AC (Tx queue) with
41             specific QOS parameters.
42     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
43             pQosParams - A pointer to the OS_802_11_QOS_PARAMS structure:
44                 acID - The number of AC to configure (0-3).
45                 MaxLifeTime - Maximum time to keep the frame in the HW (msec).
46                 VoiceDeliveryProtocol - The protocol used for voice exchange
47                                         0 = No protocol is used.
48                                         1 = use PS-Poll frames
49                 PSDeliveryProtocol - 0 = Legacy
50                                      1 = U-APSD
51     Return:	TI_RESULT_OK on success. Any other value indicates an error.
52 
53 ******************************************************************************/
54 tiINT32 TI_SetQosParameters       (TI_HANDLE hAdapter,
55                                    OS_802_11_QOS_PARAMS* pQosParams );
56 
57 
58 /******************************************************************************
59 
60     Name:	TI_GetAPQosParameters
61     Desc:	This function retrieves the associated AP�s QOS parameters.
62     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
63             pACQosParams - A Pointer to the OS_802_11_AP_QOS_PARAMS structure:
64                 uAC - Indicates the AC to which the function is addressed
65                         (range 0-3).
66                 uAssocAdmissionCtrlFlag - Indicates if the AC requires admission
67                         before data transmission (0-1).
68                 uAIFS - Indicates the required AIFS by the AP for the specified
69                         AC (2-15).
70                 uCwMin - Indicates the required CwMin by the AP for the specified
71                         AC (0-15).
72                 uCwMax - Indicates the required CwMax by the AP for the specified
73                         AC (0-15).
74                 uTXOPLimit - Indicates the required TXOPLimit by the AP for the
75                         specified AC (in units of 32 microseconds).
76     Return:	TI_RESULT_OK indicates success.
77             TI_RESULT_NOT_CONNECTED indicates that the STA is not connected to
78                                     any AP.
79             TI_RESULT_NO_QOS_AP indicates that the associated AP does not
80                                     support QOS.
81             TI_RESULT_NOK indicates invalid parameters.
82     Note:   This function should be called only after the STA was associated with
83             an infrastructure AP.
84 
85 ******************************************************************************/
86 tiINT32	TI_GetAPQosParameters     (TI_HANDLE hAdapter,
87                                    OS_802_11_AC_QOS_PARAMS* pACQosParams);
88 
89 
90 /******************************************************************************
91 
92     Name:	TI_GetAPQosCapabilitesParameters
93     Desc:	This function retrieves the associated AP�s QOS capabilities.
94     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
95             pAPQosCapabiltiesParams - A Pointer to the
96                 OS_802_11_AP_QOS_CAPABILITIES_PARAMS structure:
97                     uQOSFlag - Flag that indicates whether the AP supports
98                                 QOS (0-1)
99                     uAPSDFlag - Flag that indicates whether the AP supports
100                                 U-APSD (0-1)
101     Return:	TI_RESULT_OK indicates success.
102             TI_RESULT_NOT_CONNECTED indicates that the STA is not connected to any AP.
103             TI_RESULT_NOK indicates invalid parameters.
104     Note:   This function should be called only after the STA was associated with
105             an infrastructure AP.
106 
107 ******************************************************************************/
108 tiINT32	TI_GetAPQosCapabilitesParameters  (TI_HANDLE hAdapter,
109                                            OS_802_11_AP_QOS_CAPABILITIES_PARAMS* pAPQosCapabiltiesParams);
110 
111 
112 /******************************************************************************
113 
114     Name:	TI_PollApPackets
115     Desc:	This function commands the driver to issue a polling frame to
116             retrieve downlink traffic from the AP. It should be activated by
117             the voice application when there is no uplink traffic during a
118             voice call. This is used for a non-QoS association (so AC_BE
119             is used).
120     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
121     Return:	TI_RESULT_OK on success. Any other value indicates an error.
122 
123 ******************************************************************************/
124 tiINT32 TI_PollApPackets         (TI_HANDLE hAdapter);
125 
126 /******************************************************************************
127 
128     Name:	TI_PollApPacketsFromAC
129     Desc:	This function commands the driver to issue a polling frame to
130             retrieve downlink traffic from the AP. It should be activated by
131             the voice application when there is no uplink traffic during a
132             voice call. The polling is either PS-Poll (for legacy PS) or
133             QoS-Null-Data (for UPSD).
134             Null-Data frame is sent after the PS-Poll to activate the
135             triggered-scan, which is only triggered by data frames. These
136             packets are transmitted on the VO_AC, for QoS associations.
137     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
138             AC - The AC to be polled (values may be 0 to 3)
139     Return:	TI_RESULT_OK on success. Any other value indicates an error.
140 
141 ******************************************************************************/
142 tiINT32	TI_PollApPacketsFromAC   (TI_HANDLE hAdapter,
143                                   tiUINT32 AC );
144 
145 /******************************************************************************
146 
147     Name:	TI_SetShortRetry
148     Desc:	This function commands the driver to set Best Effort AC with maximum
149             number of transmits retries to perform for short packets.
150     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
151             uShortRetry - Maximum number of transmits retries to perform for
152                           short packets
153     Return:	TI_RESULT_OK on success. Any other value indicates an error.
154 
155 ******************************************************************************/
156 tiINT32     TI_SetShortRetry            (TI_HANDLE  hAdapter,
157                                          tiUINT32   uShortRetry  );
158 
159 /******************************************************************************
160 
161     Name:	TI_GetShortRetry
162     Desc:	This function gets the maximum number of transmits retries to perform
163             for short packets of the Best Effort AC.
164     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
165             puShortRetry - Maximum number of transmits retries to perform for
166                            short packets.
167     Return:	TI_RESULT_OK on success. Any other value indicates an error.
168 
169 ******************************************************************************/
170 tiINT32     TI_GetShortRetry            (TI_HANDLE  hAdapter,
171                                          tiUINT32*  puShortRetry );
172 
173 
174 /******************************************************************************
175 
176     Name:	TI_SetLongRetry
177     Desc:	This function commands the driver to set Best Effort AC with maximum
178             number of transmits retries to perform for long packets.
179     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
180             uLongRetry - Maximum number of transmits retries to perform for long
181             packets.
182     Return:	TI_RESULT_OK on success. Any other value indicates an error.
183 
184 ******************************************************************************/
185 tiINT32     TI_SetLongRetry             (TI_HANDLE  hAdapter,
186                                          tiUINT32   uLongRetry );
187 
188 /******************************************************************************
189 
190     Name:	TI_GetLongRetry
191     Desc:	This function gets the maximum number of transmits retries to perform
192             for long packets of the Best Effort AC.
193     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
194             puLongRetry - Maximum number of transmits retries to perform for long
195             packets.
196     Return:	TI_RESULT_OK on success. Any other value indicates an error.
197 
198 ******************************************************************************/
199 tiINT32     TI_GetLongRetry             (TI_HANDLE  hAdapter,
200                                          tiUINT32*  puLongRetry);
201 
202 /******************************************************************************
203 
204     Name:	TI_SetQosRxTimeOut
205     Desc:
206     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
207             pRxTimeOut -
208     Return:	TI_RESULT_OK on success. Any other value indicates an error.
209 
210 ******************************************************************************/
211 tiINT32 TI_SetQosRxTimeOut        (TI_HANDLE hAdapter,
212                                    OS_802_11_QOS_RX_TIMEOUT_PARAMS*  pRxTimeOut);
213 
214 
215 
216 /******************************************************************************
217 
218     Name:	TI_AddTspec
219     Desc:	This function commands the driver to add TSPEC for the specific
220             user Priority.
221     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
222             pTspecParams - Pointer to OS_802_11_QOS_TSPEC_PARAMS strcuture:
223             uUserPriority - Indicates the User priority for which TSPEC is
224                             requested (range 0-7)
225             uNominalMSDUsize - Indicates the Nominal MSDU size in units of
226                             bytes (16 LSB only).
227             uMeanDataRate - Indicates the average data rate in units of bits
228                             per sec
229             uMinimumPHYRate - Indicates the desired minimum PHY rate in units
230                             of bits per sec
231             uSurplusBandwidth -
232             hAllowance - Indicates the excess allocation of time (and bandwidth)
233                             over and above the stated application rates
234                             (represented as fix Q13 numberand used 16 LSB only).
235             uUPSDFlag - Indicates if the AC shouls support U-APSD (0-1)
236             uMediumTime - Indicates the amount of time admitted to this UP.
237                             Used only for Tspec response notification (16 LSB
238                             only).
239             uReasonCode - Indicates the reason code of AP response (applicable
240                             only in TSEPC response event, this field is zero
241                             in ADD_TSPEC request).
242     Return:	TI_RESULT_OK - Success. Any other value indicates an error.
243             TI_RESULT_TRAFIC_ADM_PENDING � Driver is still waiting for a response of previous request.
244             TI_RESULT_AC_ALREADY_IN_USE � Means that other user priority from the same AC has already been used.
245             TI_RESULT_NOT_CONNECTED -Indicates that the STA is not connected to any AP.
246             TI_RESULT_NO_QOS_AP - indicates that the associated AP does not support QOS.
247             TI_RESULT_ADM_CTRL_DISABLE � Indicates that station configured to not support admission control.
248             TI_RESULT_NOK � Parameters are not valid.
249     Notes:  1. Only one TSPEC per AC can be used. For example, user can�t
250                 request TSPEC for UP 6 and 7 since those two UPs are mapped
251                 to the same AC.
252             2. User can issue Tspec request only after he gets a response of
253                 the previous request.
254 
255 ******************************************************************************/
256 tiINT32	TI_AddTspec               (TI_HANDLE hAdapter,
257                                    OS_802_11_QOS_TSPEC_PARAMS* pTspecParams);
258 
259 /******************************************************************************
260 
261     Name:	TI_GetTspecParameters
262     Desc:	This function retrieves Tspec parameters for a specific user
263             Priority.
264     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
265             pTspecParams - Includes TSPEC parameters as indicated in
266                             TI_AddTspec().
267     Return:	TI_RESULT_OK � Driver retrieves the TSPEC parameters.
268             TI_RESULT_NOT_CONNECTED - Indicates that the STA is not connected
269                                       to any AP.
270             TI_RESULT_NO_QOS_AP - indicates that the associated AP does not
271                                   support QOS.
272             TI_RESULT_TRAFIC_ADM_PENDING � Driver is waiting for a TSPEC response.
273             TI_RESULT_NOK � Parameters are not valid.
274     Note:   This function should be called only after TSPEC Response event
275             with valid reason code.
276 ******************************************************************************/
277 tiINT32	TI_GetTspecParameters     (TI_HANDLE hAdapter,
278                                    OS_802_11_QOS_TSPEC_PARAMS* pTspecParams);
279 
280 /******************************************************************************
281 
282     Name:	TI_DeleteTspec
283     Desc:	This function commands the driver to remove TSPEC request for the
284             specific user Priority.
285     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
286     pDelTspecParams - A Pointer to the  OS_802_11_QOS_DELETE_TSPEC_PARAMS structure:
287             uUserPriority - Indicates the User priority of which TSPEC to delete
288                             (range 0-7)
289             uReasonCode - Indicates the reason code for delete TSPEC request
290                             (32-39,45).
291     Return:	TI_RESULT_OK on success. Any other value indicates an error.
292 
293 ******************************************************************************/
294 tiINT32	TI_DeleteTspec            (TI_HANDLE hAdapter,
295                                    OS_802_11_QOS_DELETE_TSPEC_PARAMS* pDelTspecParams);
296 
297 /******************************************************************************
298 
299     Name:	TI_GetCurrentACStatus
300     Desc:	This function retrieves the status of the AC in terms of U-APSD
301             activation and admission granted.
302     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
303             pAcStatusParams - Pointer to OS_802_11_QOS_AC_UPSD_STATUS_PARAMS:
304                 uAC - Indicates the AC to which the function is addressed
305                         (range 0-3)
306                 uCurrentUAPSDStatus - Current UAPSD status.
307                 uCurrentAdmissionStatus - TRUE if the selected AC can be used
308                         for traffic transmission, i.e. either admission is not
309                         required by the AP for this AC, or admission is required
310                         and a successful TSPEC took place. In all other cases the
311                         contents of this field should be FALSE.
312     Return:	TI_RESULT_OK - Success.
313             TI_RESULT_NOT_CONNECTED - Indicates that the STA is not connected to
314                         any AP.
315             TI_RESULT_NO_QOS_AP - indicates that the associated AP does not
316                         support QOS.
317             TI_RESULT_NOK � Parameters are not valid.
318 
319 ******************************************************************************/
320 tiINT32	TI_GetCurrentACStatus     (TI_HANDLE hAdapter,
321                                    OS_802_11_AC_UPSD_STATUS_PARAMS *pAcStatusParams);
322 
323 /******************************************************************************
324 
325     Name:	TI_SetMediumUsageThreshold
326     Desc:	This function set the Medium Usage low and high threshold for a
327             specific AC.
328     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
329             pThresholdCrossParams - OS_802_11_THRESHOLD_CROSS_PARAMS:
330                 uAC - Indicates the AC to which the configuration is addressed
331                         (range 0-3)
332                 uHighThreshold - Indicates high threshold in percentage over
333                         the allowed medium usage (1-100).
334                 uLowThreshold - Indicates low threshold in percentage below the
335                         allowed medium usage (1-100).
336     Return:	TI_RESULT_OK � Driver set the thresholds.
337             TI_RESULT_NOK � Parameters are not valid.
338 
339 ******************************************************************************/
340 tiINT32	TI_SetMediumUsageThreshold (TI_HANDLE hAdapter,
341                                     OS_802_11_THRESHOLD_CROSS_PARAMS* pThresholdCrossParams);
342 
343 /******************************************************************************
344 
345     Name:	TI_GetMediumUsageThreshold
346     Desc:	This function retrieves the Medium Usage low and high threshold for
347             a specific AC.
348     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
349             pThresholdCrossParams - Pointer that holds the MediumUsage current
350                                     thresholds (see TI_SetMediumUsageThreshold).
351     Return:	TI_RESULT_OK � Driver retrieved the thresholds.
352             TI_RESULT_NOK � Parameters are not valid.
353 
354 ******************************************************************************/
355 tiINT32	TI_GetMediumUsageThreshold (TI_HANDLE hAdapter,
356                                     OS_802_11_THRESHOLD_CROSS_PARAMS* pThresholdCrossParams);
357 
358 
359 /******************************************************************************
360 
361     Name:	TI_SetPhyRateThreshold
362     Desc:	This function set the Phy Rate low and high thresholds for a
363             specific AC.
364     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
365             pThresholdCrossParams - OS_802_11_THRESHOLD_CROSS_PARAMS:
366                 uAC - Indicates the AC to which the configuration is addressed
367                         (range 0-3)
368                 uHighThreshold - Indicates high Phy Rate threshold in Mbs
369                         (1,2,5,6,9,11,12,18,24,36,48,54).
370                 uLowThreshold - Indicates low Phy Rate threshold in Mbs
371                         (1,2,5,6,9,11,12,18,24,36,48,54)
372     Return:	TI_RESULT_OK � Driver set the thresholds.
373             TI_RESULT_NOK � Parameters are not valid.
374 
375 ******************************************************************************/
376 tiINT32	TI_SetPhyRateThreshold (TI_HANDLE hAdapter,
377                                 OS_802_11_THRESHOLD_CROSS_PARAMS* pThresholdCrossParams);
378 
379 
380 /******************************************************************************
381 
382     Name:	TI_GetPhyRateThreshold
383     Desc:	This function retrieves the Phy Rate thresholds for a specific AC.
384     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
385             pThresholdCrossParams - Pointer that holds the PhyRate current
386                                     thresholds.
387     Return:	TI_RESULT_OK � Driver retrieved the thresholds.
388             TI_RESULT_NOK � Parameters are not valid.
389 
390 ******************************************************************************/
391 tiINT32	TI_GetPhyRateThreshold (TI_HANDLE hAdapter,
392                                 OS_802_11_THRESHOLD_CROSS_PARAMS* pThresholdCrossParams);
393 
394 /******************************************************************************
395 
396     Name:	TI_GetDesiredPsMode
397     Desc:	This function retrieves the desired Power Save mode per AC. The PS
398             mode can be either PS-Poll Legacy or UPSD.
399     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
400             desiredPsMode - Pointer that holds the desired PS mode.
401     Return:	TI_RESULT_OK � Driver retrieved the thresholds.
402             TI_RESULT_NOK � Parameters are not valid.
403 
404 ******************************************************************************/
405 tiINT32 TI_GetDesiredPsMode   (TI_HANDLE hAdapter,
406                                OS_802_11_QOS_DESIRED_PS_MODE *desiredPsMode );
407 
408 /******************************************************************************
409 
410     Name:	TI_ConfigTxClassifier
411     Desc:	This function sends the configuration buffer to the OsSend package.
412     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
413             inParamsBuffLen - Configuration buffer length.
414             inParamsBuff - Configuration buffer pointer.
415     Return:	TI_RESULT_OK on success. Any other value indicates an error.
416 
417 ******************************************************************************/
418 tiINT32 TI_ConfigTxClassifier             (TI_HANDLE hAdapter,
419                                            tiUINT32 inParamsBuffLen,
420                                            tiUINT8  *inParamsBuff);
421 
422 /******************************************************************************
423 
424     Name:	TI_RemoveClassifierEntry
425     Desc:	This function removes a classifier entry.
426     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
427             pClsfrEntry -
428     Return:	TI_RESULT_OK on success. Any other value indicates an error.
429 
430 ******************************************************************************/
431 tiINT32	TI_RemoveClassifierEntry          (TI_HANDLE hAdapter,
432                                            clsfr_tableEntry_t *pClsfrEntry);
433 
434 /******************************************************************************
435 
436     Name:	TI_GetClsfrType
437     Desc:	This function retrieves the classifier type.
438     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
439             currClsfrType - pointer to clsfrTypeAndSupport struct:
440                 ClsfrType: one of
441                     D_TAG_CLSFR = 0,
442                     DSCP_CLSFR =1,
443                     PORT_CLSFR =2,
444                     IPPORT_CLSFR =3,
445                 oldVersionSupport:
446     Return:	TI_RESULT_OK on success. Any other value indicates an error.
447 
448 ******************************************************************************/
449 tiINT32 TI_GetClsfrType                   (TI_HANDLE hAdapter,
450                                            clsfrTypeAndSupport *currClsfrType );
451 
452 /******************************************************************************
453 
454     Name:	TI_SetTrafficIntensityThresholds
455     Desc:	This function sets the traffic intensity high and low thresholds.
456     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
457             pTrafficThresholds - A pointer to the
458                     OS_802_11_TRAFFIC_INTENSITY_THRESHOLD_PARAMS structure values:
459                         uHighThreshold, uLowThreshold, TestInterval;
460     Return:	TI_RESULT_OK on success. Any other value indicates an error.
461 
462 ******************************************************************************/
463 tiINT32		TI_SetTrafficIntensityThresholds (TI_HANDLE  hAdapter,
464                 OS_802_11_TRAFFIC_INTENSITY_THRESHOLD_PARAMS* pTrafficThresholds);
465 
466 /******************************************************************************
467 
468     Name:   TI_GetTrafficIntensityThresholds
469     Desc:	This function retrieves the traffic intensity high and low thresholds.
470     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
471             pTrafficThresholds - A pointer to the
472                     OS_802_11_TRAFFIC_INTENSITY_THRESHOLD_PARAMS structure values.
473     Return:	TI_RESULT_OK on success. Any other value indicates an error.
474 
475 ******************************************************************************/
476 tiINT32	    TI_GetTrafficIntensityThresholds (TI_HANDLE  hAdapter,
477                 OS_802_11_TRAFFIC_INTENSITY_THRESHOLD_PARAMS* pTrafficThresholds);
478 
479 /******************************************************************************
480 
481     Name:	TI_ToggleTrafficIntensityEvents
482     Desc:	This function toggles between the traffic intensity operation.
483     Params:	hAdapter - The Adapter handle returned by TI_AdapterInit().
484             NewStatus - Enable or disable value (TRUE or FALSE)
485     Return:	TI_RESULT_OK on success. Any other value indicates an error.
486 
487 ******************************************************************************/
488 tiINT32	    TI_ToggleTrafficIntensityEvents  (TI_HANDLE  hAdapter,
489                                               tiUINT32 NewStatus );
490 
491 tiINT32     TI_SetDTagToAcMappingTable(TI_HANDLE  hAdapter, acTrfcType_e* pDtagToAcTable );
492 tiINT32     TI_SetVAD(TI_HANDLE  hAdapter, txDataVadTimerParams_t* pVadTimer );
493 tiINT32     TI_GetVAD(TI_HANDLE  hAdapter, txDataVadTimerParams_t* pVadTimer );
494 
495 #ifdef __cplusplus
496 }
497 #endif
498 
499 #endif /* TI_ADAPTER_QOS_H*/
500