History log of /drivers/net/wireless/ti/wlcore/io.h
Revision Date Author Comments
51ae14d0eae31a7d678c201c9664efbb373f97fa 10-Feb-2014 Barak Bercovitz <barak@wizery.com> wlcore: block read/writes to FW during ELP

When the chip is in ELP mode read/write to FW is invalid and may cause
the lower layers to get stuck. The reads/writes concerning ELP wakeup
are the exception here and are checked for. In addition to blocking the
IO, produce a warning.

Signed-off-by: Barak Bercovitz <barak@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c83cb8031bdd7923c7c5ea87accede4a5fc3282a 08-Sep-2013 Igal Chernobelsky <igalc@ti.com> wlcore/wl18xx/wl12xx: FW log params per chip arch

FW memory block size and FW log end marker parameters
are added to wl structure and are initialized per
chip architecture.

convert_hwaddr hw operation is added to convert chip
dependent FW internal address.

Copy from FW log is also simplified to copy the entire
memory block as FW logger utility is repsponsible
for parsing of FW log content.

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2e07d02828759a506b5205b2cff40daa58df5bf7 28-Nov-2012 Ido Yariv <ido@wizery.com> wlcore: Always pass DMA-able buffers to mmc functions

Some of the mmc drivers initiate DMA transfers with buffers passed from
higher layers. This means that the driver shouldn't ever pass non
DMA-able buffers, such as ones that are unaligned, allocated on the
stack or static.

Fix a couple of calls to the mmc layer in which buffers which weren't
necessarily DMA-able were passed.

[Use sizeof(*wl->buffer_32) instead of sizeof(u32) -- Luca]

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
4cc533830b7e6b309e8b73196c410951fc2bed91 24-Jul-2012 Ido Yariv <ido@wizery.com> wlcore: Prevent interaction with HW after recovery is queued

When a function requests to recover, it would normally abort and will
not send any additional commands to the HW. However, other threads may
not be aware of the failure and could try to communicate with the HW
after a recovery was queued, but before the recovery work began.

Fix this by introducing an intermediate state which is set when recovery
is queued, and modify all state checks accordingly.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <luca@coelho.fi>
4455556d71951cfb6010e267efd00a52b63c2c20 03-Jul-2012 Arik Nemtsov <arik@wizery.com> wlcore: don't set SDIO_FAILED flag when driver state is off

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>
c24ec83bcac50160c344b3eb0e4c601b6cb4f7e5 26-Jun-2012 Ido Yariv <ido@wizery.com> wlcore: Prevent processing of work items during op_stop

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>
1d23396d9df0a9543b2ba5c288f4914ad1f19e46 21-Jun-2012 Arik Nemtsov <arik@wizery.com> wlcore: don't allow SDIO read/writes after failure

Set a flag and after the first read/write failure is encountered.
This flag will disallow further SDIO read/writes until op_stop() is
executed, which will clear all flags.

This prevents further errors from occurring, since one error usually
indicates that IO operations won't work anymore until the chip is
rebooted. By blocking more calls, we avoid extra timeouts and having
to wait for them to occur.

[Added second paragraph explaining why the change is needed. -- Luca]

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
f1a26e638e646d971f77c5a5186ee254b3f4e818 19-Jun-2012 Ido Yariv <ido@wizery.com> wlcore: Force checking of io functions' return values

All io functions' return values should be propagated and handled. Add a
__must_check annotation to verify that the return values are checked and
to avoid future mistakes.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2b80040782af56e1b13ad451f593dd4e1875b2b8 18-Jun-2012 Ido Yariv <ido@wizery.com> wlcore: Propagate errors from wl1271_read_hwaddr

Propagate errors from wl1271_read_hwaddr. This function is only used
when reading the FW log (following a recovery), so don't read the FW log
in case of a bus error.

Also rename prefixes of wlcore functions which their prototypes had to
be changed.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
b0f0ad39e3d2716fe9ca6e50ce4cda87eb409ee0 19-Jun-2012 Ido Yariv <ido@wizery.com> wlcore: Propagate errors from wl1271_raw_write32

Propagate errors from wl1271_raw_write32 and request for recovery when
appropriate.
Also rename prefixes of wlcore functions which their prototypes had to
be changed.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
6134323f42b0dbae8e8206414d26cb167b9bedfc 18-Jun-2012 Ido Yariv <ido@wizery.com> wlcore: Propagate errors from wl1271_raw_read32

Propagate errors from wl1271_raw_read32. Since the read functions had no
way of returning errors in-band, change their prototypes.
Also rename prefixes of wlcore functions which their prototypes had to
be changed.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
eb96f841b9563ba34969be25615548635728faf5 18-Jun-2012 Ido Yariv <ido@wizery.com> wlcore: Propagate errors from wl1271_write

