summaryrefslogtreecommitdiffstats
path: root/drivers/connector
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-03 11:06:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-03 11:06:56 -0400
commit4046136afbd1038d776bad9c59e1e4cca78186fb (patch)
tree1888ca7bd978c0bba891ac9ee51224fd06d1162e /drivers/connector
parentb55a0ff8df92646696c858a8fea4dbf38509f202 (diff)
parenta100d88df1e924e5c9678fabf054d1bae7ab74fb (diff)
Merge tag 'char-misc-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc into next
Pull char/misc driver patches from Greg KH: "Here is the big char / misc driver update for 3.16-rc1. Lots of different driver updates for a variety of different drivers and minor driver subsystems. All have been in linux-next with no reported issues" * tag 'char-misc-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (79 commits) hv: use correct order when freeing monitor_pages spmi: of: fixup generic SPMI devicetree binding example applicom: dereferencing NULL on error path misc: genwqe: fix uninitialized return value in genwqe_free_sync_sgl() miscdevice.h: Simple syntax fix to make pointers consistent. MAINTAINERS: Add miscdevice.h to file list for char/misc drivers. mcb: Add support for shared PCI IRQs drivers: Remove duplicate conditionally included subdirs misc: atmel_pwm: only build for supported platforms mei: me: move probe quirk to cfg structure mei: add per device configuration mei: me: read H_CSR after asserting reset mei: me: drop harmful wait optimization mei: me: fix hw ready reset flow mei: fix memory leak of mei_clients array uio: fix vma io range check in mmap drivers: uio_dmem_genirq: Fix memory leak in uio_dmem_genirq_probe() w1: do not unlock unheld list_mutex in __w1_remove_master_device() w1: optional bundling of netlink kernel replies connector: allow multiple messages to be sent in one packet ...
Diffstat (limited to 'drivers/connector')
-rw-r--r--drivers/connector/connector.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index b14f1d36f897..f612d68629dc 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -43,6 +43,8 @@ static struct cn_dev cdev;
43static int cn_already_initialized; 43static int cn_already_initialized;
44 44
45/* 45/*
46 * Sends mult (multiple) cn_msg at a time.
47 *
46 * msg->seq and msg->ack are used to determine message genealogy. 48 * msg->seq and msg->ack are used to determine message genealogy.
47 * When someone sends message it puts there locally unique sequence 49 * When someone sends message it puts there locally unique sequence
48 * and random acknowledge numbers. Sequence number may be copied into 50 * and random acknowledge numbers. Sequence number may be copied into
@@ -62,10 +64,13 @@ static int cn_already_initialized;
62 * the acknowledgement number in the original message + 1, then it is 64 * the acknowledgement number in the original message + 1, then it is
63 * a new message. 65 * a new message.
64 * 66 *
67 * If msg->len != len, then additional cn_msg messages are expected following
68 * the first msg.
69 *
65 * The message is sent to, the portid if given, the group if given, both if 70 * The message is sent to, the portid if given, the group if given, both if
66 * both, or if both are zero then the group is looked up and sent there. 71 * both, or if both are zero then the group is looked up and sent there.
67 */ 72 */
68int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __group, 73int cn_netlink_send_mult(struct cn_msg *msg, u16 len, u32 portid, u32 __group,
69 gfp_t gfp_mask) 74 gfp_t gfp_mask)
70{ 75{
71 struct cn_callback_entry *__cbq; 76 struct cn_callback_entry *__cbq;
@@ -98,7 +103,7 @@ int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __group,
98 if (!portid && !netlink_has_listeners(dev->nls, group)) 103 if (!portid && !netlink_has_listeners(dev->nls, group))
99 return -ESRCH; 104 return -ESRCH;
100 105
101 size = sizeof(*msg) + msg->len; 106 size = sizeof(*msg) + len;
102 107
103 skb = nlmsg_new(size, gfp_mask); 108 skb = nlmsg_new(size, gfp_mask);
104 if (!skb) 109 if (!skb)
@@ -121,6 +126,14 @@ int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __group,
121 gfp_mask); 126 gfp_mask);
122 return netlink_unicast(dev->nls, skb, portid, !(gfp_mask&__GFP_WAIT)); 127 return netlink_unicast(dev->nls, skb, portid, !(gfp_mask&__GFP_WAIT));
123} 128}
129EXPORT_SYMBOL_GPL(cn_netlink_send_mult);
130
131/* same as cn_netlink_send_mult except msg->len is used for len */
132int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __group,
133 gfp_t gfp_mask)
134{
135 return cn_netlink_send_mult(msg, msg->len, portid, __group, gfp_mask);
136}
124EXPORT_SYMBOL_GPL(cn_netlink_send); 137EXPORT_SYMBOL_GPL(cn_netlink_send);
125 138
126/* 139/*