Skip to content

Commit 72a2707

Browse files
author
Jakub Kicinski
committed
Merge branch 'nfc-convert-from-txt-to-rst'
Robert Schwebel says: ==================== here is v2 of the series converting the NFC documentation from txt to rst. Thanks to Jonathan and Dave for the input. Changes since (implicit) v1: * replace code-block by more compact :: syntax * really add the rst file to the index ==================== Signed-off-by: Jakub Kicinski <[email protected]>
2 parents a5d66f8 + 4791d77 commit 72a2707

File tree

2 files changed

+39
-36
lines changed

2 files changed

+39
-36
lines changed

Documentation/networking/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Contents:
3333
scaling
3434
tls
3535
tls-offload
36+
nfc
3637

3738
.. only:: subproject and html
3839

Documentation/networking/nfc.txt renamed to Documentation/networking/nfc.rst

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
===================
12
Linux NFC subsystem
23
===================
34

@@ -8,7 +9,7 @@ This document covers the architecture overview, the device driver interface
89
description and the userspace interface description.
910

1011
Architecture overview
11-
---------------------
12+
=====================
1213

1314
The NFC subsystem is responsible for:
1415
- NFC adapters management;
@@ -25,33 +26,34 @@ The control operations are available to userspace via generic netlink.
2526
The low-level data exchange interface is provided by the new socket family
2627
PF_NFC. The NFC_SOCKPROTO_RAW performs raw communication with NFC targets.
2728

28-
29-
+--------------------------------------+
30-
| USER SPACE |
31-
+--------------------------------------+
32-
^ ^
33-
| low-level | control
34-
| data exchange | operations
35-
| |
36-
| v
37-
| +-----------+
38-
| AF_NFC | netlink |
39-
| socket +-----------+
40-
| raw ^
41-
| |
42-
v v
43-
+---------+ +-----------+
44-
| rawsock | <--------> | core |
45-
+---------+ +-----------+
46-
^
47-
|
48-
v
49-
+-----------+
50-
| driver |
51-
+-----------+
29+
.. code-block:: none
30+
31+
+--------------------------------------+
32+
| USER SPACE |
33+
+--------------------------------------+
34+
^ ^
35+
| low-level | control
36+
| data exchange | operations
37+
| |
38+
| v
39+
| +-----------+
40+
| AF_NFC | netlink |
41+
| socket +-----------+
42+
| raw ^
43+
| |
44+
v v
45+
+---------+ +-----------+
46+
| rawsock | <--------> | core |
47+
+---------+ +-----------+
48+
^
49+
|
50+
v
51+
+-----------+
52+
| driver |
53+
+-----------+
5254
5355
Device Driver Interface
54-
-----------------------
56+
=======================
5557

5658
When registering on the NFC subsystem, the device driver must inform the core
5759
of the set of supported NFC protocols and the set of ops callbacks. The ops
@@ -64,7 +66,7 @@ callbacks that must be implemented are the following:
6466
* data_exchange - send data and receive the response (transceive operation)
6567

6668
Userspace interface
67-
--------------------
69+
===================
6870

6971
The userspace interface is divided in control operations and low-level data
7072
exchange operation.
@@ -82,7 +84,7 @@ The operations are composed by commands and events, all listed below:
8284
* NFC_EVENT_DEVICE_ADDED - reports an NFC device addition
8385
* NFC_EVENT_DEVICE_REMOVED - reports an NFC device removal
8486
* NFC_EVENT_TARGETS_FOUND - reports START_POLL results when 1 or more targets
85-
are found
87+
are found
8688

8789
The user must call START_POLL to poll for NFC targets, passing the desired NFC
8890
protocols through NFC_ATTR_PROTOCOLS attribute. The device remains in polling
@@ -101,14 +103,14 @@ it's closed.
101103
LOW-LEVEL DATA EXCHANGE:
102104

103105
The userspace must use PF_NFC sockets to perform any data communication with
104-
targets. All NFC sockets use AF_NFC:
105-
106-
struct sockaddr_nfc {
107-
sa_family_t sa_family;
108-
__u32 dev_idx;
109-
__u32 target_idx;
110-
__u32 nfc_protocol;
111-
};
106+
targets. All NFC sockets use AF_NFC::
107+
108+
struct sockaddr_nfc {
109+
sa_family_t sa_family;
110+
__u32 dev_idx;
111+
__u32 target_idx;
112+
__u32 nfc_protocol;
113+
};
112114

113115
To establish a connection with one target, the user must create an
114116
NFC_SOCKPROTO_RAW socket and call the 'connect' syscall with the sockaddr_nfc

0 commit comments

Comments
 (0)