net: wireless: rockchip: add rtl8822be pcie wifi driver
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8822be / hal / phydm / rtl8822b / phydm_rtl8822b.c
diff --git a/drivers/net/wireless/rockchip_wlan/rtl8822be/hal/phydm/rtl8822b/phydm_rtl8822b.c b/drivers/net/wireless/rockchip_wlan/rtl8822be/hal/phydm/rtl8822b/phydm_rtl8822b.c
new file mode 100644 (file)
index 0000000..52ff04a
--- /dev/null
@@ -0,0 +1,55 @@
+/******************************************************************************\r
+ *\r
+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.\r
+ *                                        \r
+ * This program is free software; you can redistribute it and/or modify it\r
+ * under the terms of version 2 of the GNU General Public License as\r
+ * published by the Free Software Foundation.\r
+ *\r
+ * This program is distributed in the hope that it will be useful, but WITHOUT\r
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\r
+ * more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License along with\r
+ * this program; if not, write to the Free Software Foundation, Inc.,\r
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA\r
+ *\r
+ *\r
+ ******************************************************************************/\r
+\r
+/*============================================================\r
+// include files\r
+============================================================*/\r
+\r
+#include "mp_precomp.h"\r
+#include "../phydm_precomp.h"\r
+\r
+#if (RTL8822B_SUPPORT == 1)\r
+\r
+\r
+VOID\r
+phydm_dynamic_switch_htstf_mumimo_8822b(\r
+       IN              PDM_ODM_T               pDM_Odm\r
+       )\r
+{\r
+       /*if rssi > 40dBm, enable HT-STF gain controller, otherwise, if rssi < 40dBm, disable the controller*/\r
+       /*add by Chun-Hung Ho 20160711 */\r
+               if (pDM_Odm->RSSI_Min >= 40)\r
+                       ODM_SetBBReg(pDM_Odm, 0x8d8, BIT17, 0x1);\r
+               else if (pDM_Odm->RSSI_Min < 35)\r
+                       ODM_SetBBReg(pDM_Odm, 0x8d8, BIT17, 0x0);\r
+\r
+               ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("%s, RSSI_Min = %d\n", __func__, pDM_Odm->RSSI_Min));\r
+}              \r
+\r
+VOID\r
+phydm_hwsetting_8822b(\r
+       IN              PDM_ODM_T               pDM_Odm\r
+       )\r
+{\r
+       phydm_dynamic_switch_htstf_mumimo_8822b(pDM_Odm);\r
+}\r
+\r
+#endif /* RTL8822B_SUPPORT == 1 */\r
+\r