]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - wl12xx/wl12xx.git/log
wl12xx/wl12xx.git
11 years agowl12xx: fix generic cfg fw command R5.xx_Build-52 R5.xx_Build-53 R5.xx_Build-56 R5.xx_Build-59
Eyal Shapira [Wed, 19 Sep 2012 10:35:50 +0000 (13:35 +0300)]
wl12xx: fix generic cfg fw command

The command struct was missing the header struct.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: increase scan dwell times if no activity R5.xx_Build-40 R5.xx_Build-41 R5.xx_Build-46 R5.xx_Build-47 R5.xx_Build-48 R5.xx_Build-49 R5.xx_Build-50 R5.xx_Build-51 ol_R5.SP3.01
Eyal Shapira [Thu, 13 Sep 2012 16:45:39 +0000 (19:45 +0300)]
wl12xx: increase scan dwell times if no activity

There's a limit on scan dwell times of max 30ms in order
to avoid degrading voip traffic which could be going on
while scanning. However these dwell times increase the
chance of missing out on nearby APs leading to partial
scan results. Allow configuration of longer dwell times
in case there no active interface (i.e. no STA associated
or AP up)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: prevent channel switch in the MR FW R5.xx_Build-39
Arik Nemtsov [Thu, 13 Sep 2012 11:32:55 +0000 (14:32 +0300)]
wl12xx: prevent channel switch in the MR FW

When a channel switch request arrives and we are in the MR FW, drop the
connection, as the FW command is unsupported. This will hopefully cause
the STA to reconnect on the new channel.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agonl80211: sync nl80211.h with latest wpa_s copy
Arik Nemtsov [Thu, 13 Sep 2012 11:23:45 +0000 (14:23 +0300)]
nl80211: sync nl80211.h with latest wpa_s copy

Also move channel switch related command to the TI private commands
range.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: remove unnecessary WARN_ON in wl12xx_tx_reset
Victor Goldenshtein [Wed, 12 Sep 2012 08:29:44 +0000 (11:29 +0300)]
wl12xx: remove unnecessary WARN_ON in wl12xx_tx_reset

Sometimes the driver can perform a recovery while Tx is
active, this will trigger unnecessary warning which might
delay the recovery for more than 100 mS.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agowl12xx: new module param to set the dominant role
Victor Goldenshtein [Tue, 11 Sep 2012 14:27:24 +0000 (17:27 +0300)]
wl12xx: new module param to set the dominant role

New bool "ap_ch_is_dominant" module param.

