Commit Graph

3478 Commits

Author SHA1 Message Date
Srinivas Pitla
ce514f7963 qcacmn: Add NULL checks to prevent invalid access
Currently, in few instances the MLO peer APIs are called
with invalid ML peer pointer.

This change prevents NULL pointer access and clears MLO
flag for peer.

Change-Id: I8bcdae1d71655f7ed267cc5bc3f6d0fc51e930df
CRs-Fixed: 3245158
2022-07-24 04:40:58 -07:00
Edayilliam Jayadev
ac49d3b35a qcacmn: Rate limit error prints in mgmt Rx REO module
Rate limit error prints in management Rx reorder module.

Change-Id: I2f88554885568378082abd0bc41914118bb1269c
CRs-Fixed: 3249638
2022-07-24 01:01:55 -07:00
Krishna Rao
3cc8ee5529 qcacmn: Shorten err strings in helper for defragmentation
Shorten the strings in error prints in the helper that carries out
802.11 element/subelement defragmentation. This is in order to
decrease the size of the modules generated as required for some
platforms.

Change-Id: Idd37ea59467aa5ebc3928f336f05b603e5d7f6f5
CRs-Fixed: 3248821
2022-07-23 21:04:50 -07:00
Krishna Rao
18774495ac qcacmn: Shorten err strings in helper for frag sequence info
Shorten the strings in error prints in the helper that determines
802.11 element/subelement fragment sequence information. This is in
order to decrease the size of the modules generated as required for
some platforms.

Change-Id: I5a15dc12404399c4670e0cb29205a728715f4923
CRs-Fixed: 3248813
2022-07-23 19:15:01 -07:00
Krishna Rao
607f20d387 qcacmn: Shorten err strings in helper for successor frags
Shorten the strings in error prints in the helper that determines
802.11 element/subelement successor fragments. This is in order to
decrease the size of the modules generated as required for some
platforms.

Change-Id: I4457e1228f848a52f9eea056541806220ff4e8da
CRs-Fixed: 3248806
2022-07-23 19:14:55 -07:00
Shreedhar Parande
e6b1ed7180 qcacmn: Read EML and MLD Cap from target
Extract EML and MLD Capabilities from Target via
wmi_service_ready_ext2_event. These values can be
used while advertising EML and MLD Capabilities.

Add helper function to get EML related delays in
Micro Secs from values got from EML and MLD advertisments.

Send EML Capabilities received from node to Target
via WMI_PEER_ASSOC.

CRs-Fixed: 3225495
Change-Id: Ibfa2ff8dbf11d4293125331376a7986e611d5f63
2022-07-23 19:14:48 -07:00
Subrat Mishra
c667bb9d3c qcacmn: Support for per peer UL Airtime metric in ATF stats
Support for per peer Up Link Airtime metric in ATF stats.

Change-Id: Ic21239e5d1cbf337c11b35415f555c1f39e07143
CRs-Fixed: 3240833
2022-07-21 21:09:45 -07:00
Srinivas Pitla
b39112e991 qcacmn: add mld address to auth params
This change adds MLD address to deferred auth params
as Auth req carries MLD address

Change-Id: I4a97299967bc052166f351ce041ccc8d13656e9e
CRs-Fixed: 3246869
2022-07-21 07:46:24 -07:00
Jithender Miryala
7251cd10dc qcacmn: Fill in the subchannel frequency list even if it is an HT20 mode
Issue: mode was set to HT20 and marksubchannel was enabled. We injected
radar into the HT20 primary channel. The primary channel is not being added
to NOL when marksubchannel is enabled because the current subchannel
frequency list(freq_offset->freq[i]) is not being filled.

To fix this, Even if it is an HT20 mode, fill the subchannel frequency
list(freq_offset->freq[i]) based on offset.

Change-Id: I571ba60c755e7701a21db89f917c953ffa9716a6
CRs-Fixed: 3244971
2022-07-21 05:51:02 -07:00
Himanshu Batra
52cd69199f qcacmn: Change return value to true if cm ctx is NULL
In case if cm ctx is NULL, the disconnect state check API is returning
false which makes the caller assume vdev is not disconnected.
Hence, change the return value to true in this case.

