qcacld-3.0: Enable station SMPS only if the session supported NSS > 1

If HT SMPS is enabled and if the session supported NSS > 1
then include SMPS IE in the HT capabilities of the association
and the reassociation management frame.Enabling SMPS with an AP
whose capability is only 1x1 will result in association/reassociation
request being rejected or an unexpected behavior. Send SMPS force mode
to FW to trigger SMPS action frame only if SMPS is enabled in the
INI. For dynamic antenna switch, the chain mask manager will send
the SMPS action frames.

CRs-Fixed: 931250
Change-Id: Ifff2ef2c8790994a68e676b8bba2fb03c21370d4
diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c
index 02cdce3..8ef3e17 100644
--- a/core/wma/src/wma_utils.c
+++ b/core/wma/src/wma_utils.c
@@ -315,6 +315,34 @@
 	return smps_mode;
 }
 
+/**
+ * wma_smps_mode_to_force_mode_param() - Map smps mode to force
+ * mode commmand param
+ * @smps_mode: SMPS mode according to the protocol
+ *
+ * Return: int > 0 for success else failure
+ */
+int wma_smps_mode_to_force_mode_param(uint8_t smps_mode)
+{
+	int param = -EINVAL;
+
+	switch (smps_mode) {
+	case STATIC_SMPS_MODE:
+		param = WMI_SMPS_FORCED_MODE_STATIC;
+		break;
+	case DYNAMIC_SMPS_MODE:
+		param = WMI_SMPS_FORCED_MODE_DYNAMIC;
+		break;
+	case SMPS_MODE_DISABLED:
+		param = WMI_SMPS_FORCED_MODE_DISABLED;
+		break;
+	default:
+		WMA_LOGE(FL("smps mode cannot be mapped :%d "),
+			 smps_mode);
+	}
+	return param;
+}
+
 #ifdef WLAN_FEATURE_STATS_EXT
 /**
  * wma_stats_ext_event_handler() - extended stats event handler