From 66ac53a8c5c8693741ea9e6682763f6ccb43db23 Mon Sep 17 00:00:00 2001 From: Robert Schwebel Date: Fri, 22 Nov 2019 08:43:02 +0100 Subject: [PATCH 1/5] docs: networking: nfc: change headlines to sphinx syntax The headlines in this file do are not in the standard kernel docu- mentation headline format. Change it, so this file can be switched to rst in the future. Signed-off-by: Robert Schwebel Signed-off-by: Jakub Kicinski --- Documentation/networking/nfc.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/networking/nfc.txt b/Documentation/networking/nfc.txt index b24c29bdae275..c053610bfadcf 100644 --- a/Documentation/networking/nfc.txt +++ b/Documentation/networking/nfc.txt @@ -1,3 +1,4 @@ +=================== Linux NFC subsystem =================== @@ -8,7 +9,7 @@ This document covers the architecture overview, the device driver interface description and the userspace interface description. Architecture overview ---------------------- +===================== The NFC subsystem is responsible for: - NFC adapters management; @@ -51,7 +52,7 @@ PF_NFC. The NFC_SOCKPROTO_RAW performs raw communication with NFC targets. +-----------+ Device Driver Interface ------------------------ +======================= When registering on the NFC subsystem, the device driver must inform the core of the set of supported NFC protocols and the set of ops callbacks. The ops @@ -64,7 +65,7 @@ callbacks that must be implemented are the following: * data_exchange - send data and receive the response (transceive operation) Userspace interface --------------------- +=================== The userspace interface is divided in control operations and low-level data exchange operation. From c0b96e8f9f84165c294b486712aa6303391692a0 Mon Sep 17 00:00:00 2001 From: Robert Schwebel Date: Fri, 22 Nov 2019 08:43:03 +0100 Subject: [PATCH 2/5] docs: networking: nfc: change block diagram to sphinx syntax Change the block diagram to match the sphinx syntax. This will make it possible to switch this file to rst in the future. Signed-off-by: Robert Schwebel Signed-off-by: Jakub Kicinski --- Documentation/networking/nfc.txt | 49 ++++++++++++++++---------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/Documentation/networking/nfc.txt b/Documentation/networking/nfc.txt index c053610bfadcf..b6056e597e201 100644 --- a/Documentation/networking/nfc.txt +++ b/Documentation/networking/nfc.txt @@ -26,30 +26,31 @@ The control operations are available to userspace via generic netlink. The low-level data exchange interface is provided by the new socket family PF_NFC. The NFC_SOCKPROTO_RAW performs raw communication with NFC targets. - - +--------------------------------------+ - | USER SPACE | - +--------------------------------------+ - ^ ^ - | low-level | control - | data exchange | operations - | | - | v - | +-----------+ - | AF_NFC | netlink | - | socket +-----------+ - | raw ^ - | | - v v - +---------+ +-----------+ - | rawsock | <--------> | core | - +---------+ +-----------+ - ^ - | - v - +-----------+ - | driver | - +-----------+ +.. code-block:: none + + +--------------------------------------+ + | USER SPACE | + +--------------------------------------+ + ^ ^ + | low-level | control + | data exchange | operations + | | + | v + | +-----------+ + | AF_NFC | netlink | + | socket +-----------+ + | raw ^ + | | + v v + +---------+ +-----------+ + | rawsock | <--------> | core | + +---------+ +-----------+ + ^ + | + v + +-----------+ + | driver | + +-----------+ Device Driver Interface ======================= From f67b7c087404d6a7f2abf7657d4ba3a0b9fdfcfa Mon Sep 17 00:00:00 2001 From: Robert Schwebel Date: Fri, 22 Nov 2019 08:43:04 +0100 Subject: [PATCH 3/5] docs: networking: nfc: fix bullet list syntax Fix this warning: Documentation/networking/nfc.rst:87: WARNING: Bullet list ends without a blank line; unexpected unindent. Signed-off-by: Robert Schwebel Signed-off-by: Jakub Kicinski --- Documentation/networking/nfc.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/networking/nfc.txt b/Documentation/networking/nfc.txt index b6056e597e201..af69b3a90eaa6 100644 --- a/Documentation/networking/nfc.txt +++ b/Documentation/networking/nfc.txt @@ -84,7 +84,7 @@ The operations are composed by commands and events, all listed below: * NFC_EVENT_DEVICE_ADDED - reports an NFC device addition * NFC_EVENT_DEVICE_REMOVED - reports an NFC device removal * NFC_EVENT_TARGETS_FOUND - reports START_POLL results when 1 or more targets -are found + are found The user must call START_POLL to poll for NFC targets, passing the desired NFC protocols through NFC_ATTR_PROTOCOLS attribute. The device remains in polling From bf0b2511e8d7d2f08b784469a4c1d84557305d3c Mon Sep 17 00:00:00 2001 From: Robert Schwebel Date: Fri, 22 Nov 2019 08:43:05 +0100 Subject: [PATCH 4/5] docs: networking: nfc: fix code block syntax Silence this warning: Documentation/networking/nfc.rst:113: WARNING: Definition list ends without a blank line; unexpected unindent. Signed-off-by: Robert Schwebel Signed-off-by: Jakub Kicinski --- Documentation/networking/nfc.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Documentation/networking/nfc.txt b/Documentation/networking/nfc.txt index af69b3a90eaa6..9aab3a88c9b29 100644 --- a/Documentation/networking/nfc.txt +++ b/Documentation/networking/nfc.txt @@ -103,14 +103,14 @@ it's closed. LOW-LEVEL DATA EXCHANGE: The userspace must use PF_NFC sockets to perform any data communication with -targets. All NFC sockets use AF_NFC: - -struct sockaddr_nfc { - sa_family_t sa_family; - __u32 dev_idx; - __u32 target_idx; - __u32 nfc_protocol; -}; +targets. All NFC sockets use AF_NFC:: + + struct sockaddr_nfc { + sa_family_t sa_family; + __u32 dev_idx; + __u32 target_idx; + __u32 nfc_protocol; + }; To establish a connection with one target, the user must create an NFC_SOCKPROTO_RAW socket and call the 'connect' syscall with the sockaddr_nfc From 4791d77a08ccd33c989daf31bf948bbbaf673460 Mon Sep 17 00:00:00 2001 From: Robert Schwebel Date: Fri, 22 Nov 2019 08:43:06 +0100 Subject: [PATCH 5/5] docs: networking: nfc: change to rst format Now that the sphinx syntax has been fixed, change the document from txt to rst and add it to the index. Signed-off-by: Robert Schwebel Signed-off-by: Jakub Kicinski --- Documentation/networking/index.rst | 1 + Documentation/networking/{nfc.txt => nfc.rst} | 0 2 files changed, 1 insertion(+) rename Documentation/networking/{nfc.txt => nfc.rst} (100%) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index d4dca42910d09..5acab1290e034 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -33,6 +33,7 @@ Contents: scaling tls tls-offload + nfc .. only:: subproject and html diff --git a/Documentation/networking/nfc.txt b/Documentation/networking/nfc.rst similarity index 100% rename from Documentation/networking/nfc.txt rename to Documentation/networking/nfc.rst