summaryrefslogtreecommitdiffstats
path: root/include/net/nfc
Commit message (Collapse)AuthorAgeFilesLines
* NFC: RFKILL supportSamuel Ortiz2013-04-121-0/+2
| | | | | | | | | | All NFC devices will now get proper RFKILL support as long as they provide some dev_up and dev_down hooks. Rfkilling an NFC device will bring it down while it is left to userspace to bring it back up when being rfkill unblocked. This is very similar to what Bluetooth does. Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Initial Secure Element APISamuel Ortiz2013-01-103-0/+10
| | | | | | | | | | Each NFC adapter can have several links to different secure elements and that property needs to be exported by the drivers. A secure element link can be enabled and disabled, and card emulation will be handled by the currently active one. Otherwise card emulation will be host implemented. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Add HCI quirks to support driver (non)standard implementationsEric Lapuyade2013-01-101-0/+13
| | | | | | | | | Some chips diverge from the HCI spec in their implementation of standard features. This adds a new quirks parameter to nfc_hci_allocate_device() to let the driver indicate its divergence. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Added error handling in event_received hci opsEric Lapuyade2013-01-101-2/+2
| | | | | | There is no use to return an error if the caller doesn't get it. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Fixed nfc core and hci unregistration and cleanupEric Lapuyade2013-01-102-0/+4
| | | | | | | | | | When an adapter is removed, it will unregister itself from hci and/or nfc core. In order to do that safely, work tasks must first be canceled and prevented to be scheduled again, before the hci or nfc device can be destroyed. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Export nfc_hci_sak_to_protocol()Eric Lapuyade2012-11-191-0/+1
| | | | | | | Some HCI drivers will need it. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Export nfc_hci_result_to_errno as it can be needed by HCI driversEric Lapuyade2012-11-191-0/+2
| | | | | Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Use IDR library to assing NFC devices IDsSamuel Ortiz2012-10-261-1/+1
| | | | | | | As a consequence the NFC device IDs won't be increasing all the time, as IDR provides the first available ID. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Separate pn544 hci driver in HW dependant and independant partsEric Lapuyade2012-10-261-0/+6
| | | | | | | | | | The driver now has all HCI stuff isolated in one file, and all the hardware link specifics in another. Writing a pn544 driver on top of another hardware link is now just a matter of adding a new file for that new hardware specifics. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Implement HCI DEP send and receive dataArron Wang2012-10-261-1/+2
| | | | | | | And implement the corresponding hooks for pn544. Signed-off-by: Arron Wang <arron.wang@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Implement HCI DEP link up and downArron Wang2012-10-261-0/+3
| | | | | | | And implement the corresponding hooks for pn544. Signed-off-by: Arron Wang <arron.wang@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Pass hardware specific HCI event to driverArron Wang2012-10-261-0/+3
| | | | | Signed-off-by: Arron Wang <arron.wang@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Set local gb and DEP registriesArron Wang2012-10-261-0/+3
| | | | | | | | Set the local general bytes and default value for NFCIP1 Target/Initiator registries if the protocol is NFC-DEP Signed-off-by: Arron Wang <arron.wang@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* Merge branch 'master' of ↵John W. Linville2012-09-286-112/+106
|\ | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem Conflicts: net/nfc/netlink.c Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * NFC: xmit from hci ops must return 0 or negativeWaldemar Rymarkiewicz2012-09-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | xmit callback provided by a driver encapsulates upper layers data and sends it to the hardware. So, HCI does not know the exact amount of data being sent and thus can't handle partially sent frames properly. Therefore, the driver must return 0 for completely sent frame or negative for failure. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Acked-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * NFC: Changed HCI and PN544 HCI driver to use the new HCI LLC CoreEric Lapuyade2012-09-252-106/+3
| | | | | | | | | | | | | | | | | | | | | | The previous shdlc HCI driver and its header are removed from the tree. PN544 now registers directly with HCI and passes the name of the llc it requires (shdlc). HCI instantiation now allocates the required llc instance. The llc is started when the HCI device is brought up. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * NFC: Add an shdlc llc module to llc coreEric Lapuyade2012-09-251-0/+1
| | | | | | | | | | | | | | | | This is used by HCI drivers such as the one for the pn544 which require communications between HCI and the chip to use shdlc. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * NFC: Add a nop (passthrough) llc module to llc coreEric Lapuyade2012-09-251-0/+2
| | | | | | | | | | | | | | | | | | | | This is a passthrough llc. It can be used by HCI drivers that don't need link layer control. HCI will then write directly to the driver, and driver will deliver incoming frames directly to HCI without any processing. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * NFC: Add an LLC Core layer to HCIEric Lapuyade2012-09-251-0/+51
| | | | | | | | | | | | | | | | | | The LLC layer manages modules that control the link layer protocol (such as shdlc) between HCI and an HCI driver. The driver must simply specify the required llc when it registers with HCI. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * NFC: Modified hci_transceive to become an asynchronous operationEric Lapuyade2012-09-252-4/+8
| | | | | | | | | | | | | | | | | | | | | | This enables the completion callback to be called from a different context, preventing a possible deadlock if the callback resulted in the invocation of a nested call to the currently locked nfc_dev. This is also more in line with the im_transceive nfc_ops for NFC Core or NCI drivers which already behave asynchronously. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * NFC: Add a public nfc_hci_send_cmd_async methodEric Lapuyade2012-09-251-0/+3
| | | | | | | | | | | | | | | | This method initiates execution of an HCI cmd. Result will be delivered through an asynchronous callback. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * NFC: Use system_nrt_wq instead of custom onesTejun Heo2012-09-253-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | NFC is using a number of custom ordered workqueues w/ WQ_MEM_RECLAIM. WQ_MEM_RECLAIM is unnecessary unless NFC is gonna be used as transport for storage device, and all use cases match one work item to one ordered workqueue - IOW, there's no actual ordering going on at all and using system_nrt_wq gives the same behavior. There's nothing to be gained by using custom workqueues. Use system_nrt_wq instead and drop all the custom ones. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * NFC: Implement NCI dep_link_up and dep_link_downIlan Elias2012-09-252-0/+5
| | | | | | | | | | | | | | | | | | | | | | During NFC-DEP target activation, store the remote general bytes to be used later in dep_link_up. When dep_link_up is called, activate the NFC-DEP target, and forward the remote general bytes. When dep_link_down is called, deactivate the target. Signed-off-by: Ilan Elias <ilane@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * NFC: Parse NCI NFC-DEP activation paramsIlan Elias2012-09-251-0/+6
| | | | | | | | | | Signed-off-by: Ilan Elias <ilane@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * NFC: Set local general bytes in nci_start_pollIlan Elias2012-09-252-0/+24
| | | | | | | | | | | | | | | | If initiator protocol is NFC-DEP, set the local general bytes in nci_start_poll. Signed-off-by: Ilan Elias <ilane@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | netlink: Rename pid to portid to avoid confusionEric W. Biederman2012-09-101-1/+1
|/ | | | | | | | | | | | | | | It is a frequent mistake to confuse the netlink port identifier with a process identifier. Try to reduce this confusion by renaming fields that hold port identifiers portid instead of pid. I have carefully avoided changing the structures exported to userspace to avoid changing the userspace API. I have successfully built an allyesconfig kernel with this change. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* NFC: Allow HCI driver to pre-open pipes to some gatesEric Lapuyade2012-07-091-3/+14
| | | | | | | | | | Some NFC chips will statically create and open pipes for both standard and proprietary gates. The driver can now pass this information to HCI such that HCI will not attempt to create and open them, but will instead directly use the passed pipe ids. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Driver failure APIEric Lapuyade2012-07-091-0/+2
| | | | | | | | This API should be used by drivers, HCI, SHDLC or NCI stacks to report an unrecoverable error. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Prepare asynchronous error management for driver and shdlcEric Lapuyade2012-07-091-0/+2
| | | | | Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Introduce target mode rx data callbackSamuel Ortiz2012-06-041-0/+1
| | | | | | | | 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-1/+2
| | | | | | 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-1/+1
| | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Add target mode activation netlink eventSamuel Ortiz2012-06-041-0/+4
| | | | | | | | 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-043-3/+6
| | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Export LLCP general bytes getterSamuel Ortiz2012-06-041-0/+1
| | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: HCI drivers don't have to keep track of polling stateEric Lapuyade2012-05-151-2/+0
| | | | | | | | The NFC core code already does that for them. 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: Add HCI/SHDLC support to let driver check for tag presenceEric Lapuyade2012-05-152-0/+4
| | | | | | 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: Specify usage for targets found and target lost eventsEric Lapuyade2012-05-151-1/+0
| | | | | | | | | | | 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: Remove useless HCI private nfc target tableEric Lapuyade2012-05-151-2/+0
| | | | | | 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-8/+10
| | | | | | | | | | | | 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-183-1/+313
|\ | | | | | | | | | | | | | | | | | | 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-0/+5
| | | | | | | | | | | | | | | | | | 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-1/+2
| | | | | | | | | | | | 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/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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: SHDLC implementationEric Lapuyade2012-04-121-0/+104
| | | | | | | | | | | | | | | | | | | | | | Most NFC HCI chipsets actually use a simplified HDLC link layer to carry HCI payloads. This implementation registers itself as an HCI device on behalf of the NFC driver. 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: HCI supportEric Lapuyade2012-04-122-0/+199
| | | | | | | | | | | | | | | | | | | | This is an implementation of ETSI TS 102 622 specification. Many NFC chipsets use HCI as the host <-> target protocol on top of a serial link like i2c. 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: Export target lost functionEric Lapuyade2012-04-121-0/+1
| | | | | | | | | | | | | | | | | | | | 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-1/+1
|/ | | | | | | 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: NCI code identation fixesSamuel Ortiz2012-03-061-5/+5
| | | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
OpenPOWER on IntegriCloud