aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc
diff options
context:
space:
mode:
authorEric Lapuyade <eric.lapuyade@linux.intel.com>2013-07-19 08:57:55 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2013-08-13 19:12:58 -0400
commit352a5f5fb3ad8f829cfd4248fe6119895bda881f (patch)
tree48cb511da5f44e083d2773ce1b1d62100c01cf49 /net/nfc
parenteab10b71a7d62d7cc6db631dba448f1d84df9b53 (diff)
NFC: netlink: Add result of firmware operation to completion event
Result is added as an NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS attribute containing the standard errno positive value of the completion result. This event will be sent when the firmare download operation is done and will contain the operation result. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/core.c12
-rw-r--r--net/nfc/netlink.c4
-rw-r--r--net/nfc/nfc.h3
3 files changed, 15 insertions, 4 deletions
diff --git a/net/nfc/core.c b/net/nfc/core.c
index aad7f8f59784..d252912b8deb 100644
--- a/net/nfc/core.c
+++ b/net/nfc/core.c
@@ -77,11 +77,19 @@ error:
77 return rc; 77 return rc;
78} 78}
79 79
80int nfc_fw_download_done(struct nfc_dev *dev, const char *firmware_name) 80/**
81 * nfc_fw_download_done - inform that a firmware download was completed
82 *
83 * @dev: The nfc device to which firmware was downloaded
84 * @firmware_name: The firmware filename
85 * @result: The positive value of a standard errno value
86 */
87int nfc_fw_download_done(struct nfc_dev *dev, const char *firmware_name,
88 u32 result)
81{ 89{
82 dev->fw_download_in_progress = false; 90 dev->fw_download_in_progress = false;
83 91
84 return nfc_genl_fw_download_done(dev, firmware_name); 92 return nfc_genl_fw_download_done(dev, firmware_name, result);
85} 93}
86EXPORT_SYMBOL(nfc_fw_download_done); 94EXPORT_SYMBOL(nfc_fw_download_done);
87 95
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index 3b08ef90e045..68063b2025da 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -1114,7 +1114,8 @@ static int nfc_genl_fw_download(struct sk_buff *skb, struct genl_info *info)
1114 return rc; 1114 return rc;
1115} 1115}
1116 1116
1117int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name) 1117int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name,
1118 u32 result)
1118{ 1119{
1119 struct sk_buff *msg; 1120 struct sk_buff *msg;
1120 void *hdr; 1121 void *hdr;
@@ -1129,6 +1130,7 @@ int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name)
1129 goto free_msg; 1130 goto free_msg;
1130 1131
1131 if (nla_put_string(msg, NFC_ATTR_FIRMWARE_NAME, firmware_name) || 1132 if (nla_put_string(msg, NFC_ATTR_FIRMWARE_NAME, firmware_name) ||
1133 nla_put_u32(msg, NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS, result) ||
1132 nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) 1134 nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx))
1133 goto nla_put_failure; 1135 goto nla_put_failure;
1134 1136
diff --git a/net/nfc/nfc.h b/net/nfc/nfc.h
index 4e2e5a787c4a..aaf606fc1faa 100644
--- a/net/nfc/nfc.h
+++ b/net/nfc/nfc.h
@@ -124,7 +124,8 @@ static inline void nfc_device_iter_exit(struct class_dev_iter *iter)
124} 124}
125 125
126int nfc_fw_download(struct nfc_dev *dev, const char *firmware_name); 126int nfc_fw_download(struct nfc_dev *dev, const char *firmware_name);
127int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name); 127int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name,
128 u32 result);
128 129
129int nfc_dev_up(struct nfc_dev *dev); 130int nfc_dev_up(struct nfc_dev *dev);
130 131