PageRenderTime 45ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/net/wireless/tiwlan1251/common/inc/tiQosTypes.h

http://github.com/CyanogenMod/cm-kernel
C Header | 272 lines | 158 code | 43 blank | 71 comment | 0 complexity | 9ddb23838e583ed6ddae42c1b761db48 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.0
  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. /* Module: tiQosTypes.h*/
  37. /**/
  38. /* Purpose: */
  39. /**/
  40. /*--------------------------------------------------------------------------*/
  41. #if !defined TI_QOS_TYPES_H
  42. #define TI_QOS_TYPES_H
  43. #define TI_WLAN_QOS_RETURN_CODES \
  44. NOT_CONNECTED,\
  45. TRAFIC_ADM_PENDING,\
  46. NO_QOS_AP,\
  47. ADM_CTRL_DISABLE,\
  48. AC_ALREADY_IN_USE,\
  49. USER_PRIORITY_NOT_ADMITTED\
  50. /*
  51. NOT_CONNECTED - Not connected to AP
  52. TRAFIC_ADM_PENDING - TSPEC request sent - awaiting response
  53. NO_QOS_AP - primary AP does not support QOS (WME)
  54. ADM_CTRL_DISABLE - Admission control disabled
  55. AC_ALREADY_IN_USE - A TSPEC has already been sent on this specific AC
  56. USER_PRIORITY_NOT_ADMITTED - User priority is not admitted (TSPEC not sent)
  57. */
  58. typedef enum{
  59. QOS_AC_BE = 0,
  60. QOS_AC_BK,
  61. QOS_AC_VI,
  62. QOS_AC_VO,
  63. QOS_HIGHEST_AC_INDEX = QOS_AC_VO,
  64. }acTrfcType_e; /* for TI_HANDLE hAcTrfcCtrl */
  65. #define MAX_NUM_OF_AC ( QOS_HIGHEST_AC_INDEX+1 )
  66. #define FIRST_AC_INDEX QOS_AC_BE
  67. #define MAX_NUM_OF_802_1d_TAGS 8
  68. #define AC_PARAMS_MAX_TSID 15
  69. #define MAX_APSD_CONF 0xffff
  70. /*
  71. * this enum defines FW PS policing modes
  72. */
  73. typedef struct _OS_802_11_QOS_PARAMS
  74. {
  75. tiUINT32 acID;
  76. tiUINT32 MaxLifeTime;
  77. tiUINT32 VoiceDeliveryProtocol;
  78. tiUINT32 PSDeliveryProtocol;
  79. } OS_802_11_QOS_PARAMS;
  80. typedef struct {
  81. tiUINT32 psPoll;
  82. tiUINT32 UPSD;
  83. } OS_802_11_QOS_RX_TIMEOUT_PARAMS;
  84. typedef struct _OS_802_11_AC_QOS_PARAMS
  85. {
  86. tiUINT32 uAC;
  87. tiUINT32 uAssocAdmissionCtrlFlag;
  88. tiUINT32 uAIFS;
  89. tiUINT32 uCwMin;
  90. tiUINT32 uCwMax;
  91. tiUINT32 uTXOPLimit;
  92. } OS_802_11_AC_QOS_PARAMS;
  93. typedef struct _OS_802_11_AP_QOS_CAPABILITIES_PARAMS
  94. {
  95. tiUINT32 uQOSFlag;
  96. tiUINT32 uAPSDFlag;
  97. } OS_802_11_AP_QOS_CAPABILITIES_PARAMS;
  98. typedef struct _OS_802_11_QOS_TSPEC_PARAMS
  99. {
  100. tiUINT32 uUserPriority;
  101. tiUINT32 uNominalMSDUsize; /* in bytes */
  102. tiUINT32 uMeanDataRate; /* bits per second */
  103. tiUINT32 uMinimumPHYRate; /* 1,2,5,6,9,11,12,18,......*/
  104. tiUINT32 uSurplusBandwidthAllowance;
  105. tiUINT32 uAPSDFlag;
  106. tiUINT32 uMediumTime;
  107. tiUINT32 uReasonCode;
  108. } OS_802_11_QOS_TSPEC_PARAMS;
  109. typedef struct _OS_802_11_QOS_DELETE_TSPEC_PARAMS
  110. {
  111. tiUINT32 uUserPriority;
  112. tiUINT32 uReasonCode;
  113. } OS_802_11_QOS_DELETE_TSPEC_PARAMS;
  114. typedef struct _OS_802_11_QOS_DESIRED_PS_MODE
  115. {
  116. tiUINT32 uDesiredPsMode;
  117. tiUINT32 uDesiredWmeAcPsMode[MAX_NUM_OF_AC];
  118. } OS_802_11_QOS_DESIRED_PS_MODE;
  119. /* When this value is added to reason code in TSPEC events, it indicates a TSPEC response which was unexpected at the time */
  120. /* For example, a TSPEC response arrives after a TSPEC timeout */
  121. #define TSPEC_RESPONSE_UNEXPECTED 0x1000
  122. typedef enum{
  123. ADDTS_RESPONSE_ACCEPT = 0,
  124. /* ADDTS_RESPONSE_REJECT, - according to the standard*/
  125. ADDTS_RESPONSE_AP_PARAM_INVALID = 253,
  126. ADDTS_RESPONSE_TIMEOUT = 254,
  127. TSPEC_DELETED_BY_AP = 255,
  128. } tspec_status_e;
  129. typedef struct _OS_802_11_AC_UPSD_STATUS_PARAMS
  130. {
  131. tiUINT32 uAC;
  132. tiUINT32 uCurrentUAPSDStatus;
  133. tiUINT32 pCurrentAdmissionStatus;
  134. } OS_802_11_AC_UPSD_STATUS_PARAMS;
  135. typedef struct _OS_802_11_THRESHOLD_CROSS_PARAMS
  136. {
  137. tiUINT32 uAC;
  138. tiUINT32 uHighThreshold;
  139. tiUINT32 uLowThreshold;
  140. } OS_802_11_THRESHOLD_CROSS_PARAMS;
  141. typedef struct OS_802_11_THRESHOLD_CROSS_INDICATION_PARAMS
  142. {
  143. tiUINT32 uAC;
  144. tiUINT32 uHighOrLowThresholdFlag; /* According to thresholdCross_e enum */
  145. tiUINT32 uAboveOrBelowFlag; /* According to thresholdCrossDirection_e enum */
  146. } OS_802_11_THRESHOLD_CROSS_INDICATION_PARAMS;
  147. typedef enum{
  148. HIGH_THRESHOLD_CROSS,
  149. LOW_THRESHOLD_CROSS,
  150. } thresholdCross_e;
  151. typedef enum{
  152. CROSS_ABOVE,
  153. CROSS_BELOW,
  154. } thresholdCrossDirection_e;
  155. typedef struct _STREAM_TRAFFIC_PROPERTIES{
  156. UINT32 dstIpAddress;
  157. UINT32 dstPort;
  158. UINT32 PktTag;
  159. UINT32 userPriority;
  160. } STREAM_TRAFFIC_PROPERTIES;
  161. typedef enum{
  162. AC_NOT_ADMITTED,
  163. AC_WAIT_ADMISSION,
  164. AC_ADMITTED
  165. } trafficAdmState_e;
  166. typedef enum{
  167. UPLINK_DIRECTION = 0,
  168. DOWNLINK_DIRECTION = 1,
  169. RESERVED_DIRECTION = 2,
  170. BI_DIRECTIONAL = 3,
  171. } streamDirection_e;
  172. /* classification algorithms:
  173. 0) D-tag to D-tag
  174. 1) DSCP to D-tag
  175. 2) Destination port number to D-tag
  176. 3) Destination IP&Port to D-tag
  177. */
  178. typedef enum{
  179. D_TAG_CLSFR = 0,
  180. DSCP_CLSFR =1,
  181. PORT_CLSFR =2,
  182. IPPORT_CLSFR =3,
  183. CLSFR_TYPE_MAX = IPPORT_CLSFR,
  184. } clsfr_type_e;
  185. typedef struct clsfrTypeAndSupport
  186. {
  187. ULONG ClsfrType;
  188. UINT8 oldVersionSupport;
  189. } clsfrTypeAndSupport;
  190. /*************************/
  191. /* classifier params */
  192. /*************************/
  193. /* This type represents a pair of
  194. destination IP address and destination port number. */
  195. typedef struct
  196. {
  197. UINT32 DstIPAddress;
  198. UINT16 DstPortNum;
  199. } IP_Port_t;
  200. /* Classification mapping
  201. table.
  202. */
  203. typedef struct
  204. {
  205. union
  206. {
  207. IP_Port_t DstIPPort; /* for destination IP&Port classifier*/
  208. UINT16 DstPortNum; /* for destination Port classifier*/
  209. UINT8 CodePoint; /* for DSCP classifier*/
  210. }Dscp;
  211. UINT8 DTag;
  212. } clsfr_tableEntry_t;
  213. /* Classifier parameters */
  214. /* number of classifier entries in the classification table */
  215. #define NUM_OF_CLSFR_TABLE_ENTRIES 16
  216. typedef struct
  217. {
  218. clsfr_type_e clsfrType; /* The type of the classifier: D-tag, DSCP, Port or IP&Port */
  219. UINT8 NumOfActiveEntries; /* The number of active entries in the classification table */
  220. clsfr_tableEntry_t
  221. ClsfrTable[NUM_OF_CLSFR_TABLE_ENTRIES]; /* Classification table - size changed from 15 to 16*/
  222. } clsfr_Params_t;
  223. /* This type is use by setParam to insert classifier table entries */
  224. typedef struct
  225. {
  226. UINT8 EntriesNum;
  227. UINT32 *BufferPtr;
  228. } clsfr_insertEntry_t;
  229. #endif /* TI_QOS_TYPES_H */