By default the STA channel is the dominant one (this flag
is't set) and the AP/GO channel can follow it.

Setting the ap_ch_is_dominant=1 will set the AP/GO channel as
a dominant, which will block any STA attempt to authenticate
on a different channel than the AP/GO operational channel.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agomac80211: if "dominant ap ch"!="sta ch" block the auth
Victor Goldenshtein [Tue, 11 Sep 2012 14:25:58 +0000 (17:25 +0300)]
mac80211: if "dominant ap ch"!="sta ch" block the auth

Add new IEEE80211_HW_AP_CH_IS_DOMINANT flag which blocks
the authentication requests for the STA role if it's tries
to authenticate on a different channel than the AP/GO channel.

By default the STA channel is the dominant one (this flag is't
set) and the AP/GO channel can follow the dominant role channel.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agomac80211: request AP/GO channel switch if needed
Victor Goldenshtein [Thu, 30 Aug 2012 06:46:39 +0000 (09:46 +0300)]
mac80211: request AP/GO channel switch if needed

For devices which support MR on a single channel
we must perform a channel alignment between roles.
This patch handles the case when an AP/GO role is
started on channel X and a second STA role starts
the authentication process on channel Y, in this
case:

1. postpone the auth process of the second role.
2. request from the userspace to switch to channel Y.
3. wait for the channel switch to complete for the first role.
4. continue with auth process.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agowl12xx: add channel switch request debugfs entry
Victor Goldenshtein [Sun, 13 Nov 2011 10:25:13 +0000 (12:25 +0200)]
wl12xx: add channel switch request debugfs entry

Which exposes the current operational AP/GO channel
and simulates channel switch request.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agowl12xx: add channel switch ability for AP & GO
Victor Goldenshtein [Mon, 10 Oct 2011 15:08:13 +0000 (17:08 +0200)]
wl12xx: add channel switch ability for AP & GO

Add channel switch command and handle channel
switch event.

[Arik - added check for role id in the event of STA channel switch. This
will prevent bogus calls to ieee80211_chswitch_done]

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agomac80211: add ap channel switch command/event
Victor Goldenshtein [Mon, 10 Oct 2011 12:55:43 +0000 (14:55 +0200)]
mac80211: add ap channel switch command/event

Add ieee80211_ap_process_chanswitch(), to handle a channel switch
request for AP.

Add ieee80211_ap_ch_switch_done() which updates oper_channel
and notifies upper layers about channel switch complete event.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agonl80211/cfg80211: add ap channel switch command
Victor Goldenshtein [Mon, 10 Oct 2011 12:53:32 +0000 (14:53 +0200)]
nl80211/cfg80211: add ap channel switch command

Add NL80211_CMD_AP_CH_SWITCH command which
triggers an AP channel switch process.

Usermode notified about channel switch complete
event with NL80211_CMD_CH_SWITCH_NOTIFY.

Usermode (hostapd) is responsible to update the
channel switch announcement IE in the beacon
prior and after the channel switch operation.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agocfg80211: add channel switch notify event
Thomas Pedersen [Fri, 6 Apr 2012 20:35:47 +0000 (13:35 -0700)]
cfg80211: add channel switch notify event

The firmware may decide to switch channels while already beaconing, e.g.
in response to a cfg80211 connect request on a different vif. Add this
event to notify userspace when an AP or GO interface has successfully
migrated to a new channel, so it can update its configuration
accordingly.

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm>
Signed-off-by: John W. Linville <linville@tuxdriver>
11 years agomac80211: add channel switch request
Victor Goldenshtein [Tue, 4 Oct 2011 12:21:04 +0000 (14:21 +0200)]
mac80211: add channel switch request

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agonl80211/cfg80211: add channel switch request command
Victor Goldenshtein [Thu, 17 May 2012 15:51:24 +0000 (18:51 +0300)]
nl80211/cfg80211: add channel switch request command

Add new NL80211_CMD_REQ_CH_SW, which requests from usermode
to perform a channel switch operation for GO/AP.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agomac80211: fix sync of rx filters with driver and cfg80211
Eyal Shapira [Thu, 13 Sep 2012 10:53:00 +0000 (13:53 +0300)]
mac80211: fix sync of rx filters with driver and cfg80211

Avoid changing the local saved rx filters in case
the driver fails to set them. As the driver clears
the filters whenever the device is stopped we need
to configure them back when turning on the device to
avoid being out of sync with cfg80211 which reports
back to userspace what's configured.
Also fix missing locking in ieee80211_set_rx_filters.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agonl80211: don't save wowlan triggers if rx_set_filters fails
Eyal Shapira [Thu, 13 Sep 2012 10:51:25 +0000 (13:51 +0300)]
nl80211: don't save wowlan triggers if rx_set_filters fails

In case the device supports rx_set_filters and it fails
avoid replacing the local state so we won't be out of sync
with the lower levels.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: clear RX filters when adding AP/GO interface
Eyal Shapira [Wed, 12 Sep 2012 23:29:58 +0000 (02:29 +0300)]
wl12xx: clear RX filters when adding AP/GO interface

In AP/GO we don't want RX filters configured by upper levels
to be in effect. AP/GO has to be able to get all traffic
including broadcasts (for DHCP for example).
Once the last AP is removed we restore the filters.
Also fix a minor bug in some error paths in remove interface
where we might not go back to ELP sleep.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: fwlog changes and dynamic mem_block
Yair Shapira [Thu, 13 Sep 2012 08:46:13 +0000 (11:46 +0300)]
wl12xx: fwlog changes and dynamic mem_block

fwlog changes (i.e. setting it to on-demand+host by default)
were merged from R8 branch.

In addition, number of fwlog mem_blocks can now be changed
using module param.

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agowl12xx: add sysfs control over disable SGI R5.xx_Build-35 R5.xx_Build-36 R5.xx_Build-37
Eyal Shapira [Wed, 12 Sep 2012 02:28:54 +0000 (05:28 +0300)]
wl12xx: add sysfs control over disable SGI

The FW by default works with Short GI whenever possible.
This is causing trouble with some sniffers used in certification
labs. An option to disable SGI was added to the FW through
a generic command API. Add support for this new API
and enable control over disabling SGI through sysfs.
debugfs cannot be used here as the certification tests are being
run on production devices.
Note that we still publish support for SGI 20 in either STA/AP
however Short GI won't be used effectively when disable_sgi is 1.
This solution is good enough according to the certification folks.

(The generic cmd part is based on Luca's dropbcast patch
which was dropped)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: add module param to enable/disable core_dump R5.xx_Build-32 R5.xx_Build-34
Yair Shapira [Sun, 9 Sep 2012 19:40:58 +0000 (22:40 +0300)]
wl12xx: add module param to enable/disable core_dump

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agowl12xx: core_dump implementation
Yair Shapira [Sun, 9 Sep 2012 19:40:57 +0000 (22:40 +0300)]
wl12xx: core_dump implementation

Added configuration parameters, defining memory area mapping and if
this service is enabled/disabled

Added recovery routine to read core dump into vmalloc'ed memory area

Added sysfs routines to read the latest core_dump. The read routine is
blocked until core_dump is available. After userspace reads the entire
core_dump, read is blocked again until next core_dump and vice versa...

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agowl12xx: remove some trailing spaces
Yair Shapira [Sun, 9 Sep 2012 19:40:56 +0000 (22:40 +0300)]
wl12xx: remove some trailing spaces

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agowl12xx: elp_wakeup when issuing recovery from userspace
Yair Shapira [Sun, 9 Sep 2012 19:40:55 +0000 (22:40 +0300)]
wl12xx: elp_wakeup when issuing recovery from userspace

When triggering recovery from userspace (through debugfs or libnl) we
now perform elp wakeup prior to queuing the recovery request. The reason
is that the queue operation disables interrupts and ELP wakeup is needed for
recovery operations such as on-demand firmware log and later on firmware
core dump.

The call to elp wakeup from recovery work fwlog function was removed because
it is meaningless - it can only succeed if elp wakeup was alerady done.

Note that in other cases before queuing a recovery request, either elp wakeup is
called or the firmware is stuck (in this case wakeup is not done).

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agowl12xx: disable WARN_ON in case of FW watchdog recovery
Yair Shapira [Sun, 9 Sep 2012 19:40:54 +0000 (22:40 +0300)]
wl12xx: disable WARN_ON in case of FW watchdog recovery

disable WARN_ON backtrace in case recovery was queued becasue of
FW watchdog interrupt

This allows faster recovery time becasue log to console is omitted

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agomac80211: always set in_reconfig=false on wakeup R5.xx_Build-24 R5.xx_Build-25 R5.xx_Build-26 R5.xx_Build-27 R5.xx_Build-28
Eliad Peller [Mon, 2 Jul 2012 12:08:25 +0000 (15:08 +0300)]
mac80211: always set in_reconfig=false on wakeup

If the interfaces were removed just before a restart
work was started, open_count will be 0, and most of
the reconfig work will be skipped, including the
resetting of local->in_reconfig to false.

Leaving local->inconfig = true will result in
dropping any incoming packet.

Fix it by always setting local->in_reconfig = false
(even if there are no active interfaces).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: stop Rx during HW reconfig
Arik Nemtsov [Wed, 6 Jun 2012 08:25:02 +0000 (11:25 +0300)]
mac80211: stop Rx during HW reconfig

While HW reconfig is in progress, drop all incoming Rx. This prevents
incoming packets from changing the internal state of the driver or
calling callbacks of the low level driver while it is in inconsistent
state.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: add stations after AP start on reconfig
Arik Nemtsov [Sun, 3 Jun 2012 20:31:56 +0000 (23:31 +0300)]
mac80211: add stations after AP start on reconfig

When performing a HW restart for an AP mode interface, add stations back
only after the AP is beaconing. This mimics the normal flow of STA
addition on AP.

Some devices (wlcore) do not support adding stations before beaconing,
so this has the added benefit of making recovery work for them.

[Eyal - backported to R5]

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoRevert "wl12xx: fix BA session after AP recovery"
Eyal Shapira [Thu, 6 Sep 2012 08:12:49 +0000 (11:12 +0300)]
Revert "wl12xx: fix BA session after AP recovery"

This reverts commit 5ec6973c0fd6f3d2744d174576beb2e7ad007e0b.
which introduced a bug where the hlid allocated for the sta during
reconfig wasn't saved in the ieee80211_sta which was passed
from mac80211. Instead a copy of ieee80211_sta was created and
maintained by wl12xx. This is wrong as mac80211 needs to be in
sync with us. The result could be attempting to free the wrong
hlid when mac80211 removes the sta among others. Fix this by
avoiding the copy and instead keep the pending peers list by
linking the driver private struct at the end of ieee80211_sta.

Another bug existed in wl1271_bss_info_changed_ap() where when
adding the peers the state was updated effectively only for the
first peer.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: Always pass DMA-able buffers to mmc functions
Ido Yariv [Wed, 5 Sep 2012 19:17:09 +0000 (22:17 +0300)]
wl12xx: 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.

Reported-by: "De Cesco, Jonathan" <jonathanc@ti.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
11 years agowl12xx: don't ROC or switch to MR on p2p mgmt on-chan Tx R5.xx_Build-23
Arik Nemtsov [Sun, 2 Sep 2012 17:13:28 +0000 (20:13 +0300)]
wl12xx: don't ROC or switch to MR on p2p mgmt on-chan Tx

When in the SR FW and Tx arrives on the p2p mgmt interface on the
same channel as an existing p2p role, don't switch to MR or ROC on
the newly started device role. Just start the device role and use it
for Tx. Do the ROC as usual in the MR FW.

This avoids problems during p2p operation, when we need to respond
to packets via the p2p-dev interface (i.e. provision discovery in GO).

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: enable the dev role on the p2p mgmt iface
Arik Nemtsov [Sun, 5 Aug 2012 16:55:25 +0000 (19:55 +0300)]
wl12xx: enable the dev role on the p2p mgmt iface

When starting a p2p mgmt interface, enable its device role. This
is used to keep the FW Rx filters down for the p2p dev role MAC address.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agomac80211: mark the p2p0 interface with a special flag
Arik Nemtsov [Sun, 5 Aug 2012 16:51:43 +0000 (19:51 +0300)]
mac80211: mark the p2p0 interface with a special flag

This flag indicates the lower driver the interface will be used for
p2p management operations only (p2p find). This will be superseded
by pending upstream patches making p2p a wdev-only interface.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: disable arp filter only if configured R5.xx_Build-20 R5.xx_Build-22
Eyal Shapira [Mon, 3 Sep 2012 23:36:22 +0000 (02:36 +0300)]
wl12xx: disable arp filter only if configured

Disabling auto arp actually causes FW resources allocation
and it's better to avoid that unless an arp filter was
already configured (i.e. the interface had an IP configured).
This also prevents exceeding the FW arp filters limit (2)
in certain scenarios. Once such case which poses a problem
is having a P2P_GO with an associated client + a connected STA
concurrently. Once you disconnect the GO, for a brief moment
the interface is changed to STA before removal. This leads to
having 3 STA interfaces (the actual STA, P2P device and the
disconnected GO which turned into a STA) and would attempt
allocating 3 FW arp filters which fails.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: don't send the sleep_auth to FW on recovery R5.xx_Build-19
Arik Nemtsov [Sun, 2 Sep 2012 10:34:54 +0000 (13:34 +0300)]
wl12xx: don't send the sleep_auth to FW on recovery

The FW doesn't seem to handle it gracefully, and it's redundant since
recovery will make us load a new FW anyway.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: Fix continuous and on-demand fwlog modes R5.xx_Build-10 R5.xx_Build-11 R5.xx_Build-12 R5.xx_Build-13 R5.xx_Build-14 R5.xx_Build-15 R5.xx_Build-16 R5.xx_Build-57 R5.xx_Build-58 R5.xx_Build-6 R5.xx_Build-7 R5.xx_Build-8 R5.xx_Build-9
Ido Yariv [Wed, 15 Aug 2012 14:51:01 +0000 (17:51 +0300)]
wl12xx: Fix continuous and on-demand fwlog modes

Commit 4d7944cc ("wl12xx: set default FW log mode to dbg-pins") set the
default debug output to debug pins. However, when either continuous or
on-demand fwlog modes are set, the debug output is not overridden
accordingly. Fix this.

Signed-off-by: Ido Yariv <ido@wizery.com>
11 years agowl12xx: Fix unbalanced interrupts enablement
Ido Yariv [Wed, 15 Aug 2012 14:20:16 +0000 (17:20 +0300)]
wl12xx: Fix unbalanced interrupts enablement

The interrupt line is enabled by wl1271_boot_enable_interrupts, but it
will not be disabled in all failure paths. Fix this.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: Don't recover during boot
Ido Yariv [Wed, 15 Aug 2012 14:20:15 +0000 (17:20 +0300)]
wl12xx: Don't recover during boot

While recursive recovery is avoided during shutdown, a new recovery may
be queued when the FW boots. The recovery work will then try to stop an
already stopped hardware, which will most likely result in a kernel
panic.

Fix this by verifying that wl->state is on before queueing a new
recovery.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowlcore: make debug prints work without dynamic debug
Arik Nemtsov [Wed, 8 Aug 2012 23:25:32 +0000 (02:25 +0300)]
wlcore: make debug prints work without dynamic debug

Make debug prints operational when dynamic debug is not defined.
This allows better debugging in production environments.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowlcore: op_tx: pass sta explicitly when inferring frame hlid
Arik Nemtsov [Thu, 26 Jul 2012 18:22:11 +0000 (21:22 +0300)]
wlcore: op_tx: pass sta explicitly when inferring frame hlid

avoid using the skb CB for getting the appropriate sta.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowlcore: don't get the hlid from a queued skb
Arik Nemtsov [Thu, 26 Jul 2012 18:19:44 +0000 (21:19 +0300)]
wlcore: don't get the hlid from a queued skb

There was a bug hiding here since the hlid was sometimes inferred from
the sta, which might be invalid at this point.

Instead, propagate the hlid from the skb-queue where we got the skb
in the first place.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowlcore: Prevent interaction with HW after recovery is queued ol_R5.SP2.04
Ido Yariv [Tue, 24 Jul 2012 16:18:49 +0000 (19:18 +0300)]
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.

[Arik - ported to r5 driver version]

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: Use a dedicated fw for PLT
Eliad Peller [Mon, 6 Feb 2012 10:47:54 +0000 (12:47 +0200)]
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).

