Commit Graph

451 Commits

Author SHA1 Message Date
Gururaj Pandurangi
0b84f05679 qcacmn: Fix compilation warnings on x86
Fix the compilation warnings on x86.

Change-Id: Ic9edafc5b33462f5c96faa391e6441141aa09837
CRs-Fixed: 3591586
2023-09-12 23:35:21 -07:00
Srinivas Pitla
734c9fcae7 qcacmn: Add WMI service support for WSI stats info
This change adds service bit support for WSI stats
to FW

Change-Id: I06119c2196b951393e8bbbb82bd4a10436207d63
CRs-Fixed: 3601765
2023-09-11 15:50:57 -07:00
Aditya Sathish
25c27f83e0 qcacmn: Add support for WSI link info libraries
Add support to capture ingress and egress stats
in the MLO manager

Change-Id: Ife0acab15ba802c953cfcf3a720c6e54933ded5e
CRs-Fixed: 3601749
2023-09-11 15:50:46 -07:00
Pragaspathi Thilagaraj
1c1ebf792c qcacmn: Fix two enum members using same name
Fix the conflict between the host and fw enum
for mlo teardown reason.

CRs-Fixed: 3610563
Change-Id: I20638ed0cbe6b88e20f48815c236e92b833a34a9
2023-09-11 03:38:57 -07:00
Arun Kumar Khandavalli
0d54df03f9 qcacmn: Release mutex lock only once
In mlo_is_sta_csa_synced the mlo dev context lock is released
twice resulting in assert.

Release the mlo mutex once to avoid the assert

CRs-Fixed: 3598455
Change-Id: I1ceb797ddcaa8c57b8e7218c5b6aebf8d0136ab5
2023-09-09 22:45:32 -07:00
Aasir Rasheed
e4b28f875e qcacmn: Use mlo dev context to fetch link info
This change is to use ml dev context to fetch
link info, As ml dev context is available in both
vdev and psoc context. It's valid for both standby
and active links.

Change-Id: Ib705bd5a5a1144f980295331f5f26ba667906cf1
CRs-Fixed: 3568944
2023-09-09 19:32:34 -07:00
Vinod Kumar Pirla
f161aeba7c qcacmn: Defer disconnect req when link switch in progress
If link switch is in progress and no other disconnects are
pending in MLO manager sta ctx, save the new disconnect req
and move link switch state to abort. On link switch complete
schedule the pending disconnect in MLO manager.

In the scheduler callback for pending disconnect handling
add NULL check for disconnect request.

Change-Id: I4b144239eb1542cea934478643b6e53b371f2c93
CRs-Fixed: 3608727
2023-09-08 04:12:12 -07:00
Vinod Kumar Pirla
d968a41646 qcacmn: Do not serialize link switch for host force reason
In response to host set link request, FW might send link switch
request where FW will wait for response of link switch in order
to send response of set link. As set link is already in
serialization link switch will be in pending queue.
This will lead to dead lock case where set link in serialization
is waiting for FW response where FW is waiting for link switch
response which is in pending queue due to set link command.

To avoid this dead-lock, do not serialize link switch request
due to set link as FW will send the reason code as HOST_FORCE.

Change-Id: I338f6b4c90ceba5452ede77ad0237af7ddecb31f
CRs-Fixed: 3607164
2023-09-08 04:12:01 -07:00
Vinod Kumar Pirla
dcb8808eb6 qcacmn: Notify callbacks post link switch with status
Introduce new enum to hold the reason for invoking link switch
notify callback.

Notification happens in the following scenarios:
    a) On FW request received in host before serialization.
    b) Once link switch is serialized before link switch disconnect.
    c) On link switch complete but before removed from serialization.

Change-Id: Id502db935ccc3835ab8bb8fab8d89276abe0a243
CRs-Fixed: 3606668
2023-09-08 04:11:49 -07:00
Uraj Sasan
9487a4d77f qcacmn: Clear bridge_sta_ctx in MLO WDS STA
Clear bridge_sta_ctx during disconnect/connect failure.

There were issues in MLO WDS bridge STA mode when there was
multiple disconnect/connect failure, as the previous context
was not cleared and code logic was going into the earlier
state leading to issues.

Make sure to clear the context during disconnect and connect
failure so the STA context will be initialized properly.

CRs-Fixed: 3603610
Change-Id: I586ee44e7f4569693aa6c3550d1c5d94a1a9d3a7
2023-09-08 04:11:38 -07:00
Balaganapathy Palanisamy
0761c3f248 qcacmn: Add bridge vdev count under mlo dev
Add bridge vdev count under MLO dev context and
free dev context when all vdevs in mlo dev context
are freed

