Commit Graph

757 Commits

Author SHA1 Message Date
Jia Ding
96a5992852 qcacld-3.0: Add 320MHz support for SAP module
As part of 11BE 320MHz bandwidth support, add 320MHz support for
SAP module, including 320MHz ACS support.

Change-Id: If26d9e62b16bbecbb1ea10c70f42e9a8464a70c7
CRs-Fixed: 2935873
2021-05-07 01:56:26 -07:00
Liangwei Dong
9a7ab6fe1d qcacld-3.0: Refine SAP force SCC target channel bandwdith selection
Merge the bandwidth selection of the two API
wlansap_get_csa_chanwidth_from_phymode &
wlan_sap_get_concurrent.
Update 5G Force SCC target Max BW selection for dbs hw:
1. Max BW 80Mhz if sta_sap_scc_on_dfs_chan = 1 and Single SAP
2. Max BW 80Mhz if sta_sap_scc_on_dfs_chan = 0 and STA+SAP SCC
3. other case use User configured BW

The above Max BW value will be limited by SAP user configured
BW at the end.

Change-Id: I1b165d1411288ca6845f90103adbf8bbfc34f67d
CRs-Fixed: 2925750
2021-05-06 08:32:44 -07:00
Utkarsh Bhatnagar
0a488c8261 qcacld-3.0: Move STA params of profile under connecton mgr macro
Move legacy unused STA params of csr_roam_profile under connecton mgr
macro.

Change-Id: I247b07af89203d4e0e16d7449d178b28e2138fdf
CRs-Fixed: 2938277
2021-05-04 15:04:10 -07:00
Liangwei Dong
9b047dac2c qcacld-3.0: Check MKKN for JP for preferred location
DFS region MKKN was added to JP, add MKKN checking to
enable the SAP preferred location INI setting.

Change-Id: Ied1e961bd4067946dda131c923e8590f8fe79ae5
CRs-Fixed: 2927114
2021-04-30 04:21:25 -07:00
Abhishek Ambure
5920ab273f qcacld-3.0: Allow MCC if STA ch is non-preferred and sap ACS 1-11
If STA is present on non-preferred channel i.e. 12, 13, 14 and SAP
ACS channel list is 1-11 then MCC is preferable as SAP don't want
to come up on non-preferable channel.

Change-Id: I82bd707c26258e0bf0b7cc14657185d11f56f757
CRs-Fixed: 2922824
2021-04-29 01:45:15 -07:00
Liangwei Dong
765b466f12 qcacld-3.0: Fix DFS CAC start event missing
At present check SAP on DFS is based on primary channel,
it doesn't work for 160M case. Use "sap_operating_on_dfs"
to do the check before deliver CAC Start event.

Change-Id: I3896dc2738da16b9bff0d54826191d0edcc251a4
CRs-Fixed: 2929729
2021-04-26 22:54:13 -07:00
Gururaj Pandurangi
7a5f5cd09c qcacld-3.0: Fix caller of sap_get_bonding_channels API
Send correct channel frequency to sap_get_bonding_channels
to prevent ACS to fail for SAP.

Change-Id: I93ffd0e033cabb30d33d23ab26f656e0f0659d4f
CRs-Fixed: 2928495
2021-04-22 17:34:03 -07:00
Jyoti Kumari
e9a700f4aa qcacld-3.0: Don't use wlan_freq_to_chan
As part of regulatory cleanup, wlan_freq_to_chan() is removed.

Use wlan_reg_freq_to_chan() instead of wlan_freq_to_chan()

Change-Id: I18d7996a0b117de90cd32f2208702d01655ceeb9
CRs-Fixed: 2926114
2021-04-20 11:42:27 -07:00
bings
b9792c62d3 qcacld-3.0: Add 11BE phy mode in csr/sap layer
Implement 11BE phy mode in csr/sap layer

Change-Id: I7f35379b94dcb64dec0da463b95967125dc7fd14
CRs-Fixed: 2908011
2021-04-15 07:03:21 -07:00
Gururaj Pandurangi
900c3acdac qcacld-3.0: Remove all wlan_reg_chan_has_dfs_attribute instances
Use wlan_reg_chan_has_dfs_attribute_for_freq API to check DFS
attribute flag instead of unused wlan_reg_chan_has_dfs_attribute
API as part of regulatory clean-up effort.