Change-Id: Iadd52d94d6f561974101aa245ddbfdb1eb301b06
CRs-Fixed: 3246161
2022-07-21 02:38:44 -07:00
Aakanksha Doda
6be39668f5 qcacmn: Change print level to avoid flooding of prints
Change print level from scm_err to scm_debug_rl to avoid
flooding of prints.

Change-Id: Iae82e8aa55b765860f994757fb035ddcb4342edf
CRs-Fixed: 3225542
2022-07-19 17:04:31 -07:00
Paul Zhang
e6eb58971d qcacmn: set pdev id to 0xFF when set country code
From firmware perspective, host only sets 5 GHz regdomain hence 2 GHz
uses default setting and firmware does not update channel list event
for all phys according to the new country code.

Therefore sets pdev_id to 0xFF in function reg_set_country and it is
mapping to WMI_PDEV_ID_SOC when issue wmi command
WMI_SET_CURRENT_COUNTRY_CMDID as firmware required.

Change-Id: I0eb84db9f6d77c0473161cc4ffc0dcebd31c3d45
CRs-Fixed: 3239644
2022-07-19 08:46:57 -07:00
Rahul Gusain
030e248d13 qcacmn: Add enum for OCI mismatch in disassoc reason
Added enum for OCI mismatch in disassoc reason

Change-Id: Iaf7a318ba629bba758c8f04bd404008678036a07
CRs-Fixed: 3235848
2022-07-19 03:34:01 -07:00
Srinivas Pitla
baaea274e7 qcacmn: Reset primary umac bit in assoc peer
In current code, assoc peer is designated as primry umac,
on primary umac allocation, primary umac bit gets reset.
But in force umac case, primary umac bit not getting reset.

This change resets primary umac bit of assoc peer, if
assoc peer is not designated primary UMAC.

Change-Id: I640433548b9efeb20ba2b23f8d1141cc5505087b
CRs-Fixed: 3243326
2022-07-19 01:36:17 -07:00
Deeksha Gupta
3d3d3c4fdb qcacmn: Validate next_ie length in util_get_successorfrag()
Currently, in wlan_defrag_elemsubelem_fragseq() API,
there is possible buffer over-read in fragbuff buffer.
Buffer may have a malicious length larger than their
payload size, which leads to a buffer over-read during
defragmentation.

Fix is to validate the fragment length against the buffer
boundary in util_get_successorfrag().

Change-Id: Ia9e688a0ab17954eb464ec586820bb95b51f12d1
CRs-Fixed: 3236560
2022-07-19 01:36:02 -07:00
Gururaj Pandurangi
a57b8d20e4 qcacmn: Add host fixes for 11be eMLSR mode
Add following fixes for STA to support and operate in
eMLSR mode
1) Update and send eMLSR cap flag to FW even in vdev start
request on both links.
2) Copy EML caps to wmi peer assoc mlo params to send it
to FW.

Change-Id: Ic17b9b82809659d7a4392c09eceecae7c53b2049
CRs-Fixed: 3237737
2022-07-18 23:36:38 -07:00
Hariharan Basuthkar
f8cd3e0110 Revert "qcacmn: Check if opclass is supported by country"
This reverts change-id I3be0e0aa7dc2a41f987a6725bc74444311408e51.

Change-Id: I89b373e1445b62c0eb00850ad6bf969045a42f7a
CRs-Fixed: 3246260
2022-07-18 23:36:31 -07:00
Pragaspathi Thilagaraj
728ff15ea3 qcacmn: Don't allow PASN peer create if peer del all is not supported
Firmware advertises WMI_SERVICE_DELETE_ALL_PEER_SUPPORT
capability to indicate vdev peer delete all command support.
PASN peer relies on the WMI_VDEV_DELETE_ALL_PEER_CMDID
command to delete the PASN peers before vdev delete.

So allow PASN peer create only on targets that advertise
WMI_SERVICE_DELETE_ALL_PEER_SUPPORT.

Change-Id: Ib94d9e14e34dd1e5c25bf6946e0d59fe83fd6dd3
CRs-Fixed: 3229438
2022-07-18 16:00:32 -07:00
Jianmin Zhu
f2a742540b qcacmn: Select best partner for MLO of 2+ links
Select best candidate by mlo score algorithm.

Check bss mlo type first by mlo info, mlo config, partner frequency and
dbs/sbs cap, calculate candidate score for SLO/MLMR/EMLSR bss types.

