wlcore: start sta role on CHANGED_BSSID

Make the connection flow simpler by starting
sta role on bssid change.

Currently, we start dev role when going idle-off,
and start the sta role only after association
indication. This complicates the connection
flow with some possible intermediate states.

Make it simpler by starting sta role on bssid change,
which now happens *before* auth req get sent.

Update the handling of mac80211's notifications
and change wl1271_join/unjoin accordingly -
* Split wl1271_join() into wlcore_join (tuning on
  a channel/bssid) and wlcore_set_assoc (configure
  sta after association).
* Rename wl1271_unjoin() to wlcore_unset_assoc(), as
  it is no longer the inversion of wl1271_join()
  (now it's only used to disconnect associated sta /
  joined ibss, without stopping the role).
* Set ssid before starting station role (needed for
  start_role(sta)

While on it, split wl1271_bss_info_changed_sta() into
some sub-functions.

since we no longer use dev role in the connection flow,
we now always use the hlid of the sta role.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: workaround start_sta problem in wl12xx fw

for some reason, the wl12xx fw is not able to rx/tx
on the first start_sta cmd.
Workaround it by issuing a dummy start_sta + stop_sta
before starting the sta for the final time.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: implement .remain_on_channel() callback

implement the reamin_on_channel() callback by starting
a dev role (already associated with the current vif)
on the requested channel/band.

This channel is usually different from the channel
of the sta role, so pass it to wl12xx_roc() as well,
and notify mac80211 (async) when the fw is ready
on the new channel.

Now, in case of offchannel tx, we should use the dev
role hlid, instead of the sta hlid.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: get channel from bss_conf instead of hw->conf

We care only about the operational channel, not
about the temporal hw channel (which won't have
any real meaning in multi-channel env anyway)

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: add chanctx implementation

Add some basic chanctx implementation - debug prints,
and save the vif's channel/band/type.

After that, we no longer need to handle channel change
notifications on op_config.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: initiate ROC/CROC on sta state updates

Use the sta_state notifications to ROC when a station
is about to connect, and CROC respectively on
authorization (success) / deletion (failure).

Change the wl12xx_update_sta_state() flow to bail out
only on error, so multiple code blocks could refer
to the same state.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: set active psm on association

The default ps mode of the fw is auto, while the default
ps mode of mac80211 is active (ps off).
In order to sync them, configure active ps on association.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: specify correct supported_rates

The supported_rates field should contain all our supported
rates, even if the remote peer doesn't support them.

(rename CONF_TX_AP_ENABLED_RATES to CONF_TX_ENABLED_RATES,
as we now use it for both ap and sta)

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: reconfigure rate policy on association

When first configuring the rate policy, before auth,
we still don't have the correct rates that were
agreed during association.

Reconfigure the rate policy on association in order
to update them.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: refactor CHANGED_HT handling

Pass a variable indicating whether HT is enabled,
instead of duplicating the function call with
different arguments.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: configure the remote rates with our own rates

With the new connection flow, start_sta is called before
the remote rates where updated. Use our own supported rates
instead to make sure we don't disable any potential rate
(the rate policies will be updated later, but there is
currently no way to update the remote rates)
wlcore: don't stop fwlog if dbgpins are used

Due to some bug, the fw asserts on fw log stop
when dbgping are used.
Don't stop the fw log in this case.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: allow TX BA on all TIDs

Previous fw limitation prevented us from from doing
TX BA on TIDs 6/7. However, this restriction no
longer exists, so enable TX BA on all TIDs.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: declare interface combinations
wlcore: use sta_state-based ROCs for AP mode

we still need matching patches in hostapd to add the station
on authentication.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: mask out CCK rates when starting GO

mask out CCK rates from the AP's local rates
when the interace is p2p interface (GO).

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: move the sched_scan channels functions up
wlcore: make scan_get_sched_scan_channels more generic
wl18xx: change fw name and bump min fw version

update the min fw version to 8.2.0.0.19

Signed-off-by: Eliad Peller <eliad@wizery.com>
wlcore: update commands enum to new fw api

Align the commands enum with the new fw api (8.4.0.0.19)

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