22 #include <linux/kernel.h>
23 #include <linux/module.h>
24 #include <linux/list.h>
26 #include <linux/netlink.h>
28 #include <linux/connector.h>
29 #include <linux/slab.h>
43 static int cn_already_initialized;
78 spin_lock_bh(&dev->
cbdev->queue_lock);
87 spin_unlock_bh(&dev->
cbdev->queue_lock);
100 skb = alloc_skb(size, gfp_mask);
104 nlh = nlmsg_put(skb, 0, msg->
seq,
NLMSG_DONE, size -
sizeof(*nlh), 0);
110 data = nlmsg_data(nlh);
112 memcpy(data, msg,
sizeof(*data) + msg->
len);
123 static int cn_call_callback(
struct sk_buff *
skb)
131 spin_lock_bh(&dev->
cbdev->queue_lock);
139 spin_unlock_bh(&dev->
cbdev->queue_lock);
157 static void cn_rx_skb(
struct sk_buff *__skb)
163 skb = skb_get(__skb);
166 nlh = nlmsg_hdr(skb);
175 err = cn_call_callback(skb);
194 if (!cn_already_initialized)
221 static int cn_proc_show(
struct seq_file *
m,
void *
v)
249 .open = cn_proc_open,
277 cn_already_initialized = 1;
288 cn_already_initialized = 0;