For SLO case, same as before except:
Decrease percent of legacy band and nss to include 320M and 8x8.
Decrease max percent of congestion from 100 to 80 to include MLMR joint
congestion.
Increase weight of both band width and nss to 20.

For EMLSR case, same as SLO except adding EMLSR boost score.

For MLMR case, besides adding MLMR boost score,
calculate joint RSSI/band width/congestion score for combination of
scan entry + each partner link by new mlo algorithm, select partner with
highest total joint score as candidate combination, only activate that
partner link.

Change-Id: I640c6825d945caf5fab504a77717195c2eac0c93
CRs-Fixed: 3234912
2022-07-18 11:55:27 -07:00
Surya Prakash Raajen
d8c841f63b qcacmn: Add mld config checks in vap create
Add mld config checks in osif_vap_create_check and fail
once the config is invalid.

Change-Id: I26c3b4719fa9b18be0a4590861c654504fb3e6bf
CRs-Fixed: 3200923
2022-07-18 04:53:18 -07:00
Edayilliam Jayadev
2bd4b3e1ac qcacmn: Drop mgmt frames if snapshot sanity checks fails
Drop management frames if snapshot sanity checks fails.

CRs-Fixed: 3242562
Change-Id: I7b6ba04b23e57c5b516be7c3b53b8e13e24f4e53
2022-07-18 02:51:44 -07:00
Edayilliam Jayadev
62e885aa1b qcacmn: Log raw snapshot values
Log raw values of management Rx REO snapshots for debug purposes.

CRs-Fixed: 3242558
Change-Id: Idf30985691226e835190bd3305f29e2d43e654b5
2022-07-18 02:51:36 -07:00
Aditya Kodukula
ec13c2ea39 qcacmn: Add infra to support DBAM feature
Add infra to support Dedicated Bluetooth Antenna Mode (DBAM)
feature. It is used to switch between dedicated antenna for
BT and shared antenna for WLAN and BT.

Change-Id: I21688093674ef9b63ee811df9168a31bd71c56b5
CRs-Fixed: 3239895
2022-07-17 23:12:37 -07:00
Qun Zhang
c9493c28ee qcacmn: Align secondary_cur_chan_list/cur_chan_list channel state
Currently the channel state of HST secondary_cur_chan_list/cur_chan_list
is out of sync and beacon IE is populated from secondary_cur_chan_list,
which causes the actual supported channel lists and country IE channel
lists are unmatched for non-6 GHz case. So let secondary_cur_chan_list
align with cur_chan_list.

Change-Id: Ie3914ac48dc05d61ac2deb78a2892986efe238dd
CRs-Fixed: 3239390
2022-07-17 19:45:48 -07:00
Vijay Krishnan
3452af5abe qcacmn: Check CAC status on RCAC channel
In case of RCAC, check if CAC is completed only on the RCAC
channel and do not check the CAC info on current operating
channel.

After RCAC complete is sent to FW, the RCAC tree info is
cleared. In case of RCAC, check the CAC done info only
on RCAC channel.

CRs-Fixed: 3231140
Change-Id: I976b2b5e29ebdf2dc4fb2e5df1f2feb700c972af
2022-07-17 05:05:01 -07:00
Vijay Krishnan
d1a9d15084 qcacmn: Clear old preCAC, RCAC channel info
In case of BW Expand is enabled, Check if the user
configured channel is available. If it is available,
STOP the AGILE SM and Restart the AGILE SM. This will
clear any old preCAC/RCAC chan information.

CRs-Fixed: 3231108
Change-Id: I0d45204c8525ad7439a3b11cb4f8f8e7f20105d3
2022-07-17 05:04:55 -07:00
Ashish Kumar Dhanotiya
ad57ba6d68 qcacmn: Use super channel list instead of current channel list
Currently regulatory is using current channel list to indicate
the available channels to all the interested components.
With the addition of 6 GHz channels which has different power
types, super channel list is introduced.
With this change, use super channel list to indicate available
channels to other components.

Change-Id: I1a99643d83f090937a667e528b0359b27311e40c
CRs-Fixed: 3160500
2022-07-15 22:26:20 -07:00
Ashish Kumar Dhanotiya
498761949d qcacmn: Update regulatory APIs to use super channel list
Since there are multiple power modes in 6 GHz, the current channel list
alone is not enough to represent the capability of the chip or
device. Given a channel, in many cases it may be required to know all
the power modes that are supported by this channel.

