NFC: nci: Add post_setup handler
authorRobert Baldyga <r.baldyga@samsung.com>
Thu, 20 Aug 2015 15:26:00 +0000 (17:26 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 20 Aug 2015 19:22:34 +0000 (21:22 +0200)
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 <r.baldyga@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
include/net/nfc/nci_core.h
net/nfc/nci/core.c

index 01fc8c53111564891a186f817d710f4e6c68b80a..1bdaa5f511078460e8af14715d1307ecde80d674 100644 (file)
@@ -79,6 +79,7 @@ struct nci_ops {
        int   (*close)(struct nci_dev *ndev);
        int   (*send)(struct nci_dev *ndev, struct sk_buff *skb);
        int   (*setup)(struct nci_dev *ndev);
+       int   (*post_setup)(struct nci_dev *ndev);
        int   (*fw_download)(struct nci_dev *ndev, const char *firmware_name);
        __u32 (*get_rfprotocol)(struct nci_dev *ndev, __u8 rf_protocol);
        int   (*discover_se)(struct nci_dev *ndev);
index 95af2d24d5be7b351c097caa9cd1aead2bee2139..d9045ec172e3c59f17fca591095dcbe5aaf8fb40 100644 (file)
@@ -388,6 +388,10 @@ static int nci_open_device(struct nci_dev *ndev)
                                   msecs_to_jiffies(NCI_INIT_TIMEOUT));
        }
 
+       if (ndev->ops->post_setup) {
+               rc = ndev->ops->post_setup(ndev);
+       }
+
        if (!rc) {
                rc = __nci_request(ndev, nci_init_complete_req, 0,
                                   msecs_to_jiffies(NCI_INIT_TIMEOUT));