Browse Source

qcacld-3.0: Accept new function argument in link switch

Link switch notification now can be called multiple times
with different reason. Use notify reason to take appropriate
steps corresponding to state of link switch.

Change-Id: Ib3a37e887903305d9bb8472112e0d92520724835
CRs-Fixed: 3606670
Vinod Kumar Pirla 1 year ago
parent
commit
6343b8c5f9

+ 5 - 1
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -6536,7 +6536,8 @@ policy_mgr_is_mlo_sap_concurrency_allowed(struct wlan_objmgr_psoc *psoc,
 
 QDF_STATUS
 policy_mgr_link_switch_notifier_cb(struct wlan_objmgr_vdev *vdev,
-				   struct wlan_mlo_link_switch_req *req)
+				   struct wlan_mlo_link_switch_req *req,
+				   enum wlan_mlo_link_switch_notify_reason notify_reason)
 {
 	struct wlan_objmgr_psoc *psoc = wlan_vdev_get_psoc(vdev);
 	struct policy_mgr_psoc_priv_obj *pm_ctx;
@@ -6551,6 +6552,9 @@ policy_mgr_link_switch_notifier_cb(struct wlan_objmgr_vdev *vdev,
 	uint8_t num_del = 0;
 	struct ml_nlink_change_event data;
 
+	if (notify_reason != MLO_LINK_SWITCH_NOTIFY_REASON_PRE_START_POST_SER)
+		return QDF_STATUS_SUCCESS;
+
 	pm_ctx = policy_mgr_get_context(psoc);
 	if (!pm_ctx) {
 		policy_mgr_err("Invalid Context");

+ 3 - 1
components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h

@@ -792,6 +792,7 @@ policy_mgr_dump_disabled_ml_links(struct policy_mgr_psoc_priv_obj *pm_ctx);
  * policy_mgr_link_switch_notifier_cb() - link switch notifier callback
  * @vdev: vdev object
  * @req: link switch request
+ * @notify_reason: Reason for notification
  *
  * This API will be registered to mlo link switch, to be invoked before
  * do link switch process.
@@ -800,7 +801,8 @@ policy_mgr_dump_disabled_ml_links(struct policy_mgr_psoc_priv_obj *pm_ctx);
  */
 QDF_STATUS
 policy_mgr_link_switch_notifier_cb(struct wlan_objmgr_vdev *vdev,
-				   struct wlan_mlo_link_switch_req *req);
+				   struct wlan_mlo_link_switch_req *req,
+				   enum wlan_mlo_link_switch_notify_reason notify_reason);
 #else
 static inline void
 policy_mgr_dump_disabled_ml_links(struct policy_mgr_psoc_priv_obj *pm_ctx) {}

+ 3 - 1
components/dp/core/inc/wlan_dp_main.h

@@ -333,12 +333,14 @@ QDF_STATUS wlan_dp_txrx_pdev_detach(ol_txrx_soc_handle soc, uint8_t pdev_id,
  * dp_link_switch_notification() - DP notifier for MLO link switch
  * @vdev: Objmgr vdev handle
  * @lswitch_req: Link switch request params
+ * @notify_reason: Reason of notification
  *
  * Return: QDF_STATUS
  */
 QDF_STATUS
 dp_link_switch_notification(struct wlan_objmgr_vdev *vdev,
-			    struct wlan_mlo_link_switch_req *lswitch_req);
+			    struct wlan_mlo_link_switch_req *lswitch_req,
+			    enum wlan_mlo_link_switch_notify_reason notify_reason);
 #endif
 
 /**

+ 10 - 1
components/dp/core/src/wlan_dp_main.c

@@ -1011,7 +1011,8 @@ dp_change_def_link(struct wlan_dp_intf *dp_intf,
 
 QDF_STATUS
 dp_link_switch_notification(struct wlan_objmgr_vdev *vdev,
-			    struct wlan_mlo_link_switch_req *lswitch_req)
+			    struct wlan_mlo_link_switch_req *lswitch_req,
+			    enum wlan_mlo_link_switch_notify_reason notify_reason)
 {
 	/* Add prints to string and print it at last, so we have only 1 print */
 	struct wlan_dp_psoc_context *dp_ctx;
@@ -1019,6 +1020,14 @@ dp_link_switch_notification(struct wlan_objmgr_vdev *vdev,
 	struct wlan_dp_link *dp_link;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
+	/*
+	 * Currently DP handles link switch notification only if the command
+	 * is in serialization's active queue.
+	 * Return success for other notify reasons which are not handled in DP.
+	 */
+	if (notify_reason != MLO_LINK_SWITCH_NOTIFY_REASON_PRE_START_POST_SER)
+		return QDF_STATUS_SUCCESS;
+
 	dp_ctx = dp_get_context();
 
 	dp_link = dp_get_vdev_priv_obj(vdev);

+ 1 - 1
core/hdd/src/wlan_hdd_son.c

@@ -1489,7 +1489,7 @@ static void hdd_son_deauth_sta(struct wlan_objmgr_vdev *vdev,
 		  QDF_MAC_ADDR_REF(peer_mac), ignore_frame);
 
 	status = hdd_softap_sta_deauth(link_info->adapter, &param);
-	if (QDF_STATUS_IS_ERROR(status))
+	if (QDF_IS_STATUS_ERROR(status))
 		hdd_err("Error in deauthenticating peer");
 }