1 /* 2 * RxXfer.h 3 * 4 * Copyright(c) 1998 - 2009 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 * MODULE: rxXfer.h 38 * 39 * PURPOSE: Rx Xfer module header file. 40 * 41 ****************************************************************************/ 42 43 #ifndef _RX_XFER_H 44 #define _RX_XFER_H 45 46 #include "rxXfer_api.h" 47 #include "TwIf.h" 48 49 50 #define RX_DESCRIPTOR_SIZE (sizeof(RxIfDescriptor_t)) 51 #ifdef PLATFORM_SYMBIAN /* UMAC is using only one buffer and therefore we can't use consecutive reads */ 52 #define MAX_CONSECUTIVE_READS 1 53 #else 54 #define MAX_CONSECUTIVE_READS 8 55 #endif 56 57 #define MAX_PACKETS_NUMBER 8 58 #define MAX_CONSECUTIVE_READ_TXN 16 59 /* Max Txn size */ 60 #define MAX_PACKET_SIZE 4096 61 62 typedef struct 63 { 64 TI_UINT32 numPacketsRead; 65 TI_UINT32 numBytesRead; 66 TI_UINT32 numPacketsDroppedNoMem; 67 TI_UINT32 numPacketsDroppedPacketIDMismatch; 68 TI_UINT32 counters; 69 TI_UINT32 numAck0; 70 } RxXferStats_T; 71 72 73 typedef struct 74 { 75 TTxnStruct tTxnStruct; 76 TI_UINT32 uRegData; 77 TI_UINT32 uRegAdata; 78 79 } TRegTxn; 80 81 typedef struct 82 { 83 TTxnStruct tTxnStruct; 84 TI_UINT32 uCounter; 85 86 } TCounterTxn; 87 88 typedef struct 89 { 90 TTxnStruct tTxnStruct; 91 TI_UINT32 uData; 92 93 } TDummyTxn; 94 95 typedef struct 96 { 97 TI_HANDLE hOs; 98 TI_HANDLE hReport; 99 TI_HANDLE hTwIf; 100 TI_HANDLE hFwEvent; 101 TI_HANDLE hRxQueue; 102 103 TI_UINT32 aRxPktsDesc[NUM_RX_PKT_DESC]; /* Array of Rx packets short descriptors (see RX_DESC_SET/GET...) */ 104 TI_UINT32 uFwRxCntr; 105 TI_UINT32 uDrvRxCntr; 106 107 TI_UINT32 uPacketMemoryPoolStart; 108 109 TRequestForBufferCb RequestForBufferCB; 110 TI_HANDLE RequestForBufferCB_handle; 111 112 TRegTxn aSlaveRegTxn[MAX_CONSECUTIVE_READ_TXN]; 113 TTxnStruct aTxnStruct[MAX_CONSECUTIVE_READ_TXN]; 114 TCounterTxn aCounterTxn[MAX_CONSECUTIVE_READ_TXN]; 115 TDummyTxn aDummyTxn[MAX_CONSECUTIVE_READ_TXN]; 116 TI_BOOL bChipIs1273Pg10; 117 118 TI_UINT8 aTempBuffer[MAX_PACKET_SIZE]; 119 120 TI_UINT32 uAvailableTxn; 121 122 #ifdef TI_DBG 123 RxXferStats_T DbgStats; 124 #endif /* TI_DBG */ 125 126 } RxXfer_t; 127 128 129 #endif /* _RX_XFER_H */ 130