wlcore/wl12xx/wl18xx: simplify fw_status handling

Instead of splitting the fw_status into 2 and using some
complex calculations, read the fw status and let each low-level
driver (wl12xx/wl18xx) convert it into a common struct.

This is required for the upcoming fw api changes, which
break the current logic anyway.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore/wl12xx/wl18xx: configure num_links per-hw

Upcoming fw versions will have different max links support
(according to the hw). Get ready for it by configuring
wl->num_links per-hw, instead of using the const WL12XX_MAX_LINKS.

However, continue using WLCORE_MAX_LINKS in order to simplify
structs declarations (we use it in multiple bitmaps, and converting
them to dynamic arrays is just cumbersome).

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore/wl12xx/wl18xx: configure max_stations per-hw

Each hw supports a different max stations (connected to the
same ap). add a new wl->max_ap_stations and use it instead
of the current common AP_MAX_STATIONS.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore/wl12xx/wl18xx: configure iface_combinations per-hw

Each hw supports a different iface combinations.
Define the supported combinations in each driver,
and save it in wl->iface_combinations.

Since each driver defines its own combinations now,
it can also define its max supported channels, so
we no longer need to save and set it explicitly
in wlcore.

Update wl18xx interface combinations to allow
multiple APs.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wl18xx: bump min fw version

Bump the min fw version to 8.8.0.0.1 (multi-ap support)

increase wl18xx max stations to 10

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

wl18xx: increase the number of links to 16

Current wl18xx fw supports 16 links.
Note that this change affects the fw_status struct,
and thus breaking backward compatibility.

TODO: squash with the fw bump

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

wlcore: update apis to support multi-ap

Some modifications were done to the driver-fw api
in order to support multiple APs.

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

wl18xx: increase the number of RX BA sessions to 13

The 18xx FW now supports it. Most sessions are used by the AP roles.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
wlcore: send EAPOL frames with voice priority [WAIT FW]

Send EAPOL frames with voice priority by setting TX_HW_ATTR_EAPOL_FRAME
new bit in tx attribute. Sending EAPOL with voice priority fixes
re-key timeout during heavy traffic issue.

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: no sched_scan_stopped on remove interface

Simulating a sched scan stopped from hw to userspace
is no longer valid on interface removal, since
sched scanning can be automatically restarted by mac80211

Signed-off-by: Barak Bercovitz <barak@wizery.com>
wl18xx: allow setting supported mcs rates

The supported mcs rates are set using the rx_mask field of the
ieee80211_mcs_info structure.
Add an rx_mask module param that can be used for overriding the default
rx_mask value.

[Arik - formatting changes]

Signed-off-by: Eyal Reizer <eyalr@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
wlcore: wl18xx: allow CCK rates for AP mode

12xx chips allow only OFDM rates in AP mode for BT-Coex purposes. This
is no longer required in 18xx chips, starting with FW 8.6.0.0.8.

Update the min allowed FW version in 18xx to support this functionality.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
wlcore: don't handle unsetting of default wep key

mac80211 unsets the default wep key on disassoc.
The fw doesn't support this notification, so simply
ignore it.

The actual flow actually triggers fw recovery in some
cases, as mac80211 unsets the default key only after
disassoc, when wlvif->sta.hlid, resulting in invalid
hlid being passed to the fw.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: consider multiple APs when checking active_link_count

Each AP has its own global and broadcast links, so when
checking for active sta count (according to the active_link_count)
we must take them all into account.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: decrease warning verbosity during recovery

Silently ignore repetitive scheduling of recovery work and commands
being passed to the bus when the HW is not available. This can happen
many times during recovery and slow it down. It also spams the kernel
logs.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Increase TO to 5000 instead of 1500, required for DFS command
wlcore: enable beacon filtering only after receiving a beacon

Enabling beacon filtering before receving a beacon
might result in not having a beacon at all for the
current connected AP, which prevents the station
from entering power-save.

Replace the current approach (of starting beacon
filtering on init) and configure beacon filering
only after bss_conf->dtimper is set (which means
mac80211 already parsed a beacon).

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: don't switch channels on disconnected STA vifs

Sending the FW a channel switch command on a disconnected vif may result
in a beacon loss event. Avoid this edge case.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
wlcore: add support for STA CSA with chan contexts

TI wl12xx/wl18xx cards support channel switch via a driver specific
switch_channel op while operating with channel contexts.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
wl18xx: allow using 40Mhz AP in 2.4Ghz for testing [DEBUG]

Print a more modest error and avoid the WARN_ON. It should be enough to
detect this on a user setup.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
mac80211: RX BA support for sta max_rx_aggregation_subframes

Normally rx ba buff size is limited by a max limitation set by the driver
with local->hw.max_rx_aggregation_subframes. This is the max aggregation
'win_size' supported by the chip.

This fix adds max_rx_aggregation_subframes field to sta->sta. This field
is initialy set to local->hw.max_rx_aggregation_subframes and is used
by addba_req routine. The driver/chip can choose to change this value
causing stop of existing ba sessions and effectivly forcing new ba sessions
(on this link) to be restricted by the new value.

This capability is usefull in cases of IOP, i.e. cases where peer sta
or ap doesn't respect the max subframes in a single-frame and uses the
max win_size instead. In these cases the driver/chip may recover by
decreasing the win_size to use the single frame limitation.

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
wlcore: ACX_BA_SESSION_RX_SETUP win_size taken from sta

Now that max_rx_aggregation_subframes (BA RX win size) is stored in the
mac per active link (and not only per chip), use the link (sta) value
when passing the win_size to firmware through the ACX_BA_SESSION_RX_SETUP
command.

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
wlcore: Add RX_BA_WIN_SIZE_CHANGE_EVENT event

This event is used by the Firmware to limit the RX BA win size
for a specific link.

The event handler updates the new size in the driver's link struct
and in the mac's sta->sta struct accordingly and closes all active BA
sessions for that link.

Conseqent BA sessions opened for that link will use the new restricted
win_size. This limitation remains until a new update is received or
until the link is closed.

This solves an IOP bug with APs that don't respect the max subframes in
a single-frame and uses the max win_size instead. In these cases the FW
recovers by sending this event to decrease the win_size to use the single
frame limitation.

The min fw version supporting it is 8.6.0.0.1

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>