summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* wl12xx/wl18xx: use a dynamic PS timeout of 1.5secArik Nemtsov2012-07-102-2/+2
| | | | | | | | It seems some parties have bad user experience when smaller values are used. This should have little implications for power consumption, since traffic is bursty in nature. Signed-off-by: Arik Nemtsov <arik@wizery.com>
* wlcore: define number of supported bands internallyArik Nemtsov2012-07-103-4/+7
| | | | | | | | Avoid using the IEEE80211_NUM_BANDS constant for arrays sizes etc, as this can contain bands unsupported by the driver (e.g. 60Ghz). Use an internal constant to determine the number of bands. Signed-off-by: Arik Nemtsov <arik@wizery.com>
* wlcore: don't set SDIO_FAILED flag when driver state is offArik Nemtsov2012-07-102-7/+7
| | | | | | | | | | | | | | If some IO read/write fails while the FW is not loaded, a recovery will not take place. This means the SDIO_FAILED flag will stay in place forever and prevent further read/writes. This can happen if a check for STATE_OFF was forgotten in some routine. Take this opportunity to rename the flag to IO_FAILED, since we support other buses as well. Reported-by: Ido Yariv <ido@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com>
* wlcore: change the wait for event mechanismYoni Divinsky2012-07-101-1/+7
| | | | | | | | | | | | | | | | | | | wlcore needs to wait for certain events for example for roc complete event. Usually the events are received from the FW very fast, therefore wlcore can poll with a short delay and if after a second the event was not received yet poll with a long (1-5 msec) delay. This implementation is similar to the sending of commands to the FW. Empirically the change reduced the wait for roc event from ~10-40msec to 100s of usecs. [replace udelay/msleep with usleep_range - Arik] Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com>
* wlcore: Prevent processing of work items during op_stopIdo Yariv2012-07-103-25/+32
| | | | | | | | | | | | | | | | | | | | | The interrupt line is disabled in op_stop using disable_irq. Since pending interrupts are synchronized, the mutex has to be released before disabling the interrupt to avoid a deadlock with the interrupt handler. In addition, the internal state of the driver is only set to 'off' after the interrupt is disabled. Otherwise, if an interrupt fires after the state is set but before the interrupt line is disabled, the interrupt handler will not be able to acknowledge the interrupt resulting in an interrupt storm. The driver's operations might be called during recovery. If these acquire the mutex after it was released by op_stop, but before the driver's state is changed, they may queue new work items instead of just failing. This is especially problematic in the case of scans, in which a new scan may be scheduled after all scan requests were cancelled. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com>
* wlcore: implement .flush callbackEliad Peller2012-07-101-0/+8
| | | | | | | implement the .flush() callback by simply calling wl1271_tx_flush(). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl12xx/wlcore: increase FW filename versionLuciano Coelho2012-07-104-27/+6
| | | | | | | | | | | | We have some API changes and new features in the new firmwares that are not compatible with older drivers. Increase the version of the FW filenames for wl12xx to 5. Additionally, remove the duplicate definitions from wlcore_i.h and remove the MODULE_FIRMWARE macro calls from the SDIO and SPI modules, since they're irrelevant there. Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: add probe request templates for sched and one-shot scansYoni Divinsky2012-07-106-9/+39
| | | | | | | | | | | | | | | The driver configures the firmware template for probe requests during the scan process. If the same template is used for one-shot and sched scans they will override each other when running scans simultaneously. This fix works only on firmwares later than X.3.9.2.112 for single role and X.3.9.2.23 for multi-role. [Some cleaning-up and renaming of the quirk to something smaller -- Luca.] Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: always clear recovery flag during recovery_workArik Nemtsov2012-07-101-2/+2
| | | | | | | | | If recovery is called when the FW is off, we should clear the recovery flag. Otherwise we risk booting the driver in permanent pending-recovery state. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: avoid debug prints during intended FW recoveryArik Nemtsov2012-07-101-3/+4
| | | | | | | | | Don't read the FW panic log or print other debug data when recovery is intended (i.e. FW type switch). This takes valuable time and can be confusing to the user. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: remove recover cmd from testmodeArik Nemtsov2012-07-101-12/+1
| | | | | | | | | This command is buggy (doesn't take the mutex) and unused. Instead, the "start_recovery" file is used for the same purpose. Remove the code but keep the command constant to avoid breaking the testmode ABI. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: don't stop tx queue via watermark if already stoppedArik Nemtsov2012-07-101-1/+3
| | | | | | | | If a Tx queue is currently stopped because of our Tx watermark flow control, don't stop it again. This causes a warning to appear. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore/wl12xx/wl18xx: check min FW versionArik Nemtsov2012-07-106-0/+100
| | | | | | | | | | Refuse to boot if the FW version is too old. The minimum version is set per chip, with the option of setting it per PG in the future. When boot fails because of an old FW, display a helpful message. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: enable sched scan while connectedVictor Goldenshtein2012-07-103-1/+6
| | | | | | | | | | | | New wl12xx firmware supports scheduled scans also while connected. Stop blocking sched scan requests when connected and add a quirk to block in hardware that don't support it (currently wl18xx doesn't). This requires FW version 6/7.3.10.2.112 for single-role and 6/7.5.6.0.25 for multi-role. Signed-off-by: Victor Goldenshtein <victorg@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* NFC: Check for llcp_sock and its device from llcp_sock_getnameSamuel Ortiz2012-07-091-0/+3
| | | | | | They both can potentially be NULL. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Add ISO 14443 type B protocolSamuel Ortiz2012-07-097-18/+28
| | | | | | | | | 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/+11
| | | | | | 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: Dereference LLCP bind socket address after checking for it to be NULLSamuel Ortiz2012-07-091-2/+2
| | | | | Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Do not return EBUSY when stopping a poll that's already stoppedSamuel Ortiz2012-07-091-0/+9
| | | | | | | We check for the polling flag before checking if the netlink PID caller match. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Remove warning from nfc_llcp_local_putSamuel Ortiz2012-07-091-2/+0
| | | | | | | | The socket local pointer can be NULL when a socket is created but never bound or connected. Reported-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Handle LLCP Disconnected Mode framesSamuel Ortiz2012-07-091-0/+44
| | | | | | | | When receiving such frame, the sockets waiting for a connection to finish should be woken up. Connecting to an unbound LLCP service will trigger a DM as a response. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: LLCP late bindingSamuel Ortiz2012-07-092-77/+166
| | | | | | | | | | With the LLCP 16 local SAPs we can potentially quickly run out of source SAPs for non well known services. With the so called late binding we will reserve an SAP only when we actually get a client connection for a local service. The SAP will be released once the last client is gone, leaving it available to other services. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Forbid SSAP binding to a not well known LLCP serviceSamuel Ortiz2012-07-091-17/+5
| | | | | | | | With not Well Known Services there is no guarantees as to which SSAP the server will be listening on, so there is no reason to support binding to a specific source SAP. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Forbid LLCP service name reusingSamuel Ortiz2012-07-091-1/+3
| | | | | | | This patch fixes a typo and return the correct error when trying to bind 2 sockets to the same service name. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Release LLCP SAP when the owner is releasedSamuel Ortiz2012-07-093-14/+11
| | | | | | | | The LLCP SAP should only be freed when the socket owning it is released. As long as the socket is alive, the SAP should be reserved in order to e.g. send the right wks array when bringing the MAC up. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Close listening LLCP sockets when the device is goneSamuel Ortiz2012-07-091-3/+8
| | | | | | | | When the MAC link goes down, we should only keep the bound sockets alive. They will be closed by sock_release or when the underlying NFC device is moving away. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Build LLCP general bytes upon requestSamuel Ortiz2012-07-091-15/+17
| | | | | | | | Drivers will need them before starting a poll or when being activated as targets. Mostly WKS can have changed between device registration and then so we need to re-build the whole array. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Fix LLCP getname socket opSamuel Ortiz2012-07-091-4/+7
| | | | | | Set the right target index and use a better socket declaration routine. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Update LLCP socket target index when getting a connectionSamuel Ortiz2012-07-091-0/+1
| | | | | | Getting a valid CONNECT means we have a valid target index. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Add netlink module alias for NFCSamuel Ortiz2012-07-091-0/+3
| | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Add modules alias for NFC socketsSamuel Ortiz2012-07-091-0/+1
| | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Allow HCI driver to pre-open pipes to some gatesEric Lapuyade2012-07-095-37/+47
| | | | | | | | | | 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: Error management documentationEric Lapuyade2012-07-091-0/+33
| | | | | Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: nfc_driver_failure() implementationEric Lapuyade2012-07-091-6/+2
| | | | | | | If the device is polling we sent a 0 target found event. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: nfc_targets_found() should accept zero target foundEric Lapuyade2012-07-091-6/+13
| | | | | | | | The semantics for a zero target found event is that the polling operation could not complete. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Core must test the device polling state inside the device lockEric Lapuyade2012-07-091-2/+7
| | | | | | | | | There can ever be only one call to nfc_targets_found() after polling has been engaged. This could be from a target discovered event from the driver, or from an error handler to notify poll will never complete. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Implement HCI driver or internal error managementEric Lapuyade2012-07-091-4/+11
| | | | | | | | | If there is an ongoing HCI command executing, it will be completed, thereby pushing the error up to the core. Otherwise, HCI will directly notify the core with the error. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Factorize HCI cmd completionEric Lapuyade2012-07-091-11/+16
| | | | | | | | | HCI cmd can be completed either from an HCI response or from an internal driver or HCI error. This requires to factorize the completion code outside of the device lock. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Driver failure APIEric Lapuyade2012-07-092-0/+12
| | | | | | | | 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: Changed HCI cmd execution completion result to std linux errnoEric Lapuyade2012-07-093-22/+23
| | | | | | | | | | | An HCI command can complete either from an HCI response (with an HCI result) or as a consequence of any other system error during processing. The completion therefore needs to take a standard errno code. The HCI response will convert its result to a standard errno before calling the completion. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Implement HCP reaggregation allocation error caseEric Lapuyade2012-07-091-5/+10
| | | | | | | We can now report an ENOMEM error up to the HCI layer. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Remove an impossible HCI error caseEric Lapuyade2012-07-091-10/+0
| | | | | | | nfc_hci_recv_frame can not be called with a NULL skb. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Handle SHDLC RSET frames from an SHDLC connected chipEric Lapuyade2012-07-091-4/+4
| | | | | | | | shdlc reset may leave HCI in an inconsistent state by loosing parts of HCI frames. Handle this case by reporting an unrecoverable error to HCI. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Removed addressed shdlc TODOsEric Lapuyade2012-07-091-11/+0
| | | | | | | The questions asked in the comments have been answered and addressed. 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-093-8/+21
| | | | | Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* ath9k: Stop the BTCOEX timers before disabling BTCOEXMohammed Shafi Shajakhan2012-07-092-2/+2
| | | | | | | | | | | | | | Its safe to stop the BTCOEX timers 'period_timer' and 'no_stomp_timer' before disabling BTCOEX. These timers can call ath9k_hw_btcoex_enable (or) change the BT stomp type if they seem to be running after we had called ath9k_hw_btcoex_disable, which is obviously not correct. Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Cc: Bala Shanmugam <bkamatch@qca.qualcomm.com> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Fix MCI cleanupMohammed Shafi Shajakhan2012-07-091-1/+3
| | | | | | | | | | | | We are doing MCI cleanup eventhough BTCOEX is not enabled via module parameter. This means we do ath_mci_cleanup though we skipped calling ath_mci_setup. Yet it does not causes any issues now as we free the DMA buffer allocated only when it is allocated during ath_mci_setup. Reviewed-by: Bala Shanmugam <bkamatch@qca.qualcomm.com> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: use custom printing functionsRafał Miłecki2012-07-0910-62/+69
| | | | | | | | | Having bus number printed makes it much easier to anaylze logs on systems with more buses. For example Netgear WNDR4500 has 3 AMBA buses in total, which makes standard log really messy. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
OpenPOWER on IntegriCloud