aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/connector.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/connector.h')
-rw-r--r--include/linux/connector.h63
1 files changed, 62 insertions, 1 deletions
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 1d72ef76f24f..6b6c7396a584 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -55,10 +55,71 @@ struct cn_dev {
55 struct cn_queue_dev *cbdev; 55 struct cn_queue_dev *cbdev;
56}; 56};
57 57
58/**
59 * cn_add_callback() - Registers new callback with connector core.
60 *
61 * @id: unique connector's user identifier.
62 * It must be registered in connector.h for legal
63 * in-kernel users.
64 * @name: connector's callback symbolic name.
65 * @callback: connector's callback.
66 * parameters are %cn_msg and the sender's credentials
67 */
58int cn_add_callback(struct cb_id *id, const char *name, 68int cn_add_callback(struct cb_id *id, const char *name,
59 void (*callback)(struct cn_msg *, struct netlink_skb_parms *)); 69 void (*callback)(struct cn_msg *, struct netlink_skb_parms *));
60void cn_del_callback(struct cb_id *); 70/**
71 * cn_del_callback() - Unregisters new callback with connector core.
72 *
73 * @id: unique connector's user identifier.
74 */
75void cn_del_callback(struct cb_id *id);
76
77
78/**
79 * cn_netlink_send_mult - Sends message to the specified groups.
80 *
81 * @msg: message header(with attached data).
82 * @len: Number of @msg to be sent.
83 * @portid: destination port.
84 * If non-zero the message will be sent to the given port,
85 * which should be set to the original sender.
86 * @group: destination group.
87 * If @portid and @group is zero, then appropriate group will
88 * be searched through all registered connector users, and
89 * message will be delivered to the group which was created
90 * for user with the same ID as in @msg.
91 * If @group is not zero, then message will be delivered
92 * to the specified group.
93 * @gfp_mask: GFP mask.
94 *
95 * It can be safely called from softirq context, but may silently
96 * fail under strong memory pressure.
97 *
98 * If there are no listeners for given group %-ESRCH can be returned.
99 */
61int cn_netlink_send_mult(struct cn_msg *msg, u16 len, u32 portid, u32 group, gfp_t gfp_mask); 100int cn_netlink_send_mult(struct cn_msg *msg, u16 len, u32 portid, u32 group, gfp_t gfp_mask);
101
102/**
103 * cn_netlink_send_mult - Sends message to the specified groups.
104 *
105 * @msg: message header(with attached data).
106 * @portid: destination port.
107 * If non-zero the message will be sent to the given port,
108 * which should be set to the original sender.
109 * @group: destination group.
110 * If @portid and @group is zero, then appropriate group will
111 * be searched through all registered connector users, and
112 * message will be delivered to the group which was created
113 * for user with the same ID as in @msg.
114 * If @group is not zero, then message will be delivered
115 * to the specified group.
116 * @gfp_mask: GFP mask.
117 *
118 * It can be safely called from softirq context, but may silently
119 * fail under strong memory pressure.
120 *
121 * If there are no listeners for given group %-ESRCH can be returned.
122 */
62int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 group, gfp_t gfp_mask); 123int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 group, gfp_t gfp_mask);
63 124
64int cn_queue_add_callback(struct cn_queue_dev *dev, const char *name, 125int cn_queue_add_callback(struct cn_queue_dev *dev, const char *name,