Преглед на файлове

qcacld-3.0: Fix cm id in DBS downgrade path

cm id is not passed to policy manager in case of DBS donwgrade
when NSS is modified, pass the cm id to fix it.

Change-Id: Ie038b30929c2fcddb6828f1f89765d3004ff3285
CRs-Fixed: 2860061
gaurank kathpalia преди 4 години
родител
ревизия
9e4953a33b

+ 3 - 2
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -1382,6 +1382,7 @@ typedef void (*policy_mgr_pdev_set_hw_mode_cback)(uint32_t status,
  *		beacon update
  * @reason: Reason for nss update
  * @original_vdev_id: original request hwmode change vdev id
+ * @request_id: cm req id
  *
  * This function is the callback registered with SME at nss
  * update request time
@@ -1393,7 +1394,7 @@ typedef void (*policy_mgr_nss_update_cback)(struct wlan_objmgr_psoc *psoc,
 		uint8_t vdev_id,
 		uint8_t next_action,
 		enum policy_mgr_conn_update_reason reason,
-		uint32_t original_vdev_id);
+		uint32_t original_vdev_id, uint32_t request_id);
 
 /**
  * struct policy_mgr_sme_cbacks - SME Callbacks to be invoked
@@ -1419,7 +1420,7 @@ struct policy_mgr_sme_cbacks {
 		policy_mgr_nss_update_cback cback,
 		uint8_t next_action, struct wlan_objmgr_psoc *psoc,
 		enum policy_mgr_conn_update_reason reason,
-		uint32_t original_vdev_id);
+		uint32_t original_vdev_id, uint32_t request_id);
 	QDF_STATUS (*sme_change_mcc_beacon_interval)(uint8_t session_id);
 	QDF_STATUS (*sme_rso_start_cb)(
 		mac_handle_t mac_handle, uint8_t vdev_id,

+ 12 - 10
components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c

@@ -1046,8 +1046,8 @@ policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc,
 	else
 		status = QDF_STATUS_E_NOSUPPORT;
 
-	policy_mgr_debug("next_action %d reason=%d session_id=%d",
-			 next_action, reason, session_id);
+	policy_mgr_debug("next_action %d reason=%d session_id=%d request_id %x",
+			 next_action, reason, session_id, request_id);
 
 	return status;
 }
@@ -1208,7 +1208,7 @@ QDF_STATUS policy_mgr_next_actions(
 		*  beacon updated, send down the HW mode change req
 		*/
 		status = policy_mgr_complete_action(psoc, POLICY_MGR_RX_NSS_1,
-					PM_DBS, reason, session_id);
+					PM_DBS, reason, session_id, request_id);
 		break;
 	case PM_DBS:
 		(void)policy_mgr_get_hw_dbs_nss(psoc, &nss_dbs);
@@ -1267,7 +1267,7 @@ QDF_STATUS policy_mgr_next_actions(
 		break;
 	case PM_SBS_DOWNGRADE:
 		status = policy_mgr_complete_action(psoc, POLICY_MGR_RX_NSS_1,
-					PM_SBS, reason, session_id);
+					PM_SBS, reason, session_id, request_id);
 		break;
 	case PM_SBS:
 		status = policy_mgr_pdev_set_hw_mode(psoc, session_id,
@@ -1288,7 +1288,7 @@ QDF_STATUS policy_mgr_next_actions(
 		 */
 		status = policy_mgr_nss_update(psoc, POLICY_MGR_RX_NSS_1,
 					PM_NOP, POLICY_MGR_ANY, reason,
-					session_id);
+					session_id, request_id);
 		break;
 	case PM_UPGRADE:
 		/*
@@ -1297,14 +1297,15 @@ QDF_STATUS policy_mgr_next_actions(
 		 */
 		status = policy_mgr_nss_update(psoc, POLICY_MGR_RX_NSS_2,
 					PM_NOP, POLICY_MGR_ANY, reason,
-					session_id);
+					session_id, request_id);
 		break;
 	case PM_DBS1_DOWNGRADE:
 		if (policy_mgr_dbs1_dbs2_need_action(psoc, action, &hw_mode))
 			status = policy_mgr_complete_action(psoc,
 							    POLICY_MGR_RX_NSS_1,
 							    PM_DBS1, reason,
-							    session_id);
+							    session_id,
+							    request_id);
 		else
 			status = QDF_STATUS_E_ALREADY;
 		break;
