summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2013-04-15NFC: pn544: Add MEI physical layerSamuel Ortiz
With the new mei_phy NFC driver API, the pn544 MEI physical layer is minimal and similar to the microread one. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-15NFC: mei: Add a common mei bus API for NFC driversEric Lapuyade
This isolates the common code that is required to use an mei bus nfc device from an NFC HCI drivers. This prepares for future drivers for NFC chips connected behind an Intel Management Engine controller. The microread_mei HCI driver is also modified to use that common code. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Turn radio on and off when bringing the device up and downSamuel Ortiz
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Add missing usb_put_devMarina Makienko
Add missing usb_put_dev on failure path in pn533_probe(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Marina Makienko <makienko@ispras.ru> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Increase version numberWaldemar Rymarkiewicz
Major features added in 0.2 version: * frame ops added to support wider set of devices * support of ACS ACR122U Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Remove unused pn533_cmd_complete_tWaldemar Rymarkiewicz
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Add pn533_abort_cmd procedureWaldemar Rymarkiewicz
pn533_abort_cmd() aborts last command sent to the controller and cancels already requested urb. As ACR122U does not support any mechanism (as ACK for standard PN533) which aborts last command this cannot be issued for this device. Otherwise, acr122u will behave in an unstable way. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Add support for ACS ACR122U readerWaldemar Rymarkiewicz
ACS ACR122U is an USB NFC reader, PC/SC and CCID compilant, based on NXP PN532 chip. Internally, it's build of MCU, PN532 and an antenna. MCU makes the device CCID and PC/SC compilant and provide USB connection. In this achitecture, a host cannot talk directly to PN532 and must rely on MCU. Luckily, MCU exposes pseud-APDU through PC/SC Escape mechanism which let the host to transmit standard PN532 commands directly to PN532 chip with some limitations. The frame roughly looks like: CCID header | APDU header | PN532 header (pc_to_rdr_escape) | (pseudo apdu Direct Tramsmit) | (len, TFI, cmd, params) Accordign to limitations, ACR122U does't provide any mechanism to abort last issued command. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Add protocol type for frame opsWaldemar Rymarkiewicz
As not all devices require ACK confirmation of every request sent to the controller, differentiate two protocol types. First one, request-ack-response and the second one request-response type. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Move wq_in_error to cmd contextWaldemar Rymarkiewicz
Rename 'wq_in_error' field to more relevant 'status' and move it to cmd context struct. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Re-group fields in struct pn533Waldemar Rymarkiewicz
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Avoid function declarationsWaldemar Rymarkiewicz
Reorder code to avoid functions declaration. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Simplify __pn533_send_frame_asyncWaldemar Rymarkiewicz
In all cases (send_cmd_async, send_data_async and send_sync) pn533_send_async_complete() handles all responses internally, so there is no need to pass this as a callback. Cmd context is passed to __pn533_send_frame_async in all the cases as well. It's already kept in struct pn533 which is available all the time the device is attached. So we can make use of it instead. Therefore, cmd_complete and cmd_complete_arg are no needed any more. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Fix incorrect kfree of complete argsWaldemar Rymarkiewicz
We must free 'cmd_complete_mi_arg' and not 'cmd_complete_arg' when getting send error handling fragmented response. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Remove redundant cmd_ prefix in the structWaldemar Rymarkiewicz
'cmd->code' looks better then 'cmd->cmd_code' Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Keep cmd context in pn533 structWaldemar Rymarkiewicz
Keep cmd context in pn533 struct instead of only cmd code. The context already includes cmd_code. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Optimise issued cmd context trackingWaldemar Rymarkiewicz
Use struct pn533_cmd instead of pn533_send_async_complete_arg to track the context of the issued cmd. This way pn533_send_async_complete_arg struct is no needed anymore. Just move issuer complete callback to pn533_cmd struct. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Fix memleak while scheduling next cmdWaldemar Rymarkiewicz
In case of error from __pn533_send_frame_async() while sending next cmd from the queue (cmd_wq), cmd->req, cmd->resp and cmd->arg pointers won't be freed. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Rename pn533_fw_reset appropriatelyWaldemar Rymarkiewicz
Define explicitely it is Pasori specific reset command. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Update copyrights noteWaldemar Rymarkiewicz
Remove duplicated authors info from the header as well. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Fix div by zero while stopping pollingWaldemar Rymarkiewicz
Depends on timing division by zero can happen when user stops polling. pn533_stop_poll() resets modulation counter on stop_poll, but meanwhile we get response for last poll request and try, despite of stop poll request, to schedule next modulation for polling. Log message: [345.922515] pn533 1-1.3:1.0: pn533_stop_poll [345.928314] pn533 1-1.3:1.0: pn533_send_ack [345.932769] pn533 1-1.3:1.0: Received a frame. [345.937438] PN533 RX: 00 00 ff 03 fd d5 4b 00 e0 00 [345.942840] pn533 1-1.3:1.0: pn533_poll_complete [345.947753] pn533 1-1.3:1.0: pn533_start_poll_complete [345.953186] Division by zero in kernel. [345.957244] [<c001b38c>] (unwind_backtrace+0x0/0xf0) [345.965698] [<c0260e78>] (Ldiv0+0x8/0x10) [345.974060] [<c0260e60>] (__aeabi_idivmod+0x8/0x18) [345.983978] [<c02e0064>] (pn533_poll_complete+0x3c0/0x500) [345.994903] [<c02df690>] (pn533_send_async_complete+0x7c/0xc0) [346.005828] [<c02e028c>] (pn533_wq_cmd_complete+0x1c/0x34) [346.016113] [<c005d134>] (process_one_work+0x1ac/0x57c) [346.025848] [<c005d85c>] (worker_thread+0x168/0x42c) [346.034576] [<c00620c0>] (kthread+0xa4/0xb0) Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Print out response status bits in hexWaldemar Rymarkiewicz
For better debugging as the codes are defined in hex in the spec. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Reword all std frame logic functWaldemar Rymarkiewicz
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-11NFC: pn533: Use dynamic debug for pn533 hex dumpsSamuel Ortiz
Those can be very verbose and we only want them when debugging pn533. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-10ipw2x00: move to kstrto* functionsAndy Shevchenko
There is better to use kstrto* instead of simple_strtoul. In this case it applies a bit stricter rules for input as well. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-10rtlwifi: rtl8188ee: Fix loop that ends earlyLarry Finger
In routine _rtl8188e_read_power_value_fromprom(), there are loops initializing index_cck_base and index_bw40_base from the PROM. As the result of a typo, the second loop is ended one element too soon. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-10ath9k: implement buffer holding handling for EDMA FIFOFelix Fietkau
Inside one FIFO slot queue, EDMA chipsets have the same link pointer re-read race condition as older chipsets, so the same buffer holding logic needs to be used in order to avoid use-after-free bugs. Unlike on older chips, it can be skipped for the end of the queue. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-10ath9k: detect more kinds of invalid descriptorsFelix Fietkau
If AR_CRCErr, AR_PHYErr, AR_DecryptCRCErr or AR_MichaelErr is indicated in the rx status word, but AR_RxFrameOK is also set, the descriptor contents are typically invalid. This can show up as a warning about invalid MCS rates in a frame. Even with those checks in place, a descriptor with invalid MCS rates can still sometimes make it through to the driver (mostly on older hardware like AR91xx). Detect such errors in the last descriptor of a frame and discard the whole frame if present. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-10ath9k: fix handling of broken descriptorsFelix Fietkau
As the comment in ath_get_next_rx_buf indicates, if a descriptor with the done bit set follows one with the done bit cleared, both descriptors should be discarded, however the driver is not doing that yet. To fix this, use the rs->rs_more flag as an indicator that the following frame should be discarded. This also helps with the split buffer case: if the first part of the frame is discarded, the following parts need to be discarded as well, since they contain no valid header or usable data. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-10ath9k: improve dma map failure handlingFelix Fietkau
Instead of leaving the buffer without skb and breaking out of the loop (which could leak the rx buffer), use the common error path. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-10ath9k_common: remove ath9k_cmn_padposFelix Fietkau
It is equivalent to ieee80211_hdrlen Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-10ath9k_hw: make various ar5416/ar91xx rf banks constFelix Fietkau
Banks 0-3,7 are neither modified at run time, nor SREV dependent. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-10ath9k_hw: clean up RF Bank6 handling on AR5416/AR91xxFelix Fietkau
There are two sets of initvals for this RF bank, one with TPC support and one without. The TPC one always gets used, so remove the other one to avoid confusion. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-10rt2x00: rt2x00mmio: remove unused rt2x00pci_* definesGabor Juhos
All users are converted to use the rt2x00mmio_* functions so remove the now unused defines. The patch contain no functional changes. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-10rt2x00: rt2800pci: use the rt2x00mmio_* routinesGabor Juhos
Use the recently introduced rt2x00mmio_* routines instead of the rt2x00pci_* variants. The patch contains no functional changes. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-10rt2x00: rt61pci: use the rt2x00mmio_* routinesGabor Juhos
Use the recently introduced rt2x00mmio_* routines instead of the rt2x00pci_* variants. The patch contains no functional changes. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-10rt2x00: rt2500pci: use the rt2x00mmio_* routinesGabor Juhos
Use the recently introduced rt2x00mmio_* routines instead of the rt2x00pci_* variants. The patch contains no functional changes. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-10rt2x00: rt2400pci: use the rt2x00mmio_* routinesGabor Juhos
Use the recently introduced rt2x00mmio_* routines instead of the rt2x00pci_* variants. The patch contains no functional changes. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-10rt2x00: rt2x00mmio: use rt2x00mmio prefix in function namesGabor Juhos
The functions in the rt2x00mmio module has been moved from the rt2x00pci module. Each function uses the rt2x00pci prefix which is a bit confusing. Use the r2x000mmio prefix for each function to make it consistent with the module name. The renamed functions are used by several modules, and updating the names in all of them would result in a big patch. In order to keep the patch simple, add compatibility defines for the old function names. This allows to update the names in each module separately. After each module is updated, the defines can be removed. The patch contains no functional changes. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-10Merge branch 'for-john' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
2013-04-10Merge branch 'for-john' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Conflicts: drivers/net/wireless/ath/carl9170/debug.c drivers/net/wireless/ath/carl9170/main.c net/mac80211/ieee80211_i.h
2013-04-10Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless Conflicts: drivers/net/wireless/rt2x00/rt2x00pci.c
2013-04-08brcmfmac: only use ifidx from BDC header in brcmf_rx_frames()Arend van Spriel
In brcmf_rx_frames() the call to brcmf_fweh_process_skb() could change the ifidx using information in the event data. This is only different to the BDC ifidx for IF ADD event. However, the creation of the new interface is deferred to event worker so it does not exist. After brcmf_fweh_process_skb() it is only used to set statistics. Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-08brcmfmac: obtain wdev using vif object in action frame rxArend van Spriel
The function brcmf_p2p_notify_action_frame_rx() the wireless_dev is needed to pass the action frame to cfg80211. The wireless_dev is held in brcmf_cfg80211_vif object. Use that instead of the ieee80211_ptr in net_device as P2P_DEVICE interface does not have a net_device associated with it. Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-08brcmfmac: fix reception of P2P probe requests on P2P_DEVICE interfaceArend van Spriel
The probe requests received on P2P_DEVICE interface were not sent to wpa_supplicant, which makes the device not discoverable by peers. Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-08brcmfmac: wait for firmware event when creating P2P_DEVICE interfaceArend van Spriel
The firmware sends a IF event to notify the host driver that the P2P_DEVICE interface has been created. Wait for the event before returning the related wireless_dev. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Piotr Haber <phaber@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-08brcmfmac: support creation of P2P_DEVICE through user-spaceArend van Spriel
The current driver code creates a P2P_DEVICE through a module parameter. This device has a dummy netdevice which is not how this interface type is intended. This patch add proper support for the P2P_DEVICE interface type. This requires a wpa_supplicant with such support as well. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Piotr Haber <phaber@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-08brcmfmac: use struct brcmf_if instance iso netdevice in escan functionsArend van Spriel
escan functionality is also required for P2P device operations so it is better not to rely on struct netdevice instances. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Piotr Haber <phaber@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-08brcmfmac: use struct brcmf_if instance as parameter in brcmf_set_mpc()Arend van Spriel
Remove use of struct netdevice as parameter to brcmf_set_mpc() as it will not always be available, ie. there will be non-netdevice interfaces. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Piotr Haber <phaber@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-08brcmfmac: remove use of unconditional access of struct wireless_dev::netdevArend van Spriel
With the introduction of the P2P_DEVICE interface type an instance of struct wireless_dev does not always have a netdev assigned to it. Better use container_of() construct to obtain internal structure and go from there. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Piotr Haber <phaber@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>