wl12xx: add command to get current rssi

Get current rssi from roaming statistics table.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
mac80211: recalc idle after association

A scan might come right after the association, causing
recalcing the ps state of the vif, and making it go idle
right before setting the vif as associated (which violates
the assumption of drivers expecting the vif to be non-idle
on association)

Signed-off-by: Eliad Peller <eliad@wizery.com>
mac80211: remove redundant monitor_work enqueueing

ieee80211_restart_sta_timer() takes care for enqueueing
monitor_work if needed, so no need to do it again.
wl12xx: move beacon loss consts to conf and decrease max timeout (squash)

this patch should be squashed into:
"wl12xx: send beacon loss event down to the supplicant"
mac80211: avoid lockdep warning on roaming

disconnect before authentication, but do it
before scheduling the work to avoid possible
deadlock

Signed-off-by: Eliad Peller <eliad@wizery.com>
wl12xx: clear configured filters upon resume

RX filters were cleared when suspending before
configuring new filters. This was done according
to rx_data_filters_status which indicated whether
the filter was enabled.
A FW recovery was triggered when suspending
in scenarios where the FW was reloaded (e.g. recovery
or Android driver stop/start commands which occur after
15 minutes of idle) and an attempt to clear a non configured
filter occurred. Fix by clearing the filters when resuming.
wl12xx: add erp protection IE to the beacon filter

We should reconfigure the fw when erp protection should
be enabled/disabled, so pass beacons containing changes
in the ERP protection IE.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wl12xx: increase max rx filters to 5

The new FW now supports a max of 5 so update
the driver accordingly.
nl/mac80211: add RX filters support

Enable drivers that support it to receive wowlan
patterns (filters) configured and use them as
a whitelist to filter packets regardless of suspend.

(This is piggybacking the wowlan triggers and probably
would be changed for upstream)
wl12xx: configure packet filters regardless of suspend

Enable configuring of packet filters that will be applied at
all times (not just in suspend).
When suspending, these would serve as wakeup patterns
and would wake up the host. Once activcated, any packets
which don't match would be dropped.
Therefore it's imperative to configure a unicast filter
once the mechanism is activated in order to get unicast packet
directed at the device.
wl12xx: support even longer RX filter patterns

Changed the use of the RX filters FW API in order
to support longer patterns. In addition the validation
of patterns changed as it's not just a matter of maximal
pattern size but relates also to the number of differet
byte segments within the pattern.
wl12xx: revert the dynamic_ps_timeout value to 200ms

Increase the value to improve user experience with regards to
interactivity. This is the original value used by mac80211 before the
DPS changes.

(should probably be squashed with Eyal's DPS patches)

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Assaf Azulay <assaf@ti.com>
wl12xx: set the irq polarity before loading the fw

The polarity should be set before the firmware is loaded
since the firmware touches the same register. Access
of the firmware and driver to the same register will
cause a collision since there is no exclusion scheme.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
wl12xx: fix BA session after AP recovery

After recovery mac80211 (ieee80211_reconfig) first adds
AP peers and only later starts the AP role - which causes
to troubles in the fw. The solution is to save the peer
list in the wl12xx and to add them as soon as we enable
the AP role.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
wl12xx: use correct link for bcast frames

Broadcast management frames (e.g. global deauth)
should be sent out on the bcast link, rather than
the global, which should be used only for pre-added
stations (e.g. for auth/assoc resp).

Signed-off-by: Eliad Peller <eliad@wizery.com>
wl12xx: flush before stopping AP

Make sure the deauth bcast get sent

Signed-off-by: Eliad Peller <eliad@wizery.com>
wl12xx: don't send beacon loss events for p2p

There is no roaming for p2p group, so indicate
disconnection as soon as we get the first
beacon loss event

Signed-off-by: Eliad Peller <eliad@wizery.com>
mac80211: consider "DIRECT-" in bss compare

(not for upstream)

consider "DIRECT-*" with the same bssid as the
same bss. this is need in order to prevent
outdated p2p results.

(instead, we should probably just add nl80211
flag to ignore cached results)

NOTE: this patch is some workaround in order to prevent wpa_supplicant
from getting multiple results on p2p_device <--> p2p_go transition.
a better solution might be to requested scan without returning cached
results.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wl12xx: set channels 12, 13 & 14 as pactive for sched scan

Introduce “pactive” scan mode – which instructs the fw to perform
a passive scan until an activity/energy is detected on these
channels, once energy detected the channel becomes active.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
wl12xx: fix clearing of rx filters in op_remove_interface (squash)

Sending clear commands to the FW should be attempted
only in case it's not a recovery as otherwise the FW
might not be responsive. Clear the internal driver state
in any case.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>