Commit Graph

19 Commits (8fc229a51b0e10f4ceb794e8b99fa0a427a7ba41)

Author SHA1 Message Date
Arik Nemtsov c439a1ca3b wlcore: check Rx-filter functions in the suspend path
Propagate some missing return values for Rx-filter related functions.
This and makes sure we always fail the suspend in case of SDIO errors.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-23 09:32:32 +03:00
Ido Yariv b0f0ad39e3 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>
2012-06-22 10:49:44 +03:00
Ido Yariv eb96f841b9 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>
2012-06-22 10:46:34 +03:00
Ido Yariv 045b9b5f41 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>
2012-06-22 10:46:34 +03:00
Eyal Shapira 04414e2aa5 wlcore: avoid using NET_IP_ALIGN for RX alignment
NET_IP_ALIGN can be overriden on different architectures
and therefore cannot be used in the RX path to account
for the 2 bytes added for alignment (either by the FW
in the case of 18xx or by the host for 12xx).
Instead use an internal define.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-13 21:44:10 +03:00
Arik Nemtsov 0afd04e5e5 wlcore/wl12xx/18xx: split fw_status struct into two
The number of RX packet descriptors may vary from chip to chip and
in different firmware versions.  Unfortunately, the array that
contains the actual descriptors is in the middle of the fw_status
structure.  To manage this, we split the struct into two so we can
calculate the offset of what comes after the array and access the last
elements more easily.

[Changed the STATUS_LEN macro to be placement agnostic - Arik]

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:56:58 +03:00
Arik Nemtsov 169da04f52 wlcore/wl18xx: add hw op for Rx HW checksum
Some chip families can checksum certain classes of Rx packets in FW.
Implement the Rx-checksum feature as a HW-op. For the 18xx chip-family,
set Rx-checsum according to indication from FW.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:55:23 +03:00
Eyal Shapira 4161923a24 wlcore: fix undefined symbols when CONFIG_PM is not defined
commit c21eebb503
"wl12xx: add RX filters ACX commands" breaks the build
when CONFIG_PM isn't defined:

ERROR: "wl1271_rx_filter_get_fields_size"
[drivers/net/wireless/ti/wlcore/wlcore.ko] undefined!
ERROR: "wl1271_rx_filter_flatten_fields"
[drivers/net/wireless/ti/wlcore/wlcore.ko] undefined!

code in drivers/net/wireless/ti/wlcore/acx.c is using these
functions unconditionally while they are #ifdefed CONFIG_PM.
Fix it by ifdefing all relevant RX filters code with CONFIG_PM.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Acked-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-05-29 13:45:23 -04:00
Eyal Shapira dbe0a8cdb2 wlcore: add RX filters driver state mgmt functions
More prep work to support wowlan wakeup patterns.
Added some wrappers that also keep the current filters state
updated in the driver.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-05-15 17:53:23 -04:00
Arik Nemtsov 6bac40a63a wlcore/wl12xx: adapt FW status for multiple families
Add room for a private data struct at the end of the common FW status.
Add a convenience "counters" struct inside the FW status.

The wl12xx family does not currently use the FW status private data.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-12 08:44:02 +03:00
Arik Nemtsov 4158149c24 wlcore/wl12xx: add hw op for getting rx packet data length
There is a difference in the way chip families report the length of data
in a single Rx packet. Abstract this into a HW op. Refactor the Rx data
handling function to allocate the correct size for the data, and avoid
trimming the skb.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-12 08:44:00 +03:00
Luciano Coelho b14684a004 wlcore/wl12xx: add prepare_read hw op for Rx data
The only difference in the read_data operations is that some chips
need to prepare the data to be read before reading.  So instead of
having a mandatory read_data operation, we now have an option
prepare_data operation that only needs to be implemented for chips
that require it.

In the wl12xx lower driver, we only set the prepare_data operation for
wl127x chips.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-12 08:44:00 +03:00
Arik Nemtsov cd70f6a48b wlcore/wl12xx: add hw op for getting rx buffer data alignment
An aligned data buffer is such where the Ethernet portion of the packet
starts on a 4-byte boundary. Some chip families support padding the Rx
data buffer to achieve such alignment, others rely on the host to perform
it.
Implement the HW op for getting alignment state in wl12xx. Add
support for HW-padded alignment in the Rx flow.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-12 08:43:59 +03:00
Arik Nemtsov 5766435e2f wlcore: introduce Rx block-size alignment HW quirk
For chip-families that support aligned buffers in the Rx side. The Rx
flow changes slightly for these chips.

Currently these modifications rely on a hard-coded block-size of 256.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-12 08:43:59 +03:00
Arik Nemtsov 43a8bc5a53 wlcore/wl12xx: add global elements to convert hw-rates to standard rates
Rates reported by HW can be different between chip families. Make the
rate-to-idx translation tables private per family and use them in a
common translation function. Add a global element to help determine
which rates are HW HT-rates.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-12 08:43:59 +03:00
Luciano Coelho 6f7dd16cb1 wlcore/wl12xx: add chip-specific identify chip operation
Move the code that identifies the chip ID and selects the appropriate
firmware to an operation implemented by the lower driver.  Also move
the quirks definitions into wlcore.h and rename to WLCORE_QUIRK_*.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-12 08:43:57 +03:00
Luciano Coelho 00782136b4 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>
2012-04-12 08:43:56 +03:00
Luciano Coelho c31be25a71 wl12xx/wlcore: move wl1271 struct to wlcore and add ops
In order to add chip-specific operations and prepare for future
elements that need to be set by the lower driver, move the wl1271
structure to the wlcore.h file and add an empty placeholder for the
operations structure.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-12 08:43:56 +03:00
Luciano Coelho 7b3115f265 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>
2012-04-12 08:43:56 +03:00