Commit Graph

111 Commits

Author SHA1 Message Date
Vinod Kumar Pirla
35ea97c560 qcacmn: Enhancements for link switch connect
Introduce following for link switch disconnect:
    1) Connect request source.
    2) Connect request reason.

If the set MAC address response for new link is successful, post
connection on new link and transition the link switch state to
connecting. If the status of connection is successful, update
the state to link switch complete or else directly go for
deserializing link switch command and posting response to FW.

Based on the final state of link switch at the time of sending
FW response, send the appropirate status of link switch and reset
the state of link switch to idle post FW notify.

Don't unlink BSS incase of failure in connection.

Don't indicate connect results to userspace.

As we are already in serialization due to link switch,
don't serialize/deserialize connection command if it
is due to link switch.

Incase of race condition between link switch connect and
userspace connect/disconnect always abort link switch connect.

Change-Id: Ie350b52021c36802b82d6cb5f6f441fe1bd10458
CRs-Fixed: 3556529
2023-08-02 04:55:17 -07:00
Vinod Kumar Pirla
b41d140574 qcacmn: Enhancements for link switch disconnect
Introduce following for link switch disconnect:
   1) Disconnect source.
   2) Disconnect reason.
   3) Link switch BIT in CM_ID to identify link switch request

Don't notify link switch disconnect to initiate disconnect on
other connect VDEV of MLO mgr.

Don't notify userspace if the disconnect request is due to
link switch.

Don't notify netdev to stop queues on link switch disconnect.

Don't flush any pending disconnect/connect request on complete
of link switch disconnect request.

Don't attempt to serialize/deserialize disconnect command
if it is a link switch command ID due to either disconnect request,
disconnect complete or disconnect request flush.

Before start of link switch set the VDEV flag as MLO link VDEV
to leverage the disconnect/connect checks for link VDEV and
restore the flag at the end of link switch. This will impact
when link switch on assoc VDEV is received for which initially
the flag is not set.

Check status of link switch disconnect done API to either
proceed further in link switch or terminate the link switch.
If any userspace disconnect and link switch disconnect race
condition, always abort link switch disconnect and notify
failure to FW.

Change-Id: I6ec2a850d49f5ec6df2ec868c290f19203cd8c88
CRs-Fixed: 3556481
2023-08-02 04:54:41 -07:00
Uraj Sasan
2fce323cb6 qcacmn: API's to check topology and total links
1. APIs to check topology to see if the bridge vap/peer will be used.
2. API to check the max number of links supported.

Also check if we can have the primary and assoc links to be different
for WDS STATION. Based on the topology allow/block
connection to a particular AP.

CRs-Fixed: 3562149
Change-Id: Icf3b32036199f39b0d567ac88795dc07760ac1a5
2023-07-30 19:07:45 -07:00
Vinod Kumar Pirla
160f06923c qcacmn: Call OSIF callback to update BSS info on each link
Notify OSIF about each connected link once assoc VDEV connection
is completed, call the ops callback registered while filling
kernel data structure for each link.

Earlier post connection each VDEV's OSIF callback is called to notify
individually, but this leaves the OSIF unaware of standby link details
as the standby link doesn't have VDEV associated with it.

Change-Id: I027b91d02bdc4412400a7e66f11911da149e672b
CRs-Fixed: 3556378
2023-07-26 10:53:07 -07:00
Deeksha Gupta
d47c717a77 qcacmn: Fill connect response MLO params from mlo_mgr
After mlo connection is completed driver send the connect resp event
to kernel. As of now, driver gets the ML param info from the assoc_rsp IE.
For stand_by link, driver don't have vdev. Due to this, driver can't send the
stand_by info to kernel.

Fix is, instead of assoc_rsp IE driver will use mlo_mgr to get the links
information.

