Commit Graph

459 Commits

Author SHA1 Message Date
Jyoti Kumari
a50ca46487 qcacmn: Allow scan on same mac channel where LL_LT_SAP present
Currently, scan on same mac channel is not allow where
LL_LT_SAP is present.

But as part of this change, allow scan on same mac channel
where LL_LT_SAP is present.

Change-Id: I0c781caa70bf5c95c0639218dd08a409ebeefbfc
CRs-Fixed: 3636119
2023-10-18 22:47:35 -07:00
Shashikala Prabhu
608e4120f0 qcacmn: Use the correct offset to fetch STA profile subelement
STA info length subfield of STA info field indicates the number of
octets in the STA Info field, including one octet for the STA Info
Length subfield.
In the current implementation, one extra byte is added to STA info
length subfield to access STA profile subfield. Due to this, unable
to extract CSA, ECSA and MCST IEs from the STA profile.

To fix this, don't add WLAN_ML_BV_LINFO_PERSTAPROF_STAINFO_LENGTH_SIZE
to offset field to access the STA profile subelement.

Change-Id: I99fb3c5d1bfb9b3bf414fc0b778d724e98a3c7ae
CRs-Fixed: 3640538
2023-10-18 04:25:30 -07:00
Gururaj Pandurangi
cfbb3005ef qcacmn: Add a cfg set API to configure scan mode for 6 GHz
Add a cfg set API to configure scan mode for 6 GHz. This is
invoked in reset HE capability API.

Change-Id: If4891036dec3777d85f3584eef965ed65ececadd
CRs-Fixed: 3629445
2023-10-10 23:10:02 -07:00
Gururaj Pandurangi
852d0cee43 qcacmn: Add support to configure MLD ID in scan request
In the MLO-MBSSID test, STA can request information of
non-Tx BSS through Tx BSS by configuring non-Tx BSS MLD
ID within the ML probe request that is invoked as part
of scan request. Add support to configure MLD ID in
scan start params to FW.

Change-Id: I4a6debf6c3ec830fbe3aee1d3aa60ad7218cbcd6
CRs-Fixed: 3591596
2023-10-02 20:30:12 -07:00
Aasir Rasheed
8c6365939b qcacmn: Send max num of active links to fw
This change is to send max num of active links recommended
by AP to the fw.

CRs-Fixed: 3599429
Change-Id: Id84b7d1aa8d6eb29d3acef2f3e8c552bc6c636f0
2023-10-01 18:12:23 -07:00
Srinivas Dasari
aafe99c365 qcacmn: Parse 11AX RNR TBTT info field even if 11BE is disabled
Currently, below 11BE RNR TBTT field doesn't get processed when
11BE is not defined,
TBTT_NEIGHBOR_AP_BSSID_S_SSID_BSS_PARAM_20MHZ_PSD_MLD_PARAM
So, station is not able to parse the RNR IEs from the 11BE APs.
Parse TBTT_NEIGHBOR_AP_BSSID_S_SSID_BSS_PARAM_20MHZ_PSD_MLD_PARAM
always but extract 11be info only when 11BE define is enabled.
Also, cleanup the duplicate code.

Change-Id: I49e38875f3f0a3ab238636f7a8e0f93c7aa4d04b
CRs-Fixed: 3624227
2023-09-29 02:24:16 -07:00
Jyoti Kumari
d14e4dcaa0 qcacmn: Modify default value of last_scan_ageout_time
Currently, default value of last_scan_ageout_time ini is 0 sec.
Modify it to 30 sec to avoid dependency on userspace
configuration.

Change-Id: If0d00c98950a0c20f22ee73d01e4442bd0d677c0
CRs-Fixed: 3625696
2023-09-29 02:24:03 -07:00
Guru Pratap Sharma
d383bdce33 qcacmn: Adding memory not allocate debug print
Adding memory not allocate debug print when fail to allocate
memory for scan node

Change-Id: I77c9a3deeb9fff9fd265188060ff3aa3aa17b866
CRs-Fixed: 3611905
2023-09-26 14:41:00 -07:00
Paul Zhang
a64af3b447 qcacmn: Get profile index and count for non-tx AP
In the scenario about MLO 5 GHz + 6 GHz and 6 GHz is non-tx AP in
MBSSID, if DUT tries to connect 5 GHz link as assoc link and uses
the scan entry generated from 5 GHz beacon. Then there is no info
about profile index and count in the scan entry and these info is
necessary for firmware when vdev up.

