summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-01-13NFC: pn533: Fix bad allocation sizeThierry Escande
Use dereferenced pointer in sizeof instead of pointer itself. Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-11NFC: Use skb_copy_datagram_iovecSamuel Ortiz
Safer and more robust than than memcpy_toiovec. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-11NFC: Avoid memcpy on LLCP connection less Rx pathSamuel Ortiz
We can cast msg_name to a sockaddr_nfc_llcp pointer directly. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: Update pn544 documentationSamuel Ortiz
The pn544 driver no longer has a /dev/pn544 interface nor a sysfs one. Reported-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Fix missing parenthesisWaldemar Rymarkiewicz
This is a quite critical patch as it fixes potential reference to undefined general_bytes which were never set correctly on target activation due to missing parenthesis. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: Initial Secure Element APISamuel Ortiz
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>
2013-01-10NFC: update HCI documentationEric Lapuyade
Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn544: Use devm_kzalloc APISamuel Ortiz
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn544: Use module_i2c_driverSamuel Ortiz
The pn544 init routine does nothing but adding the driver to the i2c bus. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn544: Separate the core code and the i2c one into different modulesSamuel Ortiz
As we may need to support other physical layers, we can avoid linking the core part into each and every pn544 module. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: Add HCI quirks to support driver (non)standard implementationsEric Lapuyade
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>
2013-01-10NFC: Fixed skb leak in tm_send() nfc and hci ops implementationsEric Lapuyade
Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: Changed event_received hci ops result semanticEric Lapuyade
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>
2013-01-10NFC: Added error handling in event_received hci opsEric Lapuyade
There is no use to return an error if the caller doesn't get it. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: Fixed nfc core and hci unregistration and cleanupEric Lapuyade
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>
2013-01-10NFC: nfcwilink: Use devm_kzallocJulia Lawall
devm_kzalloc allocates memory that is released when a driver detaches. This patch uses devm_kzalloc for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Introduce ops for frame logicWaldemar Rymarkiewicz
Encapsulate whole frame logic (tx/rx frame structure and size) inside the ops structure to make the core driver generic for devices which handle frames in non standard menner (different then pn533 spec say). Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Remove unused dev->wq_in_frameWaldemar Rymarkiewicz
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Cleanup pn533_cmd_complete_tWaldemar Rymarkiewicz
'params' arg in pn533_cmd_complete_t definition has been deprecated and currently is not in use (resp skb is pass in arg ptr), so remove it. Also 'params_len' arg is used as a transfer status indicator, so simply reword it appropriately. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Remove deprecated dev->out_frame buffWaldemar Rymarkiewicz
As it's not used anymore get rid of that buffer. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Use skb in __pn533_send_cmd_frame_asynWaldemar Rymarkiewicz
__pn533_send_cmd_frame_async() should be frame type independent. So, don't use pn533_frame type params and instead use skb for req and resp pointers. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Don't use out_frame in pn533_send_ackWaldemar Rymarkiewicz
dev->out_frame buffer is much bigger for ACK frame needs. Use local buffer instead. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Cleanup debug messagesWaldemar Rymarkiewicz
Remove debug messages which do not include valueable informations in debug mode. Add some new ones for better tracking or reword when if necessary. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Fix urb->status handlingWaldemar Rymarkiewicz
Fix text message to be more suitable for the error code and treat ESHUTDOWN as an error not debug msg. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Remove unused pn533_send_cmd_frame_asyWaldemar Rymarkiewicz
Remove obsolete send async api as it's no longer used. Remove global dev->in_frame as well, as each packet is kept is a seperate skb struct now, so that's not used anymore. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Fix minor style issuesWaldemar Rymarkiewicz
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Fix open parenthesis alignmentWaldemar Rymarkiewicz
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Fix spacing issuesWaldemar Rymarkiewicz
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Fix quoted strings split across linesWaldemar Rymarkiewicz
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Remove frame logic from poll cmdsWaldemar Rymarkiewicz
Remove frame logic from start_pool cb using the new iface for async send. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Dump tx and rx data in debug modeWaldemar Rymarkiewicz
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Del frame logic from Data Exchange cmdWaldemar Rymarkiewicz
Remove frame logic from transceive cb using new iface for async send. For pn533_wq_mi_recv() use pn533_send_cmd_direct_async which sends the cmd directly to the hardware, skipping cmd queue. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Del frame logic from InJumForDep cmdWaldemar Rymarkiewicz
Remove frame logic from InJmumpForDEP command using the new iface for async send. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Del frame logic from TgGet/SetData cmdWaldemar Rymarkiewicz
Remove frame logic from TgSetData and TgGetData commands using the new iface for async send. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: llcp: Fix Rx memory leakSamuel Ortiz
The reference count bump on the llcp Rx path is leading to a memory leak whenever we're not receiving an I frame. We fix that by removing the refcount bump (drivers must not free their received skb) and using it only in the I frame path, when the frame is actually queued. In that case, the skb will only be freed when someone fetches it from userspace. in all other cases, LLCP received frames will be freed when leaving the Rx work queue. Reported-by: Eric Lapuyade <eric.lapuyade@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: llcp: Remove the tx backlog queueSamuel Ortiz
Not only it was improperly use to queue backlogged RX skbuffs, but it was also not processed at all. If the socket receive queue is full we simply drop the incoming packets. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Remove pn533_send_cmd_frame_syncWaldemar Rymarkiewicz
Remove obsolate pn533_send_cmd_frame_sync() and use previously added new iface for sync send. The new interface require the use of individual skb for each cmd which removes some memcpy calls and hides frame logic. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Add pn533_alloc_skb for req allocationWaldemar Rymarkiewicz
Allocate sk_buff for the request. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Add a new pn533_send_sync ifaceWaldemar Rymarkiewicz
It is intended to replace pn533_send_cmd_frame_sync() iface which requires from the caller to create complete frame. The new function constructs a complete frame itself and sends it out in sync manner. This way frame logic is hidden from the caller. pn533_send_cmd_sync() returns ERR_PTR in case of an error or a pointer to valid response sk_buff otherwise. The pointer must be freed by the caller when it's been consumed. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Add a new pn533_send_data_async ifaceWaldemar Rymarkiewicz
This iface is intended to be used with DEP transfers. It differs from pn533_send_cmd_async() in the way the response skb is allocated. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Add a new pn533_send_cmd_async ifaceWaldemar Rymarkiewicz
This is intendend to replace pn533_send_cmd_frame_async() which requires from the caller to create a complete frame. The new function constructs a frame and sends it out which hides the frame logic and avoid code duplication. The caller has to allocate skb and put its payload there, and finally provide the skb together with a complete cb to pn533_send_cmd_async(). Response skb is allocated by the core part and pass to the caller cb. Next, the caller has to free it when is not needed anymore or pass it up to the stack. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Remove pointless flags paramWaldemar Rymarkiewicz
__pn533_send_cmd_frame_async() is called when lock is held so GFP_KERNEL flag will be always used. Thus, having extra param does not optimise the code. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Add frame header length defineWaldemar Rymarkiewicz
PN533_CMD_DATAEXCH_HEAD_LEN includes a frame header length which is not seen at a glance. It can be missleading, so split it and define the frame header length explicitly. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Remove unused definitionsWaldemar Rymarkiewicz
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: pn533: Remove in/out_maxlen as it is not usedWaldemar Rymarkiewicz
in_maxlen and out_maxlen was replaced with PN533_NORMAL_FRAME_MAX_LEN Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10NFC: Add support for SO_TIMESTAMP LLCP socket optionThierry Escande
Set timestamp in sent and received sk_buffs. timestamp is then put in msghdr structure in llcp_sock_recvmsg(). Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-07mwifiex: use map/unmap APIs in TX and RX to reduce memcpyAvinash Patil
This patch is an enhacement to mwifiex_pcie driver to use map/unmap PCI memory APIs. This reduces one memcpy each in TX path and RX path, and enhances throughput. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-07mwifiex: flush TX ring for PCIe after disconnect or bss stopAvinash Patil
This patch adds handler to clean PCIe TX rings after disconnect or bss stop is called for PCIe based mwifiex driver. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-07mwifiex: use pci_alloc/free_consistent APIs for PCIeAvinash Patil
This patch uses pci_alloc_consistent and pci_free_consistent APIs for mwifiex_pcie driver. Consistent DMA memory is allocated for TX, RX and event rings. Command buffer and command response buffer also uses map/unmap memory APIs to download commands and get command responses. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-07mwifiex: add init_fw_port handler for PCIe interfaceAvinash Patil
This patch adds support for init_fw_port handler for PCIe interface, which resets RXBD read pointer for PCIe. This fixes issue where RX doesn't work until some TX from driver happens. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>