Przeglądaj źródła

qcacmn: Return if cmd already exists in pending queue

When adding stop command to the serialization queue, if the command is
getting added to the pending queue of the vdev and there already existed
another stop command in the same queue, then return already exists as the
return value after the command is enqueued.
This to avoid notifying the vdev state machine with down event multiple
times though the command already in the pending queue would have notified.

Change-Id: I1830251c6b6c1fa2860f17a3ea8a869e8a3c87ff
CRs-Fixed: 2372563
Santosh Anbu 6 lat temu
rodzic
commit
ba57c33317
1 zmienionych plików z 17 dodań i 5 usunięć
  1. 17 5
      umac/mlme/mlme_utils/wlan_vdev_mlme_ser_if.c

+ 17 - 5
umac/mlme/mlme_utils/wlan_vdev_mlme_ser_if.c

@@ -72,17 +72,24 @@ wlan_vdev_mlme_ser_start_bss(struct wlan_serialization_command *cmd)
 enum wlan_serialization_status
 wlan_vdev_mlme_ser_stop_bss(struct wlan_serialization_command *cmd)
 {
+	uint8_t stop_cmd_pending;
+	uint8_t ret;
+
 	if (!cmd || !cmd->vdev) {
 		mlme_err("Null input");
 		return WLAN_SER_CMD_DENIED_UNSPECIFIED;
 	}
 	/*
 	 * Serialization command filtering logic
-	 * a.Cancel any existing start/stop/restart command in the pending
-	 * queue.
-	 * b.If there is a stop cmd in active queue then return
-	 * c.Else enqueue the cmd
+	 * a. Cancel any existing start/stop/restart command in the pending
+	 *  queue.
+	 * b. If there is a stop cmd in active queue then return
+	 * c. Else enqueue the cmd
+	 * d. If stop cmd already existed in pending queue then return with
+	 *  already exists else return the enqueued return value.
 	 */
+	stop_cmd_pending =
+		wlan_serialization_is_cmd_present_in_pending_queue(NULL, cmd);
 	wlan_vdev_mlme_ser_cancel_request(cmd->vdev,
 					  WLAN_SER_CMD_NONSCAN,
 					  WLAN_SER_CANCEL_VDEV_NON_SCAN_CMD);
@@ -92,7 +99,12 @@ wlan_vdev_mlme_ser_stop_bss(struct wlan_serialization_command *cmd)
 		return WLAN_SER_CMD_DENIED_UNSPECIFIED;
 	}
 
-	return wlan_serialization_request(cmd);
+	ret = wlan_serialization_request(cmd);
+
+	if (stop_cmd_pending && ret == WLAN_SER_CMD_PENDING)
+		return WLAN_SER_CMD_ALREADY_EXISTS;
+	else
+		return ret;
 }
 
 enum wlan_serialization_status