To resolve this issue, get the info from 6 GHz scan entry if it
exists.

CRs-Fixed: 3616899
Change-Id: Ic9bf9bc107c3486be1e87ea2c19c5d388ca41883
2023-09-25 01:30:04 -07:00
Linux Build Service Account
38ceb24812 Merge "qcacmn: Parse Extended MLD CAP & OP of ML IE" 2023-09-22 11:09:35 -07:00
Linux Build Service Account
771b5ac7a1 Merge "qcacmn: Get new scan capability" 2023-09-22 01:13:58 -07:00
Shwetha G K
2c7b2d2388 qcacmn: Fix OOB issue
Changes to fix OOB issue seen util_scan_parse_beacon_frame.

CRs-Fixed: 3582496
Change-Id: I53244be54d31e87b55d0b44ce94315c8001f417d
2023-09-14 04:45:19 -07:00
David Oladunjoye
096449a4fe qcacmn: Get new scan capability
Host needs to check new scan is enabled on device before
sending scan request.
Changes are as follows:

-Add new scan bit to scan obj.
-Fetch new scan service bit from FW.
-Update new scan in scan obj based on service bit from FW.

Change-Id: I19d874e859208dcdb2476e0fd2fbd61fcc77e565
CRs-Fixed: 3509136
2023-09-13 09:33:00 -07:00
Paul Zhang
3ceac81c5e qcacmn: Fix issue about generating MBSSID frames
When generating MBSSID beacon/probe response frames, it
misses the last IE in the MBSSID ie list. To address it,
correcting the comparing length.

CRs-Fixed: 3609711
Change-Id: Ia406be0ade901c9bc01698faec473bd25c59dfb3
2023-09-09 03:36:33 -07:00
Rakesh Boyina
f4b054cd11 qcacmn: Parse Extended MLD CAP & OP of ML IE
Include Extended MLD Capabilities & Operations subfield size
calculation in the calculation of Common Info Length of the
Basic Variant ML-IE parsing

Change-Id: I8fea9058dc37b7605827ef827a3ccba71be00982
CRs-Fixed: 3590364
2023-09-07 11:19:32 -07:00
Guru Pratap Sharma
dbd510c42c qcacmn: handle integer underflow in util_gen_new_ie
handle integer underflow for subie_len in util_gen_new_ie

Change-Id: I2f73e5a7e0462100deae1e85e6a51f77bfc46b95
CRs-Fixed: 3582487
2023-08-24 01:26:59 -07:00
Aravind Kishore Sukla
78d988e666 qcacmn: Reject partner link based on security check
For multi link connection there might be the case where
rsnxe of the AP is not present on the link vdev.
This causes the link vdev alone to downgrade to 11ax
mode and assoc vdev is in 11be dot11 mode.
So for vdev with ML peer, the dot11mode is 11ax,
which causes abnormal firmware behavior.

Reject the partner link that doesn’t pass the security
check and validate the next available partner link.
if none of the partner link passes the security check,
proceed connection with single link.

Change-Id: I080557027180c0566a1c284a93fcc4b69c61a9c8
CRs-Fixed: 3581189
2023-08-21 10:58:15 -07:00
Paul Zhang
674627f868 qcacmn: Fix use-after-free issue in util_scan_parse_mbssid
In some scenario, mbssid_info->prof_residue could be set to
true, hence mbssid_info->split_prof_continue will also be
set to true. Then for the next loop if buffer split_prof_start
is freed but split_prof_end does not reinitialize to NULL,
then use-after-free happens.

To address this issue, reinitialize split_prof_end properly
when split_prof_start is freed.

Change-Id: Iad7448868cfa4c2dd7922f6c1b2622cf20a6a28c
CRs-Fixed: 3583521
2023-08-18 18:10:48 -07:00
Ashish Kumar Dhanotiya
a0bd216fc8 qcacmn: Add support for LL_LT_SAP_MODE in policy mgr
Currently PM_LL_LT_SAP_MODE is not handled in policy manager.
With this change add support for PM_LL_LT_SAP_MODE in the policy
manager.

