Home | History | Annotate | Download | only in Tx_Result
      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:   txResult.h                                                 */
     39 /*                                                                         */
     40 /*    PURPOSE:  Handle packets Tx results upon Tx-complete from the FW.    */
     41 /*                                                                         */
     42 /***************************************************************************/
     43 #ifndef _TX_RESULT_H_
     44 #define _TX_RESULT_H_
     45 
     46 
     47 #include "public_descriptors.h"
     48 
     49 
     50 
     51 /* Callback function definition for Tx sendPacketComplete */
     52 typedef void (* SendPacketCompleteCB_t)(TI_HANDLE CBObj, TxResultDescriptor_t *pTxResultInfo);
     53 
     54 typedef enum
     55 {
     56     TX_RESULT_STATE_IDLE,
     57     TX_RESULT_STATE_READING,
     58     TX_RESULT_STATE_WRITING1,
     59     TX_RESULT_STATE_WRITING2,
     60     TX_RESULT_STATE_EXIT
     61 } TxResultState_e;
     62 
     63 typedef enum
     64 {
     65     TX_RESULT_NO_BUFFER = 0,
     66     TX_RESULT_ONE_BUFFER = 1,
     67     TX_RESULT_TWO_BUFFERS = 2
     68 } TxResultNumOfBuffers_e;
     69 
     70 typedef struct
     71 {
     72   UINT32 from;
     73   UINT32 to;
     74 } TxResultEntry_t;
     75 
     76 /* The TxResult module object. */
     77 typedef struct
     78 {
     79 
     80     TI_HANDLE               hOs;
     81     TI_HANDLE               hReport;
     82     TI_HANDLE               hTNETWIF;
     83     TI_HANDLE               hFwEvent;
     84 
     85     TI_STATUS               returnValue;                            /* used the return code to the FwEvent module */
     86     TxResultState_e         state;                                  /* current state of SM */
     87 
     88     /* use a struct to read buffers from the bus - used for extra bytes reserving */
     89     PADDING (TxResultDescriptor_t TxCmpltAttr[FW_TX_CMPLT_BLOCK_SIZE])
     90 																	/* The FW result table image from last read. */
     91 
     92     BOOL                    bSync;                                  /* indicate if we are in Synch bus or not */
     93     UINT32                  TxCmpltStartPointIterator;              /* Saves the last FW table index we got result-info from. */
     94     SendPacketCompleteCB_t  sendPacketCompleteCB;                   /* Tx-Complete callback function */
     95     TI_HANDLE               sendPacketCompleteHandle;               /* Tx-Complete callback function handle */
     96     UINT32                  txResultTableAddr;                      /* The HW Tx-Result Table address. */
     97     TxResultEntry_t         entry[2];                               /* address of start-end points of the new entries */
     98     TxResultNumOfBuffers_e  numOfBuffers;                           /* indicate how many buffers should be written to FW */
     99 #ifdef TI_DBG
    100     UINT32                  txCompleteDepthHistogram[ FW_TX_CMPLT_BLOCK_SIZE + 1 ];
    101                                                                     /* The depth of the TX result array on INTR */
    102 #endif
    103 } txResultObj_t;
    104 
    105 
    106 
    107 #endif  /* _TX_RESULT_H_  */
    108 
    109 
    110