@@ -1313,7 +1314,8 @@ QDF_STATUS policy_mgr_next_actions(
 			status = policy_mgr_complete_action(psoc,
 							    POLICY_MGR_RX_NSS_1,
 							    PM_DBS2, reason,
-							    session_id);
+							    session_id,
+							    request_id);
 		else
 			status = QDF_STATUS_E_ALREADY;
 		break;
@@ -1375,13 +1377,13 @@ QDF_STATUS policy_mgr_next_actions(
 		status = policy_mgr_nss_update(
 					psoc, POLICY_MGR_RX_NSS_2,
 					PM_NOP, POLICY_MGR_BAND_5, reason,
-					session_id);
+					session_id, request_id);
 		break;
 	case PM_UPGRADE_2G:
 		status = policy_mgr_nss_update(
 					psoc, POLICY_MGR_RX_NSS_2,
 					PM_NOP, POLICY_MGR_BAND_24, reason,
-					session_id);
+					session_id, request_id);
 		break;
 	default:
 		policy_mgr_err("unexpected action value %d", action);

+ 24 - 25
components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c

@@ -32,6 +32,7 @@
 #include "wlan_mlme_api.h"
 #include "wlan_cm_roam_api.h"
 #include "wlan_mlme_ucfg_api.h"
+#include "wlan_cm_api.h"
 
 #define POLICY_MGR_MAX_CON_STRING_LEN   100
 
@@ -2971,10 +2972,17 @@ static void policy_mgr_nss_update_cb(struct wlan_objmgr_psoc *psoc,
 		uint8_t vdev_id,
 		uint8_t next_action,
 		enum policy_mgr_conn_update_reason reason,
-		uint32_t original_vdev_id)
+		uint32_t original_vdev_id, uint32_t request_id)
 {
 	uint32_t conn_index = 0;
 	QDF_STATUS ret;
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("Invalid Context");
+		return;
+	}
 
 	if (QDF_STATUS_SUCCESS != tx_status)
 		policy_mgr_err("nss update failed(%d) for vdev %d",
@@ -2994,12 +3002,19 @@ static void policy_mgr_nss_update_cb(struct wlan_objmgr_psoc *psoc,
 	if (PM_NOP != next_action) {
 		if (reason == POLICY_MGR_UPDATE_REASON_AFTER_CHANNEL_SWITCH)
 			policy_mgr_next_actions(psoc, vdev_id, next_action,
-						reason, POLICY_MGR_DEF_REQ_ID);
+						reason, request_id);
 		else
 			policy_mgr_next_actions(psoc, original_vdev_id,
 						next_action, reason,
-						POLICY_MGR_DEF_REQ_ID);
+						request_id);
 	} else {
+		if (reason == POLICY_MGR_UPDATE_REASON_STA_CONNECT) {
+			sme_debug("Continue connect on vdev %d request_id %x",
+				  vdev_id, request_id);
+			wlan_cm_hw_mode_change_resp(pm_ctx->pdev, vdev_id,
+						    request_id,
+						    QDF_STATUS_SUCCESS);
+		}
 		policy_mgr_debug("No action needed right now");
 		ret = policy_mgr_set_opportunistic_update(psoc);
 		if (!QDF_IS_STATUS_SUCCESS(ret))
@@ -3013,7 +3028,7 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc,
 		uint8_t  new_nss, uint8_t next_action,
 		enum policy_mgr_band band,
 		enum policy_mgr_conn_update_reason reason,
-		uint32_t original_vdev_id)
+		uint32_t original_vdev_id, uint32_t request_id)
 {
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	uint32_t index, count;
@@ -3059,7 +3074,7 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc,
 					vdev_id, new_nss, ch_width,
 					policy_mgr_nss_update_cb,
 					next_action, psoc, reason,
-					original_vdev_id);
+					original_vdev_id, request_id);
 			if (!QDF_IS_STATUS_SUCCESS(status)) {
 				policy_mgr_err("sme_nss_update_request() failed for vdev %d",
 				vdev_id);
@@ -3093,7 +3108,7 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc,
 					vdev_id, new_nss, ch_width,
 					policy_mgr_nss_update_cb,
 					next_action, psoc, reason,
-					original_vdev_id);
+					original_vdev_id, request_id);
 			if (!QDF_IS_STATUS_SUCCESS(status)) {
 				policy_mgr_err("sme_nss_update_request() failed for vdev %d",
 				vdev_id);
@@ -3104,26 +3119,10 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc,
 	return status;
 }
 
