Skip to content

Commit

Permalink
NFC: HCI: Implement fw_upload ops
Browse files Browse the repository at this point in the history
This is a simple forward to the HCI driver. When driver is done with the
operation, it shall directly notify NFC Core by calling
nfc_fw_upload_done().

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Eric Lapuyade authored and Samuel Ortiz committed Jun 13, 2013
1 parent 9674da8 commit 9a695d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/net/nfc/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ struct nfc_hci_ops {
struct sk_buff *skb);
int (*enable_se)(struct nfc_dev *dev, u32 secure_element);
int (*disable_se)(struct nfc_dev *dev, u32 secure_element);
int (*fw_upload)(struct nfc_hci_dev *hdev, const char *firmware_name);
};

/* Pipes */
Expand Down
11 changes: 11 additions & 0 deletions net/nfc/hci/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,16 @@ static void nfc_hci_recv_from_llc(struct nfc_hci_dev *hdev, struct sk_buff *skb)
}
}

static int hci_fw_upload(struct nfc_dev *nfc_dev, const char *firmware_name)
{
struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev);

if (hdev->ops->fw_upload)
return hdev->ops->fw_upload(hdev, firmware_name);

return -ENOTSUPP;
}

static struct nfc_ops hci_nfc_ops = {
.dev_up = hci_dev_up,
.dev_down = hci_dev_down,
Expand All @@ -791,6 +801,7 @@ static struct nfc_ops hci_nfc_ops = {
.im_transceive = hci_transceive,
.tm_send = hci_tm_send,
.check_presence = hci_check_presence,
.fw_upload = hci_fw_upload,
};

struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops,
Expand Down

0 comments on commit 9a695d2

Please sign in to comment.