Change-Id: I861ec17f0143df8e063cc245aa71195f0349b4a7
CRs-Fixed: 3598970
2023-09-05 15:14:40 -07:00
Shiva Krishna Pittala
91485c3e97 qcacmn: Don't return failure in MLO disconnect path for NULL assoc case
With MLO AP removal procedure, AP MLD can remove a link that happens to be
the assoc link for a given Non-AP MLD and the Non-AP MLD can continue to
function after that. In the existing implementation, Non-AP MLD is
returning failure in the MLO disconnect path if the assoc link is NULL, fix
the same.

Change-Id: Ib14c87da083a99f5350c9b73df2b31d08749ff0a
CRs-Fixed: 3604869
2023-09-03 14:41:13 -07:00
Kenvish Butani
31876041a5 qcacmn: Attach / Detach vdev from DP MLO Dev ctx
For ML-Repurpose usecase, Attach or Detach vdev
to DP MLO device context.

Change-Id: I67a31db07c68fc9988c504f12a075541907d7027
CRs-Fixed: 3598387
2023-09-03 10:42:31 -07:00
Krunalsinh Padhar
9c5f2ce5a8 qcacmn: Fix probable null dereference
Remove the debug prints that would cause null dereferencing.

Change-Id: I002e9b14945a2e1de62f94095847ea8886decad6
CRs-Fixed: 3604295
2023-09-02 05:09:38 -07:00
Vinod Kumar Pirla
caf1626286 qcacmn: On link switch don't change the state of ML peer
On disconnect ML peer state is set to disconnect initiated,
this helps to avoid sending multiple deauth/disassoc OTA
frames to AP on each VDEV.
If link switch fails the ML peer will be in this state so
for next userspace disconnect request deauth/disassoc frame
is not sent OTA and AP might not be aware of STA leaving the
network.

Do not change ML peer's state on VDEV link switch disconnect
to ML_PEER_DISCONN_INITIATED.

Change-Id: Icbbb46bbf78cea796a3a1e07754be3a626390ad0
CRs-Fixed: 3601739
2023-09-01 21:01:39 -07:00
Abhinav Kumar
88fa8a3f0b qcacmn: Send proper control mode value to upper layer
1. Upper layer sends QCA_WLAN_VENDOR_ATTR_LINK_STATE_CONTROL_MODE
vendor command to configure control mode in host/fw.
2. Host receives GET_ML_LINK_STATE driver command to return
control mode (configured at step 1) to upper layer.

Host should reply as a response of GET_ML_LINK_STATE with same
value of control mode configured at step 1 to upper layer.

Change-Id: I3b5cb3bec31957ee8479d7f366d1e360421a7573
CRs-Fixed: 3601735
2023-08-31 11:02:29 -07:00
Amruta Kulkarni
1684c8ceac qcacmn: T2LM timer changes
Currently the T2LM timer is maintained by host.
Code change made to add support to run the T2LM timer in FW.

CRs-Fixed: 3594141
Change-Id: I7eee4800f68b07d5492a0336e3fe8e0db17d2020
2023-08-31 11:02:17 -07:00
Kenvish Butani
744e92cc0c qcacmn: Cleanup MLO CDP API's for MLO Partner List
Cleanup MLO CDP API's for updating MLO Partner
list invoked from UMAC.

Change-Id: Id3a346ceb4b103410e1e89cbce25abcad9e4adc5
CRs-Fixed: 3588208
2023-08-30 01:38:23 -07:00
Pragaspathi Thilagaraj
7f18f6e441 qcacmn: Update self link address also after roaming
When updating the AP link address and channel info after
roaming, update the self link address also to the link switch
context on each vdev. This information will be fetched while
sending roam + auth event to userspace after roaming.

Change-Id: I363a5ee8d65bb21d84c15879996369f4e397f2a6
CRs-Fixed: 3589401
2023-08-30 01:37:59 -07:00
Uraj Sasan
127fb0fc7e qcacmn: Skip sending T2LM for bridge sta
Skip sending T2LM info to Target for bridge-sta topology

CRs-Fixed: 3598171
Change-Id: Iccbbef68431ca2d415e4f6127ea8231d85ded0e1
2023-08-28 05:44:15 -07:00
Shreedhar Parande
0394351f22 qcacmn: Do not reset linkid for bridge vap
Link ID for the bridge vap is set during creation.
However during mlo ap vdev attach, it gets overwritten by 0.

