wl12xx: Load the NVS file asynchronously
The NVS file is loaded by the device's probe callback with the help of
request_firmware(). Since request_firmware() relies on udevd, the
modules cannot be loaded before hotplug events are handled.
Fix this by loading the NVS file asynchronously and continue
initialization only after the NVS file is loaded.
Also remove traces of loading the NVS file using testmode, since that is
no longer possible.
Signed-off-by: Ido Yariv <ido@wizery.com>
The NVS file is loaded by the device's probe callback with the help of
request_firmware(). Since request_firmware() relies on udevd, the
modules cannot be loaded before hotplug events are handled.
Fix this by loading the NVS file asynchronously and continue
initialization only after the NVS file is loaded.
Also remove traces of loading the NVS file using testmode, since that is
no longer possible.
Signed-off-by: Ido Yariv <ido@wizery.com>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
avoid using the skb CB for getting the appropriate sta.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
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>
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>
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>
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>
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>
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>
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>
This mode is the most stable with the current FW.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Can lead to a crash if the probe-resp was never set.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
do the fw switch only when the role was started/stopped
Signed-off-by: Eliad Peller <eliad@wizery.com>
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>
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
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>
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>
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>
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
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
Add support for setting the wowlan pattern action
to either ALLOW or DROP.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
We should release this lock before returning.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
wl12xx: refactor threaded IRQ routine
Separate the threaded IRQ handling routine into two functions.
The outer function takes the mutex and calls recovery on errors. It also
performs a Tx-path optimization to avoid redundant works.
The inner function is simplified - all calls to recovery are removed and
it assumes the lock is taken. The locked variant will be reused elsewhere.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Separate the threaded IRQ handling routine into two functions.
The outer function takes the mutex and calls recovery on errors. It also
performs a Tx-path optimization to avoid redundant works.
The inner function is simplified - all calls to recovery are removed and
it assumes the lock is taken. The locked variant will be reused elsewhere.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
wl12xx: check Rx-filter functions in the suspend path
Propagate some missing return values for Rx-filter related functions.
This and makes sure we always fail the suspend in case of SDIO errors.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Propagate some missing return values for Rx-filter related functions.
This and makes sure we always fail the suspend in case of SDIO errors.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
wl12xx: force recovery on resume if suspended without recovering
If an error is detected after mac80211 is already suspended, the recovery
work will not be queued. This will leave the driver in a bad state on
resume.
Detect this in the resume op and re-queue a recovery.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
If an error is detected after mac80211 is already suspended, the recovery
work will not be queued. This will leave the driver in a bad state on
resume.
Detect this in the resume op and re-queue a recovery.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
wl12xx: don't allow SDIO read/writes after failure
Set a flag and after the first read/write failure is encountered.
This flag will disallow further SDIO read/writes until op_stop() is
executed, which will clear all flags.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Set a flag and after the first read/write failure is encountered.
This flag will disallow further SDIO read/writes until op_stop() is
executed, which will clear all flags.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
wl12xx: cancel suspend when recovery is pending
We wish to postpone suspend if recovery is pending. This will make sure
the FW is in a good state and perform wowlan wakeup.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
We wish to postpone suspend if recovery is pending. This will make sure
the FW is in a good state and perform wowlan wakeup.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
mac80211: fix cleanup if driver suspend callback fails
In case the driver suspend callback fails, mac80211 is left
with stopped queues which prevents any further traffic as well
as all STAs are left marked with WLAN_STA_BLOCK_BA which will
cause any further ADDBA requests to be declined. Fix it by
undoing both before returning from __iee80211_suspend.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
In case the driver suspend callback fails, mac80211 is left
with stopped queues which prevents any further traffic as well
as all STAs are left marked with WLAN_STA_BLOCK_BA which will
cause any further ADDBA requests to be declined. Fix it by
undoing both before returning from __iee80211_suspend.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
mac80211: handle auth failure returned with unmatching auth algo
Some Netgear APs like WNAP210 have a quirk behavior when
configured for WEP Shared. They send an auth response with algo
SHARED and status code NOT_SUPPORTED_AUTH_ALG (13) when being
sent a request made with auth algo OPEN. Enable such response to
propagate to userspace instead of discarding it so wpa_s can
reattempt to auth with SHARED.
Reported-by: Noam Shaked <noams@ti.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Some Netgear APs like WNAP210 have a quirk behavior when
configured for WEP Shared. They send an auth response with algo
SHARED and status code NOT_SUPPORTED_AUTH_ALG (13) when being
sent a request made with auth algo OPEN. Enable such response to
propagate to userspace instead of discarding it so wpa_s can
reattempt to auth with SHARED.
Reported-by: Noam Shaked <noams@ti.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
wl12xx: Force checking of io functions' return values
All io functions' return values should be propagated and handled. Add a
__must_check annotation to verify that the return values are checked and
to avoid future mistakes.
Signed-off-by: Ido Yariv <ido@wizery.com>
All io functions' return values should be propagated and handled. Add a
__must_check annotation to verify that the return values are checked and
to avoid future mistakes.
Signed-off-by: Ido Yariv <ido@wizery.com>
wl12xx: Propagate errors from wl1271_read_hwaddr
Propagate errors from wl1271_read_hwaddr. This function is only used
when reading the FW log (following a recovery), so don't read the FW log
in case of a bus error.
Signed-off-by: Ido Yariv <ido@wizery.com>
Propagate errors from wl1271_read_hwaddr. This function is only used
when reading the FW log (following a recovery), so don't read the FW log
in case of a bus error.
Signed-off-by: Ido Yariv <ido@wizery.com>
wl12xx: Propagate errors from wl1271_write
Propagate return values from wl1271_write in order to handle bus
operations failures.
Signed-off-by: Ido Yariv <ido@wizery.com>
Propagate return values from wl1271_write in order to handle bus
operations failures.
Signed-off-by: Ido Yariv <ido@wizery.com>
wl12xx: Propagate errors from wl1271_read
Propagate return values from wl1271_read and change prototypes of
functions calling this function to return errors.
Signed-off-by: Ido Yariv <ido@wizery.com>
Propagate return values from wl1271_read and change prototypes of
functions calling this function to return errors.
Signed-off-by: Ido Yariv <ido@wizery.com>
wl12xx: Propagate errors from wl1271_raw_write32
Propagate errors from wl1271_raw_write32 and request for recovery when
appropriate.
Signed-off-by: Ido Yariv <ido@wizery.com>
Propagate errors from wl1271_raw_write32 and request for recovery when
appropriate.
Signed-off-by: Ido Yariv <ido@wizery.com>
wl12xx: Propagate errors from wl1271_raw_read32
Propagate errors from wl1271_raw_read32. Since the read functions had no
way of returning errors in-band, change their prototypes.
Signed-off-by: Ido Yariv <ido@wizery.com>
Propagate errors from wl1271_raw_read32. Since the read functions had no
way of returning errors in-band, change their prototypes.
Signed-off-by: Ido Yariv <ido@wizery.com>
wl12xx: Check return value when reading the FW status
The return value of the bus read operation is not checked when reading
the FW status. This can lead to various problems. For instance, the
driver might not be able to acknowledge interrupts, which will keep on
firing as soon as the interrupt handler exits. Fix this by propagating
the bus operation return value and handling it.
Signed-off-by: Ido Yariv <ido@wizery.com>
The return value of the bus read operation is not checked when reading
the FW status. This can lead to various problems. For instance, the
driver might not be able to acknowledge interrupts, which will keep on
firing as soon as the interrupt handler exits. Fix this by propagating
the bus operation return value and handling it.
Signed-off-by: Ido Yariv <ido@wizery.com>
wl12xx: Change read/write ops to return errors
While bus operations may fail, either due to HW or FW issues, these are
never propagated to higher layers. As a result, the core driver has no
way of knowing that the operations failed, and will only recover if high
level logic requires it (e.g. no command completion).
Change read/write bus operations to return errors to let higher layer
functionality handle these.
Signed-off-by: Ido Yariv <ido@wizery.com>
While bus operations may fail, either due to HW or FW issues, these are
never propagated to higher layers. As a result, the core driver has no
way of knowing that the operations failed, and will only recover if high
level logic requires it (e.g. no command completion).
Change read/write bus operations to return errors to let higher layer
functionality handle these.
Signed-off-by: Ido Yariv <ido@wizery.com>
wl12xx: Disable interrupts while recovering
In case a recovery is initiated, the FW can no longer be trusted, and
the driver should not handle any new FW events.
Disable the interrupt handler when a recovery is scheduled and balance
it back in the op_stop callback.
Signed-off-by: Ido Yariv <ido@wizery.com>
In case a recovery is initiated, the FW can no longer be trusted, and
the driver should not handle any new FW events.
Disable the interrupt handler when a recovery is scheduled and balance
it back in the op_stop callback.
Signed-off-by: Ido Yariv <ido@wizery.com>
wl12xx: Fix sdio out-of-sync power state
wl12xx_sdio_power_off() manually powers down the card regardless of the
runtime pm state. If wl12xx_sdio_power_on() is called before the card
was suspended by runtime PM, it will not power up the card.
As part of the HW detection, the chip's power is toggled. Since this
happens in the context of probing sdio, the power reference counter will
be higher than zero. As a result, when wl12xx_sdio_power_off() is
called, the chip will be powered down while still having a positive
power reference counter. If the interface is quickly activated, the
driver might try to transfer data to a powered off chip.
Fix this by ensuring that wl12xx_sdio_power_on() explicitly powers on
the chip in case runtime pm claims the chip is already powered on. To
avoid cases in which it is not possible to determine if the chip was
really powered on (card's power reference counter is positive), operate
on the mmc_card instead of the function.
Also verify that the chip is indeed powered on before powering off, to
avoid wrong reference counter values in error cases.
Signed-off-by: Ido Yariv <ido@wizery.com>
wl12xx_sdio_power_off() manually powers down the card regardless of the
runtime pm state. If wl12xx_sdio_power_on() is called before the card
was suspended by runtime PM, it will not power up the card.
As part of the HW detection, the chip's power is toggled. Since this
happens in the context of probing sdio, the power reference counter will
be higher than zero. As a result, when wl12xx_sdio_power_off() is
called, the chip will be powered down while still having a positive
power reference counter. If the interface is quickly activated, the
driver might try to transfer data to a powered off chip.
Fix this by ensuring that wl12xx_sdio_power_on() explicitly powers on
the chip in case runtime pm claims the chip is already powered on. To
avoid cases in which it is not possible to determine if the chip was
really powered on (card's power reference counter is positive), operate
on the mmc_card instead of the function.
Also verify that the chip is indeed powered on before powering off, to
avoid wrong reference counter values in error cases.
Signed-off-by: Ido Yariv <ido@wizery.com>
mac80211: Clear wowlan flag when drv_suspend returns failure
drv_resume can get called without a prior call to drv_suspend.
Consider the following steps:
1. Suspend is started but driver's drv_suspend returns error.
2. Suspend is aborted. local->wowlan flag is left set.
3. Interface is removed.
4. Suspend again. This time open_count is 0 so drv_suspend is
not called and local->wowlan not cleared.
5. On resume ieee80211_reconfig will call drv_resume since
local->wowlan is set.
Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drv_resume can get called without a prior call to drv_suspend.
Consider the following steps:
1. Suspend is started but driver's drv_suspend returns error.
2. Suspend is aborted. local->wowlan flag is left set.
3. Interface is removed.
4. Suspend again. This time open_count is 0 so drv_suspend is
not called and local->wowlan not cleared.
5. On resume ieee80211_reconfig will call drv_resume since
local->wowlan is set.
Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
wlcore: send EAPOLs with basic rate policy
EAPOLs are sent at high rates as they are considered
data packets. Some APs don't respond well to these rates
and don't respond with EAPOL 3/4.
Send EAPOLs with basic rate policy in order to avoid that.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
EAPOLs are sent at high rates as they are considered
data packets. Some APs don't respond well to these rates
and don't respond with EAPOL 3/4.
Send EAPOLs with basic rate policy in order to avoid that.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
mac80211: fix non RCU-safe sta_list manipulation
sta_info_cleanup locks the sta_list using rcu_read_lock however
the delete operation isn't rcu safe. A race between sta_info_cleanup
timer being called and a STA being removed can occur which leads
to a panic while traversing sta_list. Fix this by switching to the
RCU-safe versions.
[Backported to R5 by eyalsh]
Cc: stable@vger.kernel.org
Reported-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
sta_info_cleanup locks the sta_list using rcu_read_lock however
the delete operation isn't rcu safe. A race between sta_info_cleanup
timer being called and a STA being removed can occur which leads
to a panic while traversing sta_list. Fix this by switching to the
RCU-safe versions.
[Backported to R5 by eyalsh]
Cc: stable@vger.kernel.org
Reported-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
wl12xx: add a directory specific .gitignore
Ignore version.h which is an auto generated h file
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Ignore version.h which is an auto generated h file
Signed-off-by: Eyal Shapira <eyal@wizery.com>
mac80211: fix ADDBA declined after suspend with wowlan
WLAN_STA_BLOCK_BA is set while suspending but doesn't get cleared
when resuming in case of wowlan. This causes further ADDBA requests
received to be rejected. Fix it by clearing it in the wowlan path
as well.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
WLAN_STA_BLOCK_BA is set while suspending but doesn't get cleared
when resuming in case of wowlan. This causes further ADDBA requests
received to be rejected. Fix it by clearing it in the wowlan path
as well.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: handle correctly wl_list ol_R5.00.17 ol_R5.00.18 r5.00.15-build_189 r5.00.15-build_190 r5.00.18-build_196 r5.00.18-build_197 r5.00.18-build_199 r5.00.18-build_200 r5.00.18-build_201 r5.00.18-build_202 r5.00.18-build_203 r5.00.18-build_204 r5.00.18-build_205 r5.00.18-build_206 r5.00.18-build_207 r5.00.18-build_208 r5.00.18-build_209 r5.00.18-build_210 r5.00.18-build_211 r5.00.18-build_212 r5.00.18-build_213 r5.00.18-build_214
wl12xx: handle correctly wl_list
wl_list wasn't handled correctly as the wl node added in the
wl1271_op_add_interface (for each new interface), and deleted
only once in the wl1271_op_stop.
Fix this by moving the list_add operational to wl1271_op_start.
Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
wl_list wasn't handled correctly as the wl node added in the
wl1271_op_add_interface (for each new interface), and deleted
only once in the wl1271_op_stop.
Fix this by moving the list_add operational to wl1271_op_start.
Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
mac80211: [NOT_FOR_UPSTREAM] setting only VO as UAPSD
due to IOP with a lot of APs in the world, we can see that the
best behavior of our station is when working in "mixed mode":
only voice will be in UAPSD, while the other queues are in legasy
mode.
Signed-off-by: Assaf Azulay <assaf@ti.com>
due to IOP with a lot of APs in the world, we can see that the
best behavior of our station is when working in "mixed mode":
only voice will be in UAPSD, while the other queues are in legasy
mode.
Signed-off-by: Assaf Azulay <assaf@ti.com>
Revert "wl12xx: wait stop station role event"
This reverts commit 0edbb3815513ddd114528246e96a4f994f78f844.
due to bug with merge this code it was a dupplication of previos patch.
the logic of waiting for stop role evevent remains.
Signed-off-by: Assaf Azulay <assaf@ti.com>
This reverts commit 0edbb3815513ddd114528246e96a4f994f78f844.
due to bug with merge this code it was a dupplication of previos patch.
the logic of waiting for stop role evevent remains.
Signed-off-by: Assaf Azulay <assaf@ti.com>
wl12xx: wait stop station role event
Wait for the completion event after sending
the CMD_ROLE_STOP command.
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Wait for the completion event after sending
the CMD_ROLE_STOP command.
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
wl12xx: increase number of BA session to 3
with the new FW (sigle role X.3.8.0.108, multi role X.5.4.0.21)
we are supporting 3 RX BA sessions, tis change is to support this
new ability
Signed-off-by: Assaf Azulay <assaf@ti.com>
with the new FW (sigle role X.3.8.0.108, multi role X.5.4.0.21)
we are supporting 3 RX BA sessions, tis change is to support this
new ability
Signed-off-by: Assaf Azulay <assaf@ti.com>
11 years agowl12xx: increase Tx spare size only for GEM encrypted packets ol_R5.00.15 r5.00.15-build_172 r5.00.15-build_173 r5.00.15-build_174 r5.00.15-build_175 r5.00.15-build_176 r5.00.15-build_177 r5.00.15-build_178 r5.00.15-build_179
wl12xx: increase Tx spare size only for GEM encrypted packets
When allocating FW Tx spare blocks, consider the cipher used for this
skb. GEM packets require 2 spare blocks.
This is a change from globally requiring 2 spare blocks when a GEM cipher
is configured for any interface.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
When allocating FW Tx spare blocks, consider the cipher used for this
skb. GEM packets require 2 spare blocks.
This is a change from globally requiring 2 spare blocks when a GEM cipher
is configured for any interface.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
wl12xx: don't enable BET for high basic rates
The beacon early termination is not relevant for
high basic rates, which doesn't contribute
anything to the PS and only adds unnecessary FW
work.
Enable BET only if the basic rate is less than 9
Mbps.
Signed-off-by: Ziv Riesel <zivriesel@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
The beacon early termination is not relevant for
high basic rates, which doesn't contribute
anything to the PS and only adds unnecessary FW
work.
Enable BET only if the basic rate is less than 9
Mbps.
Signed-off-by: Ziv Riesel <zivriesel@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
wl12xx: fix fm_coex parameters configuration
Wrong fm_coex parameters were set during wl12xx
init phase, fix it.
Signed-off-by: Ziv Riesel <zivriesel@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Wrong fm_coex parameters were set during wl12xx
init phase, fix it.
Signed-off-by: Ziv Riesel <zivriesel@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
wl12xx: modify default parameters (to be squashed)
Modify default parameters to reduce firmware BSS lose
probability in congested environment.
Should be squashed for upstream with original commit:
43e4ba7 modify default parameters.
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Modify default parameters to reduce firmware BSS lose
probability in congested environment.
Should be squashed for upstream with original commit:
43e4ba7 modify default parameters.
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agowl12xx: modify default parameters ol_R5.00.14 r5.00.13-build_144 r5.00.13-build_145 r5.00.13-build_146 r5.00.14-build_147 r5.00.14-build_148 r5.00.14-build_149 r5.00.14-build_150 r5.00.14-build_151 r5.00.14-build_152 r5.00.14-build_153 r5.00.14-build_154 r5.00.14-build_155 r5.00.14-build_156 r5.00.14-build_157 r5.00.14-build_158 r5.00.15-build_160 r5.00.15-build_161 r5.00.15-build_162 r5.00.15-build_163 r5.00.15-build_164 r5.00.15-build_165 r5.00.15-build_166 r5.00.15-build_167 r5.00.15-build_168 r5.00.15-build_170 r5.00.15-build_171
wl12xx: modify default parameters
Modify default parameters to reduce firmware BSS lose
probability in congested environment.
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Modify default parameters to reduce firmware BSS lose
probability in congested environment.
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
wl12xx: add a sanity check for the SSID config
If the AP is configured with hidden_ssid it still
should have a valid SSID configuration.
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
If the AP is configured with hidden_ssid it still
should have a valid SSID configuration.
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>