summaryrefslogtreecommitdiffstats
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)
downloadlinux-59ef43e681d103a51c3727dad0315e093f07ec61.tar.bz2
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:
return -EMSGSIZE;
}
+int nfc_genl_target_lost(struct nfc_dev *dev, u32 target_idx)
+{
+ struct sk_buff *msg;
+ void *hdr;
+
+ msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
+ if (!msg)
+ return -ENOMEM;
+
+ hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0,
+ NFC_EVENT_TARGET_LOST);
+ if (!hdr)
+ goto free_msg;
+
+ if (nla_put_string(msg, NFC_ATTR_DEVICE_NAME, nfc_device_name(dev)) ||
+ nla_put_u32(msg, NFC_ATTR_TARGET_INDEX, target_idx))
+ goto nla_put_failure;
+
+ genlmsg_end(msg, hdr);
+
+ genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_KERNEL);
+
+ return 0;
+
+nla_put_failure:
+ genlmsg_cancel(msg, hdr);
+free_msg:
+ nlmsg_free(msg);
+ return -EMSGSIZE;
+}
+
int nfc_genl_device_added(struct nfc_dev *dev)
{
struct sk_buff *msg;