[WCNCR00154955] perf: Fix Tx path when Nss=1 and SpeIdxCtrl=2

[Description]
Fix Tx path when Nss=1 and SpeIdxCtrl=2

Change-Id: I686274f4746e50a971a3ed13c5df09ff04cce783
Signed-off-by: Yi-Cheng Huang <yi-cheng.huang@mediatek.com>
CR-Id: WCNCR00154955
Feature: perf
diff --git a/common/wlan_lib.c b/common/wlan_lib.c
index 9cb3ea5..d03d3a3 100644
--- a/common/wlan_lib.c
+++ b/common/wlan_lib.c
@@ -9404,3 +9404,30 @@
 				u4MaxFileLen, pu4ReadFileLen);
 }
 
+/*----------------------------------------------------------------------------*/
+/*!
+* @brief This function is to update some info before connected,
+*        some decision need some info before bss info update
+*
+* @param prAdapter      Pointer of Adapter Data Structure
+*
+* @return WLAN_STATUS_SUCCESS
+*/
+/*----------------------------------------------------------------------------*/
+#if CFG_SUPPORT_ANT_SELECT
+WLAN_STATUS wlanUpdateExtInfo(IN P_ADAPTER_T prAdapter)
+{
+	UINT_32 u4BufLen = 0;
+	P_GLUE_INFO_T prGlueInfo = prAdapter->prGlueInfo;
+	PARAM_CUSTOM_SW_CTRL_STRUCT_T rSwCtrlInfo;
+
+	rSwCtrlInfo.u4Id = 0xa0640001;
+	rSwCtrlInfo.u4Data = prAdapter->rWifiVar.ucNSS;
+
+	return kalIoctl(prGlueInfo,
+					wlanoidSetSwCtrlWrite,
+					&rSwCtrlInfo, sizeof(rSwCtrlInfo),
+					FALSE, FALSE, TRUE, &u4BufLen);
+}
+#endif
+
diff --git a/include/wlan_lib.h b/include/wlan_lib.h
index 8b63ef2..65a30a8 100644
--- a/include/wlan_lib.h
+++ b/include/wlan_lib.h
@@ -1361,4 +1361,6 @@
 	const PUINT_8 pcFileName, PUINT_8 pucBuf,
 	UINT_32 u4MaxFileLen, PUINT_32 pu4ReadFileLen, BOOL bReqFw);
 
-
+#if CFG_SUPPORT_ANT_SELECT
+WLAN_STATUS wlanUpdateExtInfo(IN P_ADAPTER_T prAdapter);
+#endif
diff --git a/os/linux/gl_init.c b/os/linux/gl_init.c
index 123230e..98955c8 100644
--- a/os/linux/gl_init.c
+++ b/os/linux/gl_init.c
@@ -2451,6 +2451,11 @@
 
 		wlanCfgSetCountryCode(prGlueInfo->prAdapter);
 
+#if CFG_SUPPORT_ANT_SELECT
+    /* update some info needed before connected */
+		wlanUpdateExtInfo(prGlueInfo->prAdapter);
+#endif
+
 #if (CFG_MET_PACKET_TRACE_SUPPORT == 1)
 		DBGLOG(INIT, TRACE, "init MET procfs...\n");
 		i4Status = kalMetInitProcfs(prGlueInfo);