staging: wilc1000: rename pu32ReceivedLength in wilc_mq_recv
[deliverable/linux.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 <linux/semaphore.h>
14
15 /* Message Queue type is a structure */
16 struct message {
17 void *buf;
18 u32 len;
19 struct message *next;
20 };
21
22 struct message_queue {
23 struct semaphore sem;
24 spinlock_t lock;
25 bool exiting;
26 u32 recv_count;
27 struct message *msg_list;
28 };
29
30 /*!
31 * @brief Creates a new Message queue
32 * @details Creates a new Message queue, if the feature
33 * CONFIG_WILC_MSG_QUEUE_IPC_NAME is enabled and pstrAttrs->pcName
34 * is not Null, then this message queue can be used for IPC with
35 * any other message queue having the same name in the system
36 * @param[in,out] pHandle handle to the message queue object
37 * @param[in] pstrAttrs Optional attributes, NULL for default
38 * @return Error code indicating success/failure
39 * @author syounan
40 * @date 30 Aug 2010
41 * @version 1.0
42 */
43 int wilc_mq_create(struct message_queue *mq);
44
45 /*!
46 * @brief Sends a message
47 * @details Sends a message, this API will block until the message is
48 * actually sent or until it is timedout (as long as the feature
49 * CONFIG_WILC_MSG_QUEUE_TIMEOUT is enabled and pstrAttrs->u32Timeout
50 * is not set to WILC_OS_INFINITY), zero timeout is a valid value
51 * @param[in] pHandle handle to the message queue object
52 * @param[in] pvSendBuffer pointer to the data to send
53 * @param[in] u32SendBufferSize the size of the data to send
54 * @param[in] pstrAttrs Optional attributes, NULL for default
55 * @return Error code indicating success/failure
56 * @author syounan
57 * @date 30 Aug 2010
58 * @version 1.0
59 */
60 int wilc_mq_send(struct message_queue *mq,
61 const void *send_buf, u32 send_buf_size);
62
63 /*!
64 * @brief Receives a message
65 * @details Receives a message, this API will block until a message is
66 * received or until it is timedout (as long as the feature
67 * CONFIG_WILC_MSG_QUEUE_TIMEOUT is enabled and pstrAttrs->u32Timeout
68 * is not set to WILC_OS_INFINITY), zero timeout is a valid value
69 * @param[in] pHandle handle to the message queue object
70 * @param[out] pvRecvBuffer pointer to a buffer to fill with the received message
71 * @param[in] u32RecvBufferSize the size of the receive buffer
72 * @param[out] pu32ReceivedLength the length of received data
73 * @param[in] pstrAttrs Optional attributes, NULL for default
74 * @return Error code indicating success/failure
75 * @author syounan
76 * @date 30 Aug 2010
77 * @version 1.0
78 */
79 int wilc_mq_recv(struct message_queue *mq,
80 void *recv_buf, u32 recv_buf_size, u32 *recv_len);
81
82 /*!
83 * @brief Destroys an existing Message queue
84 * @param[in] pHandle handle to the message queue object
85 * @param[in] pstrAttrs Optional attributes, NULL for default
86 * @return Error code indicating success/failure
87 * @author syounan
88 * @date 30 Aug 2010
89 * @version 1.0
90 */
91 int wilc_mq_destroy(struct message_queue *mq);
92
93 #endif
This page took 0.035021 seconds and 5 git commands to generate.