Due to this, during 2.4 GHz link removal using ml-reconfig,
2.4 GHz linkid and bridge vap as primary vaps linkid matches
which leads to full disconnection of the peer.

To fix this, retain previously set linkid for bridge vap.

Change-Id: I28a3da110aa6427ae7024fe173ae04c5a6bebe41
CRs-Fixed: 3592545
2023-08-26 02:39:40 -07:00
Vinod Kumar Myadam
151331ba76 qcacmn: Validate num_links before accessing data
In util_parse_rv_info_from_linkinfo, accessing the array of data
without validating the index of the array will cause OOB issue.

Add check with the maximum size of the array before accessing the
data.

Change-Id: Ie8b33c83fa1cd18cfbfcb6c7a82b79ddd86e8808
CRs-Fixed: 3580821
2023-08-26 02:39:18 -07:00
Aditya Kodukula
16020acc91 qcacmn: Include structures having qdf_bitmap member
Currently kernel-doc script doesn't support qdf_bitmap
struct member. So, all structure which has qdf_bitmap
member are excluded.

Support for qdf_bitmap has been added to kernel-doc script.
So, include all structures which have qdf_bitmap.

Change-Id: I95095d458152a0285a24fba398b46effd94525db
CRs-Fixed: 3598814
2023-08-25 15:15:15 -07:00
Krunalsinh Padhar
b3727d63af qcacmn: Improve logging for ml_peer_count decrement
Added logs to make sure ml_peer_count has decremented every time mlo
peer is detached and catch rare instance when ml_peer_count is not
decremented properly.

Change-Id: Ic174a0bce22a8a85e9df4ccb840de023b45a7f9d
CRs-Fixed: 3580583
2023-08-24 21:15:24 -07:00
Balaganapathy Palanisamy
b7aac4a3be qcacmn: Ignore ap vdev count initialization
Avoid ap vdev count initialization through mlo
bridge vdev.

Change-Id: Id8845f2499d2064ec768e90ffa6324bfde60d3d9
CRs-Fixed: 3592556
2023-08-24 04:18:27 -07:00
Vinod Kumar Pirla
9e3a7ecb78 qcacmn: Allow disconnect req in INIT state for link switch
VDEV is moved to INIT state as part of link switch disconnect,
before set MAC address response is received, any disconnect
request on this VDEV will not be handled as VDEV is in INIT
state, if link switch is in progress then it will abort link
switch and starts link switch dequeue process.

If the new disconnect request is from userspace it will
increment the OSIF ops, but if link switch is on assoc VDEV
OSIF is notified to restore the adapter deflink as part of
link switch complete where it wait for all OSIF ops to
complete. This is a deadlock case where driver is waiting
for ops completion on same thread where ops is initiated.

To fix this issue, do not handle link switch dequeue on the
same thread, instead move the link switch state to abort
and when actual link switch thread comes it will flush from
serialization.

If userspace disconnect is not queued as VDEV is in INIT
state due to link switch, kernel won't be notified about
the disconnect as this notification is only done on assoc
VDEV and any further connect requests from supplicant gets
dropped in kernel saying already connected and supplicant
will immediately try disconnect which driver will again
drop as VDEV is in INIT state. To avoid this kernel-driver
out of sync, forcefully move VDEV to disconnecting state
and queue the disconnect request.

Change-Id: I116859601ebba21d44797e74e160b56532ef833c
CRs-Fixed: 3588936
2023-08-21 15:05:50 -07:00
Vinod Kumar Pirla
15b56b62e4 qcacmn: Move frame control values to header file
Move the frame control values used for link specific rsp
generation to a header file to access in other source files.

Change-Id: Ib531b9ae88604e98b9119efa610757dc5f399596
CRs-Fixed: 3586052
2023-08-21 10:58:03 -07:00
Rakesh Boyina
64dc3a4199 qcacmn: Add Max ML Peer ID support from target capability exchange
Add support to parse the Max ML Peer ID's parameter received from target
capabilities and update the parameter in global MLO context.

Change-Id: I4118d288a312dc4a18182caf765b0ded014b985a
CRs-Fixed: 3556542
2023-08-18 18:11:11 -07:00
Uraj Sasan
85dafccb66 qcacmn: Handle bridge peer creation in WDS station
Handle case where device topology needs bridge peer.
So if the device have connection on two opposite links
create bridge peer on the central vap.
Sample topology:
AP
2 GHz<-->6 GHz MLO Links
STA topology
       (5 GHz Low VAP)
         chip0
      /         \
 (2 GHz VAP)chip1    chip2 (6 GHz VAP)
      \         /
         chip3
       (5 GHz High VAP)