Change-Id: I8da762bed94de4ad2b024183c09b3d0a0f1b7ca4
CRs-Fixed: 3530712
2023-07-26 04:40:24 -07:00
Vijay Patil
c1d9d64d61 qcacmn: Add change to replace free connect request API
In current scenario osif_cm_free_connect_req() and mlo_free_connect_ies()
used to free up connect request and its sub memory.
Similarly cm_free_connect_req() and cm_free_connect_req_param() also
free up the connect request and its sub memory.

So replace osif_cm_free_connect_req() with ucfg_cm_free_connect_req(),
mlo_free_connect_ies() and qdf_mem_free() with wlan_cm_free_connect_req()
and  mlo_free_connect_ies() with wlan_cm_free_connect_req_param().

Change-Id: Ie62603652dd77ae5ae9f7b7085d4b9bb257eaf53
CRs-Fixed: 3554234
2023-07-12 07:49:19 -07:00
Sri Vidya Gunturi
138833a0eb qcacmn: Masking MLO APIs for the non-MLDs
Masking the MLO API, mlo_setup_get_total_socs
using ic_eht_target check for non-MLDs in cmn_dev.

CRs-Fixed: 3551482
Change-Id: I8d585f534146f58beee605b2165bb0c51fc5bdb9
2023-07-08 11:11:44 -07:00
Amruta Kulkarni
82d71c7059 qcacmn: Send Link reconfig event on assoc vdev
Host driver is currently indicating link reconfig
event on link vdev.

Change is to indicate link reconfig on the primary vdev
affiliated with wlan0.

Change-Id: I9955d98bcd52554adf22f838bfbd2263418432d1
CRs-Fixed: 3535940
2023-06-30 20:28:45 -07:00
Krupali Dhanvijay
e60150599d qcacmn: Add support to reset CPU freq in HO failure
CPU min frequency is boosted to maximum once roam start is received

Add support to reset CPU frequency in case of HO failure.

Change-Id: I137f78e3a307be136bcc27760be3d91cb6c1868b
CRs-Fixed: 3522954
2023-06-26 03:21:53 -07:00
Liangwei Dong
6f9b6db8f8 qcacmn: Add northbound notification for link reconfig
When link removal TBTT expires, indicate the link removal
info to upper layer by vendor event.

Change-Id: Idf882cb22ccbd1c8b4ad6f03c6d27980cdbaef50
CRs-Fixed: 3481313
2023-06-02 16:49:42 -07:00
Krupali Dhanvijay
7a3946c538 qcacmn: Add support to boost CPU freq during roam
To enable the tx queues faster during roam, boost the
CPU min frequencies to maximum once roam start is received,
and reset them once queues roam sync is complete or
roaming is aborted.
This change enables such support for lithium and Clarence targets.

Change-Id: I49d2f50f1c0142e7db1c981276bd08b75159b6d3
CRs-Fixed: 3487573
2023-05-18 09:37:07 -07:00
Himanshu Batra
23918826de qcacmn: Correct BSSID in case of correct resp failure
Correct BSSID in case of correct resp failure

Change-Id: I515d22c8e2432915e862c2e484185794c782e94c
CRs-Fixed: 3479029
2023-05-15 10:06:27 -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
Abhishek Singh
b51c893b65 qcacmn: Optimize connect/roam and disconnect complete logs
Optimize connect/roam and disconnect complete logs.

Change-Id: I9e0af49ce27c245b6e88befbe113a472b3b455f9
CRs-Fixed: 3470874
2023-04-20 00:15:39 -07:00
Krupali Dhanvijay
8ca91ab2bf qcacmn: Send Driver disconnect internal reason code to user space
Send the driver disconnect internal reason code as an event to user space
using QCA_NL80211_VENDOR_SUBCMD_DRIVER_DISCONNECT_REASON vendor command.

Change-Id: I0027675b809b94628b6c0c4b8e8286e38fa9f47d
CRs-Fixed: 3371398
2023-04-03 01:35:59 -07:00
Uraj Sasan
ab8cf64ef0 qcacmn: Connect if pri_umac & assoc link are same
Some devices in WDS station mode have limitation when connected
in 3 LINK MLD association where the Primary umac selected and assoc
link should be same. Make sure to have a sanity check before
going for association in such cases.

