Commit 07839b14 authored by Joe Perches's avatar Joe Perches Committed by John W. Linville

rtlwifi: Simplify chip version id logging

Reduce object size a few KB too.

$ size drivers/net/wireless/rtlwifi/built-in.o*
   text	   data	    bss	    dec	    hex	filename
 584493	  55333	 126800	 766626	  bb2a2	drivers/net/wireless/rtlwifi/built-in.o.new
 586904	  55333	 127216	 769453	  bbdad	drivers/net/wireless/rtlwifi/built-in.o.old
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d9595ce3
...@@ -991,6 +991,7 @@ static enum version_8192c _rtl92ce_read_chip_version(struct ieee80211_hw *hw) ...@@ -991,6 +991,7 @@ static enum version_8192c _rtl92ce_read_chip_version(struct ieee80211_hw *hw)
struct rtl_phy *rtlphy = &(rtlpriv->phy); struct rtl_phy *rtlphy = &(rtlpriv->phy);
enum version_8192c version = VERSION_UNKNOWN; enum version_8192c version = VERSION_UNKNOWN;
u32 value32; u32 value32;
const char *versionid;
value32 = rtl_read_dword(rtlpriv, REG_SYS_CFG); value32 = rtl_read_dword(rtlpriv, REG_SYS_CFG);
if (value32 & TRP_VAUX_EN) { if (value32 & TRP_VAUX_EN) {
...@@ -1003,27 +1004,25 @@ static enum version_8192c _rtl92ce_read_chip_version(struct ieee80211_hw *hw) ...@@ -1003,27 +1004,25 @@ static enum version_8192c _rtl92ce_read_chip_version(struct ieee80211_hw *hw)
switch (version) { switch (version) {
case VERSION_B_CHIP_92C: case VERSION_B_CHIP_92C:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "B_CHIP_92C";
"Chip Version ID: VERSION_B_CHIP_92C\n");
break; break;
case VERSION_B_CHIP_88C: case VERSION_B_CHIP_88C:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "B_CHIP_88C";
"Chip Version ID: VERSION_B_CHIP_88C\n");
break; break;
case VERSION_A_CHIP_92C: case VERSION_A_CHIP_92C:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "A_CHIP_92C";
"Chip Version ID: VERSION_A_CHIP_92C\n");
break; break;
case VERSION_A_CHIP_88C: case VERSION_A_CHIP_88C:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "A_CHIP_88C";
"Chip Version ID: VERSION_A_CHIP_88C\n");
break; break;
default: default:
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, versionid = "Unknown. Bug?";
"Chip Version ID: Unknown. Bug?\n");
break; break;
} }
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
"Chip Version ID: %s\n", versionid);
switch (version & 0x3) { switch (version & 0x3) {
case CHIP_88C: case CHIP_88C:
rtlphy->rf_type = RF_1T1R; rtlphy->rf_type = RF_1T1R;
......
...@@ -57,6 +57,7 @@ void rtl92c_read_chip_version(struct ieee80211_hw *hw) ...@@ -57,6 +57,7 @@ void rtl92c_read_chip_version(struct ieee80211_hw *hw)
struct rtl_phy *rtlphy = &(rtlpriv->phy); struct rtl_phy *rtlphy = &(rtlpriv->phy);
struct rtl_hal *rtlhal = rtl_hal(rtlpriv); struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
enum version_8192c chip_version = VERSION_UNKNOWN; enum version_8192c chip_version = VERSION_UNKNOWN;
const char *versionid;
u32 value32; u32 value32;
value32 = rtl_read_dword(rtlpriv, REG_SYS_CFG); value32 = rtl_read_dword(rtlpriv, REG_SYS_CFG);
...@@ -87,62 +88,51 @@ void rtl92c_read_chip_version(struct ieee80211_hw *hw) ...@@ -87,62 +88,51 @@ void rtl92c_read_chip_version(struct ieee80211_hw *hw)
pr_info("Chip version 0x%x\n", chip_version); pr_info("Chip version 0x%x\n", chip_version);
switch (rtlhal->version) { switch (rtlhal->version) {
case VERSION_NORMAL_TSMC_CHIP_92C_1T2R: case VERSION_NORMAL_TSMC_CHIP_92C_1T2R:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "NORMAL_B_CHIP_92C";
"Chip Version ID: VERSION_B_CHIP_92C\n");
break; break;
case VERSION_NORMAL_TSMC_CHIP_92C: case VERSION_NORMAL_TSMC_CHIP_92C:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "NORMAL_TSMC_CHIP_92C";
"Chip Version ID: VERSION_NORMAL_TSMC_CHIP_92C\n");
break; break;
case VERSION_NORMAL_TSMC_CHIP_88C: case VERSION_NORMAL_TSMC_CHIP_88C:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "NORMAL_TSMC_CHIP_88C";
"Chip Version ID: VERSION_NORMAL_TSMC_CHIP_88C\n");
break; break;
case VERSION_NORMAL_UMC_CHIP_92C_1T2R_A_CUT: case VERSION_NORMAL_UMC_CHIP_92C_1T2R_A_CUT:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "NORMAL_UMC_CHIP_i92C_1T2R_A_CUT";
"Chip Version ID: VERSION_NORMAL_UMC_CHIP_i92C_1T2R_A_CUT\n");
break; break;
case VERSION_NORMAL_UMC_CHIP_92C_A_CUT: case VERSION_NORMAL_UMC_CHIP_92C_A_CUT:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "NORMAL_UMC_CHIP_92C_A_CUT";
"Chip Version ID: VERSION_NORMAL_UMC_CHIP_92C_A_CUT\n");
break; break;
case VERSION_NORMAL_UMC_CHIP_88C_A_CUT: case VERSION_NORMAL_UMC_CHIP_88C_A_CUT:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "NORMAL_UMC_CHIP_88C_A_CUT";
"Chip Version ID: VERSION_NORMAL_UMC_CHIP_88C_A_CUT\n");
break; break;
case VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT: case VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "NORMAL_UMC_CHIP_92C_1T2R_B_CUT";
"Chip Version ID: VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT\n");
break; break;
case VERSION_NORMAL_UMC_CHIP_92C_B_CUT: case VERSION_NORMAL_UMC_CHIP_92C_B_CUT:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "NORMAL_UMC_CHIP_92C_B_CUT";
"Chip Version ID: VERSION_NORMAL_UMC_CHIP_92C_B_CUT\n");
break; break;
case VERSION_NORMAL_UMC_CHIP_88C_B_CUT: case VERSION_NORMAL_UMC_CHIP_88C_B_CUT:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "NORMAL_UMC_CHIP_88C_B_CUT";
"Chip Version ID: VERSION_NORMAL_UMC_CHIP_88C_B_CUT\n");
break; break;
case VERSION_NORMA_UMC_CHIP_8723_1T1R_A_CUT: case VERSION_NORMA_UMC_CHIP_8723_1T1R_A_CUT:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "NORMAL_UMC_CHIP_8723_1T1R_A_CUT";
"Chip Version ID: VERSION_NORMA_UMC_CHIP_8723_1T1R_A_CUT\n");
break; break;
case VERSION_NORMA_UMC_CHIP_8723_1T1R_B_CUT: case VERSION_NORMA_UMC_CHIP_8723_1T1R_B_CUT:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "NORMAL_UMC_CHIP_8723_1T1R_B_CUT";
"Chip Version ID: VERSION_NORMA_UMC_CHIP_8723_1T1R_B_CUT\n");
break; break;
case VERSION_TEST_CHIP_92C: case VERSION_TEST_CHIP_92C:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "TEST_CHIP_92C";
"Chip Version ID: VERSION_TEST_CHIP_92C\n");
break; break;
case VERSION_TEST_CHIP_88C: case VERSION_TEST_CHIP_88C:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "TEST_CHIP_88C";
"Chip Version ID: VERSION_TEST_CHIP_88C\n");
break; break;
default: default:
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, versionid = "UNKNOWN";
"Chip Version ID: ???????????????\n");
break; break;
} }
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
"Chip Version ID: %s\n", versionid);
if (IS_92C_SERIAL(rtlhal->version)) if (IS_92C_SERIAL(rtlhal->version))
rtlphy->rf_type = rtlphy->rf_type =
(IS_92C_1T2R(rtlhal->version)) ? RF_1T2R : RF_2T2R; (IS_92C_1T2R(rtlhal->version)) ? RF_1T2R : RF_2T2R;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment