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 /* MODULE: */ 39 /* PURPOSE: */ 40 /* */ 41 /***************************************************************************/ 42 #ifndef _FOUR_X_H 43 #define _FOUR_X_H 44 45 #include "osTIType.h" 46 #include "paramIn.h" 47 #include "paramOut.h" 48 #include "Concatenator.h" 49 #include "DeConcatenator.h" 50 #include "ackEmulUtil.h" 51 #include "memMngrEx.h" 52 #include "802_11Defs.h" 53 #include "MsduList.h" 54 #include "DataCtrl_Api.h" 55 56 57 #define FOUR_X_MODULE_LOG CTRL_DATA_MODULE_LOG 58 59 #define DEF_CW_MAX 1023 60 #define DEF_CW_MIN 15 61 #define DEF_CW_COMBO_CW_MIN 3 62 #define DEF_CW_COMBO_DIFS 64 63 #define DEF_CW_COMBO_SLOT 15 64 65 #define CONCATENATION_CAPABILITY_ID 0x0001 66 #define CONTENTION_WINDOW_CAPABILITY_ID 0x0002 67 #define CW_COMB_CAPABILITY_ID 0x0003 68 #define ACK ELIMINATION_CAPABILITY_ID 0x0004 69 #define ERP_PROTECTION_CAPABILITY_ID 0x0005 70 71 #define FOUR_X_PROTOCOL_VERSION_0 0x00 72 #define FOUR_X_INFO_ELEMENT_VERSION_0_LEN 4 73 74 #define FOUR_X_PROTOCOL_VERSION_1 0x01 75 #define FOUR_X_CONCAT_CAP_ID 0x0001 76 #define FOUR_X_CONCAT_CAP_LEN 0x0002 77 78 79 typedef struct 80 { 81 BOOL enableDisable; 82 UINT16 concatenationSize; 83 } concatenationParams_t; 84 85 typedef struct 86 { 87 UINT32 count1; 88 UINT32 count2; 89 UINT32 count3; 90 UINT32 count4; 91 UINT32 count5; 92 UINT32 count6; 93 UINT32 count7; 94 } concatenationDecisionCounter_t; 95 96 typedef struct 97 { 98 BOOL enableDisable; 99 UINT16 CWMin; 100 UINT16 CWMax; 101 }contentionWindowParams_t; 102 103 typedef struct 104 { 105 BOOL enableDisable; 106 UINT16 DIFS; 107 UINT16 SLOT; 108 UINT16 CWMin; 109 }CWCombParams_t; 110 111 typedef struct 112 { 113 BOOL enableDisable; 114 }ackEmulationParams_t; 115 116 typedef struct 117 { 118 BOOL enableDisable; 119 }ERP_ProtectionParams_t; 120 121 typedef struct 122 { 123 UINT8 fourXProtocolVersion; 124 concatenationParams_t concatenationParams; 125 contentionWindowParams_t contentionWindowParams; 126 CWCombParams_t CWCombParams; 127 ackEmulationParams_t ackEmulationParams; 128 ERP_ProtectionParams_t ERP_ProtectionParams; 129 } fourX_Capabilities_t; 130 131 132 typedef struct 133 { 134 TI_HANDLE hOs; 135 TI_HANDLE hReport; 136 TI_HANDLE hMemMngr; 137 TI_HANDLE hWhalCtrl; 138 TI_HANDLE hTxData; 139 140 /* current enable/disable status */ 141 BOOL concatenationEnable; 142 BOOL CWMinEnable; 143 BOOL CWComboEnable; 144 BOOL ackEmulationEnable; 145 BOOL ERP_ProtectionEnable; 146 147 /* desired enable/disable features */ 148 BOOL desiredConcatenationEnable; 149 BOOL desiredCWMinEnable; 150 BOOL desiredCWComboEnable; 151 BOOL desiredAckEmulationEnable; 152 BOOL desiredERP_ProtectionEnable; 153 154 /* desired parameters */ 155 UINT32 desiredMaxConcatSize; 156 UINT16 desiredCWMin; 157 UINT16 desiredCWMax; 158 159 /* AP supported features */ 160 fourX_Capabilities_t ApFourX_Capabilities; 161 162 /* 4x parameters */ 163 UINT32 currentMaxConcatSize; 164 UINT16 currentCWMin; 165 UINT16 currentCWMax; 166 167 /* 4x sub modules */ 168 deConcatenator_t* pDeConcatenator; 169 concatenator_t* pConcatenator; 170 ackEmul_t* pAckEmul; 171 172 /* for debug */ 173 concatenationDecisionCounter_t counters; 174 175 } fourX_t; 176 177 fourX_t* fourX_create(TI_HANDLE hOs); 178 179 TI_STATUS fourX_config(fourX_t* pFourX, 180 TI_HANDLE hOs, 181 TI_HANDLE hReport, 182 TI_HANDLE hMemMngr, 183 TI_HANDLE hWhalCtrl, 184 TI_HANDLE hTxData, 185 fourXInitParams_t* fourXInitParams); 186 187 TI_STATUS fourX_destroy(fourX_t* pFourX); 188 189 TI_STATUS fourX_rxMsdu(fourX_t* pFourX, 190 mem_MSDU_T** rxMsduPtr); 191 192 TI_STATUS fourX_txMsduBeforInsertToQueue(fourX_t* pFourX, 193 mem_MSDU_T** msduPtr); 194 195 TI_STATUS fourX_txMsduDeQueue(fourX_t* pFourX, 196 mem_MSDU_T** returnMsduPtr, 197 MsduList_t* pMsduList, 198 hwTxInformation_t* pHwTxInformation); 199 200 201 /* 4X manager */ 202 TI_STATUS fourXManager_evalSite(fourX_t* pFourX, 203 dot11_4X_t* site4xParams, 204 UINT32 *matchingLevel); 205 206 TI_STATUS fourXManager_setSite(fourX_t* pFourX, 207 dot11_4X_t* site4xParams); 208 209 TI_STATUS fourXManager_get4xInfoElemnt(fourX_t* pFourX, 210 dot11_4X_t* fourXInfoElemnt); 211 212 213 214 /* debug functions */ 215 void fourX_printParams(fourX_t* pFourX); 216 217 218 #endif 219