[Arik - Ported to r5_jb. Things are slighty modified here]

Signed-off-by: Gery Kahn <geryk@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: set default FW log mode to dbg-pins
Arik Nemtsov [Mon, 30 Jul 2012 15:05:00 +0000 (18:05 +0300)]
wl12xx: set default FW log mode to dbg-pins

This mode is the most stable with the current FW.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: take the mutex during delayed recovery
Arik Nemtsov [Sun, 29 Jul 2012 09:46:23 +0000 (12:46 +0300)]
wl12xx: take the mutex during delayed recovery

We are touching internal flags and talking to the FW, so we must take
the mutex. Also add an ELP wakeup/sleep before talking to the FW in this
funcion.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: tx_flush - optimize flow and force Tx during the flush
Arik Nemtsov [Sun, 29 Jul 2012 09:18:32 +0000 (12:18 +0300)]
wl12xx: tx_flush - optimize flow and force Tx during the flush

Force Tx during the flush if there are packets pending in the driver.
This actually solves a bug where we would get called from the mac80211
wq context, which would prevent tx_work from getting queued, even when
the mutex is unlocked.

Don't stop the queues needlessly if there's nothing to flush. Use a
larger delay when sleeping to give the driver a chance to flush and
avoid cpu busy looping. Re-arrange the loop so the last iteration is
not wasted.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: lazy-enable device roles
Eliad Peller [Thu, 26 Jul 2012 14:17:06 +0000 (17:17 +0300)]
wl12xx: lazy-enable device roles

