[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201103291305.02293.arnd@arndb.de>
Date: Tue, 29 Mar 2011 13:05:02 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Waldemar.Rymarkiewicz@...to.com
Cc: sameo@...ux.intel.com, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org, hthebaud@...idefr.com,
matti.j.aaltonen@...ia.com, alan@...rguk.ukuu.org.uk
Subject: Re: [PATCH] NFC: Driver for Inside Secure MicroRead NFC chip
On Tuesday 29 March 2011, Waldemar.Rymarkiewicz@...to.com wrote:
> >Yes, NFC seems to be a good fit for a new socket family.
> >Especially if we ever want to have a proper NFC p2p support
> >from the kernel.
> >Sending HCI commands should be done through a dedicated
> >netlink socket too.
> >
> >I am currently strting to work on such solution, and I hope to
> >be able to come up with a basic prototype for it in a few weeks.
>
> What about common drivers interface in this case.
> Should we go for common /dev/nfcX interface as well?
I fear there can only be one. A good implementation of a socket
interface would mean that there is no need for a character device.
The difference between the two is where you keep the common
NFC logic:
If you have a character device, it will be like a serial port
connecting to a modem. Any higher-level protocols live in the
user space and are limited to a single application then, which
is required to have appropriate priviledges to open the device.
In contrast, a socket implementation puts the protocol
stack into the kernel, which requires much more kernel code
but almost no user space library code, aside from perhaps
a small shim layer. It makes it possible to have multiple
applications and/or users concurrently use NFC to make connections
to separate endpoints. Since sockets have no implicit permission
handling, the kernel code then needs to implement a way to enforce
policy.
I still don't understand enough about NFC to judge which of
the two is better suited for the problem, but my feeling is
that a socket based implementation would be better if you expect
a lot of people to use it, while the main advantage of the
character device is its simplicity, so that would be preferred
if you only expect a very small set of possible applications
for this.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists