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 /* */ 39 /* MODULE: CmdQueue_api.h */ 40 /* PURPOSE: CmdQueue api */ 41 /* */ 42 /**********************************************************************************/ 43 #ifndef _CMDQUEUE_API_H_ 44 #define _CMDQUEUE_API_H_ 45 46 #include "whalCommon.h" 47 #include "public_commands.h" 48 49 /***************************************************************************** 50 ** Defines ** 51 *****************************************************************************/ 52 53 /***************************************************************************** 54 ** Enums ** 55 *****************************************************************************/ 56 57 /***************************************************************************** 58 ** Structures ** 59 *****************************************************************************/ 60 61 /***************************************************************************** 62 ** Types ** 63 *****************************************************************************/ 64 65 /***************************************************************************** 66 ** APIs definitions ** 67 *****************************************************************************/ 68 69 TI_HANDLE CmdQueue_Create(TI_HANDLE hOS); 70 int CmdQueue_Destroy(TI_HANDLE hCmdQueue); 71 int CmdQueue_Config(TI_HANDLE hCmdQueue, TI_HANDLE hCmdMBox, 72 TI_HANDLE hReport); 73 int CmdQueue_StartReconfig(TI_HANDLE hCmdQueue); 74 int CmdQueue_EndReconfig(TI_HANDLE hCmdQueue); 75 int CmdQueue_RegisterCmdCompleteGenericCB(TI_HANDLE hCmdQueue, void *CB_Func, TI_HANDLE CB_handle); 76 int CmdQueue_RegisterForErrorCB(TI_HANDLE hCmdQueue, void *CB_Func, TI_HANDLE CB_handle); 77 int CmdQueue_CmdConfigure(TI_HANDLE hCmdQueue, void *MboxBuf,UINT32 ParamsLen); 78 int CmdQueue_CmdConfigureWithCb(TI_HANDLE hCmdQueue, void *MboxBuf, UINT32 ParamsLen, 79 void *CB_Func, TI_HANDLE CB_handle); 80 int CmdQueue_CmdInterrogate(TI_HANDLE hCmdQueue, void *MboxBuf, UINT32 ParamsLen); 81 int CmdQueue_CmdInterrogateWithCb(TI_HANDLE hCmdQueue, void *MboxBuf, UINT32 ParamsLen, 82 void *CB_Func, TI_HANDLE CB_handle, void *CB_Buf); 83 int CmdQueue_Command(TI_HANDLE hCmdQueue, Command_e MboxCmdType, char *MboxBuf, UINT32 ParamsLen); 84 int CmdQueue_CommandWithCb(TI_HANDLE hCmdQueue, Command_e MboxCmdType, void *MboxBuf, UINT32 ParamsLen, 85 void *CB_Func, TI_HANDLE CB_handle, void* CB_Buf); 86 int CmdQueue_GetMaxNumberOfCommands (TI_HANDLE hCmdQueue); 87 void CmdQueue_Print(TI_HANDLE hCmdQueue); 88 void CmdQueue_PrintHistory(TI_HANDLE hCmdQueue, int NunOfCmd); 89 int CmdQueue_ResultReceived(TI_HANDLE hCmdQueue, UINT32 status); 90 int CmdQueue_Error (TI_HANDLE hCmdQueue); 91 int CmdQueue_SendCmplt(TI_HANDLE hCmdQueue); 92 #ifdef REPORT_LOG 93 char* CmdQueue_GetIEString(int MboxCmdType, UINT16 Id); 94 char* CmdQueue_GetCmdString(int MboxCmdType); 95 char* CmdQueue_GetErrorString(CommandStatus_e MboxError); 96 #endif /* REPORT_LOG */ 97 98 #endif 99