Skip to content

NFC: NCI protocol implementation

[email protected] linux-wireless 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest4 patches 0 repliesNew

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4NFC: Add dev_up and dev_down control operationsdrivers/nfc/pn533.c include/linux/nfc.h include/net/nfc.h +3 more+149 -00 replies
2/4NFC: move nfc.h from include/net to include/net/nfcMAINTAINERS drivers/nfc/pn533.c include/net/nfc/nfc.h +1 more+3 -30 replies
3/4NFC: basic NCI protocol implementationinclude/net/nfc/nci.h include/net/nfc/nci_core.h net/nfc/Kconfig +8 more+2129 -00 replies
4/4NFC: driver for TI shared transportdrivers/nfc/Kconfig drivers/nfc/Makefile drivers/nfc/nfcwilink.c+354 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4 RESEND] NFC: NCI protocol implementation

This series of patches is a RESEND via a different mailer.

This series of patches implements the first part of the NFC Controller Interface protocol.

The NCI is a standard communication protocol between an NFC Controller (NFCC) and a Device Host (DH), defined by the NFC Forum.

The NCI protocol implementation is chip independent and responsible for:
- Reset, initialization and configuration of the NFC controller
- Sending commands/data to the NFC controller
- Receiving responses/notifications/data from the NFC controller
- Flow control for Control and Data Messages
- Segmentation and reassembly for Control and Data Messages
- An addressing scheme for NFC Execution Environments (NFCEE), e.g. secure element
- An addressing scheme for Remote NFC Endpoints (NFCEE or RF targets) (via logical connections)

The NCI protocol is added to the NFC subsystem below the NFC core:

+--------------------------------------+
|              USER SPACE              |
+--------------------------------------+
     ^                        ^
     | low-level              | control
     | data exchange          | operations
     |                        |
     |                        v
     |                  +-----------+
     | AF_NFC           |  netlink  |
     | socket           +-----------+
     | raw                    ^
     |                        |
     v                        v
+---------+             +-----------+
| rawsock | <---------> | NFC core  |
+---------+             +-----------+
                              ^
                              |
                              v
                        +-----------+
                        | NCI core  |
                        +-----------+
                              ^
                              |
                              v
                        +-----------+
                        |  driver   |
                        +-----------+

The driver will register itself to the NCI core, and in turn the NCI core will register itself to the NFC core.

Two new control operations were added (via generic netlink):
- Dev_up, which turn on the NFC controller (this operation may take a few seconds, as it can download new FW to the NFC controller)
- Dev_down, which turn off the NFC controller

The nfc.h file was moved from include/net to include/net/nfc, since 2 new header files were added to the new include/net/nfc folder.

To test the implementation, we developed the NFC TI Shared Transport driver and tested it with the user application example (provided by Lauro/Aloisio). The driver implementation is included in this patch series.

Ilan Elias (4):
NFC: Add dev_up and dev_down control operations
NFC: move nfc.h from include/net to include/net/nfc
NFC: basic NCI protocol implementation
NFC: driver for TI shared transport

 MAINTAINERS                 |    2 +-
 drivers/nfc/Kconfig         |   11 +
 drivers/nfc/Makefile        |    1 +
 drivers/nfc/nfcwilink.c     |  342 +++++++++++++++++++
 drivers/nfc/pn533.c         |    4 +-
 include/linux/nfc.h         |    6 +
 include/net/nfc/nci.h       |  313 +++++++++++++++++
 include/net/nfc/nci_core.h  |  183 ++++++++++
 include/net/{ => nfc}/nfc.h |    4 +
 net/nfc/Kconfig             |    2 +
 net/nfc/Makefile            |    1 +
 net/nfc/core.c              |   77 +++++
 net/nfc/nci/Kconfig         |   10 +
 net/nfc/nci/Makefile        |    7 +
 net/nfc/nci/core.c          |  790 +++++++++++++++++++++++++++++++++++++++++++
 net/nfc/nci/data.c          |  245 +++++++++++++
 net/nfc/nci/lib.c           |   94 +++++
 net/nfc/nci/ntf.c           |  258 ++++++++++++++
 net/nfc/nci/rsp.c           |  226 ++++++++++++
 net/nfc/netlink.c           |   56 +++
 net/nfc/nfc.h               |    6 +-
 21 files changed, 2635 insertions(+), 3 deletions(-)
 create mode 100644 drivers/nfc/nfcwilink.c
 create mode 100644 include/net/nfc/nci.h
 create mode 100644 include/net/nfc/nci_core.h
 rename include/net/{ => nfc}/nfc.h (97%)
 create mode 100644 net/nfc/nci/Kconfig
 create mode 100644 net/nfc/nci/Makefile
 create mode 100644 net/nfc/nci/core.c
 create mode 100644 net/nfc/nci/data.c
 create mode 100644 net/nfc/nci/lib.c
 create mode 100644 net/nfc/nci/ntf.c
 create mode 100644 net/nfc/nci/rsp.c