Enable device roles just before starting it.
This way, a single device role should be enough
for all vifs, as we can't use concurrent device
roles (which require ROC) anyway.

Signed-off-by: Eliad Peller <eliad@wizery.com>
11 years agowl12xx: always use wlvif->role_id for scans
Eliad Peller [Thu, 26 Jul 2012 14:17:05 +0000 (17:17 +0300)]
wl12xx: always use wlvif->role_id for scans

enabled (but not-started) sta role should be good enough
for scanning (both normal and scheduled), so use it
instead of the device_role.

Signed-off-by: Eliad Peller <eliad@wizery.com>
11 years agowl12xx: disable roaming only when booting the MR FW
Arik Nemtsov [Wed, 25 Jul 2012 20:51:09 +0000 (23:51 +0300)]
wl12xx: disable roaming only when booting the MR FW

Since the SR/MR switch is now delayed, only disable roaming when the
MR FW is booted, and otherwise enable it.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: don't try to free a NULL probe-resp
Arik Nemtsov [Wed, 25 Jul 2012 20:10:28 +0000 (23:10 +0300)]
wl12xx: don't try to free a NULL probe-resp

Can lead to a crash if the probe-resp was never set.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: allow setting 3 mac addresses
Arik Nemtsov [Wed, 18 Jul 2012 11:43:17 +0000 (14:43 +0300)]
wl12xx: allow setting 3 mac addresses

To create the third MAC address, use the first address, but set the LAA
bit. This will allow STA + P2P + AP scenarios.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agomac80211: avoid using synchronize_rcu in ieee80211_set_probe_resp
Eyal Shapira [Wed, 25 Jul 2012 06:06:14 +0000 (09:06 +0300)]
mac80211: avoid using synchronize_rcu in ieee80211_set_probe_resp

This could take a while (100ms+) and may delay sending assoc resp
in AP mode with WPS or P2P GO (as setting the probe resp takes place
there). We've encountered situations where the delay was big enough
to cause connection problems with devices like Galaxy Nexus.
Switch to using call_rcu with a free handler.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agomac80211: avoid using synchronize_rcu in ieee80211_config_beacon
Eyal Shapira [Tue, 24 Jul 2012 18:12:44 +0000 (21:12 +0300)]
mac80211: avoid using synchronize_rcu in ieee80211_config_beacon

This was causing a very long delay (>200ms) which would
delay sending assoc resp in cases of an AP with WPS (where
the beacon gets updated after assoc req is received).
Some devices like Galaxy Nexus don't accept the assoc resp
if it's delayed for too long. This is causing connection issues
in AP mode with WPS and in P2P GO.

Switch instead to using kfree_rcu which wouldn't block here
but is still safe.

(This is based on upstream changes by Johannes)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowlcore: don't stop tx queue via watermark if already stopped
Arik Nemtsov [Mon, 25 Jun 2012 19:26:17 +0000 (22:26 +0300)]
wlcore: don't stop tx queue via watermark if already stopped

