Commit Graph

163 Commits

Author SHA1 Message Date
Arik Nemtsov 55df5afb13 wl12xx: implement SW Tx watchdog
Track freed FW blocks during Tx. If no blocks were freed during a
predefined timeout, initiate a HW recovery. This helps in situations
when the FW watchdog fails.

Don't trigger recovery during activities that can temporarily stop
Tx. This includes:
- scanning
- buffering packets for sleeping stations (AP role)
- ROC on any role

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-03-08 14:25:18 +02:00
Eliad Peller e9ba7152c1 wl12xx: avoid bug_on_recovery during fw switch
Add a flag to indicate we initiated a recovery work
on purpose, in order to avoid triggering BUG() (when
the bug_on_recovery module param was set).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-03-05 15:45:26 +02:00
Eliad Peller 9fd6f21ba2 wl12xx: set authorized AP on sta_state notification
wl12xx currently looks for AP authorization by registering
a netdev notifier and waiting for the IF_OPER_UP notification,
which is quite cumbersome.

Use the newly introduced sta_state callback (waiting
for assoc -> auth notification) instead, in order to
simplify it.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-03-05 15:45:24 +02:00
Eliad Peller 9b44350b49 wl12xx: delete wl->vif (and allow multiple vifs)
Delete the global wl->vif (and the checks on it),
so multiple vifs could be added.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:36 +02:00
Eliad Peller 4549d09c57 wl12xx: dynamically change fw according to number of active roles
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>
2012-02-15 08:38:36 +02:00
Eliad Peller 3fcdab7066 wl12xx: Use a dedicated fw for PLT
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>
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
Eyal Shapira 5c0dc2fcfe wl12xx: add forced_ps mode
For certain WiFi certification tests forcing PS
is necessary. Since DPS is now enabled in the FW
and this can't be achieved by using netlatency
this required a new config option.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:33 +02:00
Eyal Shapira d18da7fcca wl12xx: change WLVIF_FLAG_PSM name and remove WLVIF_FLAG_PSM_REQUESTED
WLVIF_FLAG_PSM turned to WLVIF_FLAG_IN_AUTO_PS which
marks that this vif is in AUTO PS.

WLVIF_FLAG_PSM_REQUESTED is not required as mac80211
calls op_config with CONF_PS after association.

wl12xx_config_vif() handling of CONF_PS was simplified
and cleaned up.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:32 +02:00
Eyal Shapira d6bf9ada92 wl12xx: remove PS management code
Removal of PS management code from the driver as PS
is handled by the FW (dynamic PS)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:31 +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 5e037e7480 wl12xx: use two MAC addresses based on the NVS or from fuse ROM
Add support for two MAC addresses.  If the NVS has a valid MAC
address, that takes precedence and we use two sequential address
starting from the one specified.

If the NVS doesn't contain a valid MAC address (ie. if it is set to
00:00:00:00:00:00), we check if the HW PG version in use has the
BD_ADDR written in the fuse ROM.  If it does, we read it and derive
the two subsequent addresses for WLAN.

During production, 3 addresses are reserved per device.  The first for
Bluetooth (burnt in the fuse ROM) and the following two for WLAN.

This patch has some code by Igal and Arik (squashed from internal
patches).

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:29 +02:00
Eliad Peller a0c7b7825e wl12xx: make WL1271_FLAG_IDLE flag per-vif
This flag should be set per-vif, rather than globally.

Rename the flag to indicate IN_USE (rather than IDLE), as
in the default configuration (i.e. flag is clear) the vif
should be idle.

Change all the bit operations (and elp conditions) appropriately.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-20 22:30:14 +02:00
Luciano Coelho 7f74484a46 wl12xx: remove unused firmware version macros
We don't use WL12XX_BA_SUPPORT_FW_COST_VER2_START nor
WL12XX_BA_SUPPORT_FW_COST_VER2_END anymore.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-15 09:58:42 +02:00
Arik Nemtsov 560f00241b wl12xx: configure probe-resp template according to notification
When operating in AP-mode, replace our probe-response template when a
notification is recieved from mac80211. We preserve the "legacy" way of
configuring a probe-response according to beacon for IBSS mode and for
versions of hostapd that do not support this feature.

