Commit graph

59 commits

Author SHA1 Message Date
Ido Reis
c08e371a68 wl12xx: increase max probe-req template size to WL1271_CMD_TEMPL_MAX_SIZE
Increase max scan IEs to allow big probe-req frames

Report a correct max-length for the scan IEs we can support, according
to the now larger size of the probe-req template.

Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:35 +02:00
Eliad Peller
5ec8a448e0 wl12xx: consider encryption and QoS in auto arp template
When configuring the arp response template,
and encryption is enabled, we should add some
space and set the protected flag bit in the fc.

In order to track the encryption type, set
wlvif->encryption_type when setting an encryption key,
and reconfigure the arp response. Clear this field on
wl1271_join, as keys have to be re-configured
anyway after a join command.

Similarly, track whether QoS is configured.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:34 +02:00
Eliad Peller
cdaac62811 wl12xx: fw api change - add role_id to set_template
The set_template commands now takes the role_id as
parameter.

Usually, we'll use the vif's main role_id.
However, sometimes we'll want to use
wlvif->dev_role_id instead of wlvif->role_id,
so pass the wanted role_id as param.

Update WL127X_FW_NAME/WL128X_FW_NAME.

(This commit starts a series of fw update patches,
and changes the start() callback to return an error
in order to prevent the use of the driver during the
transition. This change will be reverted in the
last patch of series)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:30 +02:00
Luciano Coelho
36b2082434 wl12xx: remove deprecated packet detection threshold config
The ACX_PD_THRESHOLD configuration command is deprecated and should
not be used anymore.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-15 09:58:42 +02:00
Luciano Coelho
2c8f82eabc wl12xx: call extended radio parameters for wl127x AP mode
We need to set the extended radio parameters for wl127x only.
Currently, we were only calling this command with wl127x STA mode, but
we should also do it for AP mode.

Move the call to the extended radio paramaters to the common hw_init
and use a single if for the chip type to do everything at once.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-15 09:58:41 +02:00
Eliad Peller
97127e6721 wl12xx: init CMD_TEMPL_KLV to sizeof(ieee80211_qos_hdr)
The keep alive template should have a max size of
sizeof(struct ieee80211_qos_hdr).

Additionally, Remove the redundant wl12xx_qos_null_data_template
struct.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-01 15:55:49 +02:00
Luciano Coelho
ce39defb5c wl12xx: change blocksize alignment quirk to negative
SDIO blocksize alignment support is now the rule, not the exception.
To simplify the code in patches to come, invert the meaning of the
quirk to be negative (ie. the quirk is set if the device does _not_
support blocksize alignment).

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-11-08 15:36:53 +02:00
Arik Nemtsov
a693534b1a wl12xx: keep beacon-filtering enabled during STA operation
Enable beacon filtering on STA init, and don't disable it when entering
active mode. Otherwise dynamic-PS supports means we receive beacons from
the current AP during any Tx/Rx performed by the driver.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-11-08 15:36:46 +02:00
Luciano Coelho
0f4e31222a wl12xx: move debugging definitions to a separate file
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>
2011-10-11 16:19:05 +03:00
Eliad Peller
e5a359f873 wl12xx: use dynamic rate policies
allocate the rate policies dynamically, instead of using hardcoded
indexes. this is needed for proper multi-role configuration.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:28:02 +03:00
Eliad Peller
6bd6502990 wl12xx: add power_level field to wlvif
move power_level into the per-interface data.

mac80211 configures some values (e.g. band, channel)
globally, while we configure them per-interface.

In order to make it easier to keep track of the
configured value for each value while keeping sync
with mac80211, save these values both globally
and per-vif.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:12:13 +03:00
Eliad Peller
a4e4130dce wl12xx: configure sleep_policy according to active roles
If there is an active AP role, stay always on.
Otherwise, allow chip to enter elp.

