They are used only in a (disabled) debug print.
In practice, lsusb can be used to read the actual vid and pid.
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(-)
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index ef1ae95d7db0..563b7c0a2c90 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -985,23 +985,15 @@ static void Hal_EfuseParsePIDVID_8188EU(struct adapter *adapt, u8 *hwinfo, bool
struct 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);
}
diff --git a/drivers/staging/r8188eu/include/rtl8188e_hal.h b/drivers/staging/r8188eu/include/rtl8188e_hal.h
index d7db1dfc39d0..84fa65972039 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_hal.h
@@ -175,8 +175,6 @@ struct hal_data_8188e {
u8 BoardType;
/* EEPROM setting. */
- u16 EEPROMVID;
- u16 EEPROMPID;
u16 EEPROMSVID;
u16 EEPROMSDID;
u8 EEPROMCustomerID;
diff --git a/drivers/staging/r8188eu/include/rtl8188e_spec.h b/drivers/staging/r8188eu/include/rtl8188e_spec.h
index 01aeaa4ac605..cfab7ad08947 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_spec.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_spec.h
@@ -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
--
2.20.1
In Hal_InitPGData88E, the same code is run, regardless of
bautoload_fail_flag.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
index 566b49fd7478..019e67a7989f 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
@@ -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
--
2.20.1
For this driver, rf_chip is always RF_6052. Remove the rf_chip component
from struct hal_data_8188e and resulting dead code.
Signed-off-by: Martin Kaiser <[email protected]>
---
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(-)
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
index bb0cda0c16a0..47402851700b 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
@@ -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;
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 1625873aa742..119523d9c38a 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -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;
diff --git a/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h b/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h
index 6f901ce607e8..b1ba7acb454c 100644
--- a/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h
+++ b/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h
@@ -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] */
diff --git a/drivers/staging/r8188eu/include/rtl8188e_hal.h b/drivers/staging/r8188eu/include/rtl8188e_hal.h
index 3593334e24b6..6630cb5c5e55 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_hal.h
@@ -169,7 +169,6 @@ struct hal_data_8188e {
u16 BasicRateSet;
/* rf_ctrl */
- u8 rf_chip;
u8 rf_type;
u8 BoardType;
--
2.20.1
ReadAdapterInfo8188EU calls _ReadAdapterInfo8188EU.
_ReadAdapterInfo8188EU calls _ReadPROMContent.
Each of these functions is small and has only one caller. Move all
their code into ReadAdapterInfo8188EU.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/hal/usb_halinit.c | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 119523d9c38a..004622f7a85f 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -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);
--
2.20.1
There's no need to use the ? operator and to set true and
false explicitly.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/hal/usb_halinit.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 004622f7a85f..2a1620fe0556 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -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"));
--
2.20.1
On Thursday, November 11, 2021 10:26:38 PM CET Martin Kaiser wrote:
> 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
> 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(-)
On Thursday, November 11, 2021 10:26:41 PM CET Martin Kaiser wrote:
> In Hal_InitPGData88E, the same code is run, regardless of
> bautoload_fail_flag.
Same comment I made for patch 1/7.
Greetings,
Fabio
>
> Signed-off-by: Martin Kaiser <[email protected]>
> ---
> drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 14 ++------------
> 1 file changed, 2 insertions(+), 12 deletions(-)
Thus wrote Fabio M. De Francesco ([email protected]):
> On Thursday, November 11, 2021 10:26:38 PM CET Martin Kaiser wrote:
> > 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.
Hi Fabio,
thanks for the reminder. The commit message should indeed make sense
without the title.
> 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