Change-Id: I7ff75f56ebd641d500c365f756526b787986dcbe
CRs-Fixed: 2908159
2021-04-13 18:53:43 -07:00
Deeksha Gupta
7cfc990823 qcacld-3.0: Remove radar event if dfs_channel_switch is disable
Currently, DUT is able to detect the radar event
causing channel switch even if disable dfs channel
switch ini is set. Due to this, there is a chance
of unwanted CSA.

Adding check for disable dfs channel switch ini before
detecting the radar. If gDisableDFSChSwitch = 0 then
detect the radar event else ignore the radar event.

Change-Id: I977d93e47ee35026662d55a8e292c8790ddc7d31
CRs-Fixed: 2905871
2021-03-24 12:04:15 -07:00
Liangwei Dong
b0fa851d3c qcacld-3.0: Fix invalid frequency in CSA
API sap_indicate_radar needs to return sap current
frequency instead of channel.

Change-Id: I62a4aae0604b11587a14d17d4c641262b8019ab3
CRs-Fixed: 2900489
2021-03-23 21:39:21 -07:00
sheenam monga
1f6cb040c4 qcacld-3.0: Don't find dsrc channel based on channel number
Channel number may be same for different bands due to which
non-dsrc channel may be treated as dsrc or vice-versa.

Fix is to find channel is dscrc or non-dsrc based on frequency.

Change-Id: I349172713dda6880771e14231aeb1b4419a86e01
CRs-Fixed: 2902986
2021-03-22 13:31:02 -07:00
Gururaj Pandurangi
9996bc7175 qcacld-3.0: Remove feature flag WLAN_FEATURE_11W for pmf
Remove all of the conditional compilation for pmf since this
feature is mandatory for future scope from protocol point
of view.

Change-Id: Id3a2127e9ecb343ad2a0354dcbc331c22167d7fb
CRs-Fixed: 2852630
2021-03-18 00:39:42 -07:00
Utkarsh Bhatnagar
9f9dc3d5ee qcacld-3.0: Cleanup the tCsrRoamConnectedProfile params
Cleanup the tCsrRoamConnectedProfile params

Change-Id: I6c6f9a8888eebc320191c88020a8ec19cd32c998
CRs-Fixed: 2896190
2021-03-10 19:12:16 -08:00
gaurank kathpalia
2120b33aab qcacld-3.0: Move hdd callback events under connection manager macro
Move hdd callback events under connection manager macro.

Change-Id: I4563f26c94fdb5960be9bd02b4c07b4a38cb2f2a
CRs-Fixed: 2889620
2021-03-02 16:33:39 -08:00
sheenam monga
97f0114fe0 qcacld-3.0: Use get_channel_state_for_freq to get chan state
As chan num may be same for different bands, getting chan state
from channel number may provide incorrect chan state.

Fix is to get chan state from frequency instead of channel number.

Change-Id: Iaf379614d8e536dba2cde71b9294a5a4b018769a
CRs-Fixed: 2869828
2021-02-24 14:52:56 -08:00
Aditya Kodukula
a9f651f6ba qcacld-3.0: Rename the flag QCA_WIFI_NAPIER_EMULATION
To make it generic, rename the flag QCA_WIFI_NAPIER_EMULATION
as QCA_WIFI_EMULATION.

Change-Id: I8e654262a38a7a701a5a34e2bbd5394c8985c65a
CRs-Fixed: 2871313
2021-02-05 12:43:51 -08:00
Liangwei Dong
055acc35f7 qcacld-3.0: Fix SAP 160Mhz radar event miss issue
When SAP operated in channel 36 with 160Mhz, the primary channel
36 is non-dfs and existing checking dfs will drop the radar event
if the radar detected on channel 52. Change policy mgr API to
check the dfs flags instead of primary channel state.

Change-Id: Ie2f242182b8df30e5d1875e278c5ebffa2e7cafd
CRs-Fixed: 2865173
2021-02-01 13:15:37 -08:00
Lincoln Tran
4abfac4f6b qcacld-3.0: Rate limit logs related to SAP chan select
When selecting channel for SAP to operate on, it searches,
calculates, and sorts the channels. Each of these steps produces a lot
of prints, so rate limit them to prevent a time out.

