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: whalBus_Defs.h 39 * PURPOSE: Bus access component structures definitions 40 * 41 ****************************************************************************/ 42 43 #ifndef _WHAL_BUS_DEFS_H 44 #define _WHAL_BUS_DEFS_H 45 46 #include "public_types.h" 47 #include "osTIType.h" 48 #include "ratesTypes.h" 49 #include "commonTypes.h" 50 #include "public_host_int.h" 51 #include "public_descriptors.h" 52 53 /* Typedefs */ 54 55 typedef struct 56 { 57 rxPacketType_e packetType; 58 UINT8 rxLevel; 59 INT8 rssi; 60 UINT8 SNR; 61 UINT8 band; 62 UINT32 TimeStamp; 63 } rxXfer_Reserved_t; 64 65 typedef struct 66 { 67 rxPacketType_e packetType; 68 TI_STATUS status; 69 rate_e Rate; 70 UINT8 SNR; 71 INT8 Rssi; 72 UINT8 channel; 73 UINT32 packetInfo; 74 UINT8 band; 75 UINT32 TimeStamp; 76 }Rx_attr_t; 77 78 79 80 /* Callback for rx packet */ 81 typedef void (*packetReceiveCB_t)(TI_HANDLE hObj, 82 TI_STATUS aStatus, 83 const void *aFrame, 84 UINT16 aLength, 85 UINT32 aRate, 86 UINT8 aChannel, 87 UINT8 aRCPI, 88 void *Reserved, 89 UINT32 aFlags); 90 91 /* CallBack for Buffer request */ 92 typedef const void *(*requestForBufferCB_t)(TI_HANDLE hObj, UINT16 aLength, UINT32 uEncryptionFlag); 93 94 95 /* Scan complete Callback - This routine is called from the HAL upon TNET scan complete */ 96 typedef void (*scanCompleteCB_t)(TI_HANDLE hScanSrv, char* str, UINT32 strLen); 97 98 /* Disassociation sent - This function is called by the HAL's Tx to indicate that dissasociation frame has been sent.*/ 99 typedef void (*disassocSentCB_t)(TI_HANDLE Hobj); 100 101 /* Incoming Info Callback */ 102 typedef void (*InfoCB_t)(TI_HANDLE handle, char* buf, UINT32 bufSize); 103 /* Device Error Callback */ 104 typedef void (*deviceErrorCB_t)(TI_HANDLE siteMgr); 105 106 /* Mac status Callback */ 107 typedef void (*MacStatusCB_t)(TI_HANDLE handle, char* str , UINT32 strLen); 108 109 /* Health Report Callback */ 110 typedef void (*HealthReportCB_t)(TI_HANDLE handle, char* str , UINT32 strLen); 111 112 /* Aci Indication Callback */ 113 typedef void (*AciIndicationCB_t)(TI_HANDLE handle, char* str , UINT32 strLen); 114 115 /* Failure Event Callback */ 116 typedef void (*failureEventCB_t)(TI_HANDLE handle, failureEvent_e failureEvent); 117 118 /* 119 * -------------------------------------------------------------- 120 * DmaParams_T - Rx/Tx Queues and Bufffers params 121 * -------------------------------------------------------------- 122 */ 123 124 125 typedef struct 126 { 127 int NumTxQueues; 128 int NumRxQueues; 129 UINT32 BlockSize; 130 int NumTxBlocks; 131 int NumRxBlocks; 132 int TxNumDesc[MAX_NUM_OF_TX_QUEUES]; 133 int RxNumDesc; 134 int TxQPriority[MAX_NUM_OF_TX_QUEUES]; 135 int RxQPriority; 136 137 UINT16 NumStations; 138 UINT8 RxQueue_Priority; 139 UINT8 RxQueue_Type; 140 141 UINT32 TraceBufferSize; 142 BOOLEAN TraceBufferDoPrint; 143 144 UINT8 rxMemBlkNumber; 145 UINT8 txMinMemBlkNumber; 146 147 } DmaParams_T; 148 149 150 /* 151 * -------------------------------------------------------------- 152 * Internal hal attributes 153 * -------------------------------------------------------------- 154 */ 155 156 157 158 typedef enum 159 { 160 SW_DIVS_TX_RESET = 0, /* reset, i.e. invalid value */ 161 SW_DIVS_TX_ANT2 = BIT_2, /* defined to match TX_PING0 & CFG_ANT_SEL*/ 162 SW_DIVS_TX_ANT1 = BIT_3, /* defined to match TX_PING0 & CFG_ANT_SEL*/ 163 SW_DIVS_RX_W_LAST_TX = BIT_4, 164 SW_DIVS_TOGGLE_DISABLE = BIT_5, 165 SW_DIVS_TOGGLE_COUNT_MASK = BIT_6+BIT_7 166 } SwAntDivs_enum; 167 168 169 #define CTRL_NO_TX_COMPLETE 0x40 170 171 172 #define RX_PACKET_FLAGS_MATCH_RXADDR1 0x00000001 173 #define RX_PACKET_FLAGS_GROUP_ADDR 0x00000002 174 #define RX_PACKET_FLAGS_BCAST 0x00000004 175 #define RX_PACKET_FLAGS_STAINTIM 0x00000008 176 #define RX_PACKET_FLAGS_VIRTUAL_BM 0x00000010 177 #define RX_PACKET_FLAGS_MATCH_SSID 0x00000020 178 #define RX_PACKET_FLAGS_MATCH_BSSID 0x00000040 179 #define RX_PACKET_FLAGS_ENCRYPTION 0x00030000 180 #define RX_PACKET_FLAGS_MORE_PACKETS 0x00040000 181 #define RX_PACKET_FLAGS_MEASURMENT 0x00080000 182 183 #define RX_DESC_FLAGS_ENCRYPTION 8 184 #define RX_PACKET_FLAGS_ENCRYPTION_SHIFT 16 185 #define RX_PACKET_FLAGS_ENCRYPTION_SHIFT_FROM_DESC (RX_PACKET_FLAGS_ENCRYPTION_SHIFT - RX_DESC_FLAGS_ENCRYPTION) 186 187 /* The next definitions are used to decide which encryption is used by the Rx flags */ 188 #define RX_FLAGS_NO_SECURITY 0 189 #define RX_FLAGS_WEP 1 190 #define RX_FLAGS_TKIP 2 191 #define RX_FLAGS_AES 3 192 193 #define RX_DESC_PACKETID_SHIFT 11 194 #define RX_MAX_PACKET_ID 3 195 196 197 /* Cal backs */ 198 199 /* Callback for rx compleate */ 200 201 202 typedef void (*WhalSendPacketTranferCB_t)(TI_HANDLE hWhalTx, 203 TI_STATUS TxStatus, 204 UINT32 aPacketId, 205 void *reserved); 206 207 #endif /* _WHAL_BUS_DEFS_H */ 208