To represent this information per channel, the concept of a super
channel list is introduced. Update regulatory APIs to use
super channel list.

Change-Id: I2e292125d6b667c2c28e4b1326f47f8ccc81e5a9
CRs-Fixed: 3159628
2022-07-15 22:26:13 -07:00
Jianmin Zhu
a8990e0bab qcacmn: Peer sta connects in HE20 for SAP HE160
SAP secondary channel offset of HT info in beacon is set wrongly.
When STA connects it, channel bonding mode check fails, falls back to
20 MHz width.

SAP secondary channel offset of HT info in beacon is decided by checking
40 MHz bonded frequency list. If primary frequency is start frequency of a
bonded frequency, then secondary channel is above the primary channel,
secondary channel offset should be set to 1, else set to 3.

For example, if SAP primary frequency is 5220 MHz, {5220, 5240} is 40 MHz
bonded frequency, secondary channel offset only can be 1, can't be 3.

Change-Id: I491c2351c4c89d6344adf40a46150dc7577ee783
CRs-Fixed: 3241004
2022-07-15 19:07:06 -07:00
Himanshu Batra
bccbe0389d qcacmn: Add fix to avoid race between connect comlplete and disconnect
In case of MLO, if connect is in progress and assoc vdev is moved to
connected state, if the disconnect is received before mlo mgr is
notified for connect, then it can lead to race between connect and
disconnect processing.

Add fix to avoid race between connect comlplete and disconnect by
checking connected link bitmap which is set in mlo connect notifier

Change-Id: I5783827c00106bf6bda2949e4154088fd172de15
CRs-Fixed: 3241708
2022-07-15 07:15:50 -07:00
Vijay Krishnan
f4ad06f0cc qcacmn: Add Function declarations for BW Expand
Add function declaration for the following APIs
1) dfs_bwexpand_find_usr_cnf_chan
2) dfs_bwexpand_try_jumping_to_target_subchan
3) dfs_is_rcac_cac_done
4) dfs_get_configured_bwexpand_dfs_chan

The mentioned APIs are used for BW Expand feature.

CRs-Fixed: 3230855
Change-Id: I17a4549a804a92f2ad3fbc8050a979a44796a152
2022-07-14 18:23:34 -07:00
Pragaspathi Thilagaraj
38b8236ddc qcacmn: Add support for initiate pasn auth vendor command
Add support for initiate pasn authentication using the vendor
command: QCA_NL80211_VENDOR_SUBCMD_PASN
Fill the below required attributes to initiate PASN:
QCA_WLAN_VENDOR_ATTR_PASN_ACTION
QCA_WLAN_VENDOR_ATTR_PASN_PEERS
QCA_WLAN_VENDOR_ATTR_PASN_PEER_MAC_ADDR
QCA_WLAN_VENDOR_ATTR_PASN_PEER_SRC_ADDR

Change-Id: If33f54eafe5986b4571cc21a80fb0b61578db116
CRs-Fixed: 3232261
2022-07-14 04:12:51 -07:00
Vignesh Mohan
93eaeb9799 qcacmn: Modify the get chan enum API to binary search
Modify the get API that fetches the channel index given a frequency,
from a linear search to a binary search to improve the search time.

CRs-Fixed: 3230932
Change-Id: Id6a1a20d80989a797505772954fb913c4f57d227
2022-07-13 00:22:20 -07:00
Vignesh Mohan
216322b1de qcacmn: Use formula to get IEEE from frequency
Instead of looping through the current channel list, which takes O(N),
use the existing formula to directly convert frequency to
IEEE channel number, which will take O(1). This will reduce the CPU load.

CRs-Fixed: 3230932
Change-Id: I38e3a67c6ef4295cea3a8a57f3a853651445f0b5
2022-07-13 00:22:13 -07:00
Liangwei Dong
0b43b9f1f8 qcacmn: Drop beacon or probe rsp with invalid RSN IE
Check RSN ie valid or not for beacon or probe response frames
in scanning. The invalid RSN ie will cause the AP filtered out
during candidate selection in connecting.

