From b4b7ff4b08e691656c9d77c758fc355833128ac0 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Wed, 20 Jan 2016 14:01:31 -0300 Subject: Linux-libre 4.4-gnu --- drivers/staging/wilc1000/wilc_msgqueue.h | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'drivers/staging/wilc1000/wilc_msgqueue.h') diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index ef1d2fa20..d231c334e 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -10,9 +10,22 @@ * @version 1.0 */ -#include "wilc_platform.h" -#include "wilc_errorsupport.h" -#include "wilc_memory.h" +#include + +/* 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 @@ -27,7 +40,7 @@ * @date 30 Aug 2010 * @version 1.0 */ -WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle); +int wilc_mq_create(WILC_MsgQueueHandle *pHandle); /*! * @brief Sends a message @@ -44,7 +57,7 @@ WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle); * @date 30 Aug 2010 * @version 1.0 */ -WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle, +int wilc_mq_send(WILC_MsgQueueHandle *pHandle, const void *pvSendBuffer, u32 u32SendBufferSize); /*! @@ -63,7 +76,7 @@ WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle, * @date 30 Aug 2010 * @version 1.0 */ -WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle, +int wilc_mq_recv(WILC_MsgQueueHandle *pHandle, void *pvRecvBuffer, u32 u32RecvBufferSize, u32 *pu32ReceivedLength); @@ -76,6 +89,6 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle, * @date 30 Aug 2010 * @version 1.0 */ -WILC_ErrNo WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle); +int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle); #endif -- cgit v1.2.3-54-g00ecf