|
1 /* |
|
2 * RxXfer.h |
|
3 * |
|
4 * Copyright(c) 1998 - 2010 Texas Instruments. All rights reserved. |
|
5 * All rights reserved. |
|
6 * |
|
7 * This program and the accompanying materials are made available under the |
|
8 * terms of the Eclipse Public License v1.0 or BSD License which accompanies |
|
9 * this distribution. The Eclipse Public License is available at |
|
10 * http://www.eclipse.org/legal/epl-v10.html and the BSD License is as below. |
|
11 * |
|
12 * Redistribution and use in source and binary forms, with or without |
|
13 * modification, are permitted provided that the following conditions |
|
14 * are met: |
|
15 * |
|
16 * * Redistributions of source code must retain the above copyright |
|
17 * notice, this list of conditions and the following disclaimer. |
|
18 * * Redistributions in binary form must reproduce the above copyright |
|
19 * notice, this list of conditions and the following disclaimer in |
|
20 * the documentation and/or other materials provided with the |
|
21 * distribution. |
|
22 * * Neither the name Texas Instruments nor the names of its |
|
23 * contributors may be used to endorse or promote products derived |
|
24 * from this software without specific prior written permission. |
|
25 * |
|
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|
29 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
|
30 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
31 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
32 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|
33 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|
36 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
37 */ |
|
38 |
|
39 |
|
40 /**************************************************************************** |
|
41 * |
|
42 * MODULE: rxXfer.h |
|
43 * |
|
44 * PURPOSE: Rx Xfer module header file. |
|
45 * |
|
46 ****************************************************************************/ |
|
47 |
|
48 #ifndef _RX_XFER_H |
|
49 #define _RX_XFER_H |
|
50 |
|
51 #include "rxXfer_api.h" |
|
52 #include "TwIf.h" |
|
53 |
|
54 |
|
55 #define RX_DESCRIPTOR_SIZE (sizeof(RxIfDescriptor_t)) |
|
56 #ifdef PLATFORM_SYMBIAN /* UMAC is using only one buffer and therefore we can't use consecutive reads */ |
|
57 #define MAX_CONSECUTIVE_READS 1 |
|
58 #else |
|
59 #define MAX_CONSECUTIVE_READS 8 |
|
60 #endif |
|
61 |
|
62 #define MAX_PACKETS_NUMBER 8 |
|
63 #define MAX_CONSECUTIVE_READ_TXN 16 |
|
64 /* Max Txn size */ |
|
65 #define MAX_PACKET_SIZE 4096 |
|
66 |
|
67 typedef struct |
|
68 { |
|
69 TI_UINT32 numPacketsRead; |
|
70 TI_UINT32 numBytesRead; |
|
71 TI_UINT32 numPacketsDroppedNoMem; |
|
72 TI_UINT32 numPacketsDroppedPacketIDMismatch; |
|
73 TI_UINT32 counters; |
|
74 TI_UINT32 numAck0; |
|
75 } RxXferStats_T; |
|
76 |
|
77 |
|
78 typedef struct |
|
79 { |
|
80 TTxnStruct tTxnStruct; |
|
81 TI_UINT8 *pRegData; |
|
82 } TRegTxn; |
|
83 |
|
84 typedef struct |
|
85 { |
|
86 TTxnStruct tTxnStruct; |
|
87 TI_UINT8 *pCounter; |
|
88 |
|
89 } TCounterTxn; |
|
90 |
|
91 typedef struct |
|
92 { |
|
93 TTxnStruct tTxnStruct; |
|
94 TI_UINT8 *pData; |
|
95 |
|
96 } TDummyTxn; |
|
97 |
|
98 typedef struct |
|
99 { |
|
100 TI_HANDLE hOs; |
|
101 TI_HANDLE hReport; |
|
102 TI_HANDLE hTwIf; |
|
103 TI_HANDLE hFwEvent; |
|
104 TI_HANDLE hRxQueue; |
|
105 |
|
106 TI_UINT32 aRxPktsDesc[NUM_RX_PKT_DESC]; /* Array of Rx packets short descriptors (see RX_DESC_SET/GET...) */ |
|
107 TI_UINT32 uFwRxCntr; |
|
108 TI_UINT32 uDrvRxCntr; |
|
109 |
|
110 TI_UINT32 uPacketMemoryPoolStart; |
|
111 |
|
112 TRequestForBufferCb RequestForBufferCB; |
|
113 TI_HANDLE RequestForBufferCB_handle; |
|
114 |
|
115 TRegTxn aSlaveRegTxn[MAX_CONSECUTIVE_READ_TXN]; |
|
116 TTxnStruct aTxnStruct[MAX_CONSECUTIVE_READ_TXN]; |
|
117 TCounterTxn aCounterTxn[MAX_CONSECUTIVE_READ_TXN]; |
|
118 TDummyTxn aDummyTxn[MAX_CONSECUTIVE_READ_TXN]; |
|
119 |
|
120 TI_UINT8 *pTempBuffer; |
|
121 |
|
122 TI_UINT32 uAvailableTxn; |
|
123 |
|
124 #ifdef TI_DBG |
|
125 RxXferStats_T DbgStats; |
|
126 #endif /* TI_DBG */ |
|
127 |
|
128 } RxXfer_t; |
|
129 |
|
130 |
|
131 #endif /* _RX_XFER_H */ |