1
2
3
4
5
6
7 #ifndef __MAILBOX_CLIENT_H
8 #define __MAILBOX_CLIENT_H
9
10 #include <linux/of.h>
11 #include <linux/device.h>
12
13 struct mbox_chan;
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 struct mbox_client {
30 struct device *dev;
31 bool tx_block;
32 unsigned long tx_tout;
33 bool knows_txdone;
34
35 void (*rx_callback)(struct mbox_client *cl, void *mssg);
36 void (*tx_prepare)(struct mbox_client *cl, void *mssg);
37 void (*tx_done)(struct mbox_client *cl, void *mssg, int r);
38 };
39
40 struct mbox_chan *mbox_request_channel_byname(struct mbox_client *cl,
41 const char *name);
42 struct mbox_chan *mbox_request_channel(struct mbox_client *cl, int index);
43 int mbox_send_message(struct mbox_chan *chan, void *mssg);
44 int mbox_flush(struct mbox_chan *chan, unsigned long timeout);
45 void mbox_client_txdone(struct mbox_chan *chan, int r);
46 bool mbox_client_peek_data(struct mbox_chan *chan);
47 void mbox_free_channel(struct mbox_chan *chan);
48
49 #endif