Commit Graph

22 Commits

Author SHA1 Message Date
Eliad Peller af7fbb28ef wl12xx: implement set_bitrate_mask callback
Save the configured bitrate, and use the min allowed rate
as the basic rate (e.g. when scanning).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-23 15:59:45 +03:00
Arik Nemtsov f1acea9a9d wl12xx: AP mode - clean BA and queue state in tx_reset
Reset the BA state of all connected stations and explicitly clear the
Tx queues. The latter is needed for clearing dummy packets from
tx_queue_count.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14 13:15:19 +03:00
Arik Nemtsov f8e0af6b87 wl12xx: don't indicate up PS-filtered dummy packets
Dummy packets are currently only sent on the system_hlid link. The
system_hlid link should never be filtered for PS (as it is not
a STA link). Even so, for correctness, don't indicate dummy packets up.
The skb does not belong to mac80211 and as such does not contain a
correct skb->cb.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14 12:43:51 +03:00
Guy Eilam e9eb8cbe77 wl12xx: use 2 spare TX blocks for GEM cipher
Add tx_spare_blocks member to the wl1271 struct
for more generic configuration of the amount
of spare TX blocks that should be used.
The default value is 1.
In case GEM cipher is used by the STA, we need
2 spare TX blocks instead of just 1.

Signed-off-by: Guy Eilam <guy@wizery.com>
Acked-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-25 10:10:41 +03:00
Eliad Peller f4df1bd525 wl12xx: add system_hlid
system_hlid is a const hlid (always 0), used by the fw and driver
for packets which are not bound to specific role (e.g. dynamic
memory packets).
indicate it as always allocated.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22 12:35:26 +03:00
Eliad Peller 79b122dc51 wl12xx: update rx/tx
Update the rx/tx descriptors according to the new fw api
(fw >= 6/7.3.0.0.75)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22 12:35:25 +03:00
Arik Nemtsov f1a46384ad wl12xx: start/stop queues according to global per-AC counters
Split tx_queue_count to count per-AC skb's queued, instead of relying on
the skb-queue len. The skb queues used were only valid in STA-mode, as
AP-mode uses per-link queues.

This fixes a major regression in AP-mode, caused by the patch
"wl12xx: implement Tx watermarks per AC". With that patch applied, we
effectively had no regulation of Tx queues in AP-mode. Therefore a
sustained high rate of Tx could cause exhaustion of the skb memory pool.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-08 09:39:47 +03:00
Arik Nemtsov 708bb3cf58 wl12xx: implement Tx watermarks per AC
Each AC is stopped when its queue is filled up to the high watermark,
and restarted when its queue it lower than the low watermark. This
ensures congested ACs are not able to starve other ACs.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-05 21:33:44 +03:00
Oz Krakowski b992c68228 wl12xx: fix Tx security sequence number handling
Do not reset the security sequence number when issuing a join command or
interface is removed. Instead, reset the counter only during the unjoin
command.

Added the notion of counter wrap-around to the LSB number in
wl1271_tx_complete_packet.

Added post recovery padding to adjust for potential security number
progress during the recovery process by the firmware and avoid
potential interop issues in encrypted networks.

Signed-off-by: Oz Krakowski <ozk@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-05 21:33:19 +03:00
Arik Nemtsov 7dece1c8e1 wl12xx: fix race condition during recovery in AP mode
When operating as AP, the TX queues are not stopped when we start
recovery. mac80211 is notified only after the fact. When there is
pending TX, it will be queued even after the FW is down. This leads to
situations where the TX queues are stopped (because of the TX-watermark
mechanism), and are never woken up when we return from recovery.

Fix this by explicitly stopping the TX queues when before initiating
recovery.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02 10:31:28 +03:00
Ido Yariv 990f5de738 wl12xx: Clean up the dummy packet mechanism
The current implementation allocates a skb each time one is requested by
the firmware. Since dummy packets are handled differently than regular
packets, the skb needs to be marked. Currently, this is done by
setting the pkt_type member to 5. This might not be safe, as we cannot
be sure that there won't be any other packets with this pkt_type value.

Since the packet does not change from one request to another, we can
simply allocate a dummy packet template and always send it. All changes
to the skb done during packet preparation must be reverted, so the same
skb can be reused.

