wlcore: support scan reports during periodic scan

FW API changed and now PERIODIC_SCAN_REPORT_EVENT is sent
in case results were found at the end of each sched scan
cycle. Previous FW was missing that and broke sched scan.

This API change is available from 18xx FW 8.5.0.0.27

[Arik - move changes to 18xx specific files, align FW structures to
latest for scan command]

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
wlcore: discard corrupted packets early in Rx path

Avoid reporting other abnormalities with corrupted packets that also
have other failure bytes on. Namely - we don't want to get a MIC failure
on a corrupted packet. This is mandated by the WiFi specification - see
section 11.4.2.4.1 in 802.11-2012.
Also fix the offset to the packet data when printing the corrupt packet.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
wl18xx: count HW block spare based correctly on keys

We have no idea how many VIFs there are requiring a special spare, we
know just about the number of keys set. Rename the counter appropriately
and toggle it whenever a special key is added/removed.
Previously this was only changed once, since it was toggled whenever
the actual spare was changed.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
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>
wlcore: Always pass DMA-able buffers to mmc functions

Some of the mmc drivers initiate DMA transfers with buffers passed from
higher layers. This means that the driver shouldn't ever pass non
DMA-able buffers, such as ones that are unaligned, allocated on the
stack or static.

Fix a couple of calls to the mmc layer in which buffers which weren't
necessarily DMA-able were passed.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
add blaze_defconfig (INTERNAL)
mac80211: add op to configure default key id to driver (INTERNAL)

When hw_accel is enabled and encryption type is set to WEP,
the driver should get the default key index from mac80211.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
wlcore: set default_wep_key when configured (INTERNAL)

When associating to an AP with WEP set the
default key upon association by implementing
the set_deafult_key_idx op.

Fixes auto-arp sent with wrong key_idx bug.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
wlcore: android: add wake_locks (INTERNAL)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
wlcore: android: set "any" trigger by default (INTERNAL)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
mac80211: don't stop beaconing when going offchannel (INTERNAL)

wl12xx manages the channel per-role, so there is no need
to explicitly stop beaconing when doing offchannel operations,
as the device will take care of it by itself.

This way we avoid redundant stop_ap/start_ap calls when
doing offchannel operations on another vif (e.g. auth)

NOTE: this patch shouldn't go upstream. we have to come up
with more generic multi-channel solution...

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
wlcore/wl18xx/wl12xx: add version and timestamp strings (INTERNAL)

In order to allow better version control, add version
and timestamp strings into the wl12xx module.

These strings will be printed on driver load, and when
reading the driver_state.

(this is not going to work well in compat, because it
copies all the files instead of compiling them in the
original tree, so the version of the compat tree will
appear as the driver version. we can workaround it
with the additional makefile hacks...)

NOTE: I couldn't find how to make one module recompile
when the .h file of another module was changed, so i
just duplicated it for now.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
wlcore: force recheck of version.h and use -dirty if needed (INTERNAL)

If the tree was changed and unstaged or if a new tag was added, we
were not regenerating the version.h file, so it would contain outdated
information.

To fix this, force the version.h file to be rechecked during make and
use __TIMESTAMP__ instead of using the shell's date command, so that
we don't regenerate it everytime.

Additionally, use --dirty in git describe to mark dirty trees as such.

Thanks Eliad for the help with this.

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

wlcore/wl12xx/wl18xx: don't force version check everytime (SQUASH)

With compat-wireless, we shouldn't force the version.h file checks,
otherwise it will overwrite what we generated in compat-wireless
itself.  This was only needed for dirty trees anyway.  The side-effect
is that the version will not be regenerated when the tree becomes
dirty.

Should be squashed with c062da59.

Signed-off-by: Luciano Coelho <coelho@ti.com>
wlcore/wl12xx/wl18xx: add version.h to a new .gitignore file (INTERNAL)

This file is generated by the build process and we should not store it.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
nl80211: report stopped sched scan only after driver does (INTERNAL)

Report NL80211_CMD_SCHED_SCAN_STOPPED and change internal
states in cfg80211 only after the driver reports that
sched scan was actually stopped.

Signed-off-by: Luciano Coelho <coelho@ti.com>
nl80211/cfg80211: add 'scan_cancel' command (INTERNAL)

Mostly from an energy consumption and cpu load perspective,
it can be useful to stop a triggered scan earlier, when one
finds the desired scan results.
Adding the ability to stop a scan from user space by exposing
new NL80211_CMD_SCAN_CANCEL API.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
mac80211: add 'scan_cancel' command (INTERNAL)

Implementing the scan_cancel operation in the mac80211,
by calling existing ieee80211_scan_cancel() function.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
nl80211/cfg80211: add intermediate scan result event (INTERNAL)

Adding intermediate scan result event by exposing new
NL80211_CMD_IM_SCAN_RESULT event, which will contain
NL80211_BSS_BSSID to specify the BSSID of received scan result and
NL80211_BSS_SIGNAL_MBM to indicate signal strength.

This event might be optionally enabled during
NL80211_CMD_TRIGGER_SCAN, with NL80211_ATTR_IM_SCAN_RESULT
flag attribute.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
mac80211: add intermediate scan result event call (INTERNAL)

Adding "cfg80211_send_intermediate_result" call on reception
of new beacon/probe response.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
nl80211/cfg80211: add intermediate scan result filter (INTERNAL)

User might want to be notified with intermediate scan results only
above some minimal RSSI. Adding new NL80211_ATTR_IM_SCAN_RESULT_MIN_RSSI
u32 attribute for the intermediate scan results  RSSI filtering mechanism,
which will significantly reduce unnecessary Kernel-User traffic.
It might be optionally enabled during NL80211_CMD_TRIGGER_SCAN.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>