Change-Id: Id324ddfaa0f438482673e66b683dcf903d9fc0e3
CRs-Fixed: 3218707
2022-07-12 22:33:43 -07:00
Vijay Krishnan
bcf7463728 qcacmn: Add Function pointer to Enable/Disable BW_Expand
When BW Expansion feature is enabled using UCI or cfg80211tool
command, the utility function to set/get the BW Expand feature
is introduced inside DFS module.

A new dfs member dfs_use_bw_expand is used to store the status
of BW Expansion feature.

CRs-Fixed: 3229250
Change-Id: If01e080f8e60e883fbeb2d7dfd599b91584bc293
2022-07-12 22:33:36 -07:00
Shashikala Prabhu
79b3391de9 qcacmn: Replace WLAN_FEATURE_T2LM flag with WLAN_FEATURE_11BE
Replace WLAN_FEATURE_T2LM compile-time flag with WLAN_FEATURE_11BE.

Change-Id: If3253bf3aae04f434252bfc92d00b8649f831bfe
CRs-Fixed: 3238444
2022-07-12 08:57:02 -07:00
Amith A
d298ea09cd qcacmn: Restrict LPI channels in mas chan list in outdoor deployment
When the deployment is outdoor, there will be only SP rules for AP and no
LPI rules. But there can be LPI rules for client and when this happens,
master chan list is filled with the LPI rules for client modes. It is
then propagated to super chan list when super chan list is computed.
In AFC, when power/expiry event is received, ol_ath_trigger_acs_for_afc
iscalled. In the path of ol_ath_trigger_acs_for_afc, channels are marked
with IEEE80211_CHAN_NO_IR based on availability using super chan list.
This check is failing as there are LPI client entries in super chan list
with enabled state.

In order to fix this issue, LPI rules must be restricted when filling
master chan list.

Change-Id: I7085c376f78f65c2ff3e2c9ec98d4047b5bff896
CRs-Fixed: 3234395
2022-07-12 08:56:55 -07:00
Hariharan Basuthkar
967441ed46 qcacmn: Check if opclass is supported by country
When operating class 137 (320 MHz width) is filled in the AFC partial
request on a radio that supports upto 160 MHz bandwidth, there is a
crash observed.

The 160 MHz platform on which the issue is reported does not have
enough memory to accommodate a 320 MHz AFC response. Therefore, the
crash happens.

To fix this issue, fill the operating class in the AFC partial request
based on the max_5g_bw sent in the WMI_REG_CHAN_LIST_CC_EXT_EVENT.

Change-Id: I3be0e0aa7dc2a41f987a6725bc74444311408e51
CRs-Fixed: 3238405
2022-07-12 07:01:04 -07:00
Vignesh U
65ae278074 qcacmn: Add the regdomain definition for ETSI15_ETSIC
The full regdomain pair ETSI15_ETSIC is not split into 5 GHz regdomain
and 2 GHz regdomain. So the corresponding country configuration (country
alpha 'LK') and the regdomain configuration (regdomain id '0x7A')fails.

Add the 5 GHz and 2 GHz regdomain definition for the regdomain pair
ETSI15_ETSIC .

Change-Id: Ia54516cd15d081c315f988bb3c1ecb258b352f05
CRs-Fixed: 3236859
2022-07-12 07:00:50 -07:00
Jayachandran Sreekumaran
1b244cfcb0 qcacmn: target_if support for spatial reuse feature
Add target_if support for spatial reuse feature

Change-Id: If0ad6e459e7b7d215d5016c8c7c0e94df5d36649
CRs-Fixed: 3213486
2022-07-11 23:13:02 -07:00
Liangwei Dong
25e13778d6 qcacmn: Fix scan entry age out failure
If STA is connected to AP (non MBSS AP), the scm_age_out_entries
try to age out check for APs which are not non-tx AP of MBSS.
But the API doesn't check the current connect AP is MBSS or not
and do the mbssid_info.trans_bssid mac address comparing. So
the check is invalid if both trans_bssid is zero.
Fix by check mbssid_info.profile_num value first and then
trans_bssid field of two scan nodes.

Change-Id: I64ed1eddf0583211a305ba61e1d15a6c674be3fe
CRs-Fixed: 3236072
2022-07-11 21:24:50 -07:00
Sheenam Monga
162ab8974a qcacmn: Remove multiple definitions of regulatory enums
Currently, separate reg_domain and country_code are defined for
qcacmn and qcacld and add correct enum values for 5 GHz & 2 GHz domains.