Change-Id: I7b893b04498957eb4a7e9f74c4b4395d4a823bf9
CRs-Fixed: 3536612
2023-08-17 21:01:54 -07:00
Surya Prakash Sivaraj
9cd7aef35e qcacmn: Use HT info to get operating bandwidth
APs can broadcast support for 20 & 40 MHz in the
HT cap IE and operate in 20 MHz also.

Therefore, use the extension channel offset field
of the HT info IE to identify the bandwidth of the
BSS.

Change-Id: I9987d45ec34ba3327b43ef70eb891d346e9e78c9
CRs-Fixed: 3587792
2023-08-16 19:16:42 -07:00
Vijay Raj
c9ffbec347 qcacmn: Remove redundant check in wlan_scan_start
In api wlan_scan_start(), redundant check for
scan_start_req is observed in some static analysis
tool.

Remove the redundant check in the ap
wlan_scan_start() as the check is present in the
api scm_scan_free_scan_request_mem

Change-Id: Ic320bb95253668310c5d738216daba62ba2f4b3f
CRs-Fixed: 3528505
2023-06-22 09:10:44 -07:00
Thirusenthil Kumaran J
9c6e306ffd qcacmn: Do not drop beacons for channels present in NOL
Currently, during scanning, while parsing the received beacons,
the beacon IEs are checked to verify whether the channel
present in the beacon is invalid. If the channel is found to be
invalid, the corresponding beacons are dropped. This check treats
the channels in the NOL list as invalid channels.

Consider a case of a repeater with RCSA enabled; when the RE
detects a radar, the RE adds the radar detected channels to
NOL and sends an RCSA action frame to the Root AP to intimate
the Root about the radar detection. The RE will also wait for the
Root to send CSA to RE. But in this case, the RE will not parse
the CSA IE received from the Root, as the beacons from the Root
AP are dropped, as the channel present in the beacon is
considered invalid.

The purpose of the channel validity check in the beacon parsing is
to avoid receiving beacons from an invalid channel, that is, the
channels that are not supported by the device. Since NOL channels
are valid, we can parse the beacons received from an NOL channel.
Therefore, to fix this issue, use the regulatory API
'wlan_reg_is_freq_enabled' instead of the API
'wlan_reg_is_disable_for_pwrmode' to check if the channel is
invalid.

The API 'wlan_reg_is_freq_enabled' treats NOL channels as valid
channels.

Change-Id: Iad502363c0ad15be2a009480c49bffcf8e004943
CRs-Fixed: 3513560
2023-06-21 13:30:48 -07:00
Jianmin Zhu
da25bf14e9 qcacmn: Select best link as assoc link
For mlo 5+6, 6 GHz band score is higher than 5 GHz, so 6+5 total score is
higher than 5+6, 6+5 is always selected before 5+6 even 6 GHz link score is
much worse than 5 GHz.

To fix it, calculate each link score for each MLO AP, if assoc link is
best link, add a boost score, then it can be selected first.

Update band weight and score for both SLO and MLO, select average of link
band score as MLO band score.

Change-Id: If0714fa94031d5746d89388917540f0e34086d86
CRs-Fixed: 3483850
2023-06-17 17:02:27 -07:00
Pragaspathi Thilagaraj
fe4e1c1ae3 qcacmn: Retry MLO connection with SLO on connection failure
Currently if MLO connection fails then connection is tried
with same link until it reaches to maximum no of trials but
connection is not tried with same assoc link by changing partner
link or with SLO.

So, when vendor roam score algorithm is enabled, add logic to try
MLO connection again by reducing number of partner links with
each retry till SLO connection is tried.

Change-Id: Ic0e3acd2198cfa0ed0ff893da6ae32d669d32a41
CRs-Fixed: 3521159
2023-06-08 05:09:28 -07:00
Abhishek Singh
e7e15dbff4 qcacmn: Optimize scan logs while dropping frame
Optimize scan logs while dropping frame to print frame type
and freq and other info and use same format to print.

Also If bssid hint is zero, avoid printing hidden bssid which
are filtered out.

