On 16/01/2024 02:56, Ping-Ke Shih wrote: > > >> -----Original Message----- >> From: Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx> >> Sent: Monday, January 15, 2024 8:51 PM >> To: Ping-Ke Shih <pkshih@xxxxxxxxxxx>; linux-wireless@xxxxxxxxxxxxxxx >> Cc: Larry Finger <Larry.Finger@xxxxxxxxxxxx> >> Subject: Re: [PATCH] wifi: rtlwifi: rtl8192de: Fix byte order of chip version >> >> >> diff --git a/hal/rtl8192d_hal_init.c b/hal/rtl8192d_hal_init.c >> index 156541b..175c856 100644 >> --- a/hal/rtl8192d_hal_init.c >> +++ b/hal/rtl8192d_hal_init.c >> @@ -1565,6 +1565,8 @@ hal_EfuseUpdateNormalChipVersion_92D( >> ReadEFuseByte(Adapter,EEPROME_CHIP_VERSION_L,&CutValue[0], _FALSE); >> >> ChipValue= (CutValue[1]<<8)|CutValue[0]; >> + >> + pr_err("%s: EEPROME_CHIP_VERSION_H: %#x EEPROME_CHIP_VERSION_L: %#x CutValue[1]: %#x CutValue[0]: >> %#x ChipValue: %#x\n", __func__, EEPROME_CHIP_VERSION_H, EEPROME_CHIP_VERSION_L, CutValue[1], CutValue[0], >> ChipValue); >> switch(ChipValue){ >> case 0xAA55: >> //ChipVer |= CHIP_92D_C_CUT; >> >> This is the output: >> >> Jan 15 14:35:21 ideapad2 kernel: hal_EfuseUpdateNormalChipVersion_92D: EEPROME_CHIP_VERSION_H: 0x3fe >> EEPROME_CHIP_VERSION_L: 0x3ff CutValue[1]: 0x33 CutValue[0]: 0xcc ChipValue: 0x33cc > > With the same branch and the same changes you mentioned, output is: > > hal_EfuseUpdateNormalChipVersion_92D: EEPROME_CHIP_VERSION_H: 0x3fe EEPROME_CHIP_VERSION_L: 0x3ff CutValue[1]: 0xcc CutValue[0]: 0x33 ChipValue: 0xcc33 > >> >> Maybe my device really is a different version. > > Not sure what happens. I feel no one can remember the definition of these values. > Maybe, we can just add an new value 0x33CC, and test if it works normal. > > diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c > index 743ac6871bf4..c336d4b362f5 100644 > --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c > +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c > @@ -1684,6 +1684,7 @@ static void _rtl92de_efuse_update_chip_version(struct ieee80211_hw *hw) > rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "D-CUT!!!\n"); > break; > case 0xCC33: > + case 0x33CC: > chipver |= CHIP_92D_E_CUT; > rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "E-CUT!!!\n"); > break; > > How did you find this weird value? Vendor driver doesn't work for you? > It works fine. I just saw the message "Unkown CUT!" and got curious: https://github.com/lwfinger/rtl8192du/issues/92#issuecomment-1155420291 If the addresses in the efuse are correct, then my device doesn't need any patch. Unknown cut is treated the same as D cut, which is treated the same as E cut. > Ping-Ke >