Change-Id: If78c7a4f840bf9353f42dd544134ee690637d22e
CRs-fixed: 2865639
2021-01-29 20:57:02 -08:00
Yu Wang
d91ac3bd8e qcacld-3.0: increase the max supported number of MAC ACL
Extend type of the variables for the number of MAC addresses
in ACL, from 255(uint8_t) to 65535(uint16_t).
With this change, it can support up to 65535 MAC addresses in
theory, after modifying the MACRO 'MAX_ACL_MAC_ADDRESS'.

Change-Id: I32288e46ea4590ebaaa143b2cdca7cefd14997c4
CRs-Fixed: 2856707
2021-01-27 21:50:52 -08:00
sheenam monga
07ecaebeb7 qcacld-3.0: Use wlan_reg_legacy_chan_to_freq for conversion
Use wlan_reg_legacy_chan_to_freq api for channel to
frequency conversion instead of wlan_reg_chan_to_freq.

Change-Id: I06a2638a1e402dc6a750c672ed803e8dbfa254fc
CRs-Fixed: 2853575
2021-01-21 17:04:23 -08:00
gaurank kathpalia
c86ce01b74 qcacld-3.0: Replace CSR API with connection mgr API part 3
Replace the CSR API to get connect info with cnx mgr API.

Change-Id: Id4b92ba5db10935b5deccdacd72218d4a087c61d
CRs-Fixed: 2852437
2021-01-11 15:13:25 -08:00
gaurank kathpalia
6b72d4685b qcacld-3.0: Replace CSR API with connection mgr API part 2
Replace the CSR API to get connect info with cnx mgr API.

Change-Id: Id0ffae005fde5bff69fc486c94c3332872bab786
CRs-Fixed: 2848570
2021-01-07 23:28:45 -08:00
gaurank kathpalia
dc7cca8a80 qcacld-3.0: Add connection manager Logic for connect resp from LIM
Add connection manager Logic for connect resp from LIM.

Change-Id: Ifea77cd839d5f21f50b03f833fd0daa8a1cd8bdd
CRs-Fixed: 2846957
2020-12-31 20:53:04 -08:00
Jianmin Zhu
e0fc4e83f2 qcacld-3.0: Fix treating channel id as frequency issue for SAP
There are CSA IE/beacon template cmd with duplicate IE COUNT: 10.
And interval of 2nd IE COUNT: 10 and IE COUNT: 9 is much less than
100 ms.
Radar is triggered,  tried to switch to channel 11, but set
target chan id 11 as frequency 11 wrongly,   frequency 11 is illegal
and disabled, then switch to new freq: 2412 again.

Change-Id: Id2e5823795ae2f61e6d7cbbbc91c4f485ddeceb3
CRs-Fixed: 2838113
2020-12-17 23:45:46 -08:00
Bapiraju Alla
549f5cb438 qcacld-3.0: Fix deadlock when SAP interface down during pre_cac failure
While pre cac is in progress and if the SAP is stopped from UI, It may
lead to dead-lock due to rtnl lock. This is because, stopping SAP will
trigger the stop_ap first and then hostapd_stop. Stop_ap will schedule
a work to handle pre_cac failure (Thread1). hostapd_stop will be
triggered in parallel (Thread2). This will result in a below dead-lock
scenario.
   Thread1: Waiting to acquire rtnl_lock to unregister pre_cac adapter.
   Thread2: Acquired the rtnl_lock and waiting for Thread1 to complete

To resolve this dead-lock, unregister pre_cac_adapter during
hostapd_stop without requesting for rtnl_lock.

Change-Id: I222df9ee0d75b16f79c28b7cdd86369c340a15c2
CRs-Fixed: 2832256
2020-12-15 05:49:55 -08:00
Lin Bai
c6c9bed41c qcacld-3.0: Alloc sap_event structure dynamically
Allocate sap_ap_event instead of using stack variable
in function sap_signal_hdd_event.

Change-Id: I9716479ab35b0ba76844c6fae4886acb205902cc
CRs-Fixed: 2830469
2020-12-03 21:38:35 -08:00
Liangwei Dong
4744fdbb95 qcacld-3.0: Fix SAP moved to unsafe channel
At present when user trigger SAP move to unsafe channel,
driver doesn't reject the request since "strict = false"
and unsafe checking is skipped.
Fix by check SAP channel switch target channel safe or
unsafe with API policy_mgr_is_sap_freq_allowed before
perform channel switch.