If a Tx queue is currently stopped because of our Tx watermark flow
control, don't stop it again. This causes a warning to appear.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: stop queues on Tx flush
Arik Nemtsov [Fri, 18 May 2012 04:46:39 +0000 (07:46 +0300)]
wlcore: stop queues on Tx flush

Stop network queues during Tx flush, and also drop other internal
mac80211 packets (mgmt) that may arrive when the queues are stopped.

When flush is done all driver queues are clear, forcefully if needed.

Protect the Tx flush operation with a new mutex, to prevent concurrency
that can mess us queue state.

Based on a patch by Eliad Peller <eliad@wizery.com>

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: add stop reason bitmap for waking/starting queues
Arik Nemtsov [Fri, 18 May 2012 04:46:38 +0000 (07:46 +0300)]
wlcore: add stop reason bitmap for waking/starting queues

Allow the driver to wake/stop the queues for multiple reasons. A queue
is started when no stop-reasons exist.

Convert all wake/stop queue calls to use the new API.

Before, a stopped queue was almost synonymous a high-watermark on Tx.
Remove a bit of code in wl12xx_tx_reset() that relied on it.

Internal packets arriving from mac80211 are also discarded when a queue
is stopped. A notable exception to this is the watermark reason, which
is a "soft"-stop reason. We allow traffic to gradually come to a halt,
but we don't mind spurious packets here and there. This is merely a flow
regulation mechanism.

Based on a similar patch by Eliad Peller <eliadWizery.com>.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowl12xx: make Tx flush timings more verbose
Arik Nemtsov [Mon, 23 Jul 2012 20:50:45 +0000 (23:50 +0300)]
wl12xx: make Tx flush timings more verbose

Print how much time a flush took. This will help debug the time it takes
to switch between channels.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: allow only the lowest OFDM rate for p2p setup frames
Arik Nemtsov [Mon, 23 Jul 2012 12:18:29 +0000 (15:18 +0300)]
wl12xx: allow only the lowest OFDM rate for p2p setup frames

The IEEE80211_TX_CTL_NO_CCK_RATE flag is only set for mgmt packets
transmitted during p2p connection setup. Make sure to use the lowest
OFDM rate guarantee the peer always hears us.
Change the p2p rate policy to contain only the 6mpbs rate to acheive
this effect.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: AP mode - send non-data packets with basic rates
Arik Nemtsov [Mon, 23 Jul 2012 07:38:18 +0000 (10:38 +0300)]
wl12xx: AP mode - send non-data packets with basic rates

This solves interoperability issues with peer that don't seem to "hear"
management packets transmitted in higher rates. Based on a previous
patch by Igal Chernobelsky.

Cc: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agomac80211: skip the ps count of idle STAs
Victor Goldenshtein [Sun, 22 Jul 2012 13:44:36 +0000 (16:44 +0300)]
mac80211: skip the ps count of idle STAs

To be able to enter ps on a SR FW with more than one
interface up, while only one interface is connected
and others are idle.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agowl12xx: change verbose debug print
Victor Goldenshtein [Sun, 22 Jul 2012 13:44:37 +0000 (16:44 +0300)]
wl12xx: change verbose debug print

This print_info might be too verbose in some p2p
scenarios so change the wl1271_info() to
wl1271_debug() in wl12xx_need_fw_change().

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agocfg80211/nl80211/wl12xx: align to new nl80211.h ABI
Arik Nemtsov [Wed, 18 Jul 2012 11:33:23 +0000 (14:33 +0300)]
cfg80211/nl80211/wl12xx: align to new nl80211.h ABI

This includes some minor changes:
- change NL80211_CQM_RSSI_BEACON_LOSS to
  NL80211_CQM_RSSI_BEACON_LOSS_EVENT
- remove all features concerning advertisement of intermediate scan
  capabilities. These are currently unused.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agomac80211: fix invalid band deref building preq IEs
Arik Nemtsov [Mon, 9 Jul 2012 16:57:28 +0000 (19:57 +0300)]
mac80211: fix invalid band deref building preq IEs

The function building probe-request IEs does not validate the band is
supported before dereferencing it. This can result in a panic when
all bands are traversed, as done during sched-scan start.

Warn when this happens and return an empty probe request. Also fix
sched-scan to not waste memory on unsupported bands.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agowlcore: define number of supported bands internally
Arik Nemtsov [Tue, 3 Jul 2012 06:11:03 +0000 (09:11 +0300)]
wlcore: define number of supported bands internally

Avoid using the IEEE80211_NUM_BANDS constant for arrays sizes etc, as
this can contain bands unsupported by the driver (e.g. 60Ghz). Use an
internal constant to determine the number of bands.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowlcore: use basic rates for non-data packets
Eliad Peller [Wed, 11 Jul 2012 15:01:49 +0000 (18:01 +0300)]
wlcore: use basic rates for non-data packets

After the latest mac80211 changes, the sta has
the ap's sta pointer even before association.

This cause the auth and assoc frames to be sent
with the standard ap's rates, rather than the
basic rates.

Change the tx rate policy logic to use the regular
ap rates only for data packets (so control and mgmt
packets will be sent with basic rates)

Signed-off-by: Eliad Peller <eliad@wizery.com>
11 years agowlcore: send EAPOLs using minimum basic rate for all roles
Igal Chernobelsky [Wed, 27 Jun 2012 08:09:34 +0000 (11:09 +0300)]
wlcore: send EAPOLs using minimum basic rate for all roles

Send EAPOLs using minimum basic rate for AP, STA, p2p GO and Client.
The patch fixes p2p connection issue with Realtek device in p2p
certification test 5.1.13 (DEVUT reinvokes Persistent Group).

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agomac80211: check sdata_running on ieee80211_set_bitrate_mask
Eliad Peller [Tue, 12 Jun 2012 09:41:15 +0000 (12:41 +0300)]
mac80211: check sdata_running on ieee80211_set_bitrate_mask

Otherwise, we might call the driver callback before
the interface was uploaded.

