summaryrefslogtreecommitdiffstats
path: root/net/nfc/hci
Commit message (Collapse)AuthorAgeFilesLines
* NFC: hci: Add stop_poll HCI operand.Christophe Ricard2014-07-231-2/+5
| | | | | | | | stop_poll allows to stop CLF reader polling. Some other operations might be necessary for some CLF to stop polling. For example in card mode. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: hci: Fix sparse: cast to restricted __be16Christophe Ricard2014-04-221-1/+1
| | | | | | | | Fixing "sparse: cast to restricted __be16" message when building with make C=1 CF=-D__CHECK_ENDIAN__ Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: hci: Add load_session HCI operandChristophe Ricard2014-04-221-24/+21
| | | | | | | | | | load_session allows a CLF to restore the gate <-> pipe table from some proprietary location. The main advantage to add this function is to reduce the memory wear by running pipe creation (and storing) only once. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: hci: Extend command execution delayChristophe Ricard2014-04-221-2/+4
| | | | | | | | Extend it up to the maximum FWI value 4949 ms defined by the ISO14443-3 specification. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Use LIST_HEAD() at appropriate placesAxel Lin2014-02-231-3/+1
| | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* Merge branch 'master' of ↵John W. Linville2014-01-171-5/+2
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
| * NFC: Return driver failure upon unknown event receptionSamuel Ortiz2014-01-041-5/+2
| | | | | | | | | | | | | | If the device is polling, this will trigger a netlink event to notify userspace about the polling error. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | net: Spelling s/transmition/transmission/Geert Uytterhoeven2014-01-141-1/+1
|/ | | | | Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfc: Fix FSF address in file headersJeff Kirsher2013-12-118-24/+8
| | | | | | | | | | | | | | Several files refer to an old address for the Free Software Foundation in the file header comment. Resolve by replacing the address with the URL <http://www.gnu.org/licenses/> so that we do not have to keep updating the header comments anytime the address changes. CC: linux-wireless@vger.kernel.org CC: Lauro Ramos Venancio <lauro.venancio@openbossa.org> CC: Aloisio Almeida Jr <aloisio.almeida@openbossa.org> CC: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: hci: Fix enable/disable confusionDan Carpenter2013-08-141-1/+1
| | | | | | | | There is a cut and paste bug so we enable a second time instead of disabling. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: netlink: Rename CMD_FW_UPLOAD to CMD_FW_DOWNLOADSamuel Ortiz2013-07-311-4/+4
| | | | | | | | | Loading a firmware into a target is typically called firmware download, not firmware upload. So we rename the netlink API to NFC_CMD_FW_DOWNLOAD in order to avoid any terminology confusion from userspace. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Extend and fix the internal secure element APISamuel Ortiz2013-06-141-0/+33
| | | | | | | | | | Secure elements need to be discovered after enabling the NFC controller. This is typically done by the NCI core and the HCI drivers (HCI does not specify how to discover SEs, it is left to the specific drivers). Also, the SE enable/disable API explicitely takes a SE index as its argument. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Remove the static supported_se fieldSamuel Ortiz2013-06-141-2/+1
| | | | | | | | | | | | Supported secure elements are typically found during a discovery process initiated when the NFC controller is up and running. For a given NFC chipset there can be many configurations (embedded SE or not, with or without a SIM card wired to the NFC controller SWP interface, etc...) and thus driver code will never know before hand which SEs are available. So we remove this field, it will be replaced by a real SE discovery mechanism. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: HCI: Follow a positive code path in the HCI ops implementationsSamuel Ortiz2013-06-141-18/+18
| | | | | | Exiting on the error case is more typical to the kernel coding style. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: HCI: Implement fw_upload opsEric Lapuyade2013-06-141-0/+11
| | | | | | | | | This is a simple forward to the HCI driver. When driver is done with the operation, it shall directly notify NFC Core by calling nfc_fw_upload_done(). Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Initial Secure Element APISamuel Ortiz2013-01-101-1/+2
| | | | | | | | | | 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-102-1/+9
| | | | | | | | | 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: Fixed skb leak in tm_send() nfc and hci ops implementationsEric Lapuyade2013-01-101-2/+4
| | | | | Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Changed event_received hci ops result semanticEric Lapuyade2013-01-101-6/+8
| | | | | | | | | | | | | Some chips use a standard HCI event code, destined to a proprietary gate, with a different meaning. Therefore, the HCI driver must always have a chance to intercept the event before standard processing is attempted. The new semantic specifies that the result value "1" means that the driver doesn't especially handle the event. result <= 0 means it was handled. 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-3/+5
| | | | | | 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-7/+31
| | | | | | | | | | 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-1/+2
| | | | | | | 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-1/+2
| | | | | Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Dot not dispatch HCI event received on unopened pipeEric Lapuyade2012-11-191-5/+8
| | | | | | | | A chip with pre-opened gates may send events on a gate that nobody has opened in the handset host. Discard those events. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Ignore err when chip doesn't implement HW/SW info registersEric Lapuyade2012-11-191-0/+6
| | | | | | | | | NFC_HCI_ID_MGMT_VERSION_SW and NFC_HCI_ID_MGMT_VERSION_HW are optional registers for gate NFC_HCI_ID_MGMT_GATE in standard HCI. When chip doesn't implement, just leave all the information as zeros. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Fix hci_connect_gate() when a pre-opened pipe is passedEric Lapuyade2012-11-191-2/+2
| | | | | | | | | | In some cases, pre-opened pipes don't stay open when a clear all pipes command is sent. They stay created however. Therefore, one can never assume that such a pipe is already open. As re-opening a pipe seems not to be a problem, we do that now. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Fix some code style and whitespace issuesSzymon Janc2012-10-263-10/+11
| | | | | Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Fix sparse warnings due to missing staticArron Wang2012-10-261-1/+1
| | | | | Signed-off-by: Arron Wang <arron.wang@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Fix not propagating return code in nfc_hci_clear_all_pipesSzymon Janc2012-10-261-6/+2
| | | | | | | Return code from nfc_hci_execute_cmd was not propagated to caller. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Small nfc_hci_create_pipe refactoringSzymon Janc2012-10-261-8/+8
| | | | | | | | Check for error and return if any. This makes it easier to see what is a 'positive' function flow. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Implement HCI DEP send and receive dataArron Wang2012-10-261-4/+15
| | | | | | | 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/+24
| | | | | | | 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: Handle pn544 continue activationArron Wang2012-10-261-1/+3
| | | | | | | | | We need to send continue activation command to allow NFCIP-1 activation when a NFC target has been discovered in type A or type F reader gate. 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-3/+9
| | | | | Signed-off-by: Arron Wang <arron.wang@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* workqueue: avoid using deprecated functionsLinus Torvalds2012-10-023-12/+12
| | | | | | | | | | | | | The network merge brought in a few users of functions that got deprecated by the workqueue cleanups: the 'system_nrt_wq' is now the same as the regular system_wq, since all workqueues are now non- reentrant. Similarly, remove one use of flush_work_sync() - the regular flush_work() has become synchronous, and the "_sync()" version is thus deprecated as being superfluous. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nfc: add dummy nfc_llc_shdlc_register definitionJohn W. Linville2012-09-261-0/+8
| | | | | | | This is used when CONFIG_NFC_SHDLC is disabled. Reported-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Fix typo negociating -> negotiatingWaldemar Rymarkiewicz2012-09-251-5/+5
| | | | | Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Don't handle consequent RSET frames after UAWaldemar Rymarkiewicz2012-09-251-7/+31
| | | | | | | | | | | | | During processing incoming RSET frame chip, possibly due to its internal timout, can retrnasmit an another RSET which is next queued for processing in shdlc layer. In case when we accept processed RSET skip those remaining on the rcv queue until chip will send it's first S or I frame. This will mean the chip completed connection as well. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Handle RSET in SHDLC_CONNECTING stateWaldemar Rymarkiewicz2012-09-251-1/+2
| | | | | | | | | | | As queue_work() does not guarantee immediate execution of sm_work it can happen in crossover RSET usecase that connect timer will constantly change the shdlc state from NEGOTIATING to CONNECTING before shdlc has chance to handle incoming frame. 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: Add HCI module descriptionEric Lapuyade2012-09-251-0/+1
| | | | | Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Fix LLC registration definitions for ANSI complianceEric Lapuyade2012-09-252-2/+2
| | | | | Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Remove unneeded LLC symbols exportSamuel Ortiz2012-09-253-17/+1
| | | | | | After fixing the LLC Makefile, we no longer need those exports. 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-254-1009/+123
| | | | | | | | | | | 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-254-2/+851
| | | | | | | | 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-254-2/+105
| | | | | | | | | | 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-254-1/+241
| | | | | | | | | 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-20/+42
| | | | | | | | | | | 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-1/+33
| | | | | | | | 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: Changed the HCI cmd execution callback prototypeEric Lapuyade2012-09-254-24/+21
| | | | | | | | Make it match the data_exchange_cb_t so that it can be used directly in the implementation of an asynchronous hci_transceive Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Correct outgoing frame before requeueingWaldemar Rymarkiewicz2012-09-251-2/+1
| | | | | | | | | Driver must handle its data added to the frame, so at this point removeing control field of shdlc frame is enough. 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>
OpenPOWER on IntegriCloud