NFC: Take a reference on the LLCP local pointer when creating a socket

LLCP sockets point to their local LLCP service, so they need to take a
reference on it.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Socket linked list

Simplify the LLCP sockets structure by putting all the connected ones
into a single linked list.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Move LLCP receiver window value to socket structure

RW can only be fetched from a CONNECT or a CC frame thus making it an
end points specific value, not a link one.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Move LLCP MIU extension value to socket structure

The MIU extension value can be received during the PAX or during the
connection establishment process. It's definitely a connection related value
rather than a link one.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: LLCP's MIUX is 10 bytes long, not 7

The mask is 0x7ff and not 0x7f and the return value is an u16.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Export LLCP general bytes getter

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Add target mode protocols to the polling loop startup routine

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Implement pn533 target mode polling loop

We only want to support p2p target mode for now, no host card emulation.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Add target mode activation netlink event

Userspace gets a netlink event upon target mode activation.
The LLCP layer is also signaled when we get an ATR_REQ in order to get
the remote general bytes.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Set the NFC device RF mode appropriately

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Introduce target mode tx ops

And rename the initiator mode data exchange ops for consistency sake.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Introduce target mode rx data callback

This routine will be called by drivers whenever they receive data in target
mode. This should be unexpected events and as such should be handled by a
standalone API (i.e. not as a callback pointer from an existing API).

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Implement the pn533 target mode data fetching routine

This one needs to be called as soon as we are activated as a target, for
the pn533 to receive the first SYMM and keep the LLCP link alive.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Implement the pn533 target mode Tx op

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Don't hold a NULL connecting LLCP socket lock

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Call the DEP link down ops even when in target mode

Even in target mode we need to let the driver know that we want to
bring the DEP link down.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Reset poll mod list when stopping pn533 poll

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Unregister device if pn533 initial configuration fails

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Configure pn533 RF timings

Those define the ATR_RES response timeout after which the pn533 considers the
target to be mute.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NFC: Add passive initiator data for pn533

When trying to enable a DEP link as a passive initiator, pn533 needs to
provide the polling request command payload.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>