• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** \file TNETW_Driver.h
2  *  \brief TNETW Driver include file
3  *
4  *  \see TNETW_Driver.c
5  */
6 /****************************************************************************
7 **+-----------------------------------------------------------------------+**
8 **|                                                                       |**
9 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved.      |**
10 **| All rights reserved.                                                  |**
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 /*                                                                          */
43 /*    MODULE:   TNETW_Driver.h                                              */
44 /*    PURPOSE:  TNETW Driver include file                                   */
45 /*                                                                          */
46 /***************************************************************************/
47 
48 
49 #ifndef TNETW_DRIVER_H
50 #define TNETW_DRIVER_H
51 
52 
53 #include "TNETW_Driver_types.h"
54 #include "whalCtrl_api.h"
55 
56 
57 
58 #define TNETW_DRIVER_CB_MODULE_OWNER_MASK   0xff00
59 #define TNETW_DRIVER_CB_TYPE_MASK           0x00ff
60 
61 #define SHIFT_BETWEEN_TU_AND_USEC  10  /* Shift factor to conver between TU (1024 uSec) and uSec. */
62 
63 
64 /* TNETW-Driver object */
65 typedef struct T_TnetwDrv_t
66 {
67     TI_HANDLE           hOs;
68     TI_HANDLE           hUser;
69     TI_HANDLE           hReport;
70     TI_HANDLE           hMemMgr;
71     TI_HANDLE           hMacServices;
72     TI_HANDLE           hHalCtrl;
73     TI_HANDLE           hTxCtrlBlk;
74     TI_HANDLE           hTxHwQueue;
75     TI_HANDLE           hTNETWIF;
76     TI_HANDLE           hHwIntr;
77     TI_HANDLE           hWhalParams;
78 
79     /*
80      * Ctrl modules:
81      */
82     TI_HANDLE           hCmdQueue;
83 #if !defined(GWSI_DRIVER) && !defined(GWSI_LIB)
84     TI_HANDLE           hRecoveryCtrl;
85 #endif
86 
87     /*
88      * FW-Transfer modules:
89      */
90     TI_HANDLE           hTxXfer;
91     TI_HANDLE           hTxResult;
92     TI_HANDLE           hRxXfer;
93     TI_HANDLE           hFwEvent;
94 #if !defined(GWSI_DRIVER) && !defined(GWSI_LIB)
95     TI_HANDLE           hHwInit;
96     BOOL                bRecoveryFlag;/*if true it means that we are in recovery process*/
97 #endif
98     TI_HANDLE           hCmdMBox;
99     TI_HANDLE           hEventMbox;
100 
101     void               *pInitTableCopy;
102 
103     /* Init success flag */
104     BOOL                bInitSuccess;
105 
106     /* User application configuration callback */
107     TnetDrv_callback_t  fUserConf;
108 
109     /* CB at the end of TnetwDrv_Configure(). not called if no registration was done */
110     TnetDrv_callback_t  fConfigureCmplteteCB;
111     TI_HANDLE           hConfigureCompleteOBj;
112 
113     /* CB at the end of TnetwDrv_Configure(). not called if no registration was done */
114     TnetDrv_callback_t      fConfigureEndCB;
115     TI_HANDLE           fConfigureEndObj;
116 
117 #ifdef TI_DBG  /* Just for debug. */
118     TI_HANDLE           hDebugTrace;
119 
120     UINT32 dbgPktSeqNum[MAX_NUM_OF_TX_QUEUES];          /* Packets sequence counter per queue. */
121     /* Tx counters per queue:*/
122     UINT32 dbgCountSentPackets[MAX_NUM_OF_TX_QUEUES];   /* Count packets sent from upper driver. */
123     UINT32 dbgCountQueueAvailable[MAX_NUM_OF_TX_QUEUES];/* Count packets sent and queue not busy. */
124     UINT32 dbgCountXferDone[MAX_NUM_OF_TX_QUEUES];      /* Count XferDone return values from Xfer. */
125     UINT32 dbgCountXferSuccess[MAX_NUM_OF_TX_QUEUES];   /* Count Success return values from Xfer. */
126     UINT32 dbgCountXferPending[MAX_NUM_OF_TX_QUEUES];   /* Count Pending return value from Xfer. */
127     UINT32 dbgCountXferError[MAX_NUM_OF_TX_QUEUES];     /* Count Error return value from Xfer. */
128     UINT32 dbgCountXferDoneCB[MAX_NUM_OF_TX_QUEUES];    /* Count XferDone callback calls. */
129     UINT32 dbgCountTxCompleteCB[MAX_NUM_OF_TX_QUEUES];  /* Count TxComplete callback calls. */
130 #endif
131 
132 } TnetwDrv_t;
133 
134 
135 void TnetwDrv_TxXferDone(TI_HANDLE hTnetwDrv, txCtrlBlkEntry_t *pPktCtrlBlk);
136 void TnetwDrv_TxComplete(TI_HANDLE hTnetwDrv, TxResultDescriptor_t *pTxResultInfo);
137 void TnetwDrv_TxXferDebug (TI_HANDLE hTnetwDrv, txCtrlBlkEntry_t *pPktCtrlBlk, UINT32 uDebugInfo);
138 void TnetwDrv_RecoveryCtrlBlk(TI_HANDLE hTnetwDrv);
139 
140 
141 /* External Functions Prototypes */
142 
143 void  SendPacketTransfer (TI_HANDLE hUser, UINT32 aPacketId);
144 void  SendPacketDebug (TI_HANDLE hUser, UINT32 aPacketId, UINT32 uDebugInfo);
145 void  SendPacketComplete (TI_HANDLE hUser, systemStatus_e aStatus, UINT32 aPacketId, UINT32 aRate,
146                                  UINT8 aAckFailures, UINT32 durationInAir, UINT32 fwHandlingTime, UINT32 mediumDelay);
147 
148 
149 
150 
151 #endif /* TNETW_DRIVER_H */
152 
153