-/**
- * policy_mgr_complete_action() - initiates actions needed on
- * current connections once channel has been decided for the new
- * connection
- * @new_nss: the new nss value
- * @next_action: next action to happen at policy mgr after
- *		beacon update
- * @reason: Reason for connection update
- * @session_id: Session id
- *
- * This function initiates initiates actions
- * needed on current connections once channel has been decided
- * for the new connection. Notifies UMAC & FW as well
- *
- * Return: QDF_STATUS enum
- */
 QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc,
 				uint8_t  new_nss, uint8_t next_action,
 				enum policy_mgr_conn_update_reason reason,
-				uint32_t session_id)
+				uint32_t session_id, uint32_t request_id)
 {
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	enum policy_mgr_band downgrade_band;
@@ -3147,11 +3146,11 @@ QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc,
 
 	status = policy_mgr_nss_update(psoc, new_nss, next_action,
 				       downgrade_band, reason,
-				       session_id);
+				       session_id, request_id);
 	if (!QDF_IS_STATUS_SUCCESS(status))
 		status = policy_mgr_next_actions(psoc, session_id,
 						 next_action, reason,
-						 POLICY_MGR_DEF_REQ_ID);
+						 request_id);
 
 	return status;
 }

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

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2021 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
@@ -622,10 +622,27 @@ bool policy_mgr_is_5g_channel_allowed(struct wlan_objmgr_psoc *psoc,
 				uint32_t ch_freq, uint32_t *list,
 				enum policy_mgr_con_mode mode);
 
+/**
+ * policy_mgr_complete_action() - initiates actions needed on
+ * current connections once channel has been decided for the new
+ * connection
+ * @new_nss: the new nss value
+ * @next_action: next action to happen at policy mgr after
+ *		beacon update
+ * @reason: Reason for connection update
+ * @session_id: Session id
+ * @request_id: connection manager req id
+ *
+ * This function initiates actions
+ * needed on current connections once channel has been decided
+ * for the new connection. Notifies UMAC & FW as well
+ *
+ * Return: QDF_STATUS enum
+ */
 QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc,
 				uint8_t  new_nss, uint8_t next_action,
 				enum policy_mgr_conn_update_reason reason,
-				uint32_t session_id);
+				uint32_t session_id, uint32_t request_id);
 enum policy_mgr_con_mode policy_mgr_get_mode_by_vdev_id(
 		struct wlan_objmgr_psoc *psoc,
 		uint8_t vdev_id);