Change-Id: Ibb6cb523b9be6af2c05c4a5a7a5cbccb44f984af
CRs-Fixed: 3506377
2023-05-23 21:57:17 -07:00
Paul Zhang
2c6112bf44 qcacmn: Copy ML IE from right position for MBSSID
For MBSSID case, ML IE does not contain full per-STA profile info
in MBSSID IE. When generating the beacon and probe response frame
for MBSSID case, it needs to copy the ML IE info from main frame.

Change-Id: Id369d08772f11a5f0f838351b5b76ecce3762c55
CRs-Fixed: 3479932
2023-05-16 09:16:18 -07:00
abhinav kumar
058889e6a0 qcacmn: Process ML Channel Measurement request
Host parse newely added vendor command
QCA_NL80211_VENDOR_SUBCMD_CONNECTED_CHANNEL_STATS and trigger
scan to get connected channel stats from FW in case of MLO
connection.

On scan done host sends scan done indication to upper layer
via QCA_NL80211_VENDOR_SUBCMD_CONNECTED_CHANNEL_STATS vendor
command.

Change-Id: I92dbd779c5fbdb1652a37cfa54c177bd13de4f28
CRs-Fixed: 3491060
2023-05-14 05:07:51 -07:00
Abhishek Singh
587f3af96b qcacmn: Optimize beacon/probe rsp logs
Optimize beacon/probe rsp logs, by printing the params when
their values are non 0. Thus reducing the logs size.

Also add the frame length in the logs.

Change-Id: I6cad77b6cdc4576804cdabd9f53235029e6cebd7
CRs-Fixed: 3490632
2023-05-12 23:08:59 -07:00
aloksing
d8e1a8418c qcacmn: keep non intesected phymode in scan db
scan db has intersected phymode. For BSS information via iwlist we need
non intersected phymode.

Change-Id: I62a4aea33a67ac12b5be5bcdd4a3fc4538056df9
CRs-Fixed: 3454700
2023-05-12 16:39:25 -07:00
abhinav kumar
df618544a3 qcacmn: Process get_cu_for_each_subbw driver command
1. Read the new service capability:
WMI_SERVICE_CCA_BUSY_INFO_FOREACH_20 MHz: Via this host knows
whether FW supports reporting of CCA busy info for each 20 MHz
subband of wideband scan channel or not.

WMI_SERVICE_VDEV_PARAM_CHWIDTH_WITH_NOTIFY_SUPPORT: Via this
host knows whether FW supports VDEV param channel width switch
with OMN/OMI notification or not

2. Register osif callback to send scan done indication to upper
layer

3. Add 2 new scan flags pause_home_channel and
report_cca_busy_for_each_20 MHz

Change-Id: I63d561a3c5f8e49a3ca42d956e6b630c63edeaf4
CRs-Fixed: 3460901
2023-05-03 04:58:20 -07:00
Vinod Kumar Pirla
7382a9f799 qcacmn: Use MLD address of BSS peer for PMKSA operations
If PMKID present in AP expires, AP rejects the PMKID based association.
Current design is to clear the cache using BSSID/MAC address of link
in such cases to let a fresh SAE authentication to happen.
But host driver stores PMKSA with MLD address for ML BSS.
Adapt to the same and update PMKSA cache clear APIs to use
MLD address instead of link address.

Introduce new API which return the legacy address for non-ML
association and MLD address for MLO association of the BSS peer.
Use this API to get the correct entry from PMKSA cache to delete.

Introduce new utility API to fetch the MLD address from scan entry.
Use this API to get the MLD address of the ML candidate.

Change-Id: Id35a3937ba6649e8ba7ae8f849ac1ed2a9cc83f8
CRs-Fixed: 3453839
2023-04-26 18:25:02 -07:00
Guru Pratap Sharma
42a7f2f1b4 qcacmn: Adding and parsing of bandwidth indication element
Adding and parsing of bandwidth indication element sub IE

Change-Id: I20fca6ecf370d5d20f0e6e8e4f873bf57da3d181
CRs-Fixed: 3464120
2023-04-20 00:15:51 -07:00
Guru Pratap Sharma
08131c79a1 qcacmn: Add Bandwidth Indication Element support
Adding Bandwidth Indication Element Sub IE structure and other support

