staging: r8188eu: remove haldata's EEPROMVID / PID
PATCH 1/7 staging: r8188eu: remove haldata's EEPROMVID / PID
They are used only in a (disabled) debug print.
In practice, lsusb can be used to read the actual vid and pid.
--- drivers/staging/r8188eu/hal/usb_halinit.c | 8 -------- drivers/staging/r8188eu/include/rtl8188e_hal.h | 2 -- drivers/staging/r8188eu/include/rtl8188e_spec.h | 2 -- 3 files changed, 12 deletions(-)
drivers/staging/r8188eu/hal/usb_halinit.c +0 -8
@@ -985,23 +985,15 @@ static void Hal_EfuseParsePIDVID_8188EU(struct adapter *adapt, u8 *hwinfo, boolstruct hal_data_8188e *haldata =GET_HAL_DATA (adapt);if (!AutoLoadFail) { -/* VID, PID */ - haldata->EEPROMVID =EF2BYTE (*(__le16 *)&hwinfo[EEPROM_VID_88EU ]); - haldata->EEPROMPID =EF2BYTE (*(__le16 *)&hwinfo[EEPROM_PID_88EU ]); -/* Customer ID, 0x00 and 0xff are reserved for Realtek. */ haldata->EEPROMCustomerID = *(u8 *)&hwinfo[EEPROM_CUSTOMERID_88E ]; haldata->EEPROMSubCustomerID = EEPROM_Default_SubCustomerID; }else { - haldata->EEPROMVID = EEPROM_Default_VID; - haldata->EEPROMPID = EEPROM_Default_PID; -/* Customer ID, 0x00 and 0xff are reserved for Realtek. */ haldata->EEPROMCustomerID = EEPROM_Default_CustomerID; haldata->EEPROMSubCustomerID = EEPROM_Default_SubCustomerID; } -DBG_88E ("VID = 0x%04X, PID = 0x%04X\n" , haldata->EEPROMVID, haldata->EEPROMPID);DBG_88E ("Customer ID: 0x%02X, SubCustomer ID: 0x%02X\n" , haldata->EEPROMCustomerID, haldata->EEPROMSubCustomerID); }
drivers/staging/r8188eu/include/rtl8188e_hal.h +0 -2
@@ -175,8 +175,6 @@ struct hal_data_8188e {u8 BoardType;/* EEPROM setting. */ -u16 EEPROMVID ; -u16 EEPROMPID ;u16 EEPROMSVID ;u16 EEPROMSDID ;u8 EEPROMCustomerID;
drivers/staging/r8188eu/include/rtl8188e_spec.h +0 -2
@@ -1345,8 +1345,6 @@ Current IOREG MAP#define EEPROM_DEFAULT_BT_OPTION 0x10/* For debug */ -#define EEPROM_Default_PID 0x1234 -#define EEPROM_Default_VID 0x5678#define EEPROM_Default_CustomerID 0xAB#define EEPROM_Default_CustomerID_8188E 0x00#define EEPROM_Default_SubCustomerID 0xCD
Signature · 1 line
2.20.1
PATCH 2/7 staging: r8188eu: remove haldata's EEPROMCustomerID
It is used only in a (disabled) debug print.
--- drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 7 +------ drivers/staging/r8188eu/hal/usb_halinit.c | 4 +--- drivers/staging/r8188eu/include/rtl8188e_hal.h | 1 - drivers/staging/r8188eu/include/rtl8188e_spec.h | 2 -- 4 files changed, 2 insertions(+), 12 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +1 -6
@@ -1588,13 +1588,8 @@ void Hal_EfuseParseCustomerID88E(struct adapter *padapter, u8 *hwinfo, bool Auto {struct hal_data_8188e *pHalData =GET_HAL_DATA (padapter); -if (!AutoLoadFail) { - pHalData->EEPROMCustomerID = hwinfo[EEPROM_CUSTOMERID_88E ]; - }else { - pHalData->EEPROMCustomerID =0 ; +if (AutoLoadFail) pHalData->EEPROMSubCustomerID =0 ; - } -DBG_88E ("EEPROM Customer ID: 0x%2x\n" , pHalData->EEPROMCustomerID); }void Hal_ReadAntennaDiversity88E (struct adapter *pAdapter,u8 *PROMContent,bool AutoLoadFail)
drivers/staging/r8188eu/hal/usb_halinit.c +1 -3
@@ -986,15 +986,13 @@ static void Hal_EfuseParsePIDVID_8188EU(struct adapter *adapt, u8 *hwinfo, boolif (!AutoLoadFail) {/* Customer ID, 0x00 and 0xff are reserved for Realtek. */ - haldata->EEPROMCustomerID = *(u8 *)&hwinfo[EEPROM_CUSTOMERID_88E ]; haldata->EEPROMSubCustomerID = EEPROM_Default_SubCustomerID; }else {/* Customer ID, 0x00 and 0xff are reserved for Realtek. */ - haldata->EEPROMCustomerID = EEPROM_Default_CustomerID; haldata->EEPROMSubCustomerID = EEPROM_Default_SubCustomerID; } -DBG_88E ("Customer ID: 0x%02X, SubCustomer ID: 0x%02X\n" , haldata->EEPROMCustomerID, haldata->EEPROMSubCustomerID); +DBG_88E ("SubCustomer ID: 0x%02X\n" , haldata->EEPROMSubCustomerID); }static void Hal_EfuseParseMACAddr_8188EU (struct adapter *adapt,u8 *hwinfo,bool AutoLoadFail)
drivers/staging/r8188eu/include/rtl8188e_hal.h +0 -1
@@ -177,7 +177,6 @@ struct hal_data_8188e {/* EEPROM setting. */ u16 EEPROMSVID ;u16 EEPROMSDID ; -u8 EEPROMCustomerID;u8 EEPROMSubCustomerID;u8 EEPROMVersion;u8 EEPROMRegulatory;
drivers/staging/r8188eu/include/rtl8188e_spec.h +0 -2
@@ -1345,8 +1345,6 @@ Current IOREG MAP#define EEPROM_DEFAULT_BT_OPTION 0x10/* For debug */ -#define EEPROM_Default_CustomerID 0xAB -#define EEPROM_Default_CustomerID_8188E 0x00#define EEPROM_Default_SubCustomerID 0xCD#define EEPROM_Default_Version 0
Signature · 1 line
2.20.1
PATCH 3/7 staging: r8188eu: remove haldata's EEPROMSubCustomerID
In reply to Martin KaiserIt is used only in a (disabled) debug print.
We can now remove two functions that parsed eeprom info and populated haldata components.
--- drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 8 -------- drivers/staging/r8188eu/hal/usb_halinit.c | 17 ----------------- drivers/staging/r8188eu/include/rtl8188e_hal.h | 3 --- drivers/staging/r8188eu/include/rtl8188e_spec.h | 1 - 4 files changed, 29 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +0 -8
@@ -1584,14 +1584,6 @@ void rtl8188e_EfuseParseChnlPlan(struct adapter *padapter, u8 *hwinfo, bool AutoDBG_88E ("mlmepriv.ChannelPlan = 0x%02x\n" , padapter->mlmepriv.ChannelPlan); } -void Hal_EfuseParseCustomerID88E (struct adapter *padapter,u8 *hwinfo,bool AutoLoadFail) -{ -struct hal_data_8188e *pHalData =GET_HAL_DATA (padapter); - -if (AutoLoadFail) - pHalData->EEPROMSubCustomerID =0 ; -} -void Hal_ReadAntennaDiversity88E (struct adapter *pAdapter,u8 *PROMContent,bool AutoLoadFail) {struct hal_data_8188e *pHalData =GET_HAL_DATA (pAdapter);
drivers/staging/r8188eu/hal/usb_halinit.c +0 -17
@@ -980,21 +980,6 @@ static void _ReadLEDSetting(struct adapter *Adapter, u8 *PROMContent, bool Autol haldata->bLedOpenDrain = true;/* Support Open-drain arrangement for controlling the LED. */ } -static void Hal_EfuseParsePIDVID_8188EU (struct adapter *adapt,u8 *hwinfo,bool AutoLoadFail) -{ -struct hal_data_8188e *haldata =GET_HAL_DATA (adapt); - -if (!AutoLoadFail) { -/* Customer ID, 0x00 and 0xff are reserved for Realtek. */ - haldata->EEPROMSubCustomerID = EEPROM_Default_SubCustomerID; - }else { -/* Customer ID, 0x00 and 0xff are reserved for Realtek. */ - haldata->EEPROMSubCustomerID = EEPROM_Default_SubCustomerID; - } - -DBG_88E ("SubCustomer ID: 0x%02X\n" , haldata->EEPROMSubCustomerID); -} -static void Hal_EfuseParseMACAddr_8188EU (struct adapter *adapt,u8 *hwinfo,bool AutoLoadFail) {u16 i;
@@ -1019,7 +1004,6 @@ readAdapterInfo_8188EU(/* parse the eeprom/efuse content */ Hal_EfuseParseIDCode88E (adapt, eeprom->efuse_eeprom_data); -Hal_EfuseParsePIDVID_8188EU (adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);Hal_EfuseParseMACAddr_8188EU (adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);Hal_ReadPowerSavingMode88E (adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
@@ -1027,7 +1011,6 @@ readAdapterInfo_8188EU(Hal_EfuseParseEEPROMVer88E (adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);rtl8188e_EfuseParseChnlPlan (adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);Hal_EfuseParseXtal_8188E (adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag); -Hal_EfuseParseCustomerID88E (adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);Hal_ReadAntennaDiversity88E (adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);Hal_EfuseParseBoardType88E (adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);Hal_ReadThermalMeter_88E (adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
drivers/staging/r8188eu/include/rtl8188e_hal.h +0 -3
@@ -177,7 +177,6 @@ struct hal_data_8188e {/* EEPROM setting. */ u16 EEPROMSVID ;u16 EEPROMSDID ; -u8 EEPROMSubCustomerID;u8 EEPROMVersion;u8 EEPROMRegulatory;
@@ -327,8 +326,6 @@ void Hal_EfuseParseEEPROMVer88E(struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail);void rtl8188e_EfuseParseChnlPlan (struct adapter *padapter,u8 *hwinfo,bool AutoLoadFail); -void Hal_EfuseParseCustomerID88E (struct adapter *padapter,u8 *hwinfo, -bool AutoLoadFail);void Hal_ReadAntennaDiversity88E (struct adapter *pAdapter,u8 *PROMContent,bool AutoLoadFail); void Hal_ReadThermalMeter_88E(struct adapter * dapter, u8 *PROMContent,
drivers/staging/r8188eu/include/rtl8188e_spec.h +0 -1
@@ -1345,7 +1345,6 @@ Current IOREG MAP#define EEPROM_DEFAULT_BT_OPTION 0x10/* For debug */ -#define EEPROM_Default_SubCustomerID 0xCD#define EEPROM_Default_Version 0#define EEPROM_CHANNEL_PLAN_FCC 0x0
Signature · 1 line
2.20.1
PATCH 4/7 staging: r8188eu: remove autoload check
In reply to Martin KaiserIn Hal_InitPGData88E, the same code is run, regardless of bautoload_fail_flag.
--- drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +2 -12
@@ -1312,18 +1312,8 @@ s32 InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy)void Hal_InitPGData88E (struct adapter *padapter) { -struct eeprom_priv *pEEPROM = &padapter->eeprompriv; - -if (!pEEPROM->bautoload_fail_flag) {/* autoload OK. */ -if (!is_boot_from_eeprom (padapter)) { -/* Read EFUSE real map to shadow. */ -EFUSE_ShadowMapUpdate (padapter,EFUSE_WIFI , false); - } - }else {/* autoload fail */ -/* update to default value 0xFF */ -if (!is_boot_from_eeprom (padapter)) -EFUSE_ShadowMapUpdate (padapter,EFUSE_WIFI , false); - } +if (!is_boot_from_eeprom (padapter)) +EFUSE_ShadowMapUpdate (padapter,EFUSE_WIFI , false); }void
Signature · 1 line
2.20.1
Re: [PATCH 4/7] staging: r8188eu: remove autoload check
Quoted 2 lines · CET Martin Kaiser
In
Hal_InitPGData88E, the same code is run, regardless ofbautoload_fail_flag.
Same comment I made for patch 1/7.
Greetings,
Fabio
Quoted 5 lines
Signed-off-by Martin Kaiser <[email protected]>--- drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
PATCH 5/7 staging: r8188eu: rf_chip is constant
In reply to Martin KaiserFor this driver, rf_chip is always RF_6052. Remove the rf_chip component from struct hal_data_8188e and resulting dead code.
--- drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 26 +------------------ drivers/staging/r8188eu/hal/usb_halinit.c | 8 ------ .../staging/r8188eu/include/Hal8188EPhyCfg.h | 10 ------- .../staging/r8188eu/include/rtl8188e_hal.h | 1 - 4 files changed, 1 insertion(+), 44 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c +1 -25
@@ -756,13 +756,6 @@ _PHY_SetBWMode92C(u8 regBwOpMode;u8 regRRSR_RSC; -if (pHalData->rf_chip ==RF_PSEUDO_11N ) -return ; - -/* There is no 40MHz mode in RF_8225. */ -if (pHalData->rf_chip ==RF_8225 ) -return ; -if (Adapter->bDriverStopped)return ;
@@ -814,21 +807,7 @@ _PHY_SetBWMode92C( }/* Skip over setting of J-mode in BB register here. Default value is "None J mode". Emily 20070315 */ -/* 3<3>Set RF related register */ -switch (pHalData->rf_chip) { -case RF_8225 : -break ; -case RF_8256 : -/* Please implement this function in Hal8190PciPhy8256.c */ -break ; -case RF_PSEUDO_11N : -break ; -case RF_6052 : -rtl8188e_PHY_RF6052SetBandwidth (Adapter, pHalData->CurrentChannelBW); -break ; -default : -break ; - } +rtl8188e_PHY_RF6052SetBandwidth (Adapter, pHalData->CurrentChannelBW); }/*-----------------------------------------------------------------------------
@@ -885,9 +864,6 @@ void PHY_SwChnl8188E(struct adapter *Adapter, u8 channel)/* Call after initialization */ struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); -if (pHalData->rf_chip ==RF_PSEUDO_11N ) -return ;/* return immediately if it is peudo-phy */ -if (channel ==0 ) channel =1 ;
drivers/staging/r8188eu/hal/usb_halinit.c +0 -8
@@ -1037,16 +1037,8 @@ static void _ReadPROMContent(readAdapterInfo_8188EU (Adapter); } -static void _ReadRFType (struct adapter *Adapter) -{ -struct hal_data_8188e *haldata =GET_HAL_DATA (Adapter); - - haldata->rf_chip =RF_6052 ; -} -static int _ReadAdapterInfo8188EU (struct adapter *Adapter) { -_ReadRFType (Adapter);/* rf_chip -> _InitRFType() */ _ReadPROMContent (Adapter);return _SUCCESS;
drivers/staging/r8188eu/include/Hal8188EPhyCfg.h +0 -10
@@ -48,16 +48,6 @@ enum rf_radio_path {* total three groups */ #define CHANNEL_GROUP_MAX_88E 6 -/* BB/RF related */ -enum RF_TYPE_8190P { -RF_TYPE_MIN ,/* 0 */ -RF_8225 =1 ,/* 1 11b/g RF for verification only */ -RF_8256 =2 ,/* 2 11b/g/n */ -RF_6052 =4 ,/* 4 11b/g/n RF */ -/* TODO: We should remove this psudo PHY RF after we get new RF. */ -RF_PSEUDO_11N =5 ,/* 5, It is a temporality RF. */ -}; -struct bb_reg_def {u32 rfintfs;/* set software control: */ /* 0x870~0x877[8 bytes] */
drivers/staging/r8188eu/include/rtl8188e_hal.h +0 -1
@@ -169,7 +169,6 @@ struct hal_data_8188e {u16 BasicRateSet;/* rf_ctrl */ -u8 rf_chip;u8 rf_type;u8 BoardType;
Signature · 1 line
2.20.1
PATCH 6/7 staging: r8188eu: merge three small functions
In reply to Martin KaiserReadAdapterInfo8188EU calls _ReadAdapterInfo8188EU. _ReadAdapterInfo8188EU calls _ReadPROMContent.
Each of these functions is small and has only one caller. Move all their code into ReadAdapterInfo8188EU.
--- drivers/staging/r8188eu/hal/usb_halinit.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-)
drivers/staging/r8188eu/hal/usb_halinit.c +4 -18
@@ -1018,13 +1018,14 @@ readAdapterInfo_8188EU(_ReadLEDSetting (adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag); } -static void _ReadPROMContent ( -struct adapter *Adapter - ) +void ReadAdapterInfo8188EU (struct adapter *Adapter) {struct eeprom_priv *eeprom = &Adapter->eeprompriv;u8 eeValue; +/* Read EEPROM size before call any EEPROM function */ + Adapter->EepromAddressSize =GetEEPROMSize8188E (Adapter); +/* check system boot selection */ eeValue =rtw_read8 (Adapter,REG_9346CR ); eeprom->EepromOrEfuse = (eeValue &BOOT_FROM_EEPROM ) ? true : false;
@@ -1037,21 +1038,6 @@ static void _ReadPROMContent(readAdapterInfo_8188EU (Adapter); } -static int _ReadAdapterInfo8188EU (struct adapter *Adapter) -{ -_ReadPROMContent (Adapter); - -return _SUCCESS; -} - -void ReadAdapterInfo8188EU (struct adapter *Adapter) -{ -/* Read EEPROM size before call any EEPROM function */ - Adapter->EepromAddressSize =GetEEPROMSize8188E (Adapter); - -_ReadAdapterInfo8188EU (Adapter); -} -static void ResumeTxBeacon (struct adapter *adapt) {struct hal_data_8188e *haldata =GET_HAL_DATA (adapt);
Signature · 1 line
2.20.1
PATCH 7/7 staging: r8188eu: simplify two boolean assignments
In reply to Martin KaiserThere's no need to use the ? operator and to set true and false explicitly.
--- drivers/staging/r8188eu/hal/usb_halinit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/hal/usb_halinit.c +2 -2
@@ -1028,8 +1028,8 @@ void ReadAdapterInfo8188EU(struct adapter *Adapter)/* check system boot selection */ eeValue =rtw_read8 (Adapter,REG_9346CR ); - eeprom->EepromOrEfuse = (eeValue &BOOT_FROM_EEPROM ) ? true : false; - eeprom->bautoload_fail_flag = (eeValue &EEPROM_EN ) ? false : true; + eeprom->EepromOrEfuse = (eeValue &BOOT_FROM_EEPROM ); + eeprom->bautoload_fail_flag = !(eeValue &EEPROM_EN );DBG_88E ("Boot from %s, Autoload %s !\n" , (eeprom->EepromOrEfuse ?"EEPROM" :"EFUSE" ), (eeprom->bautoload_fail_flag ?"Fail" :"OK" ));
Signature · 1 line
2.20.1
Quoted 3 lines · CET Martin Kaiser
They are used only in a (disabled) debug print.
In practice, lsusb can be used to read the actual vid and pid.
Hi Martin,
You seem to have overlooked the usual rules for writing conformant commit messages :)
Please say "what" you did along with "why" you made the changes.
Here, and in two or three other patches of your series, you forgot to describe "what" you did. You actually wrote it in the "Subject" lines but, as you know for sure, commit messages must be self-contained entities.
Also, it would be nice to have a cover letter and have all seven patches in one thread in response to the above, even if it (AFAIK) is not strictly required.
Anyway, many thanks for your work.
Regards,
Fabio
Quoted 6 lines
Signed-off-by Martin Kaiser <[email protected]>--- drivers/staging/r8188eu/hal/usb_halinit.c | 8 -------- drivers/staging/r8188eu/include/rtl8188e_hal.h | 2 -- drivers/staging/r8188eu/include/rtl8188e_spec.h | 2 -- 3 files changed, 12 deletions(-)
Thus wrote Fabio M. De Francesco ([email protected]):
Quoted 8 lines · CET Martin Kaiser
Quoted 4 lines
They are used only in a (disabled) debug print.
In practice, lsusb can be used to read the actual vid and pid.
Hi Martin,
Quoted 8 lines
You seem to have overlooked the usual rules for writing conformant commit messages :)
Please say "what" you did along with "why" you made the changes.
Here, and in two or three other patches of your series, you forgot to describe "what" you did. You actually wrote it in the "Subject" lines but, as you know for sure, commit messages must be self-contained entities.
Hi Fabio,
thanks for the reminder. The commit message should indeed make sense without the title.
Quoted 3 lines
Also, it would be nice to have a cover letter and have all seven patches in one thread in response to the above, even if it (AFAIK) is not strictly required.
There wasn't a common topic in this series so I decided to add no cover letter.
Best regards,
Martin