1 /* 2 * eventMbox_api.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: eventMbox_api.h : event Mail Box API 38 * PURPOSE: Notify EventMbox in case of an incoming event from the FW 39 * 40 ****************************************************************************/ 41 #ifndef _EVENT_MBOX_API_H 42 #define _EVENT_MBOX_API_H 43 44 45 #include "TWDriverInternal.h" 46 47 48 /* 49 * TEventMboxDataCb : This Call back is for EventMbox Client 50 * that expect an event with Data associated 51 * str: The Data String 52 * strLen : The Length of the Data 53 */ 54 typedef void (*TEventMboxDataCb)(TI_HANDLE hCb, TI_CHAR* str, TI_UINT32 strLen); 55 56 /* 57 * TEventMboxEvCb : This Call back is for EventMbox Client 58 * that expect an event without any Data 59 */ 60 typedef void (*TEventMboxEvCb)(TI_HANDLE hCb); 61 62 63 /***************************************************************************** 64 ** API ** 65 *****************************************************************************/ 66 67 TI_HANDLE eventMbox_Create (TI_HANDLE hOs); 68 void eventMbox_Destroy (TI_HANDLE hEventMbox); 69 void eventMbox_Stop (TI_HANDLE hEventMbox); 70 void eventMbox_Config (TI_HANDLE hEventMbox, 71 TI_HANDLE hTwif, 72 TI_HANDLE hReport, 73 TI_HANDLE hFwEvent, 74 TI_HANDLE hCmdBld); 75 TI_STATUS eventMbox_InitMboxAddr (TI_HANDLE hEventMbox, fnotify_t fCb, TI_HANDLE hCb); 76 void eventMbox_InitComplete (TI_HANDLE hEventMbox); 77 TI_STATUS eventMbox_RegisterEvent (TI_HANDLE hEventMbox, TI_UINT32 EvID, void *fCb, TI_HANDLE hCb); 78 TI_STATUS eventMbox_ReplaceEvent (TI_HANDLE hEventMbox, 79 TI_UINT32 EvID, 80 void *fNewCb, 81 TI_HANDLE hNewCb, 82 void **pPrevCb, 83 TI_HANDLE *pPrevHndl); 84 TI_STATUS eventMbox_UnMaskEvent (TI_HANDLE hEventMbox, TI_UINT32 EvID, void *fCb, TI_HANDLE hCb); 85 TI_STATUS eventMbox_MaskEvent (TI_HANDLE hEventMbox, TI_UINT32 EvID, void *fCb, TI_HANDLE hCb); 86 ETxnStatus eventMbox_Handle (TI_HANDLE hEventMbox, FwStatus_t *pFwStatus); 87 #ifdef TI_DBG 88 TI_STATUS eventMbox_Print (TI_HANDLE hEventMbox); 89 #endif 90 91 #endif /* _EVENT_MBOX_API_H */ 92