瀏覽代碼

qcacmn: Match vdev as well while cancelling ser cmd

For a particular vdev, If one of such same CMD id
is needed to be cancelled, either
wlan_ser_cancel_scan_cmd() is called if cmd is scan
cmd or wlan_ser_cancel_non_scan_cmd() is called if
cmd is non-scan cmd.
For both the cases, currently cmd_id is iterated
among pdev serialization cmd queue and if cmd_id
is matched then that particular id is flushed.
Since in per vdev cmd_id, same ids can be assigned
across multiple vdevs and it may be possible that in
the pdev serialization cmd queue, different vdev can
enqueue the same cmd id.
Hence, with current condition that only checks for
cmd_id may result in incorrectly cancelling the
same cmd_id for different vdev.
To prevent this, along with checking for cmd id
and type, check for the valid vdev and remove
the cmd corresponding to that vdev only

Change-Id: I10d37588a52e8d3209c7521782716e2358e57079
CRs-Fixed: 3295516
Utkarsh Bhatnagar 2 年之前
父節點
當前提交
bf2b82dec7

+ 6 - 3
umac/cmn_services/serialization/src/wlan_serialization_non_scan.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 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
@@ -562,9 +563,11 @@ wlan_ser_cancel_non_scan_cmd(
 			qdf_container_of(nnode,
 					 struct wlan_serialization_command_list,
 					 pdev_node);
-		if (cmd && !wlan_serialization_match_cmd_id_type(
-							nnode, cmd,
-							WLAN_SER_PDEV_NODE)) {
+		if (cmd &&
+		    !(wlan_serialization_match_cmd_id_type(nnode, cmd,
+							  WLAN_SER_PDEV_NODE) &&
+		      wlan_serialization_match_cmd_vdev(nnode, cmd->vdev,
+							WLAN_SER_PDEV_NODE))) {
 			pnode = nnode;
 			continue;
 		}

+ 6 - 3
umac/cmn_services/serialization/src/wlan_serialization_scan.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 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
@@ -205,9 +206,11 @@ wlan_ser_cancel_scan_cmd(
 					 struct wlan_serialization_command_list,
 					 pdev_node);
 
-		if (cmd && !wlan_serialization_match_cmd_id_type(
-							nnode, cmd,
-							WLAN_SER_PDEV_NODE)) {
+		if (cmd &&
+		    !(wlan_serialization_match_cmd_id_type(nnode, cmd,
+							  WLAN_SER_PDEV_NODE) &&
+		      wlan_serialization_match_cmd_vdev(nnode, cmd->vdev,
+							WLAN_SER_PDEV_NODE))) {
 			pnode = nnode;
 			continue;
 		}