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: txHwQueueCalc.h 39 * 40 * PURPOSE: Tx HW blocks and fragmentation threshold calculations module internal definitions. 41 * 42 ****************************************************************************/ 43 44 #ifndef _TX_HW_QUEUE_MEM_CALC_H 45 #define _TX_HW_QUEUE_MEM_CALC_H 46 47 48 #include "whalParams.h" 49 #include "TNETW_Driver_types.h" 50 #include "802_11Defs.h" 51 52 #define HW_BLOCK_SIZE 252 /* The net size per HW block (without block header). */ 53 #define RTS_FRAG_DATA_TIME 248 54 55 #define MIN_FRAG_THRESH 256 56 57 #define FCS_LENGTH 4 58 #define MAX_MSDU_SECURITY_LENGTH 16 /* RSN + MIC = 8 + 8 = 16 bytes (worst case - AES). */ 59 #define MAX_MPDU_SECURITY_LENGTH 16 /* RSN + MIC = 8 + 8 = 16 bytes (worst case - AES). */ 60 #define DIFF_HEADER_LENGTH_LEGACY_TO_QOS (WLAN_QOS_HDR_LEN - WLAN_HDR_LEN) 61 #define MAX_MPDU_HEADER_AND_SECURITY (WLAN_QOS_HDR_LEN + MAX_MPDU_SECURITY_LENGTH) 62 63 #define OFDM_PLCP_HDR_MICROSECONDS 24 64 #define SHORT_PREAMBLE_MICROSECONDS 96 65 #define LONG_PREAMBLE_MICROSECONDS 192 66 #define B_SIFS_MICROSECONDS 10 67 #define OFDM_SIGNAL_EXT_MICROSECONDS 6 68 #define NONOFDM_SHORT_DURATION_MICROSECONDS (B_SIFS_MICROSECONDS + SHORT_PREAMBLE_MICROSECONDS) 69 #define NONOFDM_LONG_DURATION_MICROSECONDS (B_SIFS_MICROSECONDS + LONG_PREAMBLE_MICROSECONDS) 70 71 72 73 /* The ACK duration in air (in uSec) per Tx rate, 74 including MAC header + SIFS, and excluding PLCP header. */ 75 const UINT8 TxMemCalcAckDurationTable[] = 76 { 77 0, /* Auto (not used in this module)*/ 78 B_SIFS_MICROSECONDS + 112, /* 1 Mbps */ 79 B_SIFS_MICROSECONDS + 56, /* 2 Mbps*/ 80 B_SIFS_MICROSECONDS + 20, /* 5.5 Mbps*/ 81 B_SIFS_MICROSECONDS + 10, /* 11 Mbps*/ 82 B_SIFS_MICROSECONDS + 4, /* 22 Mbps*/ 83 B_SIFS_MICROSECONDS + 19, /* 6 Mbps*/ 84 B_SIFS_MICROSECONDS + 12, /* 9 Mbps*/ 85 B_SIFS_MICROSECONDS + 6, /* 18 Mbps*/ 86 B_SIFS_MICROSECONDS + 4, /* 22 Mbps*/ 87 B_SIFS_MICROSECONDS + 4, /* 24 Mbps*/ 88 B_SIFS_MICROSECONDS + 4, /* 36 Mbps*/ 89 B_SIFS_MICROSECONDS + 4, /* 48 Mbps, standard says ack at 36 Mbps*/ 90 B_SIFS_MICROSECONDS + 4 /* 54 Mbps, standard says ack at 36 Mbps*/ 91 }; 92 93 94 /* Translate rate code to bit rate in Mbps (5.5M has a factor of 10). */ 95 const UINT8 TxMemCalcRateValueTable[] = 96 { 97 0, /* Auto (not used in this module)*/ 98 1, /* 1 Mbps */ 99 2, /* 2 Mbps*/ 100 55, /* 5.5 Mbp*/ 101 11, /* 11 Mbps*/ 102 22, /* 22 Mbps*/ 103 6, /* 6 Mbps*/ 104 9, /* 9 Mbps*/ 105 12, /* 18 Mbps*/ 106 18, /* 22 Mbps*/ 107 24, /* 24 Mbps*/ 108 36, /* 36 Mbps*/ 109 48, /* 48 Mbps*/ 110 54 /* 54 Mbps*/ 111 }; 112 113 114 115 /* Module local functions. */ 116 117 static UINT16 CalcFragThreshold(TxHwQueueObj_t *pTxHwQueue, txCtrlBlkEntry_t *pPktCtrlBlk); 118 static UINT16 GetTxOpFragThreshold(TxHwQueueObj_t *pTxHwQueue, txCtrlBlkEntry_t *pPktCtrlBlk, 119 UINT16 txOpLimit, WlanParams_T *pWlanParams); 120 static rate_e ConvertRateTnetToDriver (UINT16 tnetRate); 121 122 123 124 #endif /* _TX_HW_QUEUE_MEM_CALC_H */ 125 126 127