If the primary umac and assoc links are set to be different then
the connection will be rejected.

Change-Id: If56461a140d4685ba279b1babe04709d919d1650
CRs-Fixed: 3443733
2023-03-30 23:15:34 -07:00
Surya Prakash Sivaraj
88804f2cfc qcacmn: Add support for AKM25
Add support for FT-SAE-EXT-KEY AKM.

Change-Id: I832b414b31d42113eec6d099ba4c62e76dfe6cb1
CRs-Fixed: 3406626
2023-03-27 11:21:18 -07:00
Srinivas Dasari
5ec7c5416d qcacmn: Don't unlink the bss in disconnect/connect failure handler
Currently, bss is unlinked from kernel scan db in below cases,
1. Disconnect
2. Connect failure
3. AP moves to hidden SSID mode from normal mode

bss is unlinked in above 1 and 2 cases (i.e. disconnect and
connect failure) to avoid continuous connect failures when
userspace attempts connect to the same AP without issuing a
fresh scan, which may result in blacklisting the AP. But
framework/wpa_supplicant can take care of this now by making
sure that connect is attempted only if scan result is from
a fresh scan.
Unlinking the bss may lead to inconsistency in some scenarios
and found that disconnect is most common scenario. So, don't
call __wlan_cfg80211_unlink_bss_list() in case 1 and 2 to
avoid unlinking.

Change-Id: I2d3af5fcc22360a5ead0e148d623194cb815f882
CRs-Fixed: 3433127
2023-03-23 04:47:19 -07:00
Sai Pavan Akhil Remella
5d62197747 qcacmn: Send vendor attributes with the Roam stats
As part of commit I7a08635a7912cbd940d90a2d62433296740ad913
a vendor command is added to enable roam stats event.
This change registers callback to send the added vendor
command event to userspace.

Change-Id: I6dc3f8357ace5bb3fa41b4aa116652a91b9fd924
CRs-Fixed: 3427397
2023-03-14 10:37:42 -07:00
abhinav kumar
4440f2b36a qcacmn: Don't send roam indication to kernel if bss is NULL
Currently, before sending a roamed indication to the kernel,
the host calls kernel APIs ieee80211_get_channel and
cfg80211_get_bss to confirm whether the roamed channel and
BSSID are present in the kernel scan cache or not.

In case if kernel returns the BSS pointer as NULL, Host calls
osif_populate_mlo_info_for_link API and uses BSS pointer
to populate MLO info for the link(s), this results in a
NULL pointer dereference in the host.

Fix is to avoid sending roam done indication to kernel/
userspace if kernel returns BSS pointer as NULL and issue
disconnection with reason REASON_UNSPEC_FAILURE.

Change-Id: I28f51369115a7ef20105073e4fcf6ee912c068b2
CRs-Fixed: 3404248
2023-02-25 01:29:42 -08:00
Jeff Johnson
7bc9ad4d74 qcacmn: Fix OSIF Documentation
The kernel-doc script identified some documentation issues in the
os_if folder, so fix most of them. However do not modify the file
qca_vendor.h since most of the issues there are present upstream, and
the downstream file should match the upstream file.

Change-Id: I71948fb497c1ea2d1dd46308277d99beefde18b8
CRs-Fixed: 3390428
2023-01-31 17:09:48 -08:00
Uraj Sasan
0aacfaccd9 qcacmn: Allow connection with upto 3 links
Use macro which indicates maximum number of links we can support
for a given MLO association. Currently this is used for 3 Link
association in which the Association request will have per STA
profile of two other partner links.

Change-Id: If0927367110d58f8e42b40bb987c5b7497b8d551
CRs-Fixed: 3381043
2023-01-25 13:24:41 -08:00
Amruta Kulkarni
2cd3406a9a qcacmn: Add handling 1x roaming case
- Add osif callback api to get scan ie params
- Made few mlo manager api's public

