Merge branch 'pcmcia' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
[linux-2.6-microblaze.git] / drivers / staging / wilc1000 / wilc_msgqueue.h
1 #ifndef __WILC_MSG_QUEUE_H__
2 #define __WILC_MSG_QUEUE_H__
3
4 /*!
5  *  @file       wilc_msgqueue.h
6  *  @brief      Message Queue OS wrapper functionality
7  *  @author     syounan
8  *  @sa         wilc_oswrapper.h top level OS wrapper file
9  *  @date       30 Aug 2010
10  *  @version    1.0
11  */
12
13 #include "wilc_platform.h"
14 #include "wilc_errorsupport.h"
15 #include "wilc_memory.h"
16
17 /*!
18  *  @brief              Creates a new Message queue
19  *  @details            Creates a new Message queue, if the feature
20  *                              CONFIG_WILC_MSG_QUEUE_IPC_NAME is enabled and pstrAttrs->pcName
21  *                              is not Null, then this message queue can be used for IPC with
22  *                              any other message queue having the same name in the system
23  *  @param[in,out]      pHandle handle to the message queue object
24  *  @param[in]  pstrAttrs Optional attributes, NULL for default
25  *  @return             Error code indicating sucess/failure
26  *  @author             syounan
27  *  @date               30 Aug 2010
28  *  @version            1.0
29  */
30 WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle);
31
32 /*!
33  *  @brief              Sends a message
34  *  @details            Sends a message, this API will block unil the message is
35  *                              actually sent or until it is timedout (as long as the feature
36  *                              CONFIG_WILC_MSG_QUEUE_TIMEOUT is enabled and pstrAttrs->u32Timeout
37  *                              is not set to WILC_OS_INFINITY), zero timeout is a valid value
38  *  @param[in]  pHandle handle to the message queue object
39  *  @param[in]  pvSendBuffer pointer to the data to send
40  *  @param[in]  u32SendBufferSize the size of the data to send
41  *  @param[in]  pstrAttrs Optional attributes, NULL for default
42  *  @return             Error code indicating sucess/failure
43  *  @author             syounan
44  *  @date               30 Aug 2010
45  *  @version            1.0
46  */
47 WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
48                              const void *pvSendBuffer, u32 u32SendBufferSize);
49
50 /*!
51  *  @brief              Receives a message
52  *  @details            Receives a message, this API will block unil a message is
53  *                              received or until it is timedout (as long as the feature
54  *                              CONFIG_WILC_MSG_QUEUE_TIMEOUT is enabled and pstrAttrs->u32Timeout
55  *                              is not set to WILC_OS_INFINITY), zero timeout is a valid value
56  *  @param[in]  pHandle handle to the message queue object
57  *  @param[out] pvRecvBuffer pointer to a buffer to fill with the received message
58  *  @param[in]  u32RecvBufferSize the size of the receive buffer
59  *  @param[out] pu32ReceivedLength the length of received data
60  *  @param[in]  pstrAttrs Optional attributes, NULL for default
61  *  @return             Error code indicating sucess/failure
62  *  @author             syounan
63  *  @date               30 Aug 2010
64  *  @version            1.0
65  */
66 WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
67                              void *pvRecvBuffer, u32 u32RecvBufferSize,
68                              u32 *pu32ReceivedLength);
69
70 /*!
71  *  @brief              Destroys an existing  Message queue
72  *  @param[in]  pHandle handle to the message queue object
73  *  @param[in]  pstrAttrs Optional attributes, NULL for default
74  *  @return             Error code indicating sucess/failure
75  *  @author             syounan
76  *  @date               30 Aug 2010
77  *  @version            1.0
78  */
79 WILC_ErrNo WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle);
80
81 #endif