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 /* */ 38 /* */ 39 /* PURPOSE: DataCtrl module api functions header file */ 40 /* */ 41 /***************************************************************************/ 42 43 #ifndef _DATA_CTRL_API_H_ 44 #define _DATA_CTRL_API_H_ 45 46 #include "paramOut.h" 47 #include "paramIn.h" 48 #include "rxXfer_api.h" 49 #include "802_11Defs.h" 50 #include "MsduList.h" 51 #include "GeneralUtilApi.h" 52 53 54 typedef struct 55 { 56 UINT32 hwNumOfFreeMsdu; 57 UINT32 hwNumOfBusyMsdu; 58 UINT32 hwNumOfFreeBDs; 59 UINT32 hwTotalAvailMem; 60 }hwTxInformation_t; 61 62 /* RX MODULE */ 63 /*--------------*/ 64 65 /* Rx module interface functions */ 66 67 #define RECV_OK 0x1 68 #define DIRECTED_BYTES_RECV 0x2 69 #define DIRECTED_FRAMES_RECV 0x4 70 #define MULTICAST_BYTES_RECV 0x8 71 #define MULTICAST_FRAMES_RECV 0x10 72 #define BROADCAST_BYTES_RECV 0x20 73 #define BROADCAST_FRAMES_RECV 0x40 74 75 #define NO_RX_NOTIFICATION 0x0 76 77 #define ALL_RCV_FRAME (DIRECTED_FRAMES_RECV|MULTICAST_FRAMES_RECV|BROADCAST_FRAMES_RECV) 78 79 #define MAX_RX_NOTIF_REQ_ELMENTS 8 80 81 82 /*TI_HANDLE rxData_create (msduReceiveCB_t* msduReceiveCB, TI_HANDLE hOs); */ 83 TI_HANDLE rxData_create (TI_HANDLE hOs); 84 85 TI_STATUS rxData_config(TI_HANDLE hRxData, 86 TI_HANDLE hCtrlData, 87 TI_HANDLE hTxData, 88 TI_HANDLE hTnetwDrv, 89 TI_HANDLE hHalCtrl, 90 TI_HANDLE hMlme, 91 TI_HANDLE hRsn, 92 TI_HANDLE hSiteMgr, 93 TI_HANDLE hExcMngr, 94 TI_HANDLE hOs, 95 TI_HANDLE hReport, 96 TI_HANDLE hMemMngr, 97 TI_HANDLE hEvHandler, 98 rxDataInitParams_t * rxDataInitParams); 99 100 void rxData_receiveMsduFromWlan(TI_HANDLE hRxData, mem_MSDU_T *pMsdu, Rx_attr_t* pRxAttr); 101 102 103 TI_STATUS rxData_stop(TI_HANDLE hRxData); 104 105 TI_STATUS rxData_unLoad(TI_HANDLE hRxData); 106 107 TI_STATUS rxData_getParam(TI_HANDLE hRxData, paramInfo_t *pParamInfo); 108 109 TI_STATUS rxData_setParam(TI_HANDLE hRxData, paramInfo_t *pParamInfo); 110 111 TI_STATUS rxData_getTiwlnCounters(TI_HANDLE hRxData, TIWLN_COUNTERS *pTiwlnCounters); 112 113 TI_STATUS txData_copyPacketToMsdu(TI_HANDLE hTxData,mem_MSDU_T **pMsdu, int FreeOldMsdu); 114 115 void rxData_resetCounters(TI_HANDLE hRxData); 116 117 TI_STATUS txData_updateUsedTime(TI_HANDLE hTxData, UINT32 qNum, UINT16 usedTime); 118 119 TI_STATUS txData_setAdmisionCtrlParams(TI_HANDLE hTxData, 120 UINT8 acID, 121 UINT16 mediumTime, 122 UINT32 minimumPHYRate, 123 BOOL admFlag); 124 125 TI_STATUS txData_setPsVoiceDeliveryMode(TI_HANDLE hTxData, PSScheme_e PsMode); 126 127 TI_HANDLE rxData_RegNotif(TI_HANDLE hRxData,UINT16 EventMask,GeneralEventCall_t CallBack,TI_HANDLE context,UINT32 Cookie); 128 129 TI_STATUS rxData_UnRegNotif(TI_HANDLE hRxData,TI_HANDLE RegEventHandle); 130 131 TI_STATUS rxData_AddToNotifMask(TI_HANDLE hRxData,TI_HANDLE Notifh,UINT16 EventMask); 132 133 134 /* debug functions */ 135 void rxData_resetDbgCounters(TI_HANDLE hRxData); 136 void rxData_printRxBlock(TI_HANDLE hRxData); 137 void rxData_printRxCounters(TI_HANDLE hRxData); 138 void rxData_startRxThroughputTimer(TI_HANDLE hRxData); 139 void rxData_stopRxThroughputTimer(TI_HANDLE hRxData); 140 void rxData_printRxDataFilter(TI_HANDLE hRxData); 141 142 143 /* TX MODULE */ 144 /*--------------*/ 145 146 /* Tx module data types */ 147 148 typedef enum 149 { 150 NO_DISABLE = 0, 151 DISABLE_IMMEDIATELY = 1, 152 } txDisableReason_e; 153 154 typedef struct 155 { 156 UINT32 HwRate; 157 rate_e Rate; 158 UINT8 txRatePolicyId; 159 } txData_attr_t; 160 161 typedef struct 162 { 163 mem_MSDU_T *pMsdu; 164 BOOLEAN bDataMsdu; 165 UINT8 txQid; 166 UINT8 txCompleteFlags; 167 UINT32 maxTransmitRate; 168 BOOLEAN bXferDoneCalled; 169 BOOLEAN bTxCompleteCalled; 170 UINT32 msduDataLen; 171 macAddress_t destinationMac; 172 UINT32 driverHandlingTime; 173 UINT32 timeStamp [6]; 174 } txPacketIdAttr_t; 175 176 typedef struct 177 { 178 TI_STATUS status; 179 UINT32 packetId; 180 UINT32 rate; 181 UINT8 ackFailures; 182 UINT32 actualDurationInAir; 183 UINT32 fwHandlingTime; 184 UINT32 mediumDelay; 185 } txCompleteAttr_t; 186 187 #define XFER_OK 0x1 188 #define DIRECTED_BYTES_XFER 0x2 189 #define DIRECTED_FRAMES_XFER 0x4 190 #define MULTICAST_BYTES_XFER 0x8 191 #define MULTICAST_FRAMES_XFER 0x10 192 #define BROADCAST_BYTES_XFER 0x20 193 #define BROADCAST_FRAMES_XFER 0x40 194 195 #define NO_TX_NOTIFICATION 0x0 196 197 #define ALL_XMIT_FRAMES (DIRECTED_FRAMES_XMIT|MULTICAST_FRAMES_XMIT|BROADCAST_FRAMES_XMIT) 198 199 #define MAX_TX_NOTIF_REQ_ELMENTS 8 200 201 #define POLL_AP_PACKETS_FORCE_PS_POLL 0xFF /* indicates a "force" PS POLL for the PollAPPackets routine (for backwards compatibility) */ 202 203 204 /* Tx module interface functions */ 205 TI_HANDLE txData_create(txDataInitParams_t *txDataInitParams, TI_HANDLE hOs); 206 207 TI_STATUS txData_config(TI_HANDLE hTxData, 208 TI_HANDLE hCtrlData, 209 TI_HANDLE hTnetwDrv, 210 TI_HANDLE hWhalCtrl, 211 TI_HANDLE hOs, 212 TI_HANDLE hReport, 213 TI_HANDLE hMemMngr, 214 TI_HANDLE hSiteMgr, 215 TI_HANDLE hEvHandler, 216 TI_HANDLE hQosMngr, 217 TI_HANDLE hPowerMgr); 218 219 TI_STATUS txData_stop(TI_HANDLE hTxData); 220 221 TI_STATUS txData_start(TI_HANDLE hTxData); 222 TI_STATUS txData_startAfterRecovery(TI_HANDLE hTxData); 223 224 225 void txData_recoveryIndication( TI_HANDLE hTxData ); 226 227 TI_STATUS txData_getParam(TI_HANDLE hTxData, paramInfo_t *pParamInfo); 228 229 TI_STATUS txData_setParam(TI_HANDLE hTxData, paramInfo_t *pParamInfo); 230 231 TI_STATUS txData_unLoad(TI_HANDLE hTxData); 232 233 TI_STATUS txData_getTiwlnCounters(TI_HANDLE hTxData, TIWLN_COUNTERS *pTiwlnCounters); 234 235 TI_STATUS txData_checkQueueSize(TI_HANDLE hTxData,UINT8 qIndex); 236 237 TI_STATUS txData_sendPktToWlan(TI_HANDLE hTxData, mem_MSDU_T *pMsdu, UINT8 pkt_DTag); 238 239 TI_STATUS txData_txSendMsdu(TI_HANDLE hTxData, mem_MSDU_T *pMsdu); 240 241 TI_STATUS txData_startTxScheduler(TI_HANDLE hTxData); 242 243 TI_STATUS txData_txCompleteUpdate( TI_HANDLE hTxData, txCompleteAttr_t *pTxCompleteAttr ); 244 245 void txData_sendPacketTransfer(TI_HANDLE hTxData, UINT32 pPacketIdAttr); 246 void txData_sendPacketDebug(TI_HANDLE hTxData, UINT32 pPacketIdAttr, UINT32 uDebugInfo); 247 248 249 250 TI_STATUS txData_disableTransmission(TI_HANDLE hTxData,txDisableReason_e reason); 251 252 TI_STATUS txData_enableTransmission(TI_HANDLE hTxData); 253 TI_STATUS txData_sendNullFrame(TI_HANDLE hTxData, 254 BOOL powerSaveOn, 255 allocatingModule_e module); 256 257 258 TI_STATUS txData_getPsPollFrame(TI_HANDLE hTxData,mem_MSDU_T **pMsduPsPoll); 259 260 TI_STATUS txData_buildQosNullDataFrame(TI_HANDLE hTxData,mem_MSDU_T **pMsduPsPoll, UINT8 userPriority); 261 262 TI_STATUS txData_sendVadFrame(TI_HANDLE hTxData, UINT8 acID); 263 264 void txData_resetCounters(TI_HANDLE hTxData); 265 266 TI_HANDLE txData_RegNotif(TI_HANDLE hTxData,UINT16 EventMask,GeneralEventCall_t CallBack,TI_HANDLE context,UINT32 Cookie); 267 268 TI_STATUS txData_UnRegNotif(TI_HANDLE hTxData,TI_HANDLE RegEventHandle); 269 270 TI_STATUS txData_AddToNotifMask(TI_HANDLE hTxData,TI_HANDLE Notifh,UINT16 EventMask); 271 272 BOOL txData_isQueueUseMediumTime(TI_HANDLE hTxData, UINT8 qNum); 273 274 UINT32 txData_GetWlanHeaderLength( TI_HANDLE hTxData, void *pData, UINT32 txFlags ); 275 276 /* debug functions */ 277 void txData_printTxBlock(TI_HANDLE hTxData); 278 void txData_printTxCounters(TI_HANDLE hTxData); 279 void txData_printQosParams(TI_HANDLE hTxData); 280 void txData_resetDbgCounters(TI_HANDLE hTxData); 281 void txData_printDataMsduList(TI_HANDLE hTxData); 282 void txData_fullPrintDataMsduList(TI_HANDLE hTxData); 283 void txData_printMgmtMsduList(TI_HANDLE hTxData); 284 void txData_fullPrintMgmtMsduList(TI_HANDLE hTxData); 285 void txData_StartTxThroughputTimer(TI_HANDLE hTxData); 286 void txData_StopTxThroughputTimer(TI_HANDLE hTxData); 287 void txData_StartTxAirThroughputTimer(TI_HANDLE hTxData); 288 void txData_StopTxAirThroughputTimer(TI_HANDLE hTxData); 289 void txData_StartJitterTimer(TI_HANDLE hTxData); 290 void txData_StopJitterTimer(TI_HANDLE hTxData); 291 void txData_printTxQosCounters(TI_HANDLE hTxData); 292 293 294 295 /* CONTROL MODULE */ 296 /*----------------*/ 297 298 299 typedef struct 300 { 301 macAddress_t ctrlDataDeviceMacAddress; 302 } ctrlDataConfig_t; 303 304 /*******************************/ 305 /* Control module interface functions */ 306 /*TI_HANDLE ctrlData_create(TI_HANDLE hOs,*/ 307 /* TxCompleteStatusCB_t* TxCmplt_CB);*/ 308 TI_HANDLE ctrlData_create(TI_HANDLE hOs); 309 310 TI_STATUS ctrlData_config(TI_HANDLE hCtrlData, 311 TI_HANDLE hWhalCtrl, 312 TI_HANDLE hSiteMgrHandle, 313 TI_HANDLE hTxData, 314 TI_HANDLE hRxData, 315 TI_HANDLE hOs, 316 TI_HANDLE hReport, 317 TI_HANDLE hMemMngr, 318 TI_HANDLE hEvHandler, 319 TI_HANDLE hAPConnection, 320 TI_HANDLE hTrafficMonitor, 321 disassocSentCB_t disassocSentCBFunc, 322 TI_HANDLE disassocSentCBObj, 323 ctrlDataInitParams_t *ctrlDataInitParams); 324 325 TI_STATUS ctrlData_unLoad(TI_HANDLE hCtrlData); 326 327 TI_STATUS ctrlData_getParam(TI_HANDLE hCtrlData, paramInfo_t *pParamInfo); 328 329 TI_STATUS ctrlData_getParamPartial(TI_HANDLE hCtrlData, paramInfoPartial_t *pParamInfo); 330 331 TI_STATUS ctrlData_setParam(TI_HANDLE hCtrlData, paramInfo_t *pParamInfo); 332 333 TI_STATUS ctrlData_start(TI_HANDLE hCtrlData); 334 335 TI_STATUS ctrlData_stop(TI_HANDLE hCtrlData); 336 337 TI_STATUS ctrlData_getTiwlnCounters(TI_HANDLE hCtrlData, TIWLN_COUNTERS *pTiwlnCounters); 338 339 TI_STATUS ctrlData_rxMsdu(TI_HANDLE hCtrlData, 340 mem_MSDU_T **pRxMsdu); 341 #ifdef SUPPORT_4X 342 TI_STATUS ctrlData_txDequeueMsdu(TI_HANDLE hCtrlData, 343 mem_MSDU_T** buildMsduPtr, 344 MsduList_t* pMsduList, 345 whalTx_attr_t* pWhalTx_attr, 346 hwTxInformation_t* pHwTxInformation); 347 348 TI_STATUS ctrlData_txMsdu(TI_HANDLE hCtrlData, 349 mem_MSDU_T** msduPtr); 350 #endif 351 352 TI_STATUS ctrlData_getTxAttributes(TI_HANDLE hCtrlData , 353 UINT32 txFlags, 354 txData_attr_t *pTxAttr, 355 UINT32 ac); 356 357 TI_STATUS ctrlData_ClsfrClassifyTxMSDU(TI_HANDLE hCtrlData, 358 mem_MSDU_T *pMsdu, 359 UINT8 packet_DTag); 360 361 TI_STATUS ctrlData_clsfrSetClsfrType(TI_HANDLE hCtrlData, 362 clsfrTypeAndSupport newClsfrType); 363 364 365 366 void ctrlData_getCurrBssTypeAndCurrBssId(TI_HANDLE hCtrlData, macAddress_t *pCurrBssid, 367 bssType_e *pCurrBssType); 368 369 #ifdef SUPPORT_4X 370 TI_STATUS ctrlData_get4xInfoElemnt(TI_HANDLE hCtrlData, 371 dot11_4X_t* fourXInfoElemnt); 372 373 TI_STATUS ctrlData_get4xStatus(TI_HANDLE hCtrlData,BOOL* fourXEnable); 374 375 TI_STATUS ctrlData_evalSite(TI_HANDLE hCtrlData, 376 dot11_4X_t* site4xParams, 377 UINT32 *matchingLevel); 378 #endif 379 380 TI_STATUS ctrlData_setSite(TI_HANDLE hCtrlData, 381 dot11_4X_t* site4xParams); 382 383 void ctrlData_setTspecsRateEvent(TI_HANDLE hCtrlData, 384 UINT8 acID, 385 BOOL enableEvent); 386 387 void ctrlData_setTspecsRateThresholds(TI_HANDLE hCtrlData, 388 UINT8 acID, 389 UINT8 highRateThreshold, 390 UINT8 lowRateThreshold); 391 392 void ctrlData_txCompleteStatus( TI_HANDLE hCtrlData, 393 txCompleteAttr_t *pTxCompleteAttr); 394 395 396 void ctrlData_getTspecsRateThresholds(TI_HANDLE hCtrlData, UINT8 uAC, UINT32* pHighThreshold, UINT32* pLowThreshold); 397 void ctrlData_ToggleTrafficIntensityNotification (TI_HANDLE hCtrlData, BOOL enabledFlag); 398 399 400 /* dbg functions */ 401 /*---------------*/ 402 void ctrlData_printRateAdaptation(TI_HANDLE hCtrlData); 403 void ctrlData_printTxParameters(TI_HANDLE hCtrlData); 404 void ctrlData_printCtrlBlock(TI_HANDLE hCtrlData); 405 void ctrlData_printCtrlCounters(TI_HANDLE hCtrlData); 406 void ctrlData_printFourX(TI_HANDLE hCtrlData); 407 408 #ifdef TI_DBG 409 void ctrlData_clearClsfrTable ( TI_HANDLE hCtrlData ); 410 void ctrlData_printClsfrTable ( TI_HANDLE hCtrlData ); 411 #endif 412 413 /* TEST FUNCTION */ 414 /*---------------*/ 415 void Test_OsFreeFunction(TI_HANDLE hOs, TI_HANDLE pAddr); 416 TI_HANDLE Test_rxData_receiveMsduFromWlan(TI_HANDLE hRxData, mem_MSDU_T *pMsdu, Rx_attr_t* pRxAttr); 417 418 #endif 419 420