1#ifndef __WILC_MSG_QUEUE_H__ 2#define __WILC_MSG_QUEUE_H__ 3 4#include <linux/semaphore.h> 5#include <linux/list.h> 6 7struct message { 8 void *buf; 9 u32 len; 10 struct list_head list; 11}; 12 13struct message_queue { 14 struct semaphore sem; 15 spinlock_t lock; 16 bool exiting; 17 u32 recv_count; 18 struct list_head msg_list; 19}; 20 21int wilc_mq_create(struct message_queue *mq); 22int wilc_mq_send(struct message_queue *mq, 23 const void *send_buf, u32 send_buf_size); 24int wilc_mq_recv(struct message_queue *mq, 25 void *recv_buf, u32 recv_buf_size, u32 *recv_len); 26int wilc_mq_destroy(struct message_queue *mq); 27 28#endif 29