Signed-off-by: Guy Eilam <guy@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-01 15:55:46 +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
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
Felipe Balbi f79f890c9c wl12xx: drop unneeded plat_dev
now that useless plat_dev is unnecessary,
we can remove it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
[forward ported and fixed sysfs file creation]
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 16:01:19 +03:00
Felipe Balbi a390e85cfe wl12xx: move common init code from bus modules to main
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>
2011-10-11 16:01:09 +03:00
Eliad Peller e4120df982 wl12xx: use round-robin policy for tx
Currently, a single vif might starve all the other vifs.
Save the last vif we dequeued a packet from, and continue
with the following one using a round-robin policy.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:29:57 +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 61f845f4f4 wl12xx: add channel field to wlvif
add channel 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 1b92f15ee0 wl12xx: add band field to wlvif
add band field 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:12 +03:00
Eliad Peller 52630c5d89 wl12xx: make WL1271_FLAG_CS_PROGRESS flag per-vif
This flag should be set per-vif, rather than globally.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:12:12 +03:00
Eliad Peller 836d6600ea wl12xx: make WL1271_FLAG_PSPOLL_FAILURE flag per-vif
This flag should be set per-vif, rather than globally.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:12:12 +03:00
Eliad Peller 10c8cd01e3 wl12xx: make WL1271_FLAG_IF_INITIALIZED per-vif
Make the initialization flag per-vif, and add some checks for it.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:12:12 +03:00
Eliad Peller 0744bdb60b wl12xx: make WL1271_FLAG_RX_STREAMING_STARTED flag per-vif
This flag should be set per-vif, rather than globally.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:09:58 +03:00
Eliad Peller 8181aecce9 wl12xx: make WL1271_FLAG_STA_STATE_SENT flag per-vif
This flag should be set per-vif, rather than globally.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:09:58 +03:00
Eliad Peller c29bb001e4 wl12xx: make WL1271_FLAG_PSM flag per-vif
move WL1271_FLAG_PSM and WL1271_FLAG_PSM_REQUESTED into
per-vif flags.
These flags should be set per-vif, rather than globally.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:09:58 +03:00
Eliad Peller 53d40d0b86 wl12xx: make WL1271_FLAG_AP_STARTED flag per-vif
This flag should be set per-vif, rather than globally.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:09:57 +03:00
Eliad Peller eee514e3d6 wl12xx: make WL1271_FLAG_IBSS_JOINED flag per-vif
This flag should be set per-vif, rather than globally.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:09:57 +03:00
Eliad Peller ba8447f641 wl12xx: make WL1271_FLAG_STA_ASSOCIATED flag per-vif
This flag should be set per-vif, rather than globally.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:09:57 +03:00
Eliad Peller 9eb599e9c6 wl12xx: rearm rx streaming per vif
Currently, the rx streaming doesn't support multi-vif
(the actual wlvif is taken from wl->vif, and the management
is global).

Make the rx streaming timers/works per-vif, and pass the
the actual vif as param.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:09:57 +03:00
Eliad Peller 48e93e402a wl12xx: move tx_security_seq into wlvif
The last security seq num has to be saved across reconfigs.
Add a new "persistent" struct into wlvif, which won't get
deleted on wl12xx_init_vif_data()

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 4b730b6a81 wl12xx: make event handling support multirole
Some events don't indicate the role they are intended for.
In these cases, iterate through all the relevant vifs,
and pass the event to each one of them.

This is only a workaround. future fw releases should indicate
the relevant role_id for such events.

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 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 8762721473 wl12xx: add vifs list
keep a list of all the vifs associated with our hw.
it will be later used in order to iterate through vifs.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:04:22 +03:00
Eliad Peller 83587505a2 wl12xx: move bitrate_masks into wlvif
move bitrate_masks 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-11 15:04:22 +03:00
Eliad Peller d6a3cc2ef9 wl12xx: unify STA and AP tx_queue mechanism
Make sta use the global wl->links[hlid].tx_queue (by
considering its links map) instead of wl->tx_queue,
and then unify the tx and tx_reset flows for the
various vifs.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:04:22 +03:00
Eliad Peller 4438aca9e1 wl12xx: move last_tx_hlid into wlvif
move last_tx_hlid 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-11 15:04:21 +03:00
Eliad Peller 170d0e6732 wl12xx: move recorded_ap_keys into wlvif
move recorded_ap_keys 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:33:50 +03:00
Eliad Peller c7ffb902cc wl12xx: move ap_hlid_map into wlvif.ap
Add wlvif->links_map bitmap to represent all the links
allocated for this vif.

AP vif also has a sta_hlid_map bitmap, which represents
the links stations connected to it (sta_hlid_bitmap is
a subset of wlvif->links_map, which itself is a subset
of the global wl->links_map)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:33:46 +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 04324d9981 wl12xx: move rssi_thold and last_rssi_event into wlvif
move rssi_thold and last_rssi_event 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:53 +03:00
Eliad Peller 74ec839557 wl12xx: move ps_poll_failures and psm_entry_retry into wlvif
move ps_poll_failures and psm_entry_retries 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:52 +03:00
Eliad Peller 6ec45dc282 wl12xx: move ps_compl into wlvif
move ps_compl 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:51 +03:00
Eliad Peller 252efa4f97 wl12xx: move pspoll_work into wlvif
move pspoll_work 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:50 +03:00
Eliad Peller f75c753f3c wl12xx: move default_key into wlvif
move default_key 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:49 +03:00
Eliad Peller 6a89979643 wl12xx: move beacon_int into wlvif
move beacon_int 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:48 +03:00