wl18xx: update default phy configuration for HDK1.8

update phy default configuration to fit firmware 8.5.0.0.28.
this fw introduced with new phy 8.2.0.0.152 that is set to work with two
2.4 Ghz antennas by default.

Signed-off-by: Ido Reis <idor@ti.com>
wl18xx: set default ht.mode to HT_MODE_WIDE (INTERNAL)

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>
mac80211: reject BA action frames if sent fron non HT STA

The FW doesn't work well with BA sessions started from non 802.11n
STAs. Reject these as a work around until the FW issue is fixed.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
wlcore: re-enable idle handling

We need some stuff done on idle change, most notably we have to stop
sched-scanning. Take care of this be reintroducing idle handling.
While at it, fix a bug where we would send sched_scan_stopped() up
before getting an event about stopping it from FW.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
wlcore: disable Tx BA on TIDs 6 and 7

These TIDs are used for VO and we don't want
BA to be used in VO where we prefer lower latency
over higher throughput.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
mac80211: deny ADDBA on VO AC TIDs

Avoid Rx BA on TID 6 and 7 to prefer lower latency
on VO AC instead of higher throughput.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
mac80211: extract basic rates on start_ap

On ap start, the beacon is configured while
the basic rates were not set yet (they are
set only later by userspace).

Since sometimes it's important to know
the supported rates before we start
beaconing (e.g. 11a, p2p), parse the beacon
and configure the bss_conf with the correct
basic rates, according to the supported_rates
and ext_supported_rates ies.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Revert "mac80211: use legacy mode for all ACs"

This reverts commit c0ebe796adb9c63dbdcf4cdf2e0f713220f33c1c

It fixes the issue of STA in legacy/UAPSD mixed mode to send periodically
trigger frame to AP.

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
mac80211: fix NULL dereference in ieee80211_sta_process_chanswitch

Dereference "ifmgd->associated" while not being associated
will cause a kernel panic:

  Unable to handle kernel NULL pointer dereference at virtual address 00000000
  pgd = c0004000
  [00000000] *pgd=00000000
  Internal error: Oops: 5 [#1] PREEMPT SMP
  Modules linked in: wlcore_sdio fmdrv_chr(C) gps_drv wl18xx wl12xx wlcore mac80211 cfg80211 ..

  CPU: 0    Tainted: G        WC   (3.0.31 #1)
  PC is at ieee80211_sta_process_chanswitch+0x10/0x28c [mac80211]
  LR is at ieee80211_sta_rx_queued_mgmt+0x220/0x5a4 [mac80211]
  ...

Verify that the ifmgd->associated != NULL before processing
with ieee80211_sta_process_chanswitch().

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
mac80211: fix delayed ADDBA response

Block frame processing during scan might delay the
ADDBA response, which eventually timeouts and
significantly reduces the device throughput.
Remove this constrain as it's not required for the
HW scan.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
wlcore: add missing wake_lock_destroy (ANDROID)

destroy wake_locks when failing allocation after
they have been already initialized

Signed-off-by: Nadim Zubidat <nadimz@ti.com>
wl18xx: allow using 40Mhz AP in 2.4Ghz for testing

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>
wl18xx: set default mac for untrimmed devices

Some 18xx untrimmed devises doesn't have a saved
oui and nic addresses on the chip registers, use
default oui addr in this case.

As a result the default mac address will be:
 addr 0: 08:00:28:00:00:01
 addr 1: 08:00:28:00:00:02
 addr 2: 08:00:28:00:00:03

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
wlcore: fix zeroing out of tx aggr stats (DEBUG)

Before only a pointer was zeroed, giving little effect.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
wl18xx: send EAPOL frames with TID 7

Send EAPOL frames as voice, this should fix
rekeying timeouts during heavy traffic.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
wlcore: Don't acquire a wakelock in the hardirq unless waking up

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: Add missing wake_unlock in op_resume

When resuming, wlcore_irq_locked is called directly, but the wake lock which
was acquired in op_suspend is not released. Fix this.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
wlcore: ROC on AP channel before auth reply

Start a ROC on the AP channel beforing sending the authentication reply
to a connecting STA. This ROC is held up to 1 second via a timer. If the
station is authorized and added by mac80211, the ROC is extended until
the station is fully authorized.
We make sure not to ROC twice when several stations are connecting in
parallel and to only release the ROC when both the pending-reply timer
and the STA-state callbacks do not require it.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
wlcore: cancel channel switch work on interface removal

Otherwise, if the work is pending, we might get a bad dereference after
the interface is removed.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
wlcore: hold jiffies in unsigned long

u32 can be incorrect (too small) for some architectures.

Signed-off-by: Arik Nemtsov <arik@wizery.com>