wlcore: update debugfs for tx aggregation stats

Use allocated size for aggr_pkts_reason instead of define
WLCORE_AGGR_MAX_PACKETS.
[Is to be applied on top of wlcore/wl18xx/wl12xx: aggregation buffer size set
patch.]

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
wlcore: delete unused WL1271_AGGR_BUFFER_SIZE def

WL1271_AGGR_BUFFER_SIZE and WLCORE_AGGR_MAX_PACKETS unused defines are deleted,
aggr_buf_size from wl1271 structure is used instead. Spi driver is updated
to use aggr_buf_size also.

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
wl18xx: handle dbg aggr size vs rate in a dedicated function (DEBUG)

Size of the output is approximately 2 pages. I am using seq_file API
to avoid overflow of the output buffer and ensure that all chars are
going through to the user space.

Signed-off-by: Arkady Miasnikov <a-miasnikov@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.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>
wlcore: always set default wep key idx (INTERNAL)

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>
nl80211: sync nl80211.h header to supplicant (INTERNAL)

This patch includes the following changes:
- Add headers for NL80211_WOWLAN_ACTION and the associated action types.
  This feature is yet to be ported from R5 (probably wl12xx only at
  first).
- Leave some room for adding nl80211 commands - our commands will now
  start after leaving a gap of 10 in the appropriate enum. This will
  ensure old kernel can work well with new wpa_supplicants (ABI-wise).

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.

Signed-off-by: Ido Yariv <ido@wizery.com>
add blaze_defconfig
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: limit size of aggr_pkts_reason statistics

Set the size of aggr_pkts_reason statistics array depending
on the number of tx descriptors.

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
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>
wlcore: scan on the dev role for the p2p mgmt iface

When starting a p2p mgmt interface, enable its device role. This
allows us to keep the sta role disabled and scan on the dev role.

In the scan code fallback to the dev role if the regular role id is
invalid.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
wlcore: block most mac80211 ops on p2p mgmt iface

In general, p2p management interfaces cannot send vif-specific commands
to FW, as the vif role id is invalid. Only off-channel data and scans
happen on this vif, so most ops are not relevant.

If the vif is a p2p mgmt vif, block non relevant mac80211 ops.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
mac80211: allow disabling scans while another vif is active (INTERNAL)

Add new disable_scan_while_active module_param, to allow
disabling scanning on one interface while another sta/ap
interface is active.

Return EBUSY in that case.

(This is a limitation of some wl12xx/wl18xx FWs)

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: configure rate policies for p2p mgmt interface

Otherwise p2p packets come out with arbitrary rates.

Signed-off-by: Arik Nemtsov <arik@wizery.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: fix init sequence for p2p mgmt interface

We didn't handle a failure case correctly. Should be squashed with
2148a00.

Reported-by: Victor Goldenshtein <victorg@ti.com>
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>