(Note that this is a global configuration, so if the
device is already configured according to our policy,
we don't have to configure it again)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:04:23 +03:00
Eliad Peller
d0802abdf9 wl12xx: move ba fields into wlvif
move ba_fields into the per-interface data, rather than
being global.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:54 +03:00
Eliad Peller
0603d891c5 wl12xx: move role_id into wlvif
move role_id into the per-interface data, rather than
being global.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:42 +03:00
Eliad Peller
536129c8ad wl12xx: move bss_type into wlvif
move bss_type into the per-interface data, rather than
being global.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:37 +03:00
Eliad Peller
d2d66c56cf wl12xx: move basic_rate into wlvif
move basic_rate into the per-interface data, rather than
being global.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:35 +03:00
Eliad Peller
30d0c8fd5b wl12xx: move rate_set into wlvif
move rate_set into the per-interface data, rather than
being global.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:34 +03:00
Eliad Peller
87fbcb0f8c wl12xx: define wl12xx_vif
Define a per-vif data struct.
This struct holds all the vif-specifc data, which is
currently being hold by the global wl struct.

Start by moving the basic_rate_set field into it.

NOTE: in order to make the patches a bit smaller, start by
using wl->vif in some functions, instead of changing all
the function prototypes at once. finally, wl->vif will be
removed altogether.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:33 +03:00
Eliad Peller
92c77c734f wl12xx: start reworking the init sequence
Split the init sequence into common commands (non role-specific)
and role-specific commands.

We still need to call the common commands only on add_interface()
(rather than on start()) as the fw must get the mac address
when uploading the nvs.

Future patches will refactor the init sequence further more.

Signed-off-by: Eliad Peller <eliad@wizery.com>
[fixed a couple of sparse warnings]
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:32 +03:00
Eliad Peller
784f694d0f wl12xx: replace wl->mac_addr with vif->addr
The mac address of the interface already exists in vif->addr.
Use it instead of wl->mac_addr.

It seems that due to some fw bug, we still need to set nvs->mac
to the actual mac addresss, otherwise the fw doesn't function
well (e.g. can't get dhcp address).
Thus, use wl->mac_addr for this purpose, and don't delete it yet.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:31 +03:00
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
Eliad Peller
9487775c5b wl12xx: add config_hangover command
Add wl12xx_acx_config_hangover() and respective conf values.
This command configures how long the chip will stay awake
after it was configured to enter psm.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14 11:47:26 +03:00
Arik Nemtsov
1a8adb67f9 wl12xx: AP-mode - configure HT rate support to the FW
Unconditionally configure HT rate support to the FW on all ACs
when starting the AP.

When 11n support is disabled by usermode (hostapd), each STA joining
the AP will appear as a non-HT STA. This will stop us from accidentally
transmitting using MCS rates.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22 12:35:29 +03:00
Arik Nemtsov
0f9c8250e1 wl12xx: re-enable block ack session support
Incorporate interface changes for HT support.

Add ba_bitmap field to the wl1271_link struct, to indicate
activate RX BA sessions (for AP mode).

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22 12:35:27 +03:00
Eliad Peller
3be4112cb2 wl12xx: update BT coex configuration params
The BT coex params api have been changed.
Update it, and init coex for both sta and ap.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22 12:35:27 +03:00
Eliad Peller
fa6ad9f0f3 wl12xx: add set_rate_mgmt_params acx
Configure rate management parameters on hw init

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22 12:35:25 +03:00
Eliad Peller
f42bd2cbf1 wl12xx: use wl1271_acx_beacon_filter_opt for both sta and ap
Use ACX_BEACON_FILTER_OPT for both station and ap roles
(use the generic wl1271_acx_beacon_filter_opt()
instead of wl1271_acx_set_ap_beacon_filter() ).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22 12:35:25 +03:00
Eliad Peller
154037d168 wl12xx: change max/default template size
The max template size was increased in the new fw.
However, we should use the max size only when needed, as it
consumes some of the chip's memory.

Thus, by default initialize the templates to the default size.
Initialize to the maximum size only when required.

Use WL1271_CMD_TEMPL_DFLT_SIZE instead of some of the
predefined structs, as some of them didn't account
for additional IEs that might be added to the template.

Delete structs defintions not used after these changes.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22 12:35:25 +03:00
Eliad Peller
c690ec816f wl12xx: update commands & events
Change the commands and events according to the new fw api
(fw >= 6/7.3.0.0.75).

The main change is the replacement of JOIN/DISCONNECT commands,
with ROLE_START/ROLE_STOP commands.

The use of these commands should be preceded by the ROLE_ENABLE
command (allocating role resources), and followed by the
ROLE_DISABLE command (freeing role resources).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22 12:35:24 +03:00
Eliad Peller
7f097988f1 wl12xx: update acx commands
Update the acx commands according to the new fw api
(fw >= 6/7.3.0.0.75).

The main change in most of the ACXs is the addition
of a new role_id/link_id field, which is required
for multi-role operation.

Currently, we don't really support multi-role, as
most of our data (inside wl) is global.
As the current fw doesn't support concurrent roles
yet, keep it this way and add wl->role_id and
wl->sta_hlid to save the active role/link.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22 12:35:24 +03:00
Eliad Peller
08c1d1c704 wl12xx: remove rx filtering stuff
The new fw doesn't support rx_filtering configuration (as a
stand-alone command. the rx filtering is done automatically
according to the active role).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22 12:35:23 +03:00
Arik Nemtsov
097f882153 wl12xx: always initialize AP-mode max power level
Sometimes we only get the Tx power level via op->config when the FW is
off. Record the received power level when this happens and use it to
initialize the firmware during boot.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-05 21:51:05 +03:00
Arik Nemtsov
3618f30f30 wl12xx: AP mode - support FW TX inactivity triggers
In AP mode we register for the MAX_TX_RETRY and INACTIVE_STA events.
Both are reported to the upper layers as a TX failure in the offending
stations.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-05 21:33:20 +03:00
Ido Yariv
95dac04f88 wl12xx: Support routing FW logs to the host
A recently added feature to the firmware enables the driver to retrieve
firmware logs via the host bus (SDIO or SPI).

There are two modes of operation:
1. On-demand: The FW collects its log in an internal ring buffer. This
   buffer can later be read, for example, upon recovery.
2. Continuous: The FW pushes the FW logs as special packets in the RX
   path.

Reading the internal ring buffer does not involve the FW. Thus, as long
as the HW is not in ELP, it should be possible to read the logs, even if
the FW crashes.

A sysfs binary file named "fwlog" was added to support this feature,
letting a monitor process read the FW messages. The log is transferred
from the FW only when available, so the reading process might block.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27 15:10:56 +03:00
Shahar Levi
70559a0665 wl12xx: Stop BA session event from device
Adding new event that close RX BA session in case of periodic BT activity
limiting WLAN activity.

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-07 14:44:02 -04:00
Luciano Coelho
25eaea30cd Revert "wl12xx: support FW TX inactivity triggers"
This reverts commit 47684808fd.

Conflicts:

	drivers/net/wireless/wl12xx/conf.h
	drivers/net/wireless/wl12xx/main.c
2011-05-02 12:46:40 +03:00
Arik Nemtsov
c45a85b5a3 wl12xx: AP-mode - reconfigure templates after basic rates change
When there's a change in the basic rates of the AP, reconfigure relevant
templates with the new rates.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02 10:31:18 +03:00
Arik Nemtsov
70f474241b wl12xx: AP-mode - overhaul rate policy configuration
Use the minimal rate configured in the basic rates set as the AP
broadcast and multicast rate. The minimal rate is used to ensure weak
links can still communicate.

When the basic rates contains at least one OFDM rate, configure all
unicast TX rates to OFDM only.

Unify rate configuration on initialization and on change notification
into a single function.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02 10:31:13 +03:00
Arik Nemtsov
521a4a2326 wl12xx: AP-mode - disable beacon filtering on start up
New AP-mode FWs filter external beacons by default. Disable this
filtering on start up so we can properly configure ERP protection.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02 10:30:48 +03:00
Arik Nemtsov
5f704d180e wl12xx: use wiphy values for setting rts, frag thresholds on init
Use the wiphy RTS and fragmentation thresholds for initializing the FW
when possible. This mitigates a bug where previously set values are
forgotten after interface down/up.

Add checks before settings these values to ensure they are valid. Use
default values when invalid thresholds are configured.

Update the default RTS threshold to the maximum value given by the
specification.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02 10:29:20 +03:00
Arik Nemtsov
801f870bc0 wl12xx: add BT-coexistance for AP
Initialize AP specific BT coexitance parameters to default values and
enable them in AP mode.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02 10:28:49 +03:00
Shahar Levi
ff86843dfb wl12xx: FM WLAN coexistence
Add support to FM WLAN coexistence (STA only).  Some WiFi harmonics
may interfere with FM operation, to avoid this problem special
coexistence techniques are activated around some FM frequencies.

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02 10:26:06 +03:00
Arik Nemtsov
47684808fd wl12xx: support FW TX inactivity triggers
In AP mode we register for the MAX_TX_RETRY and INACTIVE_STA events.
Both are reported to the upper layers as a TX failure in the offending
stations.

In STA mode we register only for the MAX_TX_RETRY event. A TX failure is
interpreted as a loss of connection.

Support for IEEE80211_HW_REPORTS_TX_ACK_STATUS has been removed to avoid
the inherent race condition of a mac80211 TX failure counter in addition
to the FW counter.

This patch depends on "mac80211: allow low level driver to report packet
loss"

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-28 14:50:45 -04: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
Shahar Levi
49d750ca14 wl12xx: 1281/1283 support - New radio structs and functions
New general and radio parameters structures and functions.
Implemented as separate functions due to auto-detection
between wl127x and wl128x.

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:48 +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
Dan Carpenter
03c5a9cf49 wl12xx: change type from u8 to int
ret is used to store int types.  Using an u8 will break the error
handling.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-22 18:06:35 +02:00
Eliad Peller
c8bde24342 wl12xx: move to new firmware (6.1.3.50.49)
This patch adds support for the new wl12xx firmware (Rev 6.1.3.50.49)

Since this fw is not backward compatible with previous fw versions,
a new fw (with different name) is being fetched.

(the patch is big because it contains all the required fw api changes.
splitting it into multiple patches will result in corrupted intermediate
commits)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-08 22:51:42 -02:00
Levi, Shahar
bbba3e6832 wl12xx: BA receiver support
Add new ampdu_action ops to support receiver BA.
The BA initiator session management in FW independently.

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-01-24 22:58:47 +02:00
Levi, Shahar
4b7fac77b4 wl12xx: BA initiator support
Add 80211n BA initiator session support wl1271 driver.
Include BA supported FW version auto detection mechanism.
BA initiator session management included in FW independently.

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-01-24 22:58:20 +02:00