aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc/netlink.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-04-18 14:17:13 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-18 14:27:48 -0400
commit59ef43e681d103a51c3727dad0315e093f07ec61 (patch)
tree87f6320f1440ce3ce6c0c15ad3cef8bc98186f88 /net/nfc/netlink.c
parent91fbe33034c184c6a60e31c2207a2f7ec2f180dc (diff)
parentb5abcf0219263f4e961dca71cbe26e06c5b0ee68 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts: drivers/net/wireless/iwlwifi/iwl-testmode.c include/net/nfc/nfc.h net/nfc/netlink.c net/wireless/nl80211.c
Diffstat (limited to 'net/nfc/netlink.c')
-rw-r--r--net/nfc/netlink.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index 8937664674fa..f1829f6ae9c5 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -188,6 +188,37 @@ free_msg:
188 return -EMSGSIZE; 188 return -EMSGSIZE;
189} 189}
190 190
191int nfc_genl_target_lost(struct nfc_dev *dev, u32 target_idx)
192{
193 struct sk_buff *msg;
194 void *hdr;
195
196 msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
197 if (!msg)
198 return -ENOMEM;
199
200 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0,
201 NFC_EVENT_TARGET_LOST);
202 if (!hdr)
203 goto free_msg;
204
205 if (nla_put_string(msg, NFC_ATTR_DEVICE_NAME, nfc_device_name(dev)) ||
206 nla_put_u32(msg, NFC_ATTR_TARGET_INDEX, target_idx))
207 goto nla_put_failure;
208
209 genlmsg_end(msg, hdr);
210
211 genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_KERNEL);
212
213 return 0;
214
215nla_put_failure:
216 genlmsg_cancel(msg, hdr);
217free_msg:
218 nlmsg_free(msg);
219 return -EMSGSIZE;
220}
221
191int nfc_genl_device_added(struct nfc_dev *dev) 222int nfc_genl_device_added(struct nfc_dev *dev)
192{ 223{
193 struct sk_buff *msg; 224 struct sk_buff *msg;