Change-Id: Iae761582e8c5d2b12af231e58c6dcbb23421e9dd
CRs-Fixed: 3444254
2023-04-06 18:13:29 -07:00
Vinod Kumar Myadam
b7987d7b29 qcacmn: Fix OOB in util_gen_new_ie
For example, If tmp_new[1] = 3, subie_len=160,
tmp_new + tmp_new[1] + MIN_IE_LEN) - sub_copy will be 159.
In this scenario, while condition gets true (159 <= 160)
In if condition (159 >= 160), we are not breaking the loop in if.
tmp_new will get incremented, tmp_new will point at 159,
tmp_new[1] will point at 160, tmp_new[2] point at 161.
So, we are accessing one byte out-of-bound value.

To fix accessing out-of-bound value subtract one from the subie_len
in while and if condition to avoid this scenario.

Change-Id: I624585323963b6d79acf9ff0f96ec17e0b415c2d
CRs-Fixed: 3358833
2023-03-17 07:20:18 -07:00
Aravind Kishore Sukla
c60807a9c9 qcacmn: Remove ie len check for SON_IE_LEN
SON IE length check drops some of the AP beacon or probe
response due to length mismatch.

As length may increase for some of APs. Remove check for
ie len of WLAN_VENDOR_SON_IE_LEN

Change-Id: I74add7ea539913f67bf7d11e2ff8e4b0374eba05
CRs-Fixed: 3418249
2023-03-16 07:44:43 -07:00
Paul Zhang
f453c827cb qcacmn: handle MBSSID IE for critical update
With the MBSSID IE, it has to generate the corresponding
beacon and probe response frames. Then handle the generated
frames per critical update feature.

Change-Id: Iff3fdb3a335a98d9ed7e51957885e2f161069807
CRs-Fixed: 3376521
2023-03-08 21:10:24 -08:00
Sheenam Monga
a1a81cce96 qcacmn: Don't Scan same mac frequencies, if low latency SAP present
Currently, Scan list is trimmed based on low latency sap frequency.
But even after removal of 6 GHz frequencies from scan list,
host receives scan events for 6 GHz frequencies because rnr info
is updated and hint bssids and hint ssids are added due to which
FW scans 6 GHz frequencies also.

Fix is to update hint_bssid and hint_s_ssid to those frequencies
only which are allowed to be scanned in case low latency sap is up.

Change-Id: I7f9bc6b6262a235d5aa02c9155555b4827227acf
CRs-Fixed: 3379401
2023-03-01 00:54:16 -08:00
Jeff Johnson
3a13457906 qcacmn: Fix umac/scan documentation
The kernel-doc script identified some documentation errors in the
umac/scan folder, so fix them.

In addition, Change-Id I8340c6c654cf03f63aee9ed622e3db38056d714f
("qcacmn: Add API to access scan entry partner info") made an
incorrect copyright change, so fix that.

Change-Id: I629f5961ab0a284c70a47fc7d71fe81d5572ae25
CRs-Fixed: 3380633
2023-02-28 11:19:35 -08:00
Uraj Sasan
25ad461a3c qcacmn: Increase the macros for 4 LINK MLO case
In case of 4 LINK MLO we have link index as 0, 1, 2 and 3
so increase the MLD_MAX_LINKS to accommodate all links.

Also MAX RNR_BSS supported in 16vap 16 MLD across N links will
increase as:

For N(4 LINK) link MLO, Max RNR BSS will be given:
16(N_6G_LINKS) + N - (N_6G_LINKS) - 1(SELF_LINK) = 16*2 + N-2-1 = 33

Change-Id: If2e1755b8b99e83d8fe391220183921a70be61f5
CRs-Fixed: 3408516
2023-02-24 15:51:51 -08:00
Sheenam Monga
7453254a0c qcacmn: Add support to get min and max bw of chan enum
Add support to get min and max band width of provided
channel enum, so that configured bandwidth can be validated
whether it lies in the range of bandwidth or not.

Change-Id: I765b4e8013d021eaca41b37789d1ef3f1d57fa7d
CRs-Fixed: 3402928
2023-02-16 11:11:01 -08:00
Sheenam Monga
94461d8894 qcacmn: Consider last scan full scan results instead of new scan
Currently, if ACS_LAST_SCAN_AGEOUT_TIME is not provided by user then
the last_scan_ageout_time is updated to 0 and full scan is triggered
to find channel instead of using previous scan results, to avoid delay
use last full scan result based on ini "last_scan_ageout_time" value.

