linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] NFC subsystem prototype
@ 2011-04-06 22:17 Lauro Ramos Venancio
  2011-04-09 13:09 ` Harald Welte
  2011-04-14 14:17 ` Samuel Ortiz
  0 siblings, 2 replies; 12+ messages in thread
From: Lauro Ramos Venancio @ 2011-04-06 22:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Aloisio Almeida, Arnd Bergmann, Waldemar.Rymarkiewicz

As previously mentioned in this list, a NFC (Near Field Communication)
subsystem is required to standardize the NFC device drivers
development and create an unified userspace interface. This email
describes our NFC subsystem proposal.

The NFC protocols implementation is divided in some parts:

* The NFC subsystem in the kernel side is responsible for:
	- NFC adapters management;
	- Polling for targets;
	- Low level data exchange;

* All the commands to access the tags data (e.g. MIFARE commands:
READ, WRITE, SECTOR_SELECT) are implemented in the userspace using the
low level data exchange provided by kernel.

* The peer-to-peer NFC protocol (LLCP) will be implemented on kernel
side in order to provide a socket interface (DGRAM and STREAM) with
userspace. The LLCP will be implemented on top of the low level data
exchange provided by NFC subsystem.

+----------------------------------------------------+
|                    USER SPACE                      |
+----------------------------------------------------+
        ^                            ^
        | netlink                    |
        v                            |
+---------------+                    |
|     nlnfc     |                    | AF_NFC socket
+---------------+                    |
        ^                            |
        |                            |
        v                            v
+---------------+      +-----------------------------+
|    nfccore    | <--> | high-level-protocols (LLCP) |
+---------------+      +-----------------------------+
        ^
        |
        v
+---------------+
| Device driver |
+---------------+


In order to validate this idea, we developed a NFC subsystem prototype.
For testing purpose, we also implemented a device driver (PN533) and
an userspace test application.

The prototype implementation can be found at:
	git://186.215.206.130/linux-nfc.git

The userspace test application (list targets and read/write MIFARE
tags) can be found at:
	git://186.215.206.130/nfc-example.git

Prototype Scope:
	- Tag Reader/Writer
	- Protocols: MIFARE, ISO14443, FELICA, JEWEL

Subsystem Operations:
	- start poll - start polling for targets using the protocols given as parameter
	- stop poll - stop polling
	- activate target - activate a target for communication using a
specific protocol
	- deactivate target - deactivate a target
	- reset device - put the adapter in idle mode
	- data exchange - low level data exchange (send and receive data)

Subsystem Event:
	- targets found - report all targets found by the polling

Device Driver Interface:
The device driver interface is a direct correspondence from the NFC
subsystem interface.

User space interface:
When we were designing this subsystem, we were in doubt between
netlink (as in nl80211) and sockets (as in bluez) for userspace
communication. For this prototype, we decided to use generic netlink.

However, the netlink choice has not proven to be the best solution for
the data exchange operation. So we plan to have a new prototype
version using another solution. The options are:
	- sockets for all operations as in bluez implementation;
	- sockets for data exchange and keep netlink for the other operations.

Further work:
	- Define subsystem operations for adapters in "target mode"
	- Implement LLCP
	- Add support to the "secure elements"


Regards,

Lauro Ramos Venancio
INdT - Instituto Nokia de Tecnologia

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-04-15 18:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-06 22:17 [RFC] NFC subsystem prototype Lauro Ramos Venancio
2011-04-09 13:09 ` Harald Welte
2011-04-09 17:45   ` Alan Cox
2011-04-12  6:19     ` Harald Welte
2011-04-11 23:31   ` Lauro Ramos Venancio
2011-04-12  6:08     ` Harald Welte
2011-04-12  7:08       ` Clemens Ladisch
2011-04-14 21:51       ` Lauro Ramos Venancio
2011-04-14 14:17 ` Samuel Ortiz
2011-04-14 22:57   ` Lauro Ramos Venancio
2011-04-14 23:09     ` Samuel Ortiz
2011-04-15 18:27       ` Lauro Ramos Venancio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).