Jelajahi Sumber

qcacld-3.0: Fix uapsd auto trigger command failing after addts

Modify sme_enable_sta_ps_check() to take power save mode
parameter as new argument.During certification WMMAC test
cases failed due to recent change of saving user power save
configuration. The uapsd auto trigger cmd could not be send
due to user power save configuration.

Apply the user power save configuration in conjunction with
power save mode.

Change-Id: I79bdfc3f4d168df23415bfb3418913de7a45886a
CRs-Fixed: 2592560
Pankaj Singh 5 tahun lalu
induk
melakukan
dc48e39e8d
2 mengubah file dengan 14 tambahan dan 11 penghapusan
  1. 3 2
      core/sme/inc/sme_power_save_api.h
  2. 11 9
      core/sme/src/common/sme_power_save.c

+ 3 - 2
core/sme/inc/sme_power_save_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2020 The Linux Foundation. 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
@@ -34,7 +34,8 @@ QDF_STATUS sme_ps_uapsd_enable(mac_handle_t mac_handle, uint32_t session_id);
 QDF_STATUS sme_ps_uapsd_disable(mac_handle_t mac_handle, uint32_t session_id);
 
 QDF_STATUS sme_enable_sta_ps_check(struct mac_context *mac_ctx,
-				   uint32_t session_id);
+				   uint32_t session_id,
+				   enum sme_ps_cmd command);
 
 QDF_STATUS sme_ps_process_command(struct mac_context *mac_ctx,
 				  uint32_t session_id,

+ 11 - 9
core/sme/src/common/sme_power_save.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2020 The Linux Foundation. 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
@@ -323,7 +323,7 @@ QDF_STATUS sme_ps_process_command(struct mac_context *mac_ctx, uint32_t session_
  * sme_enable_sta_ps_check(): Checks if it is ok to enable power save or not.
  * @mac_ctx: global mac context
  * @session_id: session id
- *
+ * @ command: sme_ps_cmd
  * Pre Condition for enabling sta mode power save
  * 1) Sta Mode Ps should be enabled in ini file.
  * 2) Session should be in infra mode and in connected state.
@@ -331,7 +331,7 @@ QDF_STATUS sme_ps_process_command(struct mac_context *mac_ctx, uint32_t session_
  * Return: QDF_STATUS
  */
 QDF_STATUS sme_enable_sta_ps_check(struct mac_context *mac_ctx,
-				   uint32_t session_id)
+				   uint32_t session_id, enum sme_ps_cmd command)
 {
 	struct wlan_mlme_powersave *powersave_params;
 
@@ -346,7 +346,7 @@ QDF_STATUS sme_enable_sta_ps_check(struct mac_context *mac_ctx,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	if (!mac_ctx->usr_cfg_ps_enable) {
+	if (command == SME_PS_ENABLE && !mac_ctx->usr_cfg_ps_enable) {
 		sme_debug("Cannot initiate PS. PS is disabled by usr(ioctl)");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -386,7 +386,7 @@ QDF_STATUS sme_ps_enable_disable(mac_handle_t mac_handle, uint32_t session_id,
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
 
-	status =  sme_enable_sta_ps_check(mac_ctx, session_id);
+	status =  sme_enable_sta_ps_check(mac_ctx, session_id, command);
 	if (status != QDF_STATUS_SUCCESS) {
 		/*
 		 * In non associated state driver wont handle the power save
@@ -417,7 +417,7 @@ QDF_STATUS sme_ps_timer_flush_sync(mac_handle_t mac_handle, uint8_t session_id)
 	if (session_id >= WLAN_MAX_VDEVS)
 		return QDF_STATUS_E_INVAL;
 
-	status = sme_enable_sta_ps_check(mac_ctx, session_id);
+	status = sme_enable_sta_ps_check(mac_ctx, session_id, SME_PS_ENABLE);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		sme_debug("Power save not allowed for vdev id %d", session_id);
 		return QDF_STATUS_SUCCESS;
@@ -475,7 +475,8 @@ QDF_STATUS sme_ps_uapsd_enable(mac_handle_t mac_handle, uint32_t session_id)
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
 
-	status =  sme_enable_sta_ps_check(mac_ctx, session_id);
+	status =  sme_enable_sta_ps_check(mac_ctx, session_id,
+					SME_PS_UAPSD_ENABLE);
 	if (status != QDF_STATUS_SUCCESS)
 		return status;
 	status = sme_ps_process_command(mac_ctx, session_id,
@@ -499,7 +500,8 @@ QDF_STATUS sme_ps_uapsd_disable(mac_handle_t mac_handle, uint32_t session_id)
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
 
-	status = sme_enable_sta_ps_check(mac_ctx, session_id);
+	status = sme_enable_sta_ps_check(mac_ctx, session_id,
+					SME_PS_UAPSD_DISABLE);
 	if (status != QDF_STATUS_SUCCESS)
 		return status;
 	status = sme_ps_process_command(mac_ctx, session_id,
@@ -866,7 +868,7 @@ void sme_auto_ps_entry_timer_expired(void *data)
 	session_id = ps_params->session_id;
 	sme_debug("auto_ps_timer expired, enabling powersave");
 
-	status = sme_enable_sta_ps_check(mac_ctx, session_id);
+	status = sme_enable_sta_ps_check(mac_ctx, session_id, SME_PS_ENABLE);
 	if (QDF_STATUS_SUCCESS == status)
 		sme_ps_enable_disable(MAC_HANDLE(mac_ctx), session_id,
 				      SME_PS_ENABLE);