2015-05-11 07:30:56 +02:00
|
|
|
#ifndef __WILC_MSG_QUEUE_H__
|
|
|
|
#define __WILC_MSG_QUEUE_H__
|
|
|
|
|
2015-09-23 11:03:46 +02:00
|
|
|
#include <linux/semaphore.h>
|
2016-01-29 15:51:32 +01:00
|
|
|
#include <linux/list.h>
|
2015-06-16 08:28:21 +02:00
|
|
|
|
2016-01-21 12:30:31 +01:00
|
|
|
struct message {
|
2016-01-21 12:30:32 +01:00
|
|
|
void *buf;
|
2016-01-21 12:30:33 +01:00
|
|
|
u32 len;
|
2016-01-29 15:51:32 +01:00
|
|
|
struct list_head list;
|
2016-01-21 12:30:31 +01:00
|
|
|
};
|
2015-09-23 11:03:45 +02:00
|
|
|
|
2016-01-21 12:30:35 +01:00
|
|
|
struct message_queue {
|
2016-01-21 12:30:36 +01:00
|
|
|
struct semaphore sem;
|
2016-01-21 12:30:37 +01:00
|
|
|
spinlock_t lock;
|
2016-01-21 12:30:38 +01:00
|
|
|
bool exiting;
|
2016-01-21 12:30:39 +01:00
|
|
|
u32 recv_count;
|
2016-01-29 15:51:32 +01:00
|
|
|
struct list_head msg_list;
|
2016-01-21 12:30:35 +01:00
|
|
|
};
|
2015-09-23 11:03:45 +02:00
|
|
|
|
2016-01-21 12:30:41 +01:00
|
|
|
int wilc_mq_create(struct message_queue *mq);
|
2016-01-21 12:30:44 +01:00
|
|
|
int wilc_mq_send(struct message_queue *mq,
|
2016-01-21 12:30:46 +01:00
|
|
|
const void *send_buf, u32 send_buf_size);
|
2016-01-21 12:30:50 +01:00
|
|
|
int wilc_mq_recv(struct message_queue *mq,
|
2016-01-21 12:30:53 +01:00
|
|
|
void *recv_buf, u32 recv_buf_size, u32 *recv_len);
|
2016-01-21 12:30:42 +01:00
|
|
|
int wilc_mq_destroy(struct message_queue *mq);
|
2015-05-11 07:30:56 +02:00
|
|
|
|
|
|
|
#endif
|