summaryrefslogtreecommitdiffstats
path: root/net/nfc/core.c
Commit message (Collapse)AuthorAgeFilesLines
...
* NFC: Call the DEP link down ops even when in target modeSamuel Ortiz2012-06-041-5/+0Star
| | | | | | | 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: Introduce target mode rx data callbackSamuel Ortiz2012-06-041-0/+12
| | | | | | | | 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: Introduce target mode tx opsSamuel Ortiz2012-06-041-17/+20
| | | | | | And rename the initiator mode data exchange ops for consistency sake. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Set the NFC device RF mode appropriatelySamuel Ortiz2012-06-041-4/+10
| | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Add target mode activation netlink eventSamuel Ortiz2012-06-041-0/+35
| | | | | | | | 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: Add target mode protocols to the polling loop startup routineSamuel Ortiz2012-06-041-5/+5
| | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Export LLCP general bytes getterSamuel Ortiz2012-06-041-0/+8
| | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Specify usage for targets found and target lost eventsEric Lapuyade2012-05-151-9/+26
| | | | | | | | | | | It is now specified that nfc_target_found() and nfc_target_lost() core functions must not be called from an atomic context. This allow us to serialize calls and protect the targets table using the nfc device lock instead of a spinlock. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Cache the core NFC active target pointer instead of its indexEric Lapuyade2012-05-151-20/+61
| | | | | | | | | | | | The NFC Core now caches the active nfc target pointer, thereby avoiding the need to lookup the target table for each invocation of a driver ops. Consequently, pn533, HCI and NCI now directly receive an nfc_target pointer instead of a target index. Cc: Ilan Elias <ilane@ti.com> Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2012-04-181-4/+136
|\ | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem Conflicts: drivers/net/wireless/iwlwifi/iwl-testmode.c include/net/nfc/nfc.h net/nfc/netlink.c net/wireless/nl80211.c
| * NFC: Add Core support to generate tag lost eventEric Lapuyade2012-04-121-1/+71
| | | | | | | | | | | | | | | | | | Some HW/drivers get notifications when a tag moves out of the radio field. This notification is now forwarded to user space through netlink. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * NFC: Changed target activated state logicEric Lapuyade2012-04-121-3/+21
| | | | | | | | | | | | Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * NFC: Fix next target_idx type and rename for clarityEric Lapuyade2012-04-121-1/+1
| | | | | | | | | | | | Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * NFC: The core part should generate the target indexSamuel Ortiz2012-04-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | The target index can be used by userspace to uniquely identify a target and thus should be kept unique, per NFC adapter. Moreover, some protocols do not provide a logical index when discovering new targets, so we have to generate one for them. For NCI or pn533 to fetch their logical index, we added a logical_idx field to the target structure. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * NFC: Export target lost functionEric Lapuyade2012-04-121-0/+39
| | | | | | | | | | | | | | | | | | | | NFC drivers will call this routine when they detect that a tag leaves the RF field. This will eventually lead to the corresponding netlink event to be sent. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | net: cleanup unsigned to unsigned intEric Dumazet2012-04-151-2/+2
|/ | | | | | | Use of "unsigned int" is preferred to bare "unsigned" in net tree. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* NFC: Core code identation fixesSamuel Ortiz2012-03-061-16/+12Star
| | | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Remove the rf mode parameter from the DEP link up routineSamuel Ortiz2012-03-061-11/+11
| | | | | | | | | When calling nfc_dep_link_up, we implicitely are in initiator mode. Which means we also can provide the general bytes as a function argument, as all drivers will eventually request them. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: NFC core layer should not set the target_idxIlan Elias2012-01-241-5/+0Star
| | | | | | | | | | | | | The NFC core layer should not set the target_idx. Instead, the driver layer (e.g. NCI, PN533) should set the target_idx, so that it will be able to identify the target when its I/F (e.g. activate_target) is called. This is required in order to support multiple targets. Note that currently supported drivers (PN533 and NCI) don't use the target_idx in their implementation. Signed-off-by: Ilan Elias <ilane@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Initial LLCP supportSamuel Ortiz2011-12-141-2/+18
| | | | | | | | | | | | This patch is an initial implementation for the NFC Logical Link Control protocol. It's also known as NFC peer to peer mode. This is a basic implementation as it lacks SDP (services Discovery Protocol), frames aggregation support, and frame rejecion parsing. Follow up patches will implement those missing features. This code has been tested against a Nexus S phone implementing LLCP 1.0. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Set and get DEP general bytesSamuel Ortiz2011-12-141-0/+18
| | | | | | | | | | Without an API for setting and getting the local and remote general bytes, drivers won't be able to properly establish a DEP link. This API also allows them to propagate the remote general bytes they get from the DEP link establishment up to the LLCP layer. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Add a DEP link control netlink commandSamuel Ortiz2011-12-141-0/+77
| | | | | | | | | NFC-DEP (Data Exchange Protocol) is an NFC MAC layer. This command allows to enable and disable the DEP link on to which e.g. LLCP can run. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Add tx skb allocation routineSamuel Ortiz2011-12-141-3/+27
| | | | | | | | | This is a factorization of the current rawsock tx skb allocation routine, as it will be used by the LLCP code. We also rename nfc_alloc_skb to nfc_alloc_recv_skb for consistency sake. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Add function name to the NFC pr_fmt() routineSamuel Ortiz2011-12-141-1/+1
| | | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* nfc: Remove unused nfc_printk and nfc_<level> macrosJoe Perches2011-11-301-19/+0Star
| | | | | | | All uses have been removed, so killing what's not necessary. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* nfc: Convert nfc_dbg to pr_debugJoe Perches2011-11-301-18/+19
| | | | | | | | | | | Using the standard debugging mechanisms is better than subsystem specific ones when the subsystem doesn't use a specific struct. Coalesce long formats. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* nfc: Use standard logging stylesJoe Perches2011-11-301-1/+3
| | | | | | | | | | | | Using the normal logging styles is preferred over subsystem specific styles when the subsystem does not take a specific struct. Convert nfc_<level> specific messages to pr_<level> Add newlines to uses. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Add dev_up and dev_down control operationsIlan Elias2011-09-201-0/+77
| | | | | | | | | Add 2 new nfc control operations: dev_up to turn on the nfc device dev_down to turn off the nfc device Signed-off-by: Ilan Elias <ilane@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Reserve tx head and tail roomSamuel Ortiz2011-08-241-1/+5
| | | | | | | | | We can have the NFC core layer allocating the tx head and tail room for the drivers and avoid 1 or more SKBs copy on write on the Tx path. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: add the NFC socket raw protocolLauro Ramos Venancio2011-07-051-0/+7
| | | | | | | | | | This socket protocol is used to perform data exchange with NFC targets. Signed-off-by: Lauro Ramos Venancio <lauro.venancio@openbossa.org> Signed-off-by: Aloisio Almeida Jr <aloisio.almeida@openbossa.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: add NFC socket familyAloisio Almeida Jr2011-07-051-0/+7
| | | | | | Signed-off-by: Lauro Ramos Venancio <lauro.venancio@openbossa.org> Signed-off-by: Aloisio Almeida Jr <aloisio.almeida@openbossa.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: add nfc generic netlink interfaceLauro Ramos Venancio2011-07-051-2/+91
| | | | | | | | | | | The NFC generic netlink interface exports the NFC control operations to the user space. Signed-off-by: Lauro Ramos Venancio <lauro.venancio@openbossa.org> Signed-off-by: Aloisio Almeida Jr <aloisio.almeida@openbossa.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: add nfc subsystem coreLauro Ramos Venancio2011-07-051-0/+365
The NFC subsystem core is responsible for providing the device driver interface. It is also responsible for providing an interface to the control operations and data exchange. Signed-off-by: Lauro Ramos Venancio <lauro.venancio@openbossa.org> Signed-off-by: Aloisio Almeida Jr <aloisio.almeida@openbossa.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>