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.

Update the min fw version accordingly to 8.6.0.0.1

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
wl18xx: increase the number of allowed BA sessions

Starting from fw 8.5.0.0.58, WL18XX_RX_BA_MAX_SESSIONS
was increased to 8..

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
wlcore: send EAPOL frames with voice priority

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>
wl18xx: update chip ROM version mask and offset

This should properly handle new PG 2.2 devices.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
wlcore: optimize scan debug prints

Remove scan debug dumps which are rarely used.
Make scan debug prints clear and short.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
wlcore: don't bail out when beacon/probe resp are missing

On ap initialization, the ap rates are configured before
the beacon and probe-response are configured.

Trying to set the beacon/probe-response in this stage
results in bailing out from wl1271_bss_info_changed_ap,
before all the configurations took place.

Identify this case by checking explicitly for -ENOENT
return value when configuring the beacon/probe-response.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: fix unsafe dereference of the wlvif

wlvif could be passed as NULL from the wlcore_tx_work_locked()
to the wl1271_prepare_tx_frame() and to wl1271_skb_queue_head()
functions. This may lead to a Kernel panic, fix this by
validating that wlvif != NULL.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
wlcore: fix regulatory domain bit translation

This is a fix for channels 52,56,60,64 bit translation.

Reported-by: Yaniv Machani <yanivma@ti.com>
Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
wl18xx: fix boot process in high temperature environment

In addition to existing WCS PLL configuration add and enable
also the coex PLL during init phase. This fixes boot failures
due to silicon latchup in high temperature environment (>85c).

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
mac80211: use freezable workqueue for restart work

Requesting hw restart during suspend might result
in the restart work being executed after mac80211
and the hw are suspended.

Solve the race by simply scheduling the restart
work on a freezable workqueue.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wl18xx: print new RDL versions during boot

Extract and print info for the new RDL 5, 6, 7 and 8.
Replace const struct with function which translates
the RDL number to string.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
wlcore: configure rates in multiple cases

The current code configures the peer caps only on BSS_CHANGED_HT
notification. However, we have to configure the peer caps
(and rates) even when HT is not enabled. Otherwise, the fw
continues working with low rates.

Configure the peer caps when sta_exists is true (i.e. when
we extracted the sta rates, e.g. on association).

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: Add support for DT platform data

When running with DT, we no longer have a board file that can set up the
platform data for wlcore. Allow this data to be passed from DT.

Since some platforms use a gpio-irq, add support for passing either the
irq number or the gpio number. For the latter case, the driver will
request the gpio and convert it to the irq number. If an irq is
specified, it'll be used as is.

Signed-off-by: Ido Yariv <ido@wizery.com>
wl12xx/wl18xx: scan all 5ghz channels

Due to a typo, the current code copies only sizeof(cmd->channels_2)
bytes, which is smaller than the correct sizeof(cmd->channels_5)
size, resulting in a partial scan (some channels are skipped).

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: always register dummy hardirq

This keeps the kernel happy when using edge-irqs and requesting a
threaded irq.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
wl18xx: default config alignment with phy defaults

Driver default config is aligned with phy default parameters.

Now that RDL1_3 has 2 antennas defined by default we need to explicitly
define ht.mode to HT_MODE_WIDE to have SISO40 as default.

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
add blaze_defconfig
wlcore: add wake_locks (ANDROID)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
wlcore: acquire a wakelock in the hardirq only on wake up (ANDROID)

This wakelock doesn't seem to protect against a reoccurring race, but only
cases in which the system starts suspending after the hardirq was serviced but
prior to the threaded irq. This is not very likely and being handled by
flushing the interrupts in the suspend op.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
wlcore: set "any" trigger by default (ANDROID)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>