Propagate errors from wl1271_write and request for recovery when
appropriate.
Also rename prefixes of wlcore functions which their prototypes had to
be changed.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
045b9b5f4172b2b21af0b9bf5e6dda51146d51a4 17-Jun-2012 Ido Yariv <ido@wizery.com> wlcore: Propagate errors from wl1271_read

Propagate errors from wl1271_read and request for recovery when
appropriate.
Also rename prefixes of wlcore functions which their prototypes had to
be changed.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
8b7c0fc3569693c3a68103b7d5a7dad5b84109bc 17-Jun-2012 Ido Yariv <ido@wizery.com> wlcore: Propagate errors from wlcore_raw_*_data functions

wlcore_raw_read_data is called when the FW status is read which happens
while handling interrupts and when the FW log is read following a
recovery. Request a recovery in the former case, and don't read the FW
log in case the FW status read failed.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
0c2a6ce04eb4d742170a4ddfeb57263fb7964698 17-Jun-2012 Ido Yariv <ido@wizery.com> wlcore: Change raw io functions to return errors

Make wl1271_raw_write and wl1271_raw_read return errors so the driver
could handle these appropriately.
Since the prototype has changed, also rename the prefix of these
functions to wlcore.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
b666bb7f2fe2bdc0309b0d58afb48eae85d92221 21-May-2012 Ido Yariv <ido@wizery.com> wlcore: Disable interrupts while recovering

In case a recovery is initiated, the FW can no longer be trusted, and
the driver should not handle any new FW events.

Disable the interrupt handler when a recovery is scheduled and balance
it back in the op_stop callback.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
645865fc377c9ac73df590abf8e6af65824390a3 20-May-2012 Ido Yariv <ido@wizery.com> wlcore: Fix sdio out-of-sync power state

wl12xx_sdio_power_off() manually powers down the card regardless of the
runtime pm state. If wl12xx_sdio_power_on() is called before the card
was suspended by runtime PM, it will not power up the card.

As part of the HW detection, the chip's power is toggled. Since this
happens in the context of probing sdio, the power reference counter will
be higher than zero. As a result, when wl12xx_sdio_power_off() is
called, the chip will be powered down while still having a positive
power reference counter. If the interface is quickly activated, the
driver might try to transfer data to a powered off chip.

Fix this by ensuring that wl12xx_sdio_power_on() explicitly powers on
the chip in case runtime pm claims the chip is already powered on. To
avoid cases in which it is not possible to determine if the chip was
really powered on (card's power reference counter is positive), operate
on the mmc_card instead of the function.

Also verify that the chip is indeed powered on before powering off, to
avoid wrong reference counter values in error cases.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
dd5512eb6b8317069e80d70a624b6d350afebc9e 11-Apr-2012 Luciano Coelho <coelho@ti.com> wlcore/wl12xx: move top initialization to wl12xx

The top registers initialization is very specific to the actual
hardware used, even the way in which we read from and write to the top
registers varies from chip to chip. This patch moves all top
registers initialization to wl12xx. Also add a boot op for the wlcore
module to call at the right time and a few callbacks with the common
called to be called from the lower drivers boot operations.

Signed-off-by: Luciano Coelho <coelho@ti.com>
00782136b4d6e2316e0a2a55f3b1fba160e9576e 29-Nov-2011 Luciano Coelho <coelho@ti.com> wlcore/wl12xx: implement chip-specific register tables

Add register tables support in wlcore, add some new IO functions to
read and write to chip-specific register and data addresses. Move
some common register values from wl12xx to wlcore and add the
registers table to wl12xx.

Signed-off-by: Luciano Coelho <coelho@ti.com>
25a43d78eb63281294793fdaab6108bef81d7648 21-Nov-2011 Luciano Coelho <coelho@ti.com> wlcore/wl12xx: implement chip-specific partition tables

Add partition tables to wlcore, move and reorganize partition setting
functions. Move wl12xx partition table to use the wlcore partition
table instead.

Signed-off-by: Luciano Coelho <coelho@ti.com>
7b3115f265de1b669b757f3802b67c9a7f146223 02-Dec-2011 Luciano Coelho <coelho@ti.com> wl12xx/wlcore: rename wl12xx to wlcore

Rename the wl12xx driver directory to wlcore as an initial step
towards the split of the driver into wlcore and wl12xx. We just
rename the directory first to keep git blame happy.

Signed-off-by: Luciano Coelho <coelho@ti.com>