Change-Id: I2950fb31346df8705c8fc608fd79e1a44f4d4947
CRs-Fixed: 2826619
2020-11-30 10:49:04 -08:00
Jianmin Zhu
60a41a32a0 qcacld-3.0: Not handle channel avoid event during CAC
Set chanlist=52-64 and channel=0 in hostapd.conf.
After ACS, SAP setup on channel 52, during CAC, Receive channel avoid
event with unsafe channel list 52-60.
Observed Results:
CAC completed, SAP brought up on channel 52.
Expected Results:
channel avoidance should happen, switch to safe channel, such as 36.
During CAC, SAP is not in SAP_STARTED state, so channel avoid event is
ignored.

Fix: After CAC completed and SAP started, check current channel,
if unsafe, will find safe channel from PCL and switch to it, dbs and scc
is preferred.

Change-Id: I54f9229825a74e1f4c03c156a8b194a321581b57
CRs-Fixed: 2773833
2020-11-25 02:50:08 -08:00
Lincoln Tran
b18e7854bf qcacld-3.0: Add check for passive channel for SAP
Add a check for passive channels when checking the restricted
bands on SAP. This change blocks SAP from restarting on a passive
channel.

Implement the function to filter out passive channels from the PCL.

Change-Id: I80a4b78c1af77f5bfa68be3163f9e9a78cc6425a
CRs-fixed: 2817589
2020-11-20 16:24:41 -08:00
Yu Wang
c37adc1bf1 qcacld-3.0: add api to check if the channel is allowed for sap
Check the factors as below to decide whether the channel is
allowed or not:
 * If the channel is in LTE coex channel avoidance list;
 * If it's STA+SAP SCC;
 * If STA+SAP SCC on LTE coex channel is allowed.

Replace policy_mgr_is_safe_channel() with this new function
for sap channel selection and acs channel filtering, to allow
unsafe channels when it's STA+SAP SCC and STA+SAP SCC on LTE
coex channel is allowed.

CRs-Fixed: 2743042
Change-Id: Ic5a84b2628200fe9decf6972f00706f190f04722
2020-11-18 12:03:52 -08:00
Min Liu
1498fd2554 qcacld-3.0: Channel switch on 2G when CC is updated
Current logic in wlansap_get_chan_band_restrict will skip channel
switch for 2G channel which is disabled due to CC update by mistake.
Update the condiction logic to make it work properly.

Change-Id: Ib4c07447f14a47c2934c63ebdc09821eb8e5a3d1
CRs-Fixed: 2818651
2020-11-18 07:46:06 -08:00
Srinivas Girigowda
1e37c63d94 qcacld-3.0: sap: Remove logs for cds_get_context() checks
cds_get_context() function already takes care of logging the
caller function name in case of any error.
Hence there is no need to add the error log again.
Getting rid of these unnecessary logs reduces driver memory footprint.

CRs-Fixed: 2815522
Change-Id: I735ba28f98a38e832ecb8781e39d5d8e134ad01f
2020-11-12 05:40:00 -08:00
Paul Zhang
866061de62 qcacld-3.0: remove dup invoking sap_init_dfs_channel_nol_list
When enable SAP, it invokes function sap_init_dfs_channel_nol_list
twice.
1\  __wlan_hdd_cfg80211_do_acs
    -> wlan_hdd_cfg80211_start_acs
    -> wlansap_acs_chselect
    -> sap_init_dfs_channel_nol_list
2\  wlansap_start_bss
    -> sap_fsm
    -> sap_fsm_state_init
    -> sap_init_dfs_channel_nol_list

Remove the function in 1\ path.

Change-Id: I8c0bda1fafadc463f6594e0f4c127e9cf98bf4de
CRs-Fixed: 2808989
2020-11-12 03:28:29 -08:00
gaurank kathpalia
effa6ef7f0 qcacld-3.0: Filter out the 6ghz chan freq from valid freq list
Currently the driver does not have a support to
filter out the 6ghz frequencies from the valid freq
list, and hence there is a high chance of selecting
the 6ghz freq as an operating freq for SAP, which
the legacy clients won't be able to scan.