CRs-Fixed: 3288038
Change-Id: I15a764682b8164eb1b66adeff44d7e344f2563c3
2023-01-24 09:41:08 -08:00
Surya Prakash Sivaraj
06469b874f qcacmn: Allocate TLV for KCK based on KCK length
For roam auth vendor event to userspace, currently
16bytes of static memory is allocated for KCK. However,
latest security AKMs have higher KCK length.

Allocate the TLV based on the KCK length received from
firmware.

Change-Id: I2a869989a263f141a9b24a1fb9a97eb34889ac19
CRs-Fixed: 3346092
2022-12-28 00:47:44 -08:00
Himanshu Batra
5ea3ebf775 qcacmn: Change to handle ML reconfig link delete
Change to handle ML reconfig link delete

Change-Id: Iaf743a1a61534f2f4bb12be7fccad48e67b81c12
CRs-Fixed: 3346537
2022-12-27 11:08:54 -08:00
Amruta Kulkarni
b6ca1b3ff2 qcacmn: Add null check in osif roam api
Add null check in osif_roam_auth_mlo_links api.

Change-Id: Ia3290fe3b51d8913f212c732a6c53b0a159adfc3
CRs-Fixed: 3337588
2022-11-22 20:34:32 -08:00
Linux Build Service Account
b32b979e35 Merge "qcacmn: Add changes to support link_id param in cfg80211_disconnected" 2022-11-20 06:53:45 -08:00
Himanshu Batra
80db72a890 qcacmn: Add changes to support link_id param in cfg80211_disconnected
As part of MLO dynamic link deletion handling, cfg80211_disconnected is
taking link_id as an argument.
Add changes to support link_id param in cfg80211_disconnected.

Change-Id: Ia312b5e5768ba9abb11675839e912d4819a2fa86
CRs-Fixed: 3315102
2022-11-19 20:11:05 -08:00
Mohammed Ahmed
b36ae3c3aa qcacmn: add psoc null check before passing to wlan_objmgr_get_peer_by_mac
Current code directly passes the result of wlan_vdev_get_psoc(vdev) to
wlan_objmgr_get_peer_by_mac, without null pointer checking, which can
result in null pointer dereferencing.
To fix this issue, add checking of the psoc pointer before passing to
wlan_objmgr_get_peer_by_mac.

Change-Id: Ica5ebbc448a6da8b1e7c846f05773d95f995eaca
CRs-Fixed: 3327337
2022-11-10 16:43:43 -08:00
David Oladunjoye
25cb050e32 qcacmn: Add lock to Set/clear WLAN_VDEV_FEXT2_MLO_STA_LINK flag
Currently, this MLO flag is being set/clear without regard for
concurrency. We need to lock the vdev when updating these values to
prevent race condition.

Change-Id: Ied90d62f10f6f12a35eeac3060dd0fae7d0c6cfd
CRs-Fixed: 3305558
2022-10-21 21:31:17 -07:00
Yu Wang
093c816d05 qcacmn: print SSID with QDF_SSID_FMT and QDF_SSID_REF
To protect user privacy, print SSID with QDF_SSID_FMT
and QDF_SSID_REF, then SSID will be hide in logs if
anonymization is enabled.

Change-Id: Ifad0ccd76bd1184a9b1d20f3d7fa4455df924843
CRs-Fixed: 3291826
2022-10-18 11:57:53 -07:00
Amruta Kulkarni
319456fee7 qcacmn: Add callback api to send stored keys
For STA MLO connection, the AP can send M1 right after assoc
response on assoc link, which will trigger sending keys to FW
for mlo links, but it can happen that wmi_peer_assoc is not
sent for mlo link until this time.
Current code does not have handling for this case.

To solve this, store the link vdev keys and send them once
link vdev is connected.

Change-Id: I882da96280711ca9cfa4d6ba852fda4a8b6d7a77
CRs-Fixed: 3293692
2022-10-12 23:22:44 -07:00
Jeff Johnson
8aa059674f qcacmn: os_if: Fix misspellings
Fix misspellings in os_if/...

