Răsfoiți Sursa

qcacmn: Move MLO link vdev to UP state upon legacy to MLO roaming

Host driver creates two vdev as part of initial connection.
If the connected AP supports MLO, both(sta and link) of the vdevs
would be moved to UP state. Otherwise, link vdev would be in INIT
state and not moved to UP state.
Firmware sends roam sync indication to host when it roams to a
new AP. The event carries new AP info and the new AP could be
MLO AP. If the current AP is non-MLO and new(roamed) AP is MLO AP,
move the link vdev state to UP as it's in INIT state.

Change-Id: Ib5dd216074d68b0001755024153263ba9654edbe
CRs-Fixed: 3106059
Srinivas Dasari 3 ani în urmă
părinte
comite
c49f8063e7

+ 15 - 1
umac/mlme/connection_mgr/core/src/wlan_cm_sm.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-2015,2020-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -121,6 +121,20 @@ static bool cm_state_init_event(void *ctx, uint16_t event,
 		 */
 		event_handled = false;
 		break;
+	case WLAN_CM_SM_EV_ROAM_SYNC:
+		/**
+		 * If it's a legacy to MLO roaming, bringup the link vdev to
+		 * process ROAM_SYNC indication on the link vdev.
+		 */
+		if (wlan_vdev_mlme_is_mlo_link_vdev(cm_ctx->vdev)) {
+			cm_sm_transition_to(cm_ctx, WLAN_CM_S_CONNECTED);
+			cm_sm_deliver_event_sync(cm_ctx,
+						 WLAN_CM_SM_EV_ROAM_SYNC,
+						 data_len, data);
+		} else {
+			event_handled = false;
+		}
+		break;
 	default:
 		event_handled = false;
 		break;

+ 38 - 1
umac/mlme/vdev_mgr/core/src/vdev_mlme_sm.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -197,6 +197,24 @@ static bool mlme_vdev_state_init_event(void *ctx, uint16_t event,
 		mlme_vdev_down_cmpl_notify_mlo_mgr(vdev_mlme);
 		status = true;
 		break;
+	case WLAN_VDEV_SM_EV_ROAM:
+		/**
+		 * Legacy to MLO roaming: The link vdev would be in INIT state
+		 * as the previous connection was a legacy connection.
+		 * Move the vdev state from INIT to UP up on receiving roam
+		 * sync from firmware. The caller shall make sure the ROAM
+		 * event is sent on right vdev. It's not expected to receive
+		 * WLAN_VDEV_SM_EV_ROAM event on station vdev.
+		 */
+		if (wlan_vdev_mlme_is_mlo_link_vdev(vdev_mlme->vdev)) {
+			mlme_vdev_sm_transition_to(vdev_mlme, WLAN_VDEV_S_UP);
+			mlme_vdev_sm_deliver_event(vdev_mlme, event,
+						   event_data_len, event_data);
+			status = true;
+		} else {
+			status = false;
+		}
+		break;
 
 	default:
 		status = false;
@@ -468,6 +486,25 @@ static bool mlme_vdev_state_up_event(void *ctx, uint16_t event,
 		status = true;
 		break;
 
+	case WLAN_VDEV_SM_EV_ROAM:
+		/**
+		 * Legacy to MLO roaming:
+		 * Move the vdev state to substate UP active on receiving roam
+		 * event. The caller shall make sure the ROAM
+		 * event is sent on right vdev. It's not expected to receive
+		 * WLAN_VDEV_SM_EV_ROAM event on station vdev.
+		 */
+		if (wlan_vdev_mlme_is_mlo_link_vdev(vdev_mlme->vdev)) {
+			mlme_vdev_sm_transition_to(vdev_mlme,
+						   WLAN_VDEV_SS_UP_ACTIVE);
+			mlme_vdev_sm_deliver_event(vdev_mlme, event,
+						   event_data_len, event_data);
+			status = true;
+		} else {
+			status = false;
+		}
+		break;
+
 	default:
 		status = false;
 		break;