Fix is to add a support for filtering out the 6ghz
frequencies from the valid freq list.

Change-Id: I3c32b4c8c5b93eae04d49d2d5b6bd4ec9852c2a9
CRs-Fixed: 2808350
2020-11-10 04:57:29 -08:00
Utkarsh Bhatnagar
ff006ecb1f qcacld-3.0: STA SAP concurrency changes for DFS channel
Previously, if STA is connected to DFS channel and SAP starts on
Non-DBS HW, then it is forced to start on DFS channel with BW 160 Mhz
irrespective of BW on which STA is connected without CAC.
Even after STA disconnects, SAP remains on DFS channel with BW 160Mhz.
So, scan will be disabled and STA cannot be connected on any channel
other than DFS channel.
If STA is connected on non-DFS channel on 5 GHz and SAP starts, it
will start on non-DFS channel as primary channel with BW 160 Mhz
without CAC. Also, scanning was also allowed when SAP is started with
BW 160 Mhz. This might violate regulatory in case radar comes up while
scanning.
Standalone SAP on DFS channel was not allowed.

To fix this, Force set SCC for non-dbs HW, this way standalone SAP
can come on DFS channel but scan will be disabled in such case and
STA cannot be connected other than DFS channel.
In case STA gets connected to dfs channel in non-dbs HW, then sap
starts only on STA channel with force SCC with BW
MIN(sta_chan_width, CH_WIDTH_80MHZ).
Afterwards, if STA disconnects, restart the AP with BW CH_WIDTH_80MHZ
on safe channel. Scan will be allowed as the DFS master capability is
offloaded to AP with which STA is connected on DFS channel.
Also, if standalone sap starts, then STA connects to DFS channel then
SAP will restart with STA channel frequency and Channel width
MIN(sta_chan_width, 80MHZ).
If standalone SAP starts and then STA connects to non-dfs AP or SAP
starts when STA is already connected to non-DFS AP, then ch_width is
MAX(sta_chan_width, 80MHZ) (5 Ghz) or 20 Mhz (2.4 Ghz).
If STA disconnects during SAP+STA on non-DFS, SAP won't restart unless
the STA was connected on BW 160 Mhz.

Change-Id: I1cebfc79f170c1e4e2710ed747ec804df3d8b441
CRs-Fixed: 2809255
2020-11-05 09:51:03 -08:00
Will Huang
7553cd4a2f qcacld-3.0: Don't touch CAC timer which is not created for offloaded CAC
CAC timer is only created for non-offloaded CAC case, but in some
cleanup functions, CAC timer is stopped/destroyed without checking CAC
offload flag.

Change-Id: If8422afac2389e134769a762aa87cb7969eef9ec
CRs-Fixed: 2807650
2020-10-30 11:01:44 -07:00
Jianmin Zhu
77f915b7ea qcacld-3.0: Can't restore to 5G channel when 5G re-enabled
If 5G band disabled, all channels of 5G should be disabled, before SAP
switch to 2G channels, we need save original 5G channel, or when 5G
re-enable,  can't restore back to original 5G channel.

Regression of change-Id: I679ce6f72228b431530953a631c8c8afa4597187.

Change-Id: Iabb932102c37cc7b9d4d97a2e22e781958ed906f
CRs-Fixed: 2789341
2020-10-01 19:08:45 -07:00
gaurank kathpalia
1fbd7b0de6 qcacld-3.0: use enum wlan_status_code for wlan status code
Use the new enum wlan_status_code for wlan status code and
remove enum mac_status_code.

Change-Id: If42cfdcf99d34ffa77be53382d02288ab8637c10
CRs-Fixed: 2789000
2020-10-01 16:57:57 -07:00
Jianmin Zhu
64fdb6000a qcacld-3.0: Fail to transfer DBS to SCC caused by channel avoidance
Steps to reproduce:
1. AP_AP mode setup, AP1 occupy channel 1, AP2 occupy channel 44.
2. Set channel1~channel11 as unsafe channel, which cause AP1 try to
switch to 5G band.

Observed Results:
AP1 select channel 36, and channel switch fail.

Expected Results:
AP1 select channel 44 same as AP2, and channel switch pass.

Root cause: in Dual AP concurrency case, when get PCL for one AP, need
find the AP from connection list by vdev id and remove it temporarily,
can't just remove 1st vdev from connection list.