Change-Id: I15604af98007e6ed4a7bc91abc9c07dfed1276fc
CRs-Fixed: 3304690
2022-10-11 14:23:11 -07:00
Amruta Kulkarni
f1da02acc9 qcacmn: Release vdev reference to avoid leak
Currently vdev reference is not released in api
osif_send_roam_auth_mlo_links_events().

To solve this release vdev reference to avoid leak.

Change-Id: Idc766925f5cd71cbdd577ee7b67abffc35130dd9
CRs-Fixed: 3305547
2022-10-06 16:53:03 -07:00
Amruta Kulkarni
c3051031c5 qcacmn: Send roam auth mlo links event
After mlo roaming is complete send roam auth mlo links
event to kernel.
Also populate cfg roam info structure with mlo link info.

Change-Id: I8710e3a53f05c50b7b276d87a39411cb43d0983f
CRs-Fixed: 3279967
2022-09-27 16:23:16 -07:00
Jianmin Zhu
fb43cc12b8 qcacmn: Fix scan with random address failed since wdev is connected
Reproduce steps:
1.	Connect from OSIF success, wdev->connected = true;
2.	Disconnect from target if and reassoc from OSIF happens back to
	back.
3.	Disconnect event is not sent to kernel, wdev->connected keeps
	true, isn't cleared.
4.	Connect from OSIF failed too, wdev->connected keeps true,  isn't
	cleared.
5.	Scan with random address failed since wdev->connected is true.

To fix it, if connect req was a reassoc req and received in not connected
state for race between disconnect from target if and reassoc connect from
OSIF, set reassoc_in_non_connected to send disconnect instead of
connect rsp to kernel to cleanup kernel flags like: wdev->connected.

change-Id: Ibbe38da14e9339b49589216250453b76c7387b57
CRs-Fixed: 3290496
2022-09-22 02:21:43 -07:00
Mohammed Ahmed
fa6e07082f qcacmn: add psoc null pointer check to wlan_objmgr_get_peer_by_mac
Current code directly passes the result of wlan_vdev_get_psoc(vdev) to
wlan_objmgr_get_peer_by_mac, without null pointer checking, which can
result in null pointer dereferencing.
To fix this issue, add checking of the psoc pointer before passing,
and add verification inside wlan_objmgr_get_peer_by_mac.

Change-Id: Iaf0e2535c3a584db788ddc621745c66c296fe08f
CRs-Fixed: 3277651
2022-08-29 22:19:33 -07:00
Jianmin Zhu
640ab03114 qcacmn: Don't treat assoc req as reassoc req
Add a flag to indicate assoc req is used for this roaming,
don't treat assoc req as reassoc req.

Change-Id: I58f357b5581ca71e97841f1d7e0f3daad5d60970
CRs-Fixed: 3273877
2022-08-27 12:09:14 -07:00
Deeksha Gupta
fc9e906e6d qcacmn: Add osif api to get assoc link net device
As per single netdev design, after roaming is completed on link
vdev retrieve assoc link net device and use that for roamed indication
Add osif callback api to hdd to get assoc link net device

Change-Id: I9c8fcd4b095580548b8251818d0f6823df7a52aa
CRs-Fixed: 3274570
2022-08-26 14:21:12 -07:00
Rohan Dutta
1f9ff41325 qcacmn: set partner link op-class
Update partner link op-class in station mode

Change-Id: I8d6908253e78adebabab724e7fd89737906367d2
CRs-Fixed: 3206442
2022-08-04 03:55:35 -07:00
Arun Kumar Khandavalli
1630cd3afe qcacmn: Indicate the connect response through new kernel model
Add changes to indicate the connect response for the ml association.

Change-Id: Id59b00992356c9e66a7442e5351bf9372f055f8f
CRs-Fixed: 3241844
2022-08-02 01:15:00 -07:00
Aravind Kishore Sukla
d7c3414ca0 qcacmn: Add back port flag for multi AKM connect support
Add logic to set back port flag based on Linux kernel version
for multi AKM connect support.