@@ -681,6 +698,7 @@ void policy_mgr_reg_chan_change_callback(struct wlan_objmgr_psoc *psoc,
  * @band: update AP vdev on the Band.
  * @reason: action reason
  * @original_vdev_id: original request hwmode change vdev id
+ * @request_id: request id
  *
  * The function will update AP vdevs on specific band.
  *  eg. band = POLICY_MGR_ANY will request to update all band (2g and 5g)
@@ -691,7 +709,7 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc,
 		uint8_t  new_nss, uint8_t next_action,
 		enum policy_mgr_band band,
 		enum policy_mgr_conn_update_reason reason,
-		uint32_t original_vdev_id);
+		uint32_t original_vdev_id, uint32_t request_id);
 
 /**
  * policy_mgr_is_concurrency_allowed() - Check for allowed

+ 18 - 1
core/sme/inc/sme_api.h

@@ -1818,13 +1818,30 @@ void sme_update_user_configured_nss(mac_handle_t mac_handle, uint8_t nss);
 bool sme_is_any_session_in_connected_state(mac_handle_t mac_handle);
 
 QDF_STATUS sme_pdev_set_hw_mode(struct policy_mgr_hw_mode msg);
+
+/**
+ * sme_nss_update_request() - Send beacon templete update to FW with new
+ * nss value
+ * @mac_handle: Handle returned by macOpen
+ * @vdev_id: the session id
+ * @new_nss: the new nss value
+ * @ch_width: channel width, optional value
+ * @cback: hdd callback
+ * @next_action: next action to happen at policy mgr after beacon update
+ * @original_vdev_id: original request hwmode change vdev id
+ * @request_id: request id
+ *
+ * Sends the command to CSR to send to PE
+ * Return: QDF_STATUS_SUCCESS on successful posting
+ */
 QDF_STATUS sme_nss_update_request(uint32_t vdev_id,
 				  uint8_t  new_nss, uint8_t ch_width,
 				  policy_mgr_nss_update_cback cback,
 				  uint8_t next_action,
 				  struct wlan_objmgr_psoc *psoc,
 				  enum policy_mgr_conn_update_reason reason,
-				  uint32_t original_vdev_id);
+				  uint32_t original_vdev_id,
+				  uint32_t request_id);
 
 typedef void (*sme_peer_authorized_fp) (uint32_t vdev_id);
 QDF_STATUS sme_set_peer_authorized(uint8_t *peer_addr,

+ 2 - 0
core/sme/inc/sme_inside.h

@@ -68,6 +68,7 @@ typedef struct sGenericQosCmd {
  * @next_action: Action to be taken after nss update
  * @reason: reason for nss update
  * @original_vdev_id: original request hwmode change vdev id
+ * @request_id: request id for connection manager
  */
 struct s_nss_update_cmd {
 	uint32_t new_nss;
@@ -78,6 +79,7 @@ struct s_nss_update_cmd {
 	uint8_t next_action;
 	enum policy_mgr_conn_update_reason reason;
 	uint32_t original_vdev_id;
+	uint32_t request_id;
 };
 
 /**

+ 7 - 19
core/sme/src/common/sme_api.c

@@ -2749,7 +2749,8 @@ static QDF_STATUS sme_process_nss_update_resp(struct mac_context *mac, uint8_t *
 				param->vdev_id,
 				command->u.nss_update_cmd.next_action,
 				command->u.nss_update_cmd.reason,
-				command->u.nss_update_cmd.original_vdev_id);
+				command->u.nss_update_cmd.original_vdev_id,
+				command->u.nss_update_cmd.request_id);
 	} else {
 		sme_err("Callback does not exisit");
 	}
@@ -11900,7 +11901,7 @@ QDF_STATUS sme_pdev_set_hw_mode(struct policy_mgr_hw_mode msg)
 	cmd->u.set_hw_mode_cmd.context = msg.context;
 	cmd->u.set_hw_mode_cmd.request_id = msg.request_id;
 
-	sme_debug("Queuing set hw mode to CSR, session: %d reason: %d request_id: %d",
+	sme_debug("Queuing set hw mode to CSR, session: %d reason: %d request_id: %x",
 		  cmd->u.set_hw_mode_cmd.session_id,
 		  cmd->u.set_hw_mode_cmd.reason,
 		  cmd->u.set_hw_mode_cmd.request_id);
@@ -11910,26 +11911,12 @@ QDF_STATUS sme_pdev_set_hw_mode(struct policy_mgr_hw_mode msg)
 	return QDF_STATUS_SUCCESS;
 }
 
-/**
- * sme_nss_update_request() - Send beacon templete update to FW with new
- * nss value
- * @mac_handle: Handle returned by macOpen
- * @vdev_id: the session id
- * @new_nss: the new nss value
- * @ch_width: channel width, optional value
- * @cback: hdd callback
- * @next_action: next action to happen at policy mgr after beacon update
- * @original_vdev_id: original request hwmode change vdev id
- *
- * Sends the command to CSR to send to PE
- * Return: QDF_STATUS_SUCCESS on successful posting
- */
 QDF_STATUS sme_nss_update_request(uint32_t vdev_id,
 				uint8_t  new_nss, uint8_t ch_width,
 				policy_mgr_nss_update_cback cback,
 				uint8_t next_action, struct wlan_objmgr_psoc *psoc,
 				enum policy_mgr_conn_update_reason reason,
-				uint32_t original_vdev_id)
+				uint32_t original_vdev_id, uint32_t request_id)
 {
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	struct mac_context *mac = sme_get_mac_context();
@@ -11958,9 +11945,10 @@ QDF_STATUS sme_nss_update_request(uint32_t vdev_id,
 		cmd->u.nss_update_cmd.next_action = next_action;
 		cmd->u.nss_update_cmd.reason = reason;
 		cmd->u.nss_update_cmd.original_vdev_id = original_vdev_id;
+		cmd->u.nss_update_cmd.request_id = request_id;
 
-		sme_debug("Queuing e_sme_command_nss_update to CSR:vdev (%d %d) ss %d r %d",
-			  vdev_id, original_vdev_id, new_nss, reason);
+		sme_debug("Queuing e_sme_command_nss_update to CSR:vdev (%d %d) ss %d r %d req id %x",
+			  vdev_id, original_vdev_id, new_nss, reason, request_id);
 		csr_queue_sme_command(mac, cmd, false);
 		sme_release_global_lock(&mac->sme);
 	}