The dummy packets are not transmitted, therefore there's no need to set
the BSSID or our own MAC address.

In addition, the header portion of the packet was zeroed by mistake, so
fix that as well.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-04-19 16:49:19 +03:00
Ido Yariv 0da13da767 wl12xx: Clean up the block size alignment code
Simplify and clean up the block size alignment code:
1. Set the block size according to the padding field type, as it cannot
   exceed the maximum value this field can hold.
2. Move the alignment code into a function instead of duplicating it in
   multiple places.
3. In the current implementation, the block_size member can be
   misleading because a zero value actually means that there's no need to
   align. Declare a block size alignment quirk instead.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-04-19 16:49:18 +03:00
Luciano Coelho e7ddf549f3 wl12xx: use 1 spare TX block instead of two
All the new firmware versions (>=6.1.3.50.58 for STA and >=6.2.0.0.47
for AP) use 1 spare TX block.  We still want to support older
firmwares that require 2 spare blocks, so added a quirk to handle the
difference.

Also implemented a generic way of setting quirks that depend on the
firmware revision.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-04-19 16:49:03 +03:00
Shahar Levi ae47c45fd0 wl12xx: 1281/1283 support - Add dummy packet support
Support sending dummy packet to wl128x FW as results of
dummy packet event. That is part of dynamic TX mem blocks mechanism.

Only send dummy packet when not in AP mode.

[Even though the DUMMY_PACKET_EVENT_ID and the
STA_REMOVE_COMPLETE_EVENT_ID events are defined to the same value, we
need to treat them separately in the code.  Keep the check and enable
STA_REMOVE_COMPLETE_EVENT_ID for AP mode and DUMMY_PACKET_EVENT_ID for
STA.  Moved one warning to a cleaner place.  Use WL1271_TID_MGMT for
dummy packets -- 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>
2011-04-19 16:49:01 +03:00
Shahar Levi 48a61477bd wl12xx: 1281/1283 support - Add acx commands
New acx command that sets: Rx fifo enable reduced bus transactions
in RX path. Tx bus transactions padding to SDIO block size that
improve preference in Tx and essential for working with SDIO HS (48Mhz).
The max SDIO block size is 256 when working with Tx bus transactions
padding to SDIO block.

Add new ops to SDIO & SPI that handles the win size change in case of
transactions padding (relevant only for SDIO).

[Fix endianess issues; simplify sdio-specific block_size handling;
minor changes in comments; use "aligned_len" in one calculation
instead of "pad" to avoid confusion -- 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>
2011-04-19 16:19:47 +03:00
Arik Nemtsov a8c0ddb5ba wl12xx: AP-mode - TX queue per link in AC
When operating in AP-mode we require a per link tx-queue.
This allows us to implement HW assisted PS mode for links,
as well as regulate per-link FW TX blocks consumption.
Split each link into ACs to support future QoS for AP-mode.

AC queues are emptied in priority and per-link queues are
scheduled in a simple round-robin fashion.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-23 11:14:56 +02:00
Eliad Peller 02ad2d9080 wl12xx: use standard ALIGN() macro
Use the standard ALIGN() macro instead of redefining similar macros.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-23 11:11:19 +02:00
Arik Nemtsov beb6c88072 wl12xx: Add AP related definitions to HOST-FW interface
Change structures in a non-destructive manner. This means no
changes in size or location of existing members used by STA.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-01-24 22:11:48 +02:00
Arik Nemtsov e0fe371b74 wl12xx: AP mode - init sequence
Split HW init sequence into AP/STA specific parts

The AP specific init sequence includes configuration of templates, rate
classes, power mode, etc. Also unmask AP specific events in the event mbox.

Separate the differences between AP and STA init into mode
specific functions called from wl1271_hw_init. The first is called after
radio configuration and the second after memory configuration.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-01-24 22:11:48 +02:00
Shahar Levi 00d201001b wl1271: Change wl12xx Files Names
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>
2010-11-22 16:45:09 +02:00
Juuso Oikarinen 9f2ad4fb52 wl12xx: Moved wl1251 TX path implementation into chip specific files
Moved wl1251 TX path implementation into chip specific files to enable
parallel implementation for the wl1271 TX path.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:46 -04:00
Kalle Valo 2f01a1f588 wl12xx: add driver
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>
2009-05-06 15:14:54 -04:00