Commit Graph

440 Commits

Author SHA1 Message Date
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
Shiva Krishna Pittala
ac7f260278 qcacmn: Migrate PTQM of BSS peer of a non-AP MLD upon ML AP removal
Before proceeding to the ML AP removal at the non-AP MLD, migrate the
PTQM of its BSS peer if it has the link to be removed as the primary.

Change-Id: I477538135186e4f1039bbdf83cfd0c826503f75f
CRs-Fixed: 3575221
2023-08-01 20:29:22 -07:00
Liangwei Dong
adb0ec3b16 qcacmn: Fix duplicate process of link set event
Add flag in event response struct to indicate event processed
or not.
Use scheduler thread to process set link active event same as
other link switch and vdev event to avoid race condition.

Change-Id: I963f9106e296a59cff5078c85a4accf63c7026dc
CRs-Fixed: 3572868
2023-08-01 09:38:15 -07:00
Liangwei Dong
5a23527cfd qcacmn: Extract current active/inactive link bitmap
FW will report current active/inactive link bitmap for
each set link command. Extract them and save to respone
data struct.

Change-Id: I8513391fbf3b181c6182d6568d0ce8e83c627bc6
CRs-Fixed: 3564785
2023-07-31 23:55:45 -07:00
Vinod Kumar Pirla
af6cf93a07 qcacmn: FW Link switch request event handler and cnf resp
Once the FW sends the link switch request to host handle
the request from scheduler thread and send confirmation
back on completion of link switch process with status of
link switch (success/failure).

Add new serialization command type for link switch.

Introduce flags to get the current state of link switch
request, set the state to idle when no link switch in
progress or once the current link switch is completed.
Access to state is protected with MLO dev context lock.
Implement various helper API to:
    a) Transition link switch to next state.
    b) Get current state of link switch.
    c) To check whether any link switch is in progress.
    c) To check whether link switch is happening
       on assoc VDEV or not.

Introduce a new VDEV flag to suggest the VDEV is in
link switch process and also implement helper APIs to
set/get/clear this VDEV flag.
   a) The flag is set at start of link switch, once
      the FW request params are validated and before
      proceeding for link switch disconnect on VDEV.
   b) Clear the flag once the Link switch confirmation
      is sent to FW.

Validate the link switch request params:
     a) IEEE link ID's received.
     b) Check if new connection is part of MLO connection.
     c) Check if VDEV is MLO STA VDEV or not.
     d) Is VDEV in connected state or not, that means
        VDEV is not in transitioning state due to disconnect.
     e) Check if any link switch in progress on this MLD
     f) Current link ID of VDEV equals the FW params.

If validation is successful, serialize the link switch
command and in the serialization activation start the
actual link switch process.

Change-Id: Ie582650541054c8cf39aaa8316e86a7a40256a15
CRs-Fixed: 3556422
2023-07-31 19:38:48 -07:00
Vinod Kumar Pirla
2ec28965cf qcacmn: Clear copied connect request IEs on disconnect
If non-ML type connection fails, then the connection IEs
copied in sta ctx are not cleared as VDEV is not ML VDEV.

Clear the IEs if connection fails irrespective of VDEV type.

Change-Id: I2a2ca155aadeb408e9a4a425d3f1f03f4dbfb867
CRs-Fixed: 3572185
2023-07-31 15:51:23 -07:00
Shiva Krishna Pittala
97684a103f qcacmn: Handle unmigrated clients during MLO AP removal
At the end of the link removal procedure, issue full disconnect of only
those ML peers that still have the removed link as primary TQM and there is
no ongoing PTQM migration of those peers.

Change-Id: I1a4c34313eb2cb49187c1d9b47e5918ada32ccf7
CRs-Fixed: 3550142
2023-07-31 12:20:26 -07:00
Shreedhar Parande
b4db727551 qcacmn: Add API for bridge vdev handing
Add APIs to populate, destroy and get bridge vdev count.

Also send bridge VDEV details in partner link info via
VDEV START command to target.

Change-Id: Iea155b09051b6724d07cf2b6052a07c1d3beb7e8
CRs-Fixed: 3567098
2023-07-30 22:45:14 -07:00
Uraj Sasan
329a080940 qcacmn: Add bridge sta link id
Store linkid used by vdev in bridge sta ctx

CRs-Fixed: 3562149
Change-Id: Ib6550b65abfaae71c7f021640fa3f93bc1ad967c
2023-07-30 19:07:56 -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
Aasir Rasheed
8f15871d98 qcacmn: Use WLAN_MAX_ML_BSS_LINKS to check max number of links
Currently, We are using WLAN_MLO_MAX_VDEVS to check
max number of links, However with n link mlo we need
WLAN_MAX_ML_BSS_LINKS to check max number link.

Change-Id: Idd8a96ae80030c813bbdcebcdc4c76d2f93bea5d
CRs-Fixed: 3567342
2023-07-28 05:33:05 -07:00
Himanshu Batra
80cdcc68dd qcacmn: Donot allow PTQM migration for unauthorized peers
Donot allow PTQM migration for unauthorized peers

Change-Id: I1d4d7b715793b976f6020ecc74b9443893d8073e
CRs-Fixed: 3568618
2023-07-27 08:31:58 -07:00