Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1210591

[PATCH v3 1/3] NFC: nci: Add post_setup handler

From Robert Baldyga <r.baldyga@samsung.com>
Newsgroups linux.kernel
Subject [PATCH v3 1/3] NFC: nci: Add post_setup handler
Date 2015-08-20 17:30 +0200
Message-ID <pZzWW-r1-15@gated-at.bofh.it> (permalink)
References <pZzWV-r1-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 include/net/nfc/nci_core.h | 1 +
 net/nfc/nci/core.c         | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
index 01fc8c5..1bdaa5f 100644
--- a/include/net/nfc/nci_core.h
+++ b/include/net/nfc/nci_core.h
@@ -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);
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 95af2d2..d9045ec 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -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));
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/3] nfc: Add driver for Samsung S3FWRN5 NFC Chip Robert Baldyga <r.baldyga@samsung.com> - 2015-08-20 17:30 +0200
  [PATCH v3 1/3] NFC: nci: Add post_setup handler Robert Baldyga <r.baldyga@samsung.com> - 2015-08-20 17:30 +0200
  Re: [PATCH v3 0/3] nfc: Add driver for Samsung S3FWRN5 NFC Chip Samuel Ortiz <sameo@linux.intel.com> - 2015-08-20 22:00 +0200

csiph-web