Change-Id: Ia2365afc678edf025f63d4d3c0fc963c97193eb8
CRs-Fixed: 3246135
2022-07-27 07:22:47 -07:00
Deeksha Gupta
b75f0b1100 qcacmn: Fill mlo connect resp parameter if connection is successful
In connect resp, while sending the connect resp indication to supplicant
fill mlo parameters only if connect resp status is successful

Change-Id: Ifa1baf34deaffff68e98b81bd20a4939aaec170f
CRs-Fixed: 3250884
2022-07-25 08:22:04 -07:00
Arun Kumar Khandavalli
db02916cc1 qcacmn: Add new cfg80211 wrapper api's Multi link operation
Add new cfg80211 wrapper api's to support single link multi wdev
operation.

Change-Id: Idf245df7a96a85afe5ff1aac5829423d0bee5b85
CRs-Fixed: 3235154
2022-07-05 09:01:26 -07:00
abhinav kumar
edd1669c23 qcacmn: Handle vendor control command and event
WMI_ROAM_GET_VENDOR_CONTROL_PARAM_CMDID: Add support
for a new roam command to get vendor control parameters
from FW. Host needs to send proper param ID in command
(from enum WMI_ROAM_GET_VENDOR_CONTROL_PARAM_ID)
to get corresponding INI value from FW.

WMI_ROAM_GET_VENDOR_CONTROL_PARAM_EVENTID:
Add support for a new roam event to get param value
from FW. FW sends this event upon receiving
WMI_ROAM_GET_VENDOR_CONTROL_PARAM_CMDID command.

Change-Id: Ic7b3badb14daff183dd36927b4dae6bbc036e6cd
CRs-Fixed: 3225166
2022-06-25 01:08:55 -07:00
Aravind Kishore Sukla
e84ac077e5 qcacmn: Update connect request crypto parameters
Update the connect request crypto parameters based
on the new kernel changes to increase the size of the
akm_suites array in connect request

Change-Id: I6e9cecdb6fa02da5f2b2e238780d3f0fb389c8a2
CRs-Fixed: 3214567
2022-06-24 03:55:06 -07:00
Edayilliam Jayadev
40dacfa471 qcacmn: Count MLO vdevs in a pdev
Count the MLO vdevs in a pdev. WLAN_VDEV_FEXT2_MLO feature
flag in vdev object is set for all MLO vdevs. Simple solution is
to increment/decrement the count on every set/clear of
WLAN_VDEV_FEXT2_MLO feature flag. Since this feature flag will be
set/clear at multiple places for a given vdev, this approach
will lead to wrong MLO vdev count. To fix this we need to
increment/decrement the count on first set/first clear of
WLAN_VDEV_FEXT2_MLO flag. Add a lock also to prevent the race
conditions.

CRs-Fixed: 3106235
Change-Id: Ice7edde04553088fbb7c9b769508d441ccd6e4bf
2022-05-11 05:53:18 -07:00
Deeksha Gupta
aaee26bbb5 qcacmn: Rename bss to bssid in struct cfg80211_mlo_link_params
Rename bss to bssid in struct cfg80211_mlo_link_params

Change-Id: I6353f6879c7e531f4447906553044291a9caf799
CRs-Fixed: 3179562
2022-04-25 01:48:24 -07:00
Himanshu Batra
022ae0bb7f qcacmn: Avoid connect req for a 3 link MLD AP
Avoid connect req for a 3 link MLD AP

Change-Id: I7c2a1166f1d67b272f07bf62761cf850d9c2ee51
CRs-Fixed: 3165708
2022-04-08 07:20:27 -07:00
Surya Prakash Sivaraj
2fa9e5cab5 qcacmn: Add support for max 5 number of AKMs in connect req
Currently, host supports max 2 number of AKMs in connect req.

Add support for max 5 number of AKMs in connect req from
userspace.

Change-Id: I889124257c374092128e92f0f1eca1e1d0711f49
CRs-Fixed: 3151412
2022-03-29 14:12:07 -07:00