Change-Id: Ic38f0d3c83087dafde54b43762dd14deb7d02870
CRs-Fixed: 3404550
2023-02-16 11:10:51 -08:00
Vijay Raj
6effc63bb2 qcacmn: Remove api wlan_add_age_ie on scan result
In api wlan_add_age_ie(), age ie is included in scan
result.

Remove api wlan_add_age_ie() as the bss age is
calculated using NL80211_BSS_SEEN_MS_AGO.

Change-Id: Ided2364ce7a52d942d29343455fc7ae511be9a18
CRs-Fixed: 3391276
2023-02-16 04:17:35 -08:00
sandhu
89c50d8df3 qcacmn: Add API to access scan entry partner info
Add API to access scan entry partner info by bssid
and freq.

Change-Id: I8340c6c654cf03f63aee9ed622e3db38056d714f
CRs-Fixed: 3376315
2023-02-13 12:45:24 -08:00
Pooja T C
324b10dec5 qcacmn: Changed debug traces severity level
Changed scm_err_rl to scm_debug_rl to stop the prints from flooding.

Change-Id: Ida541ac96bf656fc68d0a6fd7cca302d2071585b
CRs-Fixed: 3347726
2023-01-17 21:05:09 -08:00
Himanshu Batra
b23b9551cc qcacmn: Changes to handle dynamic link add for non-AP MLD
Changes to handle dynamic link add for non-AP MLD.
Also add change to clear mlo cap for link removal of vdev.

Change-Id: I47e0bb77b7f32296e5745ffd53ce3a34ec35a63a
CRs-Fixed: 3346538
2022-12-27 11:09:04 -08:00
Deeksha Gupta
de6b627426 qcacmn: Add support to parse reconfig ML IE
Add support to parse Reconifg ML IE and fill ml info in the scan
cache entry.

Change-Id: Ieb7ba1731d82474fbead1d6edbe1584fbdb42e0d
CRs-Fixed: 3347362
2022-12-27 11:08:35 -08:00
Jianmin Zhu
2b43c860f6 qcacmn: Validate AP ML IE length before parse it
One bad AP Multi-Link IE length is 5, have no MLD addr, BSS peer MLD
addr is set as zero, connect fails, and bss peer leak happens.
DUT STA can't connect other AP any more if bss peer leak happen 2 times.
At last, if wifi is disabled, vdev delete fails for ref count leak, assert
happens.

To fix it, validate AP ML IE length before parse it, if it's actual length
is less than expected length, set ML IE as NULL, downgrade the AP to legacy
mode.

Change-Id: I7d6b27f0816f3169c8802f67b64e5561ffdde6ed
CRs-Fixed: 3351189
2022-12-09 15:50:51 -08:00
Amruta Kulkarni
52bd685515 qcacmn: TID to Link IE scan db changes
Change done to parse TID to Link IE in scan database.

Change-Id: I391c2f9939b43fd6bb21cd713e323ddb04e4bb79
CRs-Fixed: 3344664
2022-12-07 02:24:30 -08:00
Srinivas Dasari
8b311c3358 qcacmn: Fetch bcn/probe rsp with given mac addr from scan db
Fetch beacon/probe response with given mac address from scan db.
The frame can be used to fill bss descriptor in case of MLO
roaming where scan entry is derived from ML probe response of
assoc link.

Change-Id: Ie20b36c6619dd0e44d04d3bd8767c7dd09b053d5
CRs-Fixed: 3342439
2022-11-25 08:18:23 -08:00
Deeksha Gupta
4ff65dc760 qcacmn: Parse 11be capable beacons if DUT is not 11be enabled
Currently, in driver, if DUT fw does not support 11be,
11be capable beacons will not be parsed in the scan result.
But driver can have 11be capable parsing even when target
is not capable of 11be. This may be helpful in understanding
OBSS and ACS kind of scenarios.

To fix, driver will parse 11be capable beacon in the scan result.

Change-Id: I1eb4d60c8a7513a01126575dd9c4fc4f1a4ee6e0
CRs-Fixed: 3296848
2022-11-22 15:50:55 -08:00