Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8723au: Remove rf type from struct hal_version

This gets rid of yet another duplicated copy of the RF type

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jes Sorensen and committed by
Greg Kroah-Hartman
277c722c f1508fe3

+13 -102
+8 -11
drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c
··· 978 978 is13simular = false; 979 979 980 980 for (i = 0; i < 3; i++) { 981 - if (IS_92C_SERIAL(pHalData->VersionID)) { 982 - _PHY_IQCalibrate(pAdapter, result, i, true); 983 - } else { 984 - /* For 88C 1T1R */ 981 + if (pHalData->rf_type == RF_2T2R) 982 + _PHY_IQCalibrate(pAdapter, result, i, true); 983 + else /* For 88C 1T1R */ 985 984 _PHY_IQCalibrate(pAdapter, result, i, false); 986 - } 987 985 988 986 if (i == 1) { 989 987 is12simular = _PHY_SimularityCompare(pAdapter, result, 0, 1); ··· 1049 1051 if ((RegE94 != 0)/*&&(RegEA4 != 0)*/) 1050 1052 _PHY_PathAFillIQKMatrix(pAdapter, bPathAOK, result, final_candidate, (RegEA4 == 0)); 1051 1053 1052 - if (IS_92C_SERIAL(pHalData->VersionID)) { 1054 + if (pHalData->rf_type == RF_2T2R) { 1053 1055 if ((RegEB4 != 0)/*&&(RegEC4 != 0)*/) 1054 - _PHY_PathBFillIQKMatrix(pAdapter, bPathBOK, result, final_candidate, (RegEC4 == 0)); 1056 + _PHY_PathBFillIQKMatrix(pAdapter, bPathBOK, result, 1057 + final_candidate, (RegEC4 == 0)); 1055 1058 } 1056 1059 1057 1060 _PHY_SaveADDARegisters(pAdapter, IQK_BB_REG_92C, pdmpriv->IQK_BB_backup_recover, 9); ··· 1071 1072 if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) 1072 1073 return; 1073 1074 1074 - if (IS_92C_SERIAL(pHalData->VersionID)) { 1075 + if (pHalData->rf_type == RF_2T2R) 1075 1076 _PHY_LCCalibrate(pAdapter, true); 1076 - } else { 1077 - /* For 88C 1T1R */ 1077 + else /* For 88C 1T1R */ 1078 1078 _PHY_LCCalibrate(pAdapter, false); 1079 - } 1080 1079 } 1081 1080 1082 1081 void
-40
drivers/staging/rtl8723au/hal/hal_com.c
··· 22 22 23 23 #define _HAL_INIT_C_ 24 24 25 - void dump_chip_info23a(struct hal_version ChipVersion) 26 - { 27 - int cnt = 0; 28 - u8 buf[128]; 29 - 30 - cnt += sprintf((buf + cnt), "Chip Version Info: CHIP_8723A_"); 31 - 32 - cnt += sprintf((buf + cnt), "%s_", IS_NORMAL_CHIP(ChipVersion) ? 33 - "Normal_Chip" : "Test_Chip"); 34 - cnt += sprintf((buf + cnt), "%s_", 35 - IS_CHIP_VENDOR_TSMC(ChipVersion) ? "TSMC" : "UMC"); 36 - if (IS_A_CUT(ChipVersion)) 37 - cnt += sprintf((buf + cnt), "A_CUT_"); 38 - else if (IS_B_CUT(ChipVersion)) 39 - cnt += sprintf((buf + cnt), "B_CUT_"); 40 - else if (IS_C_CUT(ChipVersion)) 41 - cnt += sprintf((buf + cnt), "C_CUT_"); 42 - else if (IS_D_CUT(ChipVersion)) 43 - cnt += sprintf((buf + cnt), "D_CUT_"); 44 - else if (IS_E_CUT(ChipVersion)) 45 - cnt += sprintf((buf + cnt), "E_CUT_"); 46 - else 47 - cnt += sprintf((buf + cnt), "UNKNOWN_CUT(%d)_", 48 - ChipVersion.CUTVersion); 49 - 50 - if (IS_1T1R(ChipVersion)) 51 - cnt += sprintf((buf + cnt), "1T1R_"); 52 - else if (IS_1T2R(ChipVersion)) 53 - cnt += sprintf((buf + cnt), "1T2R_"); 54 - else if (IS_2T2R(ChipVersion)) 55 - cnt += sprintf((buf + cnt), "2T2R_"); 56 - else 57 - cnt += sprintf((buf + cnt), "UNKNOWN_RFTYPE(%d)_", 58 - ChipVersion.RFType); 59 - 60 - cnt += sprintf((buf + cnt), "RomVer(%d)\n", ChipVersion.ROMVer); 61 - 62 - DBG_8723A("%s", buf); 63 - } 64 - 65 25 #define EEPROM_CHANNEL_PLAN_BY_HW_MASK 0x80 66 26 67 27 /* return the final channel plan decision */
+1 -3
drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
··· 169 169 prevent conficting setting in Fw power */ 170 170 /* saving sequence. 2010.06.07. Added by tynli. 171 171 Suggested by SD3 yschang. */ 172 - if ((Mode != PS_MODE_ACTIVE) && 173 - (!IS_92C_SERIAL(pHalData->VersionID))) { 172 + if (Mode != PS_MODE_ACTIVE && pHalData->rf_type != RF_2T2R) 174 173 ODM_RF_Saving23a(&pHalData->odmpriv, true); 175 - } 176 174 177 175 H2CSetPwrMode.Mode = Mode; 178 176 H2CSetPwrMode.SmartPS = pwrpriv->smart_ps;
+1 -9
drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
··· 744 744 value32 = rtl8723au_read32(padapter, REG_SYS_CFG); 745 745 ChipVersion.ICType = CHIP_8723A; 746 746 ChipVersion.ChipType = ((value32 & RTL_ID) ? TEST_CHIP : NORMAL_CHIP); 747 - ChipVersion.RFType = RF_TYPE_1T1R; 747 + pHalData->rf_type = RF_1T1R; 748 748 ChipVersion.VendorType = 749 749 ((value32 & VENDOR_ID) ? CHIP_VENDOR_UMC : CHIP_VENDOR_TSMC); 750 750 ChipVersion.CUTVersion = (value32 & CHIP_VER_RTL_MASK) >> CHIP_VER_RTL_SHIFT; /* IC version (CUT) */ ··· 768 768 pHalData->PolarityCtl = 769 769 ((value32 & WL_HWPDN_SL) ? RT_POLARITY_HIGH_ACT : 770 770 RT_POLARITY_LOW_ACT); 771 - dump_chip_info23a(ChipVersion); 772 771 pHalData->VersionID = ChipVersion; 773 - 774 - if (IS_1T2R(ChipVersion)) 775 - pHalData->rf_type = RF_1T2R; 776 - else if (IS_2T2R(ChipVersion)) 777 - pHalData->rf_type = RF_2T2R; 778 - else 779 - pHalData->rf_type = RF_1T1R; 780 772 781 773 MSG_8723A("RF_Type is %x!!\n", pHalData->rf_type); 782 774 }
+2 -2
drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c
··· 419 419 int PHY_MACConfig8723A(struct rtw_adapter *Adapter) 420 420 { 421 421 struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter); 422 - bool is92C = IS_92C_SERIAL(pHalData->VersionID); 423 422 424 423 /* */ 425 424 /* Config MAC */ ··· 428 429 /* 2010.07.13 AMPDU aggregation number 9 */ 429 430 /* rtw_write16(Adapter, REG_MAX_AGGR_NUM, MAX_AGGR_NUM); */ 430 431 rtl8723au_write8(Adapter, REG_MAX_AGGR_NUM, 0x0A); 431 - if (is92C && (BOARD_USB_DONGLE == pHalData->BoardType)) 432 + if (pHalData->rf_type == RF_2T2R && 433 + BOARD_USB_DONGLE == pHalData->BoardType) 432 434 rtl8723au_write8(Adapter, 0x40, 0x04); 433 435 434 436 return _SUCCESS;
+1 -14
drivers/staging/rtl8723au/hal/usb_halinit.c
··· 447 447 static void _InitRFType(struct rtw_adapter *Adapter) 448 448 { 449 449 struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter); 450 - bool is92CU = IS_92C_SERIAL(pHalData->VersionID); 451 450 452 451 pHalData->rf_chip = RF_6052; 453 - 454 - if (!is92CU) { 455 - pHalData->rf_type = RF_1T1R; 456 - DBG_8723A("Set RF Chip ID to RF_6052 and RF type to 1T1R.\n"); 457 - return; 458 - } 459 - 460 - /* TODO: Consider that EEPROM set 92CU to 1T1R later. */ 461 - /* Force to overwrite setting according to chip version. Ignore 462 - EEPROM setting. */ 463 - /* pHalData->RF_Type = is92CU ? RF_2T2R : RF_1T1R; */ 464 - MSG_8723A("Set RF Chip ID to RF_6052 and RF type to %d.\n", 465 - pHalData->rf_type); 452 + pHalData->rf_type = RF_1T1R; 466 453 } 467 454 468 455 /* Set CCK and OFDM Block "ON" */
-22
drivers/staging/rtl8723au/include/HalVerDef.h
··· 51 51 CHIP_VENDOR_UMC = 1, 52 52 }; 53 53 54 - enum hal_rf_type { 55 - RF_TYPE_1T1R = 0, 56 - RF_TYPE_1T2R = 1, 57 - RF_TYPE_2T2R = 2, 58 - RF_TYPE_2T3R = 3, 59 - RF_TYPE_2T4R = 4, 60 - RF_TYPE_3T3R = 5, 61 - RF_TYPE_3T4R = 6, 62 - RF_TYPE_4T4R = 7, 63 - }; 64 - 65 54 struct hal_version { 66 55 enum hal_ic_type ICType; 67 56 enum hal_chip_type ChipType; 68 57 enum hal_cut_version CUTVersion; 69 58 enum hal_vendor VendorType; 70 - enum hal_rf_type RFType; 71 59 u8 ROMVer; 72 60 }; 73 61 74 62 /* Get element */ 75 63 #define GET_CVID_IC_TYPE(version) ((version).ICType) 76 64 #define GET_CVID_CHIP_TYPE(version) ((version).ChipType) 77 - #define GET_CVID_RF_TYPE(version) ((version).RFType) 78 65 #define GET_CVID_MANUFACTUER(version) ((version).VendorType) 79 66 #define GET_CVID_CUT_VERSION(version) ((version).CUTVersion) 80 67 #define GET_CVID_ROM_VERSION(version) (((version).ROMVer) & ROM_VERSION_MASK) ··· 95 108 #define IS_CHIP_VENDOR_UMC(version) \ 96 109 ((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_UMC) ? true : false) 97 110 98 - #define IS_1T1R(version) \ 99 - ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T1R) ? true : false) 100 - #define IS_1T2R(version) \ 101 - ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T2R) ? true : false) 102 - #define IS_2T2R(version) \ 103 - ((GET_CVID_RF_TYPE(version) == RF_TYPE_2T2R) ? true : false) 104 - 105 111 /* Chip version Macro. -- */ 106 112 107 - #define IS_92C_SERIAL(version) \ 108 - ((IS_81XXC(version) && IS_2T2R(version)) ? true : false) 109 113 #define IS_81xxC_VENDOR_UMC_A_CUT(version) \ 110 114 (IS_81XXC(version)?(IS_CHIP_VENDOR_UMC(version) ? \ 111 115 (IS_A_CUT(version) ? true : false) : false) : false)
-1
drivers/staging/rtl8723au/include/hal_com.h
··· 116 116 #define REG_NOA_DESC_COUNT 0x05EC 117 117 118 118 #include "HalVerDef.h" 119 - void dump_chip_info23a(struct hal_version ChipVersion); 120 119 121 120 122 121 u8 /* return the final channel plan decision */