Skip to content

Commit 25af01e

Browse files
Clément PerrochaudSamuel Ortiz
authored andcommitted
NFC: nci: Add firmware download support
A simple forward for firmware download (i.e. sending a new firmware to the NFC adapter) from the NFC subsystem to the drivers. This feature is required to update the firmware of NXP-NCI NFC controllers but can be used by any NCI driver. This feature has been present in the HCI subsystem since 9a695d. Signed-off-by: Clément Perrochaud <clement.perrochaud@effinnov.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
1 parent 5a352dd commit 25af01e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

include/net/nfc/nci_core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ struct nci_ops {
7171
int (*close)(struct nci_dev *ndev);
7272
int (*send)(struct nci_dev *ndev, struct sk_buff *skb);
7373
int (*setup)(struct nci_dev *ndev);
74+
int (*fw_download)(struct nci_dev *ndev, const char *firmware_name);
7475
__u32 (*get_rfprotocol)(struct nci_dev *ndev, __u8 rf_protocol);
7576
int (*discover_se)(struct nci_dev *ndev);
7677
int (*disable_se)(struct nci_dev *ndev, u32 se_idx);

net/nfc/nci/core.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,16 @@ static int nci_se_io(struct nfc_dev *nfc_dev, u32 se_idx,
907907
return 0;
908908
}
909909

910+
static int nci_fw_download(struct nfc_dev *nfc_dev, const char *firmware_name)
911+
{
912+
struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
913+
914+
if (!ndev->ops->fw_download)
915+
return -ENOTSUPP;
916+
917+
return ndev->ops->fw_download(ndev, firmware_name);
918+
}
919+
910920
static struct nfc_ops nci_nfc_ops = {
911921
.dev_up = nci_dev_up,
912922
.dev_down = nci_dev_down,
@@ -922,6 +932,7 @@ static struct nfc_ops nci_nfc_ops = {
922932
.disable_se = nci_disable_se,
923933
.discover_se = nci_discover_se,
924934
.se_io = nci_se_io,
935+
.fw_download = nci_fw_download,
925936
};
926937

927938
/* ---- Interface to NCI drivers ---- */

0 commit comments

Comments
 (0)