diff options
author | 2016-04-11 10:41:07 +0300 | |
---|---|---|
committer | 2016-04-13 08:17:18 +0300 | |
commit | e09b41010ba33a20a87472ee821fa407a5b8da36 (patch) | |
tree | d10dc367189862e7ca5c592f033dc3726e1df4e3 /kernel/drivers/staging/wilc1000/wilc_msgqueue.h | |
parent | f93b97fd65072de626c074dbe099a1fff05ce060 (diff) |
These changes are the raw update to linux-4.4.6-rt14. Kernel sources
are taken from kernel.org, and rt patch from the rt wiki download page.
During the rebasing, the following patch collided:
Force tick interrupt and get rid of softirq magic(I70131fb85).
Collisions have been removed because its logic was found on the
source already.
Change-Id: I7f57a4081d9deaa0d9ccfc41a6c8daccdee3b769
Signed-off-by: José Pekkarinen <jose.pekkarinen@nokia.com>
Diffstat (limited to 'kernel/drivers/staging/wilc1000/wilc_msgqueue.h')
-rw-r--r-- | kernel/drivers/staging/wilc1000/wilc_msgqueue.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/kernel/drivers/staging/wilc1000/wilc_msgqueue.h b/kernel/drivers/staging/wilc1000/wilc_msgqueue.h new file mode 100644 index 000000000..d231c334e --- /dev/null +++ b/kernel/drivers/staging/wilc1000/wilc_msgqueue.h @@ -0,0 +1,94 @@ +#ifndef __WILC_MSG_QUEUE_H__ +#define __WILC_MSG_QUEUE_H__ + +/*! + * @file wilc_msgqueue.h + * @brief Message Queue OS wrapper functionality + * @author syounan + * @sa wilc_oswrapper.h top level OS wrapper file + * @date 30 Aug 2010 + * @version 1.0 + */ + +#include <linux/semaphore.h> + +/* Message Queue type is a structure */ +typedef struct __Message_struct { + void *pvBuffer; + u32 u32Length; + struct __Message_struct *pstrNext; +} Message; + +typedef struct __MessageQueue_struct { + struct semaphore hSem; + spinlock_t strCriticalSection; + bool bExiting; + u32 u32ReceiversCount; + Message *pstrMessageList; +} WILC_MsgQueueHandle; + +/*! + * @brief Creates a new Message queue + * @details Creates a new Message queue, if the feature + * CONFIG_WILC_MSG_QUEUE_IPC_NAME is enabled and pstrAttrs->pcName + * is not Null, then this message queue can be used for IPC with + * any other message queue having the same name in the system + * @param[in,out] pHandle handle to the message queue object + * @param[in] pstrAttrs Optional attributes, NULL for default + * @return Error code indicating sucess/failure + * @author syounan + * @date 30 Aug 2010 + * @version 1.0 + */ +int wilc_mq_create(WILC_MsgQueueHandle *pHandle); + +/*! + * @brief Sends a message + * @details Sends a message, this API will block unil the message is + * actually sent or until it is timedout (as long as the feature + * CONFIG_WILC_MSG_QUEUE_TIMEOUT is enabled and pstrAttrs->u32Timeout + * is not set to WILC_OS_INFINITY), zero timeout is a valid value + * @param[in] pHandle handle to the message queue object + * @param[in] pvSendBuffer pointer to the data to send + * @param[in] u32SendBufferSize the size of the data to send + * @param[in] pstrAttrs Optional attributes, NULL for default + * @return Error code indicating sucess/failure + * @author syounan + * @date 30 Aug 2010 + * @version 1.0 + */ +int wilc_mq_send(WILC_MsgQueueHandle *pHandle, + const void *pvSendBuffer, u32 u32SendBufferSize); + +/*! + * @brief Receives a message + * @details Receives a message, this API will block unil a message is + * received or until it is timedout (as long as the feature + * CONFIG_WILC_MSG_QUEUE_TIMEOUT is enabled and pstrAttrs->u32Timeout + * is not set to WILC_OS_INFINITY), zero timeout is a valid value + * @param[in] pHandle handle to the message queue object + * @param[out] pvRecvBuffer pointer to a buffer to fill with the received message + * @param[in] u32RecvBufferSize the size of the receive buffer + * @param[out] pu32ReceivedLength the length of received data + * @param[in] pstrAttrs Optional attributes, NULL for default + * @return Error code indicating sucess/failure + * @author syounan + * @date 30 Aug 2010 + * @version 1.0 + */ +int wilc_mq_recv(WILC_MsgQueueHandle *pHandle, + void *pvRecvBuffer, u32 u32RecvBufferSize, + u32 *pu32ReceivedLength); + +/*! + * @brief Destroys an existing Message queue + * @param[in] pHandle handle to the message queue object + * @param[in] pstrAttrs Optional attributes, NULL for default + * @return Error code indicating sucess/failure + * @author syounan + * @date 30 Aug 2010 + * @version 1.0 + */ +int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle); + +#endif |