Define reg_domain and country_code in reg_db.h and include
reg_db.h to avoid multiple definitions.

Change-Id: Icd1da48a51a107a7b8ba04570d01c44d504492c4
CRs-Fixed: 3206927
2022-07-11 03:59:30 -07:00
Paul Zhang
b4a50cb3ce qcacmn: Lock protection when access mlo peer list
The api wlan_mlo_peer_list_peek_head is invoked with lock acquired.
wlan_mlo_peer_create api does not invoke ml_peerlist_lock_acquire
and ml_peerlist_lock_release when invoking api mlo_get_mlpeer, this
causes race condition issue.

To resolve this issue, using api wlan_mlo_get_mlpeer instead of
api mlo_get_mlpeer.

Change-Id: Ifb41b7d83bf17938d210ce5a2d7f370d6355197c
CRs-Fixed: 3228243
2022-07-11 03:59:16 -07:00
Amith A
5bb1139116 qcacmn: Add API reg_is_supr_entry_mode_disabled to check AFC_NOT_DONE flag
Add an API reg_is_supr_entry_mode_disabled to check if
REGULATORY_CHAN_AFC_NOT_DONE is cleared for a given frequency and
input power mode.

Change-Id: I6ca851bbe89e6003d8084856eb30b4796d01616e
CRs-Fixed: 3230917
2022-07-09 09:59:36 -07:00
Pragaspathi Thilagaraj
788ca7bb89 qcacmn: Set 11az Ranging related feature capabilities
Set 11az Ranging related extended capabilities over the
wiphy extended capabilities. Mask these fields for SAP iface

Change-Id: Ib6ce92f42d7125b4e9532d5c893ffe955be0f0dc
CRs-Fixed: 3235143
2022-07-08 21:30:55 -07:00
Kani M
c9f08ae24b qcacmn: Add beacon ratelimiting
Rate-limiting will be based on number of beacons received.
When the beacon is not from connected AP, the beacons
are dropped on a percentage of received beacons and
rate limit, which is configured by the user.

CRs-Fixed: 3230508
Change-Id: Iac591c37129fda6923ef254c2950cb0bdbb44ce9
2022-07-08 11:57:54 -07:00
Paul Zhang
8bddc409a3 qcacmn: validate frame length in util_find_extn_eid
A malicious input can cause a buffer over-read in util_find_extn_eid.
When len==2 and frame[TAG_LEN_POS]==0, the while loop will be entered
and an over-read will happen for frame[ELEM_ID_EXTN_POS].

Since both MIN_IE_LEN and ELEM_ID_EXTN_POS are equal to 2, ensure
(len > MIN_IE_LEN) before accessing the index.

Change-Id: Ia0aa8a2b59e8bf9ac06f5454e40687c5c34c5d88
CRs-Fixed: 3236559
2022-07-08 05:41:04 -07:00
Vinay Adella
e9a54debcb qcacmn: Fix buffer copy beyond max size causing corruption
During ML IE fragmentaion, the inline copy should account for
increase in size due to difference in destination and source.
This avoids corrupting the buffer beyond the max allowed size.

CRs-Fixed: 3236544
Change-Id: I8114c15accb70fa0c92ee51453dd112875bd09d5
2022-07-08 03:01:18 -07:00
Hariharan Basuthkar
261715db9e qcacmn: Modify max_bw for 240 MHz channels after copying to psoc
A kernel warning is observed when the reg_rules are sent to the cfg80211
module on a 320mhz supported radio.

On a 320mhz supported radio, for the 5 GHz reg_rule of the 5490-5730 band,
the max_bw initially comes from the target as 240 MHz. Since
reg_modify_max_bw_for_240mhz_5g_chans is called before copying
the reg_rules to psoc, the max_bw is set to 320 MHz. There is a warning
condition the cfg80211 module to check if the max bandwidth is greater
start and end frequency difference. This check causes the warning.

To fix this issue, call reg_modify_max_bw_for_240mhz_5g_chans after
copying the reg_rules to the psoc.

Change-Id: I385971a2f6c849f7cdd17903ff33646f0fa9d47e
CRs-Fixed: 3236069
2022-07-08 01:21:01 -07:00