wlcore: configure dwell times according to scan type

Allow configuring different dwell times to the different
scan types (regular and scheduled).

Add new configuration entry (dwell_time_dfs) to
conf_scan_settings, in order to allow setting
different values for normal scan and scheduled scan.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: use new set bandwidth command to adjusting channel BW

We support changing the channel BW when we started the STA role on
a 40Mhz bandwidth. Otherwise a reconnection is required.
Save the started channel width and use it when channel width updates
arrive.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
wlcore: don't stop fwlog if dbgpins are used

Due to some bug, the fw asserts on fw log stop
when dbgping are used.
Don't stop the fw log in this case.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: allow TX BA on all TIDs

Previous fw limitation prevented us from from doing
TX BA on TIDs 6/7. However, this restriction no
longer exists, so enable TX BA on all TIDs.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: declare interface combinations
wlcore: use sta_state-based ROCs for AP mode

we still need matching patches in hostapd to add the station
on authentication.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: mask out CCK rates when starting GO

mask out CCK rates from the AP's local rates
when the interace is p2p interface (GO).

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: move ps change handling to .bss_info_changed()

Adapt the new mac80211 BSS_CHANGED_PS notification,
and do the ps handling in mac80211's per-vif
callback (.bss_info_changed), rather than in
the per-device (.config) callback.

Make sure to configure it only after association.

Signed-off-by: Eliad Peller <eliad@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.

Signed-off-by: Ido Yariv <ido@wizery.com>
wlcore: add num tx desc parameter to alloc_hw

Add number of Tx descriptors as new paramter to wlcore_alloc_hw function.

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
wlcore: gather information about firmware stability

It's sometimes useful to gather information about the firmware
stability in long test runs, especially to see if problems are
recurring frequently or not.  With this commit we count the number of
times a hardware recovery was issued and print it out during recovery
and in the driver_state in debugfs.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
wlcore/wl18xx/wl12xx: add recovery settings to conf

add support for recovery settings including bug_on_recovery and
no_recovery options.

These options can now be set using wl18xx-conf.bin file and wlconf
tool.

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
wl18xx: update default phy parameters to rdl1/3 (INTERNAL)

default phy parameters are now set to RDL1/RDL3 (HP SISO boards)
instead of RDL2/RDL4 (MIMO boards).
HT_MODE set to WIDE (siso40).
external dc2dc set ti 1.
power level thresholds updated.

Signed-off-by: Ido Reis <idor@ti.com>
wl18xx: Add missing wl18xx conf default value

Added missing 18xx conf (phy parameter) default value for
pwr_limit_reference_11p. Default is set to 0xc8

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
wl18xx: set default HT mode to automatic

We can correctly select between wide/mimo modes according to the number
of antennas.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
wlcore: Allow memory access when the FW crashes

When the no_recovery flag is used, the recovery work will not restart
the FW and the state will not be set to 'on'. To enable post-mortem
analysis, allow memory access in the 'restarting' state.

Also, since the FW might not be operational, don't fail the read/write
operations if elp_wakeup fails.

Reported-by: Arkady Miasnikov <a-miasnikov@ti.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
wlcore: allow fw commands to fail

Currently, each fw command/acx that return a status code
different than CMD_STATUS_SUCCESS will trigger a recovery
in the driver.

However, it is a valid for some fw commands to fail (e.g.
due to temporary lack of resources), so add new functions
that allow passing bitmap of valid error return values.

(make the current wl1271_cmd_send/wl1271_cmd_configure
wrappers around the new functions, in order to avoid
changing the whole driver)

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: allow ACX_BA_SESSION_RX_SETUP to fail

Under some circumstances, that fw might be asked to
remove a rx ba sessions it doesn't know about. In
this case, instead of triggering a recovery, accept
the error code (CMD_STATUS_NO_RX_BA_SESSION) and
ignore it.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wl18xx: update phy config and defaults

Modify phy config params structure to latest phy version
Default values and min FW version were updated accordingly.
Default external_pa_dc2dc value set to 0 (internal dc2dc).
New firmware baseline is 8.4.0.0.5.

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
wlcore: remove WLCORE_QUIRK_NO_ELP

all the current firmwares support elp, so
we can safely remove WLCORE_QUIRK_NO_ELP.

Signed-off-by: Eliad Peller <eliad@wizery.com>