Change-Id: I763bbc89bacdad4389084588ee68c3a1e2f17b7b
CRs-Fixed: 2774570
2020-10-01 12:28:43 -07:00
hqu
f88549090b qcacld-3.0: Fix implicit-fallthrough compile error casued by gcc 9.3
Compiling with gcc 9.3 will cause many implicit-fallthrough
compile errors.

Fix is to add keyword fallthrough to resolve such compile error.

Change-Id: I3fdc48b1a9ab2345a47ae644e3217b4d29238364
CRs-Fixed: 2785172
2020-10-01 12:28:39 -07:00
Srinivas Girigowda
a2ca355c9f qcacld-3.0: umac: Remove logs for qdf_mem_malloc() checks
qdf_mem_malloc() function already takes care of logging the
caller function name and line number in case of any allocation error.
Hence there is no need to add the error log again.

Getting rid of these unnecessary logs reduces driver memory footprint.

Change-Id: I9f97967870b3bd05355e21b68a77230b920eeb0a
CRs-Fixed: 2781932
2020-09-25 12:59:50 -07:00
gaurank kathpalia
b81c0ae7d2 qcacld-3.0: Replace tSirMacReasonCodes with enum wlan_reason_code
Replace all enums of tSirMacReasonCodes with common
enum wlan_reason_code.

Change-Id: Ida950a08ac4ceea2911344a8d919b2d93ac7d1fe
CRs-Fixed: 2781197
2020-09-21 16:55:34 -07:00
Srinivas Girigowda
7e11aadd9d qcacld-3.0: Replace QDF_TRACE(QDF_MODULE_ID_SAP,...) with sap log macros
qcacld-3.0: Replace QDF_TRACE(QDF_MODULE_ID_SAP,...) with
sap_{debug|info|warn|err|alert()}

CRs-Fixed: 2755126
Change-Id: I58ef919175e0043b8a5a60c7a14e4ca3e672cb84
2020-08-28 13:03:36 -07:00
gaurank kathpalia
f955b44a6d qcacld-3.0: Enable/Disable SRD support for vdev
Currently the driver enables the SRD channels
support for both P2P_GO and SAP if the SRD master
mode is enabled.

Have individual ini values to enable/disable
the SRD channel for each op-mode as required.

Change-Id: If6e66996ed19dacbde7f71a6702f378a7e9a273c
CRs-Fixed: 2748446
2020-08-27 18:36:55 -07:00
Liangwei Dong
cc9cbfc8de qcacld-3.0: Fix STA+SAP SCC on DFS when sta_sap_scc_on_dfs_chan = 0
When sta_sap_scc_on_dfs_chan = 0, SAP is not allowed to SCC
with STA on DFS channel. Check the SAP target channel DFS flag
considering the target channel bandwidth.

Change-Id: I321c1055574477fe39ca8569f24a4040c8dc1904
CRs-Fixed: 2756518
2020-08-24 03:58:57 -07:00
Srinivas Girigowda
f71adaf0e5 qcacld-3.0: sap: Change %pM/QDF_MAC_ADDR_STR/ARRAY to QDF_MAC_ADDR_FMT/REF
Change %pM/QDF_MAC_ADDR_STR/ARRAY to QDF_MAC_ADDR_FMT/REF.

CRs-Fixed: 2752355
Change-Id: Ia9b814f028df9fabe661861d25dbf45deefd008d
2020-08-22 16:00:25 -07:00
Amar Singhal
f8517e79e7 qcacld-3.0: Replace dfs utils call
Replace with dfs utils call utils_dfs_get_vdev_random_channel with
utils_dfs_get_vdev_random_channel_for_freq. We are replacing
channel numbers with frequency.

Change-Id: I0244512f83f45ef7974e39016832784b804286b7
CRs-Fixed: 2753219
2020-08-17 19:59:10 -07:00
Lincoln Tran
eb083f3346 qcacld-3.0: Add logic to check if channel is disabled
Currently, when the country code changes, there is no logic
to restart the SAP on a new channel. Add a case to check if
the channel is not allowed, then calculate a new safe channel
and update the SAP restart reason.

Change-Id: I679ce6f72228b431530953a631c8c8afa4597187
CRs-fixed: 2718324
2020-08-17 15:12:09 -07:00