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>
This commit is contained in:

committed by
Samuel Ortiz

parent
eab10b71a7
commit
352a5f5fb3
@@ -77,11 +77,19 @@ error:
|
||||
return rc;
|
||||
}
|
||||
|
||||
int nfc_fw_download_done(struct nfc_dev *dev, const char *firmware_name)
|
||||
/**
|
||||
* nfc_fw_download_done - inform that a firmware download was completed
|
||||
*
|
||||
* @dev: The nfc device to which firmware was downloaded
|
||||
* @firmware_name: The firmware filename
|
||||
* @result: The positive value of a standard errno value
|
||||
*/
|
||||
int nfc_fw_download_done(struct nfc_dev *dev, const char *firmware_name,
|
||||
u32 result)
|
||||
{
|
||||
dev->fw_download_in_progress = false;
|
||||
|
||||
return nfc_genl_fw_download_done(dev, firmware_name);
|
||||
return nfc_genl_fw_download_done(dev, firmware_name, result);
|
||||
}
|
||||
EXPORT_SYMBOL(nfc_fw_download_done);
|
||||
|
||||
|
@@ -1114,7 +1114,8 @@ static int nfc_genl_fw_download(struct sk_buff *skb, struct genl_info *info)
|
||||
return rc;
|
||||
}
|
||||
|
||||
int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name)
|
||||
int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name,
|
||||
u32 result)
|
||||
{
|
||||
struct sk_buff *msg;
|
||||
void *hdr;
|
||||
@@ -1129,6 +1130,7 @@ int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name)
|
||||
goto free_msg;
|
||||
|
||||
if (nla_put_string(msg, NFC_ATTR_FIRMWARE_NAME, firmware_name) ||
|
||||
nla_put_u32(msg, NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS, result) ||
|
||||
nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx))
|
||||
goto nla_put_failure;
|
||||
|
||||
|
@@ -124,7 +124,8 @@ static inline void nfc_device_iter_exit(struct class_dev_iter *iter)
|
||||
}
|
||||
|
||||
int nfc_fw_download(struct nfc_dev *dev, const char *firmware_name);
|
||||
int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name);
|
||||
int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name,
|
||||
u32 result);
|
||||
|
||||
int nfc_dev_up(struct nfc_dev *dev);
|
||||
|
||||
|
Reference in New Issue
Block a user