This source file includes following definitions.
- rpmsg_chrdev_register_device
1
2
3
4
5
6
7
8
9
10
11
12 #ifndef __RPMSG_INTERNAL_H__
13 #define __RPMSG_INTERNAL_H__
14
15 #include <linux/rpmsg.h>
16 #include <linux/poll.h>
17
18 #define to_rpmsg_device(d) container_of(d, struct rpmsg_device, dev)
19 #define to_rpmsg_driver(d) container_of(d, struct rpmsg_driver, drv)
20
21
22
23
24
25
26
27
28
29
30
31 struct rpmsg_device_ops {
32 struct rpmsg_endpoint *(*create_ept)(struct rpmsg_device *rpdev,
33 rpmsg_rx_cb_t cb, void *priv,
34 struct rpmsg_channel_info chinfo);
35
36 int (*announce_create)(struct rpmsg_device *ept);
37 int (*announce_destroy)(struct rpmsg_device *ept);
38 };
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 struct rpmsg_endpoint_ops {
56 void (*destroy_ept)(struct rpmsg_endpoint *ept);
57
58 int (*send)(struct rpmsg_endpoint *ept, void *data, int len);
59 int (*sendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);
60 int (*send_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst,
61 void *data, int len);
62
63 int (*trysend)(struct rpmsg_endpoint *ept, void *data, int len);
64 int (*trysendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);
65 int (*trysend_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst,
66 void *data, int len);
67 __poll_t (*poll)(struct rpmsg_endpoint *ept, struct file *filp,
68 poll_table *wait);
69 };
70
71 int rpmsg_register_device(struct rpmsg_device *rpdev);
72 int rpmsg_unregister_device(struct device *parent,
73 struct rpmsg_channel_info *chinfo);
74
75 struct device *rpmsg_find_device(struct device *parent,
76 struct rpmsg_channel_info *chinfo);
77
78
79
80
81
82
83
84
85 static inline int rpmsg_chrdev_register_device(struct rpmsg_device *rpdev)
86 {
87 strcpy(rpdev->id.name, "rpmsg_chrdev");
88 rpdev->driver_override = "rpmsg_chrdev";
89
90 return rpmsg_register_device(rpdev);
91 }
92
93 #endif