Bug 916883: Added LLCP constants and primitives

The Logical Link Control Protocol (LLCP) is used to establish
connections over NFC. It's completely independend of NFC and
can also be used over any other networking technology.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 916863: Added NFC infrastructure

This commit adds some infrastructure for NFC debugging and logging.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 916863: Added NFC RF

The NFC RF data structure represents the state of an RF interface.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 916863: Added NFC device state

The NFC device state is an abstract implementation on the state
of a device. The state currently contains information about the
device's initialization, and a number of configuration options.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 916863: Added NCI parser

The NFC Controller Interface (NCI) is the standardized protocol
for talking to local NFC controllers. This commit implements a
number of NIC protocol primitives for the bcm2079x driver. There
are more primitives specified, which can be added when necessary.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 916863: Added HCI parser

The Host Controller Interface is an older interface for talking
to NFC chipsets. This commit only adds minimum support for HCI,
so that the bcm2079x driver's initialization completes. HCI is
deprecated and shouldn't be used otherwise.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 916863: Added Goldfish NFC device

This patch adds an NCI-compatible NFC device to the Goldfish
emulator. The NFC Communication Interface (NCI) is a standardized
protocol for communicating with NFC chipsets. The protocol is
generic enough to be vendor and chipset independend and can be
implemented by devices with NFC-like characteristics.

The NFC device in the Goldfish emulator handles NCI messages, and
responds accordingly. This will allow for simulating basic
functionality of an NFC chipset. Some HCI and proprietary commands
are also supported to allow for use of the BCM2079x driver in the
guest system.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 916863: Added NFC Remote Endpoint

A remote endpoint implements an external NFC device, such as a
tag. Remote endpoints with different properties can be implemented
and used in the emulator.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 916863: Added NFC console commands

There are currently 3 console commands for NFC, which allow
for injecting rf_discovery and rf_intf_activated notificatons,
and data messages into the emulated NFC device.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 916863: Fix STATUS_{NCI|HCI}_CMND in status register while processing command

This commit fixes the state of the status register during
command processing.

While the NFC device processes a command, no other command
might be submitted. Command processing is signalled to the
driver by setting STATUS_{NCI|HCI}_CMND in the status
register.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 916863: Fix HCI event for WRITE_SLEEP_MODE

The returned HCI event for WRITE_SLEEP_MODE did not include the
final status value. The user-space driver thus worked with an
undefined value.

This patch fixes the bug and cleans up the HCI command handling.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>