After SAP switches the channel, policy manager needs to check if
the host needs to change HW mode. SAP state machine updates channel
change event to hdd to indicate SAP channel switch. Hence move logic
to change HW mode from start bss success event to channel change
event case in sap event callback.
Problem scenario:
1. DUT is in Single MAC mode by default.
2. SAP is up on Channel-1. So SAP is on MAC-0.
3. Host sets Policy Mgr Hw mode = DBS.
4. STA comes up on Channel-36. As host is in DBS mode, STA came up
on MAC-1.
5. SAP does CSA to Channel-36 (STA’s channel). So SAP moves from
MAC-1 to MAC-0.
6. Host sets Policy Mgr HW mode = Single MAC (As both VDEVs are on
same band).
7. Now, SAP does CSA to Channel-11. As Policy Manager Hw mode is still
Single MAC, SAP is still on MAC-0. So now STA (Channel-36) & SAP
(Channel-1) are in MAC-0 doing MCC.
Fix:
After SAP switches channel, policy manager checks and changes HW mode
change in hdd sap event callback.
Change-Id: If7964057592d85a11dd77197c889a4ed77ed039a
CRs-Fixed: 2719810
AGO/AP is started and beaconing, but the hostapd_cli status cmd still
show "dfs". This will happen when the STA connected on DFS
channel and AGO/AP is starting on same DFS channel.
By design the AGO/AP CAC is skipped due to STA+SAP DFS concurrency.
If we skip CAC timer, we will need to indicate the CAC event
even though driver doesn't perform CAC, otherwise hostapd will
stuck in "DFS" state.
Change-Id: I7961d0b976fd84fc1f29449d98eb150d1463a92f
CRs-Fixed: 2733624
Wlan phy mode in sap roaming profile will become invalid when
the following corner case happens:
1) sta starts in 5G channel x;
2) sap starts in 5G channel y, leading to mcc;
3) sap moves to 2.4G band on the other mac;
In the above case, sap channel frequency will be set to 2.4G,
but the phy mode in its roaming profile will not change.
Override the sap phy mode in its roaming profile so it aligns
with channel frequency again.
Change-Id: I0b243c1d312f77bf4a4d782f6b9d0d75928d0277
CRs-Fixed: 2736429
Update calls from reg_get_curr_band to reg_get_band since
they provide the same functionality.
Update calls to reg_get_band to expect a bitmap since the API
has been updated.
Update getband driver command to convert the bitmap to the
old values. Also add the new vendor command getband.
Change-Id: I069489ebf4826f8f4bfcb974b74e4d0591d5b33f
CRs-fixed: 2726361
If the ACS SCAN failed, the API sap_select_default_oper_chan
will select a default channel from ACS scan channel list.
At present sap_select_default_oper_chan doesn't validate the
channel with regulatory. It may select an invalid channel and
report to hostapd. This will happen when driver is doing ACS
scan, the upper layer set different country code and result to
some channels in the acs freq_list become invalid.
Fix by checking the channel supported by regulatory before select
it.
Change-Id: I438b2947ba1fd5388a2472d5122e55edc89229db
CRs-Fixed: 2723689
Currently the driver skips the DFS channels if
g_sta_sap_scc_on_dfs_chan = 2 which should not
happen as master mode is supported if this ini
is 2. Driver should only skip the DFS channels
if the ini value is 1.
Fix is to correct the condition for the same.
Change-Id: I9d6c2f2c42f9d9f4f1b5bd080b9cdc5c13e031f2
CRs-Fixed: 2700201
Use MIN_6GHZ_CHANNEL to replace CHAN_ENUM_5945, MAX_6GHZ_CHANNEL to
replace CHAN_ENUM_7105, since min/max channel of 6ghz may be changed.
Change-Id: Ibb0aa4182162d956d632b271cbbfef5af07f918c
CRs-Fixed: 2706639
Check phymode to verify it is allowed for the current country
before starting SAP or connecting STA.
Change-Id: Ica5e70bbd421c4dc18a34545f63e436bc482fc46
CRs-fixed: 2658294
Currently, Rx retry count statistic is not supported by firmware.
So host driver also not updating the corresponding statistic in
peer stats. Datapth is updating this counter using retry bit in the
rx MPDU. Update peer Rx retry count value from data path.
Change-Id: I4fd422faa7a766090991c461cd6fd2cc70d2fcc3
CRs-Fixed: 2691704
The mhz_freq_seg0 & mhz_freq_seg1 fields are not assigned
with values from sap ctx.
Fix by copy the whole the struct of "ch_params" to
csr_roamProfile.ch_params instead of one by one.
Change-Id: I92d7bc6ddeed1038597c7639d41fca059bf13457
CRs-Fixed: 2688693
eCsrForcedDeauthSta equals to 14 and as far as reason
codes are concerned, it is MIC_FAILURE. It is observed
that when wlan is configured as SAP-SAP DBS with same
SSID and same encryption WPA2/WPA3 mixed mode, it leads
to an IOT issue where clients with iOS 13 in particular
are not able to auto reconnect back after wlan is restarted.
Thus populate subtype to IEEE80211_STYPE_DEAUTH >> 4 and
reason_code to WLAN_REASON_DEAUTH_LEAVING as defined in
kernel since station_del_parameters is a kernel defined
structure.
Also correct internal use of subtype since right shift
4 for SIR_MAC_MGMT_DEAUTH and SIR_MAC_MGMT_DISASSOC
will always end up with value 0.
Change-Id: I60aa5ed4e7b672b7a92f05ad322fcb48ab0526d4
CRs-Fixed: 2678637
Remove instances of CFG_COUNTRY_CODE and country_code from
wlan_mlme_reg struct.
Remove redundant country code APIs.
This change is needed because the country code is no longer
stored in CFG file, and subsequently, there is no need for
CFG_COUNTRY_CODE.
Change-Id: Ia4b3b40d0dccfde696352967f2902dfba344a445
CRs-Fixed: 2634079
Use wlan_reg_get_channel_state_for_freq API to get channel
state and identify 6Ghz channel as non-dfs channel.
Change-Id: Ib134a71c62e24324abc12e5a5b11a524e89de810
CRs-Fixed: 2681608
Add support to provide the channel weightage of
DFS channels so that the weight can be configured
and the user can control whether they are allowed
to be selected for the SAP.
Change-Id: I53a22a0059d56aa8fca66215fed1ed0588db7db5
CRs-Fixed: 2676919
The log signifying SAP failure was incorrectly printed.
Changed the logic to print those logs correctly
Change-Id: Ifc26b34f41c60a3ce50d9c7cfc4ecd0739853844
CRs-Fixed: 2680263
Added debig logs in __wlan_hdd_cfg80211_channel_switch and in
wlansap_set_channel_change_with_csa
Change-Id: Idf0f29f21d879e32a0ad8e1db25fc8360ec36800
CRs-Fixed: 2676407
Remove the calls to wlan_reg_dmn_get_opclass_from_channel API
when SAP is changing channel by ECSA/CSA.
The API accepts channel number and will cause issue when 6GHz
band is supported in target.
Change-Id: Ib6c67417f1a0edae88b5e714e3ed23c589e7eb62
CRs-Fixed: 2676354
Bring up SAP(2.4G)+SAP(161 channel with 11a mode)+STA mode, when STA
is connected to ref-ap on channel 36, 11a mode SAP will also switch
channel to STA's connected channel due to force scc, it will set
channel width to CH_WIDTH_40MHZ for 11a mode SAP channel switch,
actually 11a mode SAP doesn't support CH_WIDTH_40MHZ, it's wrong and
issue is introduced by
'Change-Id: I709dd35575866b7ec9fddcfb94078f114a78d1a2'.
Fix is to set channel width with 20MHz for 11a mode in function
wlansap_update_csa_channel_params().
Change-Id: I90fea788ff30ef0897c1ba98ad5b4d3c8eec3695
CRs-Fixed: 2623617
Regarding to the go+sap scc on dfs channel, sap can follow with go
to the same dfs channel, but sap tx is hung.
Since the host set the dfs_cac_block_tx by mistake when ap started,
though the ap skip the cac because the scc go finished the cac
procedure, then dfs_cac_block_tx has no chance to be reset.
The fix is to take account of dfs cac state to determine the proper
dfs_cac_block_tx.
Change-Id: I7a35225711f587b83d2fc381108d7d3f15893867
CRs-Fixed: 2631457
Currently the driver uses the reason code
POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH for
chanenl switch for P2P-CLI which is same
reason code used for hw mode change in case
of SAP, so after the hw mode is changed the
VDEV-SM does call the callback of SAP CSA
also.
Fix is to use a different reason code for
SAP CSA.
Change-Id: I16b0521d5a21391e642f29e86037f9eb4fd2af62
CRs-Fixed: 2663915
When detect radar in the process of SAP cac, SAP may choose another
DFS channel to switch and will do cac again, but still indicate
WLAN_SVC_DFS_CAC_START_IND with old DFS channel info to hostapd, it's
wrong. Issue is introduced by
'Change-Id: I0915ee78a97e5f27ce83c31cc673cb8820ae535b', due to this
change it will drop one time eSAP_CHANNEL_CHANGE_EVENT signal before
do cac start on new DFS channel, then operating_chan_freq for
hdd_ap_ctx can't be updated to new DFS channel timely.
Fix is to add one time eSAP_CHANNEL_CHANGE_EVENT signal before do cac
start in the process of channel switch.
Change-Id: I441e32e4ecd356834e66f97f2e2334966f48ec5d
CRs-Fixed: 2663539
Currently the driver sets the CAC required for
SAP if it changes it channel to DFS, it
issues a broadcast deauth to all clients,
which leads to unwanted disconnection, which
can be avoided if any STA if already connected
to an AP on that channel.
This is because there is already active TX going
on that channel, so the SAP need not wait for
CAC time to sense the medium.
Fix is to check whether any STA vdev operating
frequency matches with the target frequency of
the SAP, and if it is true, then do not set the
CAC required to true in SAP's vdev.
Change-Id: I09dbecc1a4625cb51e6095f7579479413e525a74
CRs-Fixed: 2643790
Currently the driver fails the ACS process
if no channel is found suitable for SAP by
ACS and thus hotspot cannot be enabled.
Fix is to force SAP to come up on some
default channel, this behaviour would
be controlled via an ini to that customers
can choose whether to opt for this behaviour
or not.
Change-Id: I8a63cf0c5d42802e33f4ad67a33d148a4da54d2a
CRs-Fixed: 2658297
If the SAP is already in stopping state and wlansap_stop_bss is invoked
as a part of stop_adapter, it returns error which causes the
stop_adapter not to wait for the vdev to return to proper state.
To avoid this, return success in case of SAP_STOPPING for the event
eSAP_HDD_STOP_INFRA_BSS
Change-Id: I99a2cd0a1d12b8e43fb3e88b6889e1d651633283
CRs-Fixed: 2654042
Bring up SAP+SAP with acs mode on 5G and set chanlist only with
DFS channel, run heavy traffic to make noisy on SAP beacon channel,
then DCS will be triggered to do ACS again for choosing better
channel to switch, new DFS channel will be choosed, but channel
switch is failed.
DCS policy is SAP do channel switch one by one with the same target
channel, ignore three fail point concurrency check in
wlan_hdd_cfg80211_start_acs/wlansap_set_channel_change_with_csa/
wlansap_roam_process_dfs_chansw_update, furthermore need to add DFS
channel to acs channel list in sap_get_freq_list.
Change-Id: I7360792105cd1fdd4f4c75040c510cc620c3d5c5
CRs-Fixed: 2648641
Currently QDF_MAX_NUM_CHAN/POLICY_MGR_MAX_CHANNEL_LIST aren't aligned with
NUM_CHANNELS, these unalignment may cause some potential OOB access.
So replace QDF_MAX_NUM_CHAN/POLICY_MGR_MAX_CHANNEL_LIST with NUM_CHANNELS
to keep unified.
Change-Id: Ib6c81a3979f2fd29ba1ec678f018a6704b599385
CRs-Fixed: 2644066
After channel switch, driver should indicate new operation channel to
kernel, otherwise wireless_dev->chandef still uses old channel whose
status may become disable when radar is detected in the old channel.
In hdd_chan_change_notify use frequency instead of channel number.
Notify channel information to kernel after channel switch.
Change-Id: I6dbf3d61978e4c35fe41b438397e635d62378719
CRs-Fixed: 2639076
In SAP on/off stress test, when hostapd call hdd_start_adapter
to create vdev, vdev2 will be created while vdev1 doesn't be
deleted physically even if vdev1 is already destroyed logically,
then hostapd issue acs operation, currently use mac address to
get vdev in sap_channel_sel, because vdev2 is using the same mac
address as vdev1 and vdev1 is still in vdev_list at this point,
so will find vdev1 firstly but will return failure due to vdev1 is
WLAN_OBJ_STATE_LOGICALLY_DELETED status, then will cause acs fail.
Fix is to use vdev_id to get vdev in sap_channel_sel.
Change-Id: I89ae3e847b725c2b64331536bc7c1de3fffce0bd
CRs-Fixed: 2640850
sap_ctx->csr_roamProfile.op_freq is already channel frequency.
Do not call wlan_reg_legacy_chan_to_freq for it.
Change-Id: I20ce4eb8852087175c0fae4a7a9dd5e3168e1f24
CRs-Fixed: 2643218
Channel to frequency conversion is unnecessary in function
sap_is_conc_sap_doing_scc_dfs, issue is introduced by
'Change-Id: Ifa62248169ad7b8ff1c62cab44c92d99a8db0e45'.
Fix is to set ch_freq with op_freq directly, no need to convert.
Change-Id: I2e21956833c18240045c85bfb0837ca058069ff5
CRs-Fixed: 2639443
When dynamic channel switch is enabled, trigger acs and switch to best
channel if wlan interference is found in 5g mac.
Change-Id: I56661f5c42a233a0dc0a6400d75cb8f5c0019706
CRs-Fixed: 2599176
In channel switch response start bss success event is used to
indicate the success in which the initial bss settings are done
that is leading to set the incorrect keys after the channel switch.
Use the channel change event to indicate channel switch success.
Change-Id: I0915ee78a97e5f27ce83c31cc673cb8820ae535b
CRs-Fixed: 2620809
The ch_params of sap_ctx->csr_roamProfile is not populated
correctly during SAP channel switching.
Fix it and send channel change event to supplicant with
correct seg0/seg1 value.
Change-Id: I7ef82c6e79b970edfee58d9960e8c6b42fa91ef8
CRs-Fixed: 2594973
Combine and print channel for ACS and roam channels, instead
of printing one channel at a time.
Change-Id: I398678e1843849bdf4f4c72f0315c626c97438a6
CRs-Fixed: 2623805
Enhance logs in ACS module to remove duplicate
prints and keep only useful logs to debug.
Change-Id: I2cf98fb8b4d7a8391617c9ce1baaa5ff6ad42114
CRs-Fixed: 2614609
Currently the logic in ACS for 0 scan results is
to select default channel from the ACS channel list,
but the available channels may not always be capable
of the max BW sent by ACS, for example in HW MODE as
ANY then all the channels 2.4ghz and 5ghz would be
present in the ACS channel list, 2.4ghz channels at
the first followed by the 5ghz channels, and if the
scan results are 0 then 2.4ghz channel would be
selected as default which should not be the case.
Fix is to remove the check to select default channel
and let me ACS algorithm decide the best channel
accounting other factors such as noise floor
and max tx rx clear count, power also.
Change-Id: I21e5d73e12fffb00c4996c406d62361b74db629f
CRs-Fixed: 2601141
If SAP start on 5G DFS channel, it will keep in CAC for 1 minute.
If Disable 5G by cmd: hostapd_cli -iwlan2 set setband 2G during
this minute, SAP won't switch to 2G since SAP isn't in started
state, and SAP start also fail since SAP operate channel
becomes disabled instead of DFS state, SAP will be hung in DFS
state.
Fix: When CAC complete and SAP start, check SAP operate channel
with wlan_reg_chan_has_dfs_attribute_for_freq.
After SAP started, will check for SAP restart,
if found current band is disabled, will switch to 2G band.
Change-Id: I3c29b5d324d4324ce958a5c2cd2102df2cc183ff
CRs-Fixed: 2601081
Currently during ACS process, if best channel after weight sorting
is not in PCL list, then further check if there is a channel in PCL
has some weight, if there is, then switch to this new channel.
Skip above process if best channel is already in PCL list.
Change-Id: I5bfb6d18c531e6b7b4ff0b8b2bb2bd47388fed0c
CRs-Fixed: 2589033
CRYPTO_SET_KEY_CONVERGED is a temporary flag which is used for
converged crypto component transition. The transition has already
been done, so cleanup legacy code related to the flag in HDD layer
and SAP module.
Change-Id: Ic92e44e53c63ba2752907ace3ffc0f55d18470e2
CRs-fixed: 2593520
wlan_set_vdev_crypto_prarams_from_ie() is defined in qcacmn code but
disabled in Kbuild if CONFIG_CRYPTO_COMPONENT=n, it caused runtime
error if run it.
The #ifdef/#else code should live in common code where define
wlan_set_vdev_crypto_prarams_from_ie(), but there is no motivation
from WIN side to add any code which is not converged.
And it is not appropriate to put it into exist head files, so just
define inlined wrapper functions to cover the not defined case.
Change-Id: I11916703fff860025728f904c8d3906eee1d0037
CRs-Fixed: 2592904
If g_enable_go_force_scc isn't enabled, P2P Go failed to switch
to 2G band when 5G disabled.
Fix: Check whether need switch channel for band restriction
first, check go force scc later.
Change-Id: Icf8de51321debea2806585d47d2bd4fc6486075e
CRs-Fixed: 2594279
Currently the driver does not allow the channels
12 and 13 for SAP ACS because most of the legacy
stations don't scan them and they can cause many
IOT issues. But if they are the only channels left
in the spectrum (for eg. all other channels became
unsafe), then the SAP would fail as the driver did
not consider channel 12-14 for ACS.
Fix is to consider 12-14 for ACS, remove them if
other channels are available and if they are the
only channels available in the spectrum, then start
the SAP on any one of these channels.
Change-Id: I599d0e95e9bdc3aed70d6a515d7a52c39846b6f2
CRs-Fixed: 2576635
When SAP is on 5G and STA connects to 6Ghz AP, the "force
SCC" logic will move SAP to STA home channel if SAP is 6Ghz capable.
If SAP is not 6Ghz capable, SAP will be moved to 2G (DBS) to
avoid MCC(5G+6G) for DBS HW and SAP will stay on 5G for non-DBS HW.
SAP is 6Ghz capable only when all of below statements are true:
a. SAP config includes WPA3 security - SAE,OWE,SuiteB.
b. SAP is configured by ACS range which includes any 6G channel or
configured by 6G Fixed channel.
c. SAP has no legacy clients (client doesn't support 6G band).
legacy client (non 6ghz capable): association request frame has no
6G band global operating Class.
Change-Id: I7e9723fd1b679326a3df61932850589e6e503f3d
CRs-Fixed: 2593569