In the above case we will have Bridge peer on either
5 GHz Low or 5 GHz High VAP

CRs-Fixed: 3575939
Change-Id: I923cc01b3c6e23099436a25565cbabab5a08d93c
2023-08-18 18:10:58 -07:00
Vinod Kumar Pirla
9319e99df8 qcacmn: Notify link switch status to FW in all error cases
Currently if host receives invalid link switch params from FW,
the request is dropped in host and reject status is not sent to FW.

Update link switch status to FW in all error cases.

Change-Id: If1ce5e30517d98c38e869baa1cfc620302b839b2
CRs-Fixed: 3588204
2023-08-17 01:39:49 -07:00
Krishna Rao
a1c589112a qcacmn: Update ML Reconfig TBTT docs and print per 11be D3.0
IEEE802.11be D3.0 has renamed the 'Delete Timer' subfield to 'AP
Removal Timer' in the STA Info field in per-STA profile in
Reconfiguration Multi-Link element. The earlier name did not correctly
reflect the AP removal operation and was a source of confusion.
Update documentation related to the erstwhile Delete Timer to indicate
the new name. Similarly, update a print related to this timer.

CRs-Fixed: 3589907
Change-Id: Ie5c9c4c8756057791095e87532e0e14bcf7ef133
2023-08-17 01:39:39 -07:00
Aakanksha Doda
074162a87a qcacmn: Remove number of vaps check in vdev detach from MLD context
Remove number of vaps check in vdev detach from MLD context.

Change-Id: I3f67534911582a0773da52fe7e800f32b1de831e
CRs-Fixed: 3585336
2023-08-16 13:36:49 -07:00
Surya Prakash Raajen
6aa15982ae qcacmn: Do mlo register only for mlo capable soc
Do mlo register only for mlo capable soc, since non mlo
chips also could be part of mlo capable target

Change-Id: Ibef1899257f60a00ba3933af44efdb736550b9e4
CRs-Fixed: 3582269
2023-08-14 18:57:18 -07:00
Shiva Krishna Pittala
f796368068 qcacmn: Remove the assumption of assoc link's presence post connection
With MLO link removal, AP can remove a link that happens to be the assoc
link for a given Non-AP MLD. So far, the Non-AP MLD has been using the
assoc link to interact with other layers and make various decisions.
Change those behaviors on a case-by-case basis.

CRs-Fixed: 3577559
Change-Id: Iaa001bdd2571bce424a953caa3197a99a6f84180
2023-08-14 18:57:08 -07:00
Kenvish Butani
ea4ddc65ed qcacmn: CP hooks to support MLO device Context Structure
Control Path hooks to create, attach, detach and destroy
DP MLO device context structure

Change-Id: Ib3fe459dfabb8b8971b92c0529e9df0093bf5342
CRs-Fixed: 3567004
2023-08-13 23:59:00 -07:00
Guru Pratap Sharma
84562049b6 qcacmn: Adding lock in epcs info structure
Adding lock in epcs info structure to achieve synchronization
in epcs state etc

Change-Id: I76b35075f2ecdfba64d4df5ea06c898f5be059e8
CRs-Fixed: 3583860
2023-08-11 14:59:35 -07:00
Amruta Kulkarni
712aff4786 qcacmn: Add check for frame boundary check in t2lm api
While parsing t2lm ie pass the frame length and add
check for frame boundary.

Change-Id: Iebb2cb5f0756785e4698613b80bfb31d60a2ed80
CRs-Fixed: 3577156
2023-08-11 04:36:05 -07:00
Pragaspathi Thilagaraj
5a0e761ce4 qcacmn: Reset Roam state for link vdev after link switch
After link switch, the assoc vdev and link vdev could change.
So once the link switch is complete, change the roam state to
DEINIT for the link vdevs

Change-Id: I3e583fc1cb5be8d17d8680dab96461b058740c0a
CRs-Fixed: 3581730
2023-08-11 01:24:31 -07:00
Uraj Sasan
082bbef13c qcacmn: WDS STATION send bridge partner details
Send bridge partner details during peer create and peer
assoc. The partner of bridge peer are saved which are used later
during bridge peer create and assoc. Also add bridge peer partner
details while sending peer create and assoc on actual links.

