summaryrefslogtreecommitdiffstats
path: root/drivers/nfc
Commit message (Collapse)AuthorAgeFilesLines
* NFC: Add ISO 14443 type B protocolSamuel Ortiz2012-07-093-8/+12
| | | | | | | | | Some devices (e.g. Sony's PaSoRi) can not do type B polling, so we have to make a distinction between ISO14443 type A and B poll modes. Cc: Eric Lapuyade <eric.lapuyade@intel.com> Cc: Ilan Elias <ilane@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Use communicate thru only for PaSoRi when trying to read Felica tagsSamuel Ortiz2012-07-091-12/+11Star
| | | | | | Otherwise DATA_EXCHANGE seems to be just fine. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Add initial Sony RC-S360 support to pn533Samuel Ortiz2012-07-091-38/+181
| | | | | | | Sony RC-S360 is also known as the Sony PaSoRi contactless reader. Only type 2, 3 and 4 tag reading is supported at the moment. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Allow HCI driver to pre-open pipes to some gatesEric Lapuyade2012-07-091-13/+18
| | | | | | | | | | 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: update PN544 HCI driver state when opened/closedEric Lapuyade2012-07-091-0/+5
| | | | | Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Monitor pn533 target modeSamuel Ortiz2012-06-041-1/+22
| | | | | | | When receiving a DEP link down event, we should cancel all pending URBs if we're activated as a target or if we're an initiator. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Convert pn533 from semaphore to mutexSamuel Ortiz2012-06-041-7/+7
| | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Set the proper baud rate when trying to activate pn533 targetsSamuel Ortiz2012-06-041-2/+23
| | | | | | We get the right baud rate from the last polled modulation. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Implement pn533 polling loopSamuel Ortiz2012-06-041-126/+161
| | | | | | | After going through all the modulations, the pn533 driver spends 2 seconds listening for targets. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Add type A and type F parameters for pn533 target modeSamuel Ortiz2012-06-041-1/+24
| | | | | | Without those settings several devices will not activate pn533 as a target. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Add passive initiator data for pn533Samuel Ortiz2012-06-041-5/+18
| | | | | | | 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>
* NFC: Configure pn533 RF timingsSamuel Ortiz2012-06-041-0/+25
| | | | | | | 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: Unregister device if pn533 initial configuration failsSamuel Ortiz2012-06-041-1/+5
| | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Reset poll mod list when stopping pn533 pollSamuel Ortiz2012-06-041-0/+2
| | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Implement the pn533 target mode Tx opSamuel Ortiz2012-06-041-9/+73
| | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Implement the pn533 target mode data fetching routineSamuel Ortiz2012-06-041-5/+80
| | | | | | | 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: Introduce target mode tx opsSamuel Ortiz2012-06-041-4/+4
| | | | | | And rename the initiator mode data exchange ops for consistency sake. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Add target mode activation netlink eventSamuel Ortiz2012-06-041-2/+25
| | | | | | | | 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: Implement pn533 target mode polling loopSamuel Ortiz2012-06-041-5/+104
| | | | | | 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 protocols to the polling loop startup routineSamuel Ortiz2012-06-042-14/+35
| | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: potential integer overflow problem in check_crc()Dan Carpenter2012-05-251-1/+1
| | | | | | | | | If "buf[0]" is 255 then "len" gets set to 0. The call to "crc_ccitt(0xffff, buf, len - 2);" casts the "len - 2" to a high positive number which is ugly. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: HCI based pn544 driverEric Lapuyade2012-05-153-0/+961
| | | | | | | | | This is an NFC driver for NXP pn544. Unlike pn544.c, this one is based on the NFC HCI and SHDLC kernel layers. 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 unneeded pn533 dev NULL checkDan Carpenter2012-05-151-3/+0Star
| | | | | | | | | | | container_of() works by subtracting the offset of the member. The math can't really return a zero here. Sometimes people check it when they actually meant to check something else but in this case we can just remove the check. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.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/+8
| | | | | | | | | | | | 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>
* NFC: pn533 Rx chaining supportSamuel Ortiz2012-04-121-16/+128
| | | | | | | | | | | When buffers on the receiption path exceed 262 bytes, the pn533 uses a chaining mechanism where the initiator has to send NULL data frames to fetch the remaining frames. We do that from a workqueue context while holding the cmd lock. Once the MI bit is gone, we aggregate the queued received skbs. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Convert pn533 from tasklet to workqueuesSamuel Ortiz2012-04-121-38/+48
| | | | | | | There is no need for soft IRQ contexts, and workqueues are more flexible. 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-15/+5Star
| | | | | | | | | 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: Export NFCID when detecting a p2p target with pn533Samuel Ortiz2012-03-061-0/+2
| | | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Export Jewel/Topaz ID from pn533Samuel Ortiz2012-03-061-0/+2
| | | | | | | The jewel ID is the NFCID1 for Topaz NFC tags. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Export sensf from pn533Samuel Ortiz2012-03-061-0/+3
| | | | | | | sensf is the detection response for Felica NFC tags. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Clear pn533 target structureSamuel Ortiz2012-03-061-0/+2
| | | | | | | | The polled target structure should be memset to 0 in order to avoid sel_res and sens_res garbage. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Export NFCID1 from pn533Samuel Ortiz2012-03-061-0/+2
| | | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Free sk_buff if nfcwilink_send failsIlan Elias2012-01-241-2/+4
| | | | | | | | Free sk_buff if nfcwilink_send fails. Signed-off-by: Ilan Elias <ilane@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Download TI NFC init scriptIlan Elias2012-01-241-4/+284
| | | | | | | | | | | | | Download TI NFC init script during nfcwilink open operation, after the NFC channel is registered with TI shared transport. TI NFC init script is written in BTS format. First, read the chip version via a special vendor specific command. Second, we request the relevant BTS file from the user space, and then send the BTS commands to the chip. Signed-off-by: Ilan Elias <ilane@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Add endian annotations to nfcwilink driverIlan Elias2012-01-241-5/+6
| | | | | | | | Add endian annotations to TI nfcwilink driver. Signed-off-by: Ilan Elias <ilane@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'driver-core-next' of ↵Linus Torvalds2012-01-071-18/+1Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core * 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (73 commits) arm: fix up some samsung merge sysdev conversion problems firmware: Fix an oops on reading fw_priv->fw in sysfs loading file Drivers:hv: Fix a bug in vmbus_driver_unregister() driver core: remove __must_check from device_create_file debugfs: add missing #ifdef HAS_IOMEM arm: time.h: remove device.h #include driver-core: remove sysdev.h usage. clockevents: remove sysdev.h arm: convert sysdev_class to a regular subsystem arm: leds: convert sysdev_class to a regular subsystem kobject: remove kset_find_obj_hinted() m86k: gpio - convert sysdev_class to a regular subsystem mips: txx9_sram - convert sysdev_class to a regular subsystem mips: 7segled - convert sysdev_class to a regular subsystem sh: dma - convert sysdev_class to a regular subsystem sh: intc - convert sysdev_class to a regular subsystem power: suspend - convert sysdev_class to a regular subsystem power: qe_ic - convert sysdev_class to a regular subsystem power: cmm - convert sysdev_class to a regular subsystem s390: time - convert sysdev_class to a regular subsystem ... Fix up conflicts with 'struct sysdev' removal from various platform drivers that got changed: - arch/arm/mach-exynos/cpu.c - arch/arm/mach-exynos/irq-eint.c - arch/arm/mach-s3c64xx/common.c - arch/arm/mach-s3c64xx/cpu.c - arch/arm/mach-s5p64x0/cpu.c - arch/arm/mach-s5pv210/common.c - arch/arm/plat-samsung/include/plat/cpu.h - arch/powerpc/kernel/sysfs.c and fix up cpu_is_hotpluggable() as per Greg in include/linux/cpu.h
| * USB: convert some miscellanies drivers to use module_usb_driver()Greg Kroah-Hartman2011-11-181-18/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts the remaining USB drivers in the kernel to use the module_usb_driver() macro which makes the code smaller and a bit simpler. Added bonus is that it removes some unneeded kernel log messages about drivers loading and/or unloading. Cc: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Jean Delvare <khali@linux-fr.org> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Till Harbaum <till@harbaum.org> Cc: Karsten Keil <isdn@linux-pingi.de> Cc: Chris Ball <cjb@laptop.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org> Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org> Cc: Samuel Ortiz <sameo@linux.intel.com> Cc: Steve Glendinning <steve.glendinning@smsc.com> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Evgeniy Polyakov <zbr@ioremap.net> Cc: Wim Van Sebroeck <wim@iguana.be> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jesper Juhl <jj@chaosbits.net> Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Cc: Jamie Iles <jamie@jamieiles.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | NFC: DEP link hook implementation for pn533Samuel Ortiz2011-12-141-0/+159
| | | | | | | | | | 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-1/+6
| | | | | | | | | | | | | | | | | | | | 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 tx skb allocation routineSamuel Ortiz2011-12-141-1/+1
| | | | | | | | | | | | | | | | | | 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: pn533: Staticise pn533_data_exchange()Axel Lin2011-11-301-1/+1
|/ | | | | | | It is not used outside this driver so no need to make the symbol global. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* drivers/nfc: add module.h to nfcwilink.cPaul Gortmaker2011-11-011-0/+1
| | | | | | | | This is a full module, with module_init() and module_exit() and so it needs module.h called out for inclusion. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
* nfc: NFC_WILINK depends on NFC_NCIRandy Dunlap2011-09-211-1/+1
| | | | | | | | | | | | | | | nwcwilink.c uses nci_*() interfaces, so it should depend on NFC_NCI. Fixes these build errors: ERROR: "nci_register_device" [drivers/nfc/nfcwilink.ko] undefined! ERROR: "nci_allocate_device" [drivers/nfc/nfcwilink.ko] undefined! ERROR: "nci_recv_frame" [drivers/nfc/nfcwilink.ko] undefined! ERROR: "nci_free_device" [drivers/nfc/nfcwilink.ko] undefined! ERROR: "nci_unregister_device" [drivers/nfc/nfcwilink.ko] undefined! Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: driver for TI shared transportIlan Elias2011-09-203-0/+354
| | | | | Signed-off-by: Ilan Elias <ilane@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: move nfc.h from include/net to include/net/nfcIlan Elias2011-09-201-1/+1
| | | | | | | | The file nfc.h was moved from include/net to include/net/nfc, since new NFC header files will be added to include/net/nfc. Signed-off-by: Ilan Elias <ilane@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Add dev_up and dev_down control operationsIlan Elias2011-09-201-0/+2
| | | | | | | | | 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-14/+3Star
| | | | | | | | | 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: pn533: use after free in pn533_disconnect()Dan Carpenter2011-07-261-1/+1
| | | | | | | We freed "dev" on the line before. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: pn533: add NXP pn533 nfc device driverAloisio Almeida Jr2011-07-053-0/+1643
| | | | | | | 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 subsystem coreLauro Ramos Venancio2011-07-052-13/+5Star
| | | | | | | | | | | 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>