Solves the following warning:
WARNING: at net/mac80211/driver-ops.h:12 ieee80211_set_bitrate_mask+0xbc/0x18c [mac80211]()
wlan0:  Failed check-sdata-in-driver check, flags: 0x0
Modules linked in: wlcore_sdio wl12xx wl18xx wlcore mac80211 cfg80211 [last unloaded: cfg80211]
[<c001b964>] (unwind_backtrace+0x0/0x12c) from [<c0495550>] (dump_stack+0x20/0x24)
[<c0495550>] (dump_stack+0x20/0x24) from [<c003ee28>] (warn_slowpath_common+0x5c/0x74)
[<c003ee28>] (warn_slowpath_common+0x5c/0x74) from [<c003eefc>] (warn_slowpath_fmt+0x40/0x48)
[<c003eefc>] (warn_slowpath_fmt+0x40/0x48) from [<bf5c1ad0>] (ieee80211_set_bitrate_mask+0xbc/0x18c [mac80211])
[<bf5c1ad0>] (ieee80211_set_bitrate_mask+0xbc/0x18c [mac80211]) from [<bf575960>] (nl80211_set_tx_bitrate_mask+0x350/0x358 [cfg80211])
[<bf575960>] (nl80211_set_tx_bitrate_mask+0x350/0x358 [cfg80211]) from [<c03e9e94>] (genl_rcv_msg+0x1a8/0x1e8)
[<c03e9e94>] (genl_rcv_msg+0x1a8/0x1e8) from [<c03e9164>] (netlink_rcv_skb+0x5c/0xc0)
[<c03e9164>] (netlink_rcv_skb+0x5c/0xc0) from [<c03e9ce0>] (genl_rcv+0x28/0x34)
[<c03e9ce0>] (genl_rcv+0x28/0x34) from [<c03e8e74>] (netlink_unicast+0x158/0x234)
[<c03e8e74>] (netlink_unicast+0x158/0x234) from [<c03e93e0>] (netlink_sendmsg+0x218/0x298)
[<c03e93e0>] (netlink_sendmsg+0x218/0x298) from [<c03b4e5c>] (sock_sendmsg+0xa4/0xc0)
[<c03b4e5c>] (sock_sendmsg+0xa4/0xc0) from [<c03b5af4>] (__sys_sendmsg+0x1d8/0x254)
[<c03b5af4>] (__sys_sendmsg+0x1d8/0x254) from [<c03b5ca8>] (sys_sendmsg+0x4c/0x70)
[<c03b5ca8>] (sys_sendmsg+0x4c/0x70) from [<c0013980>] (ret_fast_syscall+0x0/0x3c)

Note that calling the driver can also result
in undefined behaviour since it doesn't have
to deal with calls while down.

Signed-off-by: Eliad Peller <eliad@wizery.com>
[removed timestamps, added note - Johannes]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agowl12xx: increase WL12XX_MAX_ROLES
Eliad Peller [Wed, 18 Jul 2012 11:43:17 +0000 (14:43 +0300)]
wl12xx: increase WL12XX_MAX_ROLES

when working with AP + 2*STA we have more than
4 active roles. increase WL12XX_MAX_ROLES to 6.

Signed-off-by: Eliad Peller <eliad@wizery.com>
11 years agowl12xx: change recovery on start/stop device role
Eliad Peller [Mon, 9 Jul 2012 12:31:54 +0000 (15:31 +0300)]
wl12xx: change recovery on start/stop device role

since the recovery itself will usually stop the offchannel
operation, on fw boot we will use SR fw again, which will
result in endless recoveries... avoid it by forcing MR fw
for some grace period after it was needed.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: add grace period when changing MR -> SR fw
Eliad Peller [Mon, 9 Jul 2012 12:29:13 +0000 (15:29 +0300)]
wl12xx: add grace period when changing MR -> SR fw

This improves user experience when performing p2p_find for instance.

[Changed grace period to 30 seconds]

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: delay fw switch to start/stop_role_sta/ap
Eliad Peller [Thu, 5 Jul 2012 16:40:44 +0000 (19:40 +0300)]
wl12xx: delay fw switch to start/stop_role_sta/ap

do the fw switch only when the role was started/stopped

Signed-off-by: Eliad Peller <eliad@wizery.com>
11 years agomac80211: count started vifs
Arik Nemtsov [Tue, 17 Jul 2012 05:47:23 +0000 (08:47 +0300)]
mac80211: count started vifs

count the started roles by simply counting the non-idle vifs.

this method also takes care of counting non-associated
stations (when device role is started)

[Arik - backport usage of rcu here]

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: increase command completion timeout r5_3.2 ol_R5.00.21 r5.00.19-build_235 r5.00.19-build_236 r5.00.19-build_237 r5.00.19-build_239 r5.00.19-build_240 r5.00.19-build_241 r5.00.19-build_242 r5.00.19-build_243 r5.00.19-build_245 r5.00.19-build_246 r5.00.19-build_247 r5.00.19-build_248 r5.00.19-build_249 r5.00.19-build_253 r5.00.19-build_254 r5.00.19-build_255 r5.00.19-build_256 r5.00.19-build_257
Luciano Coelho [Wed, 18 Jul 2012 14:15:45 +0000 (17:15 +0300)]
wl12xx: increase command completion timeout

In some rare cases, the CMD_ROC completion may take over 1 second.
The timeout had earlier been increased to 1000ms (from 750ms), but it
is still not enoug.  Increase it to 1500ms.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: implement SW Tx watchdog
Arik Nemtsov [Sat, 3 Mar 2012 20:18:00 +0000 (22:18 +0200)]
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>
11 years agowl12xx: add an extra block for all data packets in GEM r5.00.19-build_232 r5.00.19-build_233 r5.00.19-build_234
Yoni Divinsky [Sun, 15 Jul 2012 11:21:34 +0000 (14:21 +0300)]
wl12xx: add an extra block for all data packets in GEM