CRs-Fixed: 3574656
Change-Id: I755614a131f6552ac28377d2c7648db4fd87b8df
2023-08-10 18:22:50 -07:00
Aasir Rasheed
33f9c6eb46 qcacmn: Fix typographical errors
Currently, the host driver interprets an active link
status as 0 and an inactive link status as 1.
To comply with updated requirements, the change will
switch active links to be represented as 1 and inactive
links as 0, aligning with the correct status interpretation.

Change-Id: I5342e85106b4623ed4c79a4841884bfa8cd9d638
CRs-Fixed: 3581454
2023-08-09 17:26:11 -07:00
Himanshu Batra
d0b09316c5 qcacmn: Add wait logic for sync mld disconnection
Add wait logic for sync mld disconnection

Change-Id: Ie0931cf77205dd4f88eb903e7b43a3735786c859
CRs-Fixed: 3570519
2023-08-09 04:01:55 -07:00
Srinivas Pitla
4251e4ac67 qcacmn: Add/Remove VDEV from MLD
This change adds APIs
1) remove VDEV from MLD
2) add VDEV to MLD

CRs-Fixed: 3579048
Change-Id: I5a81d7a50b0c3865c3ab914a3e10906e3010cb91
2023-08-08 06:10:53 -07:00
Rahul Gusain
ba9a0f4a3d qcacmn: Add EMLSR caps in ML STA context
Currently, driver extracts EMLSR caps info from association response
for assoc vdev but this info is not present in link vdev.
Thus, driver should cache this EMLSR caps info in ML STA context while
extracting for assoc vdev and use these values for link vdev.

So, for this, add EMLSR caps struct in ML STA context.

Change-Id: I0ecf32ed4af9fb07624498f2753c12c5420edec1
CRs-Fixed: 3578371
2023-08-07 16:29:14 -07:00
Liangwei Dong
796501841d qcacmn: Add link removal flag in link info struct
Previously, the link removal state is in vdev object, but
the standby link has no vdev and vdev maybe repurposed
to other link, so link removal flag has to be in link info
struct to record the link removal state of corresponding link.

Change-Id: I435a8910897b099cffcccb0e435b70efb896eb8a
CRs-Fixed: 3572873
2023-08-04 06:53:48 -07:00
Shreedhar Parande
15f840d145 qcacmn: Create bridge peer under bridge vdev
Create and attach bridge peer under bridge vdev for 4-link
MLD.

If there are no bridge VDEVs, fall back to existing mechanism.

Change-Id: I32187bcc849fbe36200967bb7f88dfa56c22c3dc
CRs-Fixed: 3574491
2023-08-03 10:03:49 -07:00
Aasir Rasheed
7dc944d192 qcacmn: Remove crypto keys in case of reset
Currently, host driver removes crypto keys based
on pdev create or delete. But these keys are not
valid across connections. So, free the crypto keys
upon new candidate selection/new connect request.

This change is to free crypto keys if there is new
candidate selection or another connection request.

Change-Id: Ifaa8786efab09f6b753a6355f249ccb3018da097
CRs-Fixed: 3568173
2023-08-02 04:55:26 -07:00
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
a61df6019c qcacmn: Update VDEV MAC addr after link switch disconnect
After receiving link switch disconnect completion indication
from connection manager, update the VDEV's MAC address to new
link's address to support link specific OTA frames exchange.

Introduce new dispatcher API to call from VDEV MLME, if the
VDEV for which MAC address response received is in link
switch in progress, then deliver the response to MLO mgr,
or else deliver it directly to OSIF.

Handle the FW response for link switch set MAC address in
MLO manager and if the set MAC addr response is successful,
update OSIF about the new MAC address to perform cleanup on
old link and initialize fields in new link.

If the response is successful, transition the link switch to
initiate connection or else abort link switch.

Change-Id: Ic330dca84e602909cc5ddf7e134809c0e0345a17
CRs-Fixed: 3556506
2023-08-02 04:54:52 -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
Vinod Kumar Pirla
cbf4cdb23c qcacmn: Link Switch start notifier callback registration
Move the MLO MGR in UMAC to core and dispatcher directories.
Introduce function prototype of callback and provide
dispatcher API for components interested in link switch
to register callback.
Introduce API to register and unregister callback for
link switch.

Change-Id: I14a64f61ab1269f1d46b7aff03d20b820d1cd8d9
CRs-Fixed: 3556465
2023-08-02 04:54:30 -07:00