summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/spi.c
Commit message (Collapse)AuthorAgeFilesLines
* wl12xx: dynamically change fw according to number of active rolesEliad Peller2012-02-151-2/+4
| | | | | | | | | | | | | wl12xx uses different fw for single-role and multi-role scenarios (due to lack of space, some of the fw advanced features are disabled in the multi-role fw). Add checks on add_interfae and remove_interface in order to determine whether a fw switch is needed (and initiate recovery in this case). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl12xx: Use a dedicated fw for PLTEliad Peller2012-02-151-0/+2
| | | | | | | | | | | | A special PLT firmware is used for calibration. Add multiple fw support by introducing a new fw_type member, representing the currently saved fw (the actual fw state can be determined by wl->state). Signed-off-by: Gery Kahn <geryk@ti.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* Merge branch 'master' of ↵Luciano Coelho2011-12-011-1/+0
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into wl12xx-next
| * wireless: Remove redundant spi driver bus initializationLars-Peter Clausen2011-11-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In ancient times it was necessary to manually initialize the bus field of an spi_driver to spi_bus_type. These days this is done in spi_driver_register(), so we can drop the manual assignment. The patch was generated using the following coccinelle semantic patch: // <smpl> @@ identifier _driver; @@ struct spi_driver _driver = { .driver = { - .bus = &spi_bus_type, }, }; // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Dan Williams <dcbw@redhat.com> Cc: "John W. Linville" <linville@tuxdriver.com> Cc: Christian Lamparter <chunkeey@googlemail.com> Cc: Luciano Coelho <coelho@ti.com> Cc: libertas-dev@lists.infradead.org Cc: linux-wireless@vger.kernel.org Acked-by: Luciano Coelho <coelho@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | wl12xx: use the same plat dev name for both SPI and SDIOLuciano Coelho2011-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no need to have the bus name included in the platform device name that we create. The core driver doesn't need to know about the type of bus it uses. Any differences between the buses that need to be handled differently in the core, can be passed in the platform data (as the pwr_in_suspend boolean does). Use "wl12xx" for the device name in both bus drivers. Rename the platform driver name to "wl12xx_driver", just to differentiate from the platform device names. Signed-off-by: Luciano Coelho <coelho@ti.com>
* | wl12xx: spi: use dev_err instead of wl1271_errorLuciano Coelho2011-10-111-19/+12
| | | | | | | | | | | | | | | | | | | | | | | | To prevent a useless dependency between the spi module and the wl12xx module, we need to replace the wl1271_error macros with dev_err. At the same time, remove the SPI data hexdump, since this produces way too much data and is not particularly useful. There's no print_hex_dump() equivalent for dynamic debug, so it's hard to control when the dumps are printed out. Signed-off-by: Luciano Coelho <coelho@ti.com>
* | wl12xx: move debugging definitions to a separate fileLuciano Coelho2011-10-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | Separate the debugging macros and other definitions to a new debug.h file. This is be needed because the sdio and spi modules don't need to depend on the wl12xx module anymore, but still need to include wl12xx.h. Currently they do depend on it, because of the debugging global that wl12xx exports. A future patch will remove this dependency. Signed-off-by: Luciano Coelho <coelho@ti.com>
* | wl12xx: move common init code from bus modules to mainFelipe Balbi2011-10-111-139/+22
| | | | | | | | | | | | | | | | | | | | | | Move all common parts from sdio.c and spi.c to main.c, since they now can be handled as part of the platform driver. Signed-off-by: Felipe Balbi <balbi@ti.com> [forward-ported, cleaned-up and rephrased commit message] [added a bunch of fixes and a new pdata element] [moved some new code into main.c as well] Signed-off-by: Luciano Coelho <coelho@ti.com>
* | wl12xx: add a platform device to the spi moduleFelipe Balbi2011-10-111-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | The platform device will be used to match the platform driver that will be implemented by the core module. Signed-off-by: Felipe Balbi <balbi@ti.com> [forward-ported, cleaned-up and rephrased commit message] [call platform_device_add() instead of platform_device_register()] [store alloc'ed device platform directly in glue->core] [fixed the length of memset(res...)] Signed-off-by: Luciano Coelho <coelho@ti.com>
* | wl12xx: add an spi glue struct to keep wl and device side-by-sideFelipe Balbi2011-10-111-20/+47
|/ | | | | | | | | | | | In order to fully abstract the bus, we need to save the device structure *beside* wl1271, instead of inside it. This will help re-structuring the driver so that we avoid the duplicated code in the bus modules. Signed-off-by: Felipe Balbi <balbi@ti.com> [forward-ported and cleaned up and rephrased commit message] Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl12xx: Use a single fw for both STA and AP rolesArik Nemtsov2011-08-221-3/+1
| | | | | | | | | Firmware >= 6/7.3.0.0.75 (wl127x/wl128x) supports both STA and AP roles. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* Merge branch 'master' of ↵John W. Linville2011-07-081-14/+1
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
| * net: wl12xx: remove unnecessary printsFelipe Balbi2011-06-271-14/+1
| | | | | | | | | | | | | | | | Those have little value. Remove those to make the driver less noisy. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* | net: remove interrupt.h inclusion from netdevice.hAlexey Dobriyan2011-06-061-0/+1
|/ | | | | | | | * remove interrupt.g inclusion from netdevice.h -- not needed * fixup fallout, add interrupt.h and hardirq.h back where needed. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* wl12xx: Handle platforms without level trigger interruptsIdo Yariv2011-04-191-1/+8
| | | | | | | | | | | | | | | | | | | | Some platforms are incapable of triggering on level interrupts. Add a platform quirks member in the platform data structure, as well as an edge interrupt quirk which can be set on such platforms. When the interrupt is requested with IRQF_TRIGGER_RISING, IRQF_ONESHOT cannot be used, as we might miss interrupts that occur after the FW status is cleared and before the threaded interrupt handler exits. Moreover, when IRQF_ONESHOT is not set, iterating more than once in the threaded interrupt handler introduces a few race conditions between this handler and the hardirq handler. Currently this is worked around by limiting the loop to one iteration only. This workaround has an impact on performance. To remove to this restriction, the race conditions will need to be addressed. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl12xx: 1281/1283 support - Use different FW file for AP mode wl127x/wl128x ↵Arik Nemtsov2011-04-191-1/+2
| | | | | | | | | | | chips Choose a different FW for AP-mode wl127x and wl128x chips, base on chip ID at boot time. Signed-off-by: Arik Nemtsov <arik@wizery.com> Reviewed-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl12xx: 1281/1283 support - New boot sequenceShahar Levi2011-04-191-0/+1
| | | | | | | | | | | | | | | | | | Boot sequence support FREF clock and TCXO clock. WL128x has two clocks input - TCXO and FREF. TCXO is the main clock of the device, while FREF is used to sync between the GPS and the cellular modem. Auto-detection checks where TCXO is 32.736MHz or 16.368MHz, in that case the FREF will be used as the WLAN/BT main clock. [Use clock enumeration as defined in linux/wl12xx.h; remove unnecessary else block in wl128x_switch_fref; remove unnecessary change in main.c; remove some unnecessary debug prints and comments; fix potential use of uninitialized value (pll_config) -- Luca] Signed-off-by: Shahar Levi <shahar_levi@ti.com> Reviewed-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl12xx: 1281/1283 support - add block size handling for sdio and spiLuciano Coelho2011-04-191-1/+2
| | | | | | | | Add the the set_block_size op in the SDIO and in the SPI modules. Since it is only used with SDIO, just explicitly set the op to NULL in spi.c Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl12xx: 1281/1283 support - Add DefinitionsShahar Levi2011-04-191-0/+1
| | | | | | | | | | | | | | | | | | Definitions to support wl128x: - New FW file name - Chip ID - New PLL Configuration Algorithm macros that will be used at wl128x boot stage - Rename NVS macro name: wl127x and wl128x are using the same NVS file name. However, the ini parameters between them are different. The driver will validate the correct NVS size in wl1271_boot_upload_nvs(). [Cleaned up some of the definitions. -- Luca] Signed-off-by: Shahar Levi <shahar_levi@ti.com> Reviewed-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl12xx: fix module author's email address in the spi and sdio modulesLuciano Coelho2011-04-041-1/+1
| | | | | | | | | | The MODULE_AUTHOR() macro in the main module (wl12xx) has been updated to reflect one of the author's new email address, but the wl12xx_spi and wl12xx_sdio modules haven't been updated. This patches updates them. Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wl12xx: Switch to level trigger interruptsIdo Yariv2011-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The interrupt of the wl12xx is a level interrupt in nature, since the interrupt line is not auto-reset. However, since resetting the interrupt requires bus transactions, this cannot be done from an interrupt context. Thus, requesting a level interrupt would require to disable the irq and re-enable it after the HW is acknowledged. Since we now request a threaded irq, this can also be done by specifying the IRQF_ONESHOT flag. Triggering on an edge can be problematic in some platforms, if the sampling frequency is not sufficient for detecting very frequent interrupts. In case an interrupt is missed, the driver will hang as the interrupt line will stay high until it is acknowledged by the driver, which will never happen. Fix this by requesting a level triggered interrupt, with the IRQF_ONESHOT flag. Signed-off-by: Ido Yariv <ido@wizery.com> Reviewed-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl12xx: Switch to a threaded interrupt handlerIdo Yariv2011-03-031-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | To achieve maximal throughput, it is very important to react to interrupts as soon as possible. Currently the interrupt handler wakes up a worker for handling interrupts in process context. A cleaner and more efficient design would be to request a threaded interrupt handler. This handler's priority is very high, and can do blocking operations such as SDIO/SPI transactions. Some work can be deferred, mostly calls to mac80211 APIs (ieee80211_rx_ni and ieee80211_tx_status). By deferring such work to a different worker, we can keep the irq handler thread more I/O responsive. In addition, on multi-core systems the two threads can be scheduled on different cores, which will improve overall performance. The use of WL1271_FLAG_IRQ_PENDING & WL1271_FLAG_IRQ_RUNNING was changed. For simplicity, always query the FW for more pending interrupts. Since there are relatively long bursts of interrupts, the extra FW status read overhead is negligible. In addition, this enables registering the IRQ handler with the ONESHOT option. Signed-off-by: Ido Yariv <ido@wizery.com> Reviewed-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl12xx: add missing MODULE_FIRMWARE statment for AP-mode FWArik Nemtsov2011-01-241-0/+1
| | | | | | | | In wl12xx cards AP-mode requires a separate FW file. Add this file to the module info. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl12xx: use after free in debug codeDan Carpenter2011-01-241-1/+1
| | | | | | | | If debugging is turned on, then wl1271_dump() dereferences a freed variable. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
* wl1271: Change wl12xx Files NamesShahar Levi2010-11-221-0/+498
| | | | | | | | | All files name prefix removed due to the fact that wl12xx driver supports wl1271 and wl1273. Also the definition in Kconfig and header files changed respectively. Signed-off-by: Shahar Levi <shahar_levi@ti.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
* wl1251: add wl1251 prefix to all 1251 filesKalle Valo2009-07-101-395/+0
| | | | | | | | | Now that all 1271 files are split, we can add wl1251_ prefix to the files. Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com> Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wl12xx: Add support for block reading from a fixed register addressJuuso Oikarinen2009-07-101-4/+8
| | | | | | | | | | Add support for block reading (multiple bytes) from a fixed chipset register address. This is required for the wl1271 TX data path. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wl12xx: add support for fixed address in wl12xx_spi_readLuciano Coelho2009-07-101-4/+8
| | | | | | | | | | In the wl1271 implementation, we need to read memory from the register partition using fixed addresses. This change adds the possibility to request fixed address when calling wl12xx_spi_read() or wl12xx_spi_reg_read(). Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wl12xx: add wl12xx_spi_reg_read() and wl12xx_spi_reg_write() functionsLuciano Coelho2009-07-101-0/+18
| | | | | | | | | | | In some cases we need to read more than 32 bits from the register area. These functions were added to support that, like the existing wl12xx_spi_mem_read() and wl12xx_spi_mem_write() already do for large blocks in the memory area. Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wl12xx: allocate buffer the spi busy word from struct wl12xxKalle Valo2009-07-101-2/+3
| | | | | | | Needed for DMA transfers. Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wl12xx: allocate buffer spi read/write command buffer kzalloc()Kalle Valo2009-07-101-15/+19
| | | | | | | Needed for DMA safe transfers. Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wl12xx: reserve buffer for partition command in struct wl12xxKalle Valo2009-07-101-8/+14
| | | | | | | This is now DMA safe. Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wl12xx: add driverKalle Valo2009-05-061-0/+358
wl12xx is a driver for TI wl1251 802.11 chipset designed for embedded devices, supporting both SDIO and SPI busses. Currently the driver supports only SPI. Adding support 1253 (the 5 GHz version) should be relatively easy. More information here: http://focus.ti.com/general/docs/wtbu/wtbuproductcontent.tsp?contentId=4711&navigationId=12494&templateId=6123 (Collapsed original sequence of pre-merge patches into single commit for initial merge. -- JWL) Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
OpenPOWER on IntegriCloud