FW does not handle correctly a situation where the STA
is connected using GEM and a non-GEM data packets is sent.
Therefore, when connecting using GEM, add an extra mem
block for all data packets even if they are not encrypted.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
11 years agowlcore: don't issue SLEEP_AUTH command during recovery
Arik Nemtsov [Tue, 10 Jul 2012 07:47:54 +0000 (10:47 +0300)]
wlcore: don't issue SLEEP_AUTH command during recovery

During interface removal, don't adjust sleep_auth if we are during
recovery. Since the FW is potentially dead we shouldn't talk to it.

Reported-by: Yossi Wortzel <yossiw@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: change return code in case of WD recovery (squash) ol_R5.00.20 r5.00.19-build_226 r5.00.19-build_227 r5.00.19-build_228 r5.00.19-build_229
Yoni Divinsky [Mon, 9 Jul 2012 09:09:01 +0000 (12:09 +0300)]
wl12xx: change return code in case of WD recovery (squash)

In case of WD recovery we will manage to read correctly
FW status thus the return code will be 0. because of that
recovery wont be triggered.

This patch should be squashed into:
"wl12xx: refactor threaded IRQ routine"

Signed-off-by: Yossi Wortzel <yossiw@ti.com>
Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
11 years agowl12xx: add elp_timeout config option r5.00.19-build_224 r5.00.19-build_225
Yoni Divinsky [Sun, 8 Jul 2012 13:51:33 +0000 (16:51 +0300)]
wl12xx: add elp_timeout config option

Add a configuration option which defines the
timeout for which the driver waits until it
sets the chip into elp.

Since the dynamic_ps_timeout default value is
set to 1500 msec, using it in order to
define the elp timeout causes the chip to
stay awake for long periods.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
11 years agowl12xx: increase number of rx filters to 7
Eyal Shapira [Sun, 8 Jul 2012 14:35:00 +0000 (17:35 +0300)]
wl12xx: increase number of rx filters to 7

This is supported from the following FW revisions:
SR X.2.9.0.115 MR X.3.9.0.29

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: support wowlan pattern actions
Eyal Shapira [Sun, 8 Jul 2012 13:32:56 +0000 (16:32 +0300)]
wl12xx: support wowlan pattern actions

Add support for setting the wowlan pattern action
to either ALLOW or DROP.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agonl80211: add an action to wowlan patterns
Eyal Shapira [Sun, 8 Jul 2012 11:30:10 +0000 (14:30 +0300)]
nl80211: add an action to wowlan patterns

Add an ALLOW or DROP action to wowlan patterns.
This enables configuring exception or blacklist wowlan
pattern which would avoid waking up the host in case
the pattern was found despite matching another wowlan
pattern with ALLOW action.
For example this enables configuring something like:
wakeup for all IPv4 multicast except certain type of
multicast packets.
This patch is based on a patch by Yossi Wortzel.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowlcore: avoid debug prints during intended FW recovery r5.00.19-build_223
Arik Nemtsov [Thu, 5 Jul 2012 12:50:32 +0000 (15:50 +0300)]
wlcore: avoid debug prints during intended FW recovery

Don't read the FW panic log or print other debug data when recovery is
intended (i.e. FW type switch). This takes valuable time and can be
confusing to the user.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowlcore: android: don't suspend on pending recovery (INTERNAL) r5.00.19-build_222
Arik Nemtsov [Wed, 27 Jun 2012 18:43:39 +0000 (21:43 +0300)]
wlcore: android: don't suspend on pending recovery (INTERNAL)

Some customers complain that if we cancel a pending recovery during
suspend, the android scheduler will keep banging on the suspend handler,
without letting recovery take its course. Grab a wakelock to give the
recovery process some breathing room.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agomac80211: fix list_aliases handling (INTERNAL)
Eliad Peller [Tue, 22 May 2012 11:29:29 +0000 (14:29 +0300)]
mac80211: fix list_aliases handling (INTERNAL)

commit 37a5502 ("cfg80211: more correct support of multi-essid bss-es")
used the wrong syntax for adding an entry to existing list, causing
memory corruption later on, if the original list was not empty.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowlcore: don't set SDIO_FAILED flag when driver state is off
Arik Nemtsov [Tue, 3 Jul 2012 06:00:18 +0000 (09:00 +0300)]
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>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agomac80211: don't require associated->beacon_ies for ps
Eliad Peller [Mon, 25 Jun 2012 07:48:25 +0000 (10:48 +0300)]
mac80211: don't require associated->beacon_ies for ps

beacon_ies is needed only in order to extract the dtim
period. However, even if it's missing we can still enter
ps with dtim=1 (which also happens if the TIM ie is invalid).

Most drivers don't use conf.max_sleep_period/ps_dtim_period
anyway, and this check prevents them from entering ps if
they don't have beacon (but only probe response), even though
the beacon is not needed at all.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowlcore: Prevent processing of work items during op_stop
Ido Yariv [Tue, 3 Jul 2012 22:01:47 +0000 (01:01 +0300)]
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>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: always clear recovery flag during recovery_work
Eyal Shapira [Tue, 3 Jul 2012 15:03:19 +0000 (18:03 +0300)]
wl12xx: always clear recovery flag during recovery_work

If recovery is called when the FW is off, we should clear
the recovery flag. Otherwise we risk booting the driver in
permanent pending-recovery state or getting into a state where
the driver is left in an OFF state.
This can happen if a 2nd recovery is triggered and runs before
ieee80211_reconfig adds back the interface.
Fix this by always clearing the recovery flag.
In addition, enable interrupts to balance the disable in
wl1271_queue_recovery_work.

