Skip to content

Commit fdf79bd

Browse files
Robert BaldygaSamuel Ortiz
authored andcommitted
NFC: nci: Add post_setup handler
Some drivers require non-standard configuration after NCI_CORE_INIT request, because they need to know ndev->manufact_specific_info or ndev->manufact_id. This patch adds post_setup handler allowing to do such custom configuration. Signed-off-by: Robert Baldyga <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
1 parent aaee24a commit fdf79bd

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

include/net/nfc/nci_core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ struct nci_ops {
7979
int (*close)(struct nci_dev *ndev);
8080
int (*send)(struct nci_dev *ndev, struct sk_buff *skb);
8181
int (*setup)(struct nci_dev *ndev);
82+
int (*post_setup)(struct nci_dev *ndev);
8283
int (*fw_download)(struct nci_dev *ndev, const char *firmware_name);
8384
__u32 (*get_rfprotocol)(struct nci_dev *ndev, __u8 rf_protocol);
8485
int (*discover_se)(struct nci_dev *ndev);

net/nfc/nci/core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,10 @@ static int nci_open_device(struct nci_dev *ndev)
388388
msecs_to_jiffies(NCI_INIT_TIMEOUT));
389389
}
390390

391+
if (ndev->ops->post_setup) {
392+
rc = ndev->ops->post_setup(ndev);
393+
}
394+
391395
if (!rc) {
392396
rc = __nci_request(ndev, nci_init_complete_req, 0,
393397
msecs_to_jiffies(NCI_INIT_TIMEOUT));

0 commit comments

Comments
 (0)