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: FwEvent.h */ 39 /* PURPOSE: Handle firmware events. */ 40 /* */ 41 /***************************************************************************/ 42 #ifndef _FW_EVENT_ 43 #define _FW_EVENT_ 44 45 #include "FwEvent_api.h" 46 47 #define NUM_OF_READ_REG_LOOPS 1 48 49 #ifdef TI_DBG 50 #define MAX_EVENT_NUM 8 51 #else 52 #define MAX_EVENT_NUM 6 53 #endif 54 55 typedef enum 56 { 57 FW_EVENT_STATE_IDLE, 58 FW_EVENT_STATE_WAIT_BUS_I, 59 FW_EVENT_STATE_WAIT_BUS_II, 60 FW_EVENT_STATE_WAIT_MASK, 61 FW_EVENT_STATE_WAIT_UNMUX, 62 FW_EVENT_STATE_WAIT_HINT_READ, 63 FW_EVENT_STATE_WAIT_READ_COUNTERS, 64 FW_EVENT_STATE_HANDLE_EVENT, 65 FW_EVENT_STATE_WAIT_UNMASK 66 } FwEventState_e; 67 68 69 /* The FwEvent module object. */ 70 typedef struct 71 { 72 FwEventState_e FwEventState; /* State machine state */ 73 UINT32 EventVector; /* Read interrupt status vector */ 74 UINT32 EventMask; /* Static interrupt event mask */ 75 UINT32 EventNum; /* Event interrupt counter */ 76 UINT32 IntrState; /* Interrupt state */ 77 BOOL PendingEvent; /* Pending event indicator */ 78 UINT32 LoopCounter; 79 80 /* The next 3 variables are used for a work around solution of mismatch between Fw & Driver events */ 81 UINT32 RxControlAddr; 82 UINT32 uNumOfRxHandled; 83 /* use a struct to read buffers from the bus - used for extra bytes reserving */ 84 PADDING (UINT32 uFwRxCounter) 85 86 87 TI_HANDLE hOs; /* OS handle */ 88 TI_HANDLE hReport; /* Report handle */ 89 TI_HANDLE hTNETWIF; /* TNETWIF handle */ 90 TI_HANDLE hClient [MAX_EVENT_NUM];/* Array of client handles */ 91 92 } FwEventObj_t; 93 94 #endif /* _FW_EVENT_ */ 95 96