Home | History | Annotate | Download | only in Ctrl_Interface
      1 /*
      2  * CmdHndlr.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 #ifndef CMD_H
     36 #define CMD_H
     37 
     38 #include "queue.h"
     39 #include "DrvMainModules.h"
     40 #include "WlanDrvIf.h"
     41 
     42 /* The configuration commands structure */
     43 typedef struct
     44 {
     45     TQueNodeHdr tQueNodeHdr;                            /* The header used for queueing the command */
     46     TI_UINT32   cmd;
     47     TI_UINT32   flags;
     48     void       *buffer1;
     49     TI_UINT32   buffer1_len;
     50     void       *buffer2;
     51     TI_UINT32   buffer2_len;
     52     TI_UINT32  *param3;
     53     TI_UINT32  *param4;
     54     void       *pSignalObject;                          /* use to save handle to complete mechanism per OS */
     55     void       *local_buffer;
     56     TI_UINT32   local_buffer_len;
     57     TI_UINT32   return_code;
     58     TI_STATUS	eCmdStatus;                             /* (PEND / COMPLETE) */
     59     TI_BOOL	    bWaitFlag; 	                            /* (TRUE / FALSE) */
     60     /*
     61      * TCmdRespUnion is defined for each OS:
     62      * For Linx and WM that defined is empty.
     63      * For OSE the new typedef includes all "Done" typedefs in union from EMP code (H files).
     64      */
     65     TI_UINT8	CmdRespBuffer[sizeof(TCmdRespUnion)];
     66 } TConfigCommand;
     67 
     68 
     69 TI_HANDLE cmdHndlr_Create (TI_HANDLE hOs, TI_HANDLE hEvHandler);
     70 TI_STATUS cmdHndlr_Destroy (TI_HANDLE hCmdHndlr, TI_HANDLE hEvHandler);
     71 void      cmdHndlr_ClearQueue (TI_HANDLE hCmdHndlr);
     72 void      cmdHndlr_Init (TStadHandlesList *pStadHandles);
     73 TI_STATUS cmdHndlr_InsertCommand (TI_HANDLE     hCmdHndlr,
     74                                   TI_UINT32     cmd,
     75                                   TI_UINT32     flags,
     76                                   void         *buffer1,
     77                                   TI_UINT32     buffer1_len,
     78                                   void         *buffer2,
     79                                   TI_UINT32     buffer2_len,
     80                                   TI_UINT32    *param3,
     81                                   TI_UINT32    *param4);
     82 void      cmdHndlr_HandleCommands (TI_HANDLE hCmdHndlr);
     83 void      cmdHndlr_Complete (TI_HANDLE hCmdHndlr);
     84 void     *cmdHndlr_GetStat (TI_HANDLE hCmdHndlr);
     85 void      cmdHndlr_Enable  (TI_HANDLE hCmdHndlr);
     86 void      cmdHndlr_Disable (TI_HANDLE hCmdHndlr);
     87 
     88 #endif
     89