Wednesday, September 7, 2016

NFC improvements in Linux 4.8

Almost 4 years ago, I started to work on the linux-nfc project. I first worked on the implementation of a virtual device driver named nfcsim that was intended to simulate 2 NFC devices on the same host and make them talk to each other through the Logical Link Control Protocol (LLCP), also known as P2P mode.

My next project was the implementation of the NFC Digital Protocol stack. The Digital Protocol layer is usually embedded into the chipsets firmware but this is not the case for all of them. For example, the Sony RC-S380 USB dongle does not have it and I wrote its driver as well, based on the Digital layer.
With this work I was in the top 20 developers (by changed lines) for the Linux 3.13 release.

Here is an overall picture of the Linux NFC stack showing where the Digital Protocol layer fits in.
Linux NFC Stack
Unfortunately, about 2 years ago I had to stop  working on the linux-nfc project because of new priorities set by my former employer and switch to Android platform development.
I had to "abandon-in-place" this work and did not have any spare time to continue, so there was still some missing features and stability issues.

In the meantime, other developers have contributed to the Digital layer, adding support for some of the missing features in the NFC-DEP protocol such as packets chaining.
Also, TI and STM have added drivers for their own chipsets based on the Digital Protocol layer.

But now thanks to my new employer, Collabora, I'm now back to business and I've been offered the opportunity to keep on working the linux-nfc project.

However even with the progress made by other developers in the past years there was still a lot of kernel panics and memory leaks around the Digital layer and RC-S380 driver implementations. My main focus in the last 3 months was fixing these issues to provide a better stability both to Digital layer and RC-S380 implementations.

The upcoming Linux 4.8 release contains 26 patches for the Digital Protocol layer, the port100 driver (port100 is the NFC chip inside the RC-S380), and the nfcsim driver.

I'll talk about all of these components in more details in next posts but what I can say is that now they are rock solid!