(This is based on Arik's patch for wlcore with fixes)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowlcore: compare ssid_len before comparing ssids r5.00.19-build_221
Eliad Peller [Tue, 3 Jul 2012 14:00:21 +0000 (17:00 +0300)]
wlcore: compare ssid_len before comparing ssids

When comparing 2 ssids the ssid_len must be taken
into account. Otherwise, a substring will be treated
as equal.

This bug might cause ssids to get scanned as
public ssids (rather than hidden), resulting in
broadcast probe request (instead of ssid-specific
ones)

[ this is a backport of 587cc28 ("wlcore: compare
  ssid_len before comparing ssids") which already
  contains the "wlcore: check ssid length against
  the correct element" fix ]

Signed-off-by: Eliad Peller <eliad@wizery.com>
11 years agowl12xx: init the pll reg before reading the fuse reg
Yoni Divinsky [Mon, 2 Jul 2012 07:23:43 +0000 (10:23 +0300)]
wl12xx: init the pll reg before reading the fuse reg

The device mac address can be stored in the nvs or
the fuse registers. If the nvs contains a zero mac
address then the driver will fallback to the fuse
mac address which is read during the wl12xx_sdio
insmod.

The fuse registers are held in the DRPW partition,
therefore in order to read them safely the pll
clock must first be initialized.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
11 years agowl12xx: always set default wep key idx
Eyal Shapira [Mon, 2 Jul 2012 20:56:15 +0000 (23:56 +0300)]
wl12xx: always set default wep key idx

The driver doesn't configure the FW default wep key
in case it thinks it's identical to what was set. However,
the FW clears the default tx wep key index as part of removing
that key. This leads to key index 0 being used instead of
the correct key index in case of disconnect and reconnect
to the same network. This of course prevents any TX to the
reconnected network.
Fix it by always configuring the default wep key requested
by mac80211.
Also add a debug log for op_set_default_key_idx like the
rest of mac80211 ops.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowlcore: add probe request templates for sched and one-shot scans ol_R5.00.19 r5.00.19-build_217 r5.00.19-build_218 r5.00.19-build_219 r5.00.19-build_220
Yoni Divinsky [Thu, 14 Jun 2012 09:29:16 +0000 (12:29 +0300)]
wlcore: add probe request templates for sched and one-shot scans

The driver configures the firmware template for probe requests during
the scan process.  If the same template is used for one-shot and sched
scans they will override each other when running scans simultaneously.

This fix works only on firmwares later than
X.3.9.2.112 for single role and
X.3.9.2.23  for multi-role

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agoRevert "mac80211: use legacy mode for all ACs" r5.00.19-build_216
Assaf Azulay [Thu, 28 Jun 2012 17:40:47 +0000 (20:40 +0300)]
Revert "mac80211: use legacy mode for all ACs"

This reverts commit f4a3ec20b2a41d0988759eea247a73aac1e73f5f.
due to coex issues we have to work in mixed mode (uapsd on VO)
we will add supplicant option to configure the ACs

Signed-off-by: Assaf Azulay <assaf@ti.com>
11 years agowlcore: release lock on error in wl1271_op_suspend() r5.00.18-build_215
Eyal Shapira [Tue, 26 Jun 2012 15:10:47 +0000 (18:10 +0300)]
wlcore: release lock on error in wl1271_op_suspend()

We should release this lock before returning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agomac80211: use legacy mode for all ACs
Eyal Shapira [Tue, 19 Jun 2012 15:22:49 +0000 (18:22 +0300)]
mac80211: use legacy mode for all ACs

FritzBox 7390 (and potentially other models) have a weird behaviour
where once we enable U-APSD on the the VO AC it limits the rate
of the packets it sends us to 39Mbps and doesn't do AMPDU aggregation.
This causes a big degradation in TP obviously.
Once we use legacy mode for all ACs it's willing to use higher rates
as well as do AMPDU aggregation.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: print stack trace in every recovery
Eyal Shapira [Mon, 25 Jun 2012 18:49:07 +0000 (21:49 +0300)]
wl12xx: print stack trace in every recovery

As recovery queuing can now occur from multiple code paths
it's convenient to know what triggered it in all cases
other than an intended recovery which is part of the
switch between single role to multi role.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: queue recovery in case of bus errors during cmd_remove_peer
Eyal Shapira [Mon, 25 Jun 2012 18:49:06 +0000 (21:49 +0300)]
wl12xx: queue recovery in case of bus errors during cmd_remove_peer

Following the addition of propagating errors from the bus ops
there's a need to distinguish between bus errors (including timeout)
and a legitimate timeout occuring in cmd_wait_for_event_or_timeout.
In case of real bus errors we need to queue recovery even in cases
where a timeout on a response from the FW to a command is acceptable.

Reported-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: fix broken TX due to wrong queuing of recovery
Eyal Shapira [Mon, 25 Jun 2012 18:49:05 +0000 (21:49 +0300)]
wl12xx: fix broken TX due to wrong queuing of recovery

commit 14bba17b "wl12xx: Propagate errors from wl1271_raw_write32"
breaks down TX in certain scenarios. wl1271_irq_locked() propagates
errors from wl1271_tx_work_locked however it may return -EBUSY
when the FW queues are full which is a legitimate case and not a
a real error. In this case a recovery is triggered by wl1271_irq
and this keeps repeating itself so TX is completely broken.
Fix it by avoiding propagating return values as errors even if they
aren't. Only bus (SDIO or SPI) ops failures would be progagated
as only these should trigger recovery.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: reconfigure sleep_auth when removing interfaces r5.00.18-build_216
Arik Nemtsov [Sun, 10 Jun 2012 16:10:45 +0000 (19:10 +0300)]
wl12xx: reconfigure sleep_auth when removing interfaces

The sleep_auth value of the last interface to be set up prevailed when
an interface was removed. Take care of this by correctly configuring the
value according to the remaining STA/AP interfaces.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: prevent recovery in the middle of resume
Arik Nemtsov [Thu, 21 Jun 2012 15:10:52 +0000 (18:10 +0300)]
wl12xx: prevent recovery in the middle of resume

Take the mutex early in the resume handler and use the locked version of
the IRQ routine. This ensures any recoveries queued will only take place
after resume has fully completed.

Signed-off-by: Arik Nemtsov <arik@wizery.com>