Commit 7ad9bc70 authored by Martin Kaiser's avatar Martin Kaiser Committed by Greg Kroah-Hartman

staging: rtl8188eu: remove efuse type

A number of efuse-related functions have an "efuse type" parameter.
This type is not used and can be removed.
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-5-martin@kaiser.cxSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7c12683c
...@@ -281,7 +281,7 @@ static s32 iol_read_efuse(struct adapter *padapter, u8 txpktbuf_bndy, u16 offset ...@@ -281,7 +281,7 @@ static s32 iol_read_efuse(struct adapter *padapter, u8 txpktbuf_bndy, u16 offset
return status; return status;
} }
void efuse_ReadEFuse(struct adapter *Adapter, u8 efuseType, u16 _offset, u16 _size_byte, u8 *pbuf) void efuse_ReadEFuse(struct adapter *Adapter, u16 _offset, u16 _size_byte, u8 *pbuf)
{ {
if (rtw_iol_applied(Adapter)) { if (rtw_iol_applied(Adapter)) {
rtw_hal_power_on(Adapter); rtw_hal_power_on(Adapter);
...@@ -461,7 +461,7 @@ int Efuse_PgPacketRead(struct adapter *pAdapter, u8 offset, u8 *data) ...@@ -461,7 +461,7 @@ int Efuse_PgPacketRead(struct adapter *pAdapter, u8 offset, u8 *data)
return true; return true;
} }
static bool hal_EfuseFixHeaderProcess(struct adapter *pAdapter, u8 efuseType, struct pgpkt *pFixPkt, u16 *pAddr) static bool hal_EfuseFixHeaderProcess(struct adapter *pAdapter, struct pgpkt *pFixPkt, u16 *pAddr)
{ {
u8 originaldata[8], badworden = 0; u8 originaldata[8], badworden = 0;
u16 efuse_addr = *pAddr; u16 efuse_addr = *pAddr;
...@@ -490,7 +490,7 @@ static bool hal_EfuseFixHeaderProcess(struct adapter *pAdapter, u8 efuseType, st ...@@ -490,7 +490,7 @@ static bool hal_EfuseFixHeaderProcess(struct adapter *pAdapter, u8 efuseType, st
return true; return true;
} }
static bool hal_EfusePgPacketWrite2ByteHeader(struct adapter *pAdapter, u8 efuseType, u16 *pAddr, struct pgpkt *pTargetPkt) static bool hal_EfusePgPacketWrite2ByteHeader(struct adapter *pAdapter, u16 *pAddr, struct pgpkt *pTargetPkt)
{ {
bool ret = false; bool ret = false;
u16 efuse_addr = *pAddr; u16 efuse_addr = *pAddr;
...@@ -541,7 +541,7 @@ static bool hal_EfusePgPacketWrite2ByteHeader(struct adapter *pAdapter, u8 efuse ...@@ -541,7 +541,7 @@ static bool hal_EfusePgPacketWrite2ByteHeader(struct adapter *pAdapter, u8 efuse
fixPkt.offset = ((pg_header_temp & 0xE0) >> 5) | ((tmp_header & 0xF0) >> 1); fixPkt.offset = ((pg_header_temp & 0xE0) >> 5) | ((tmp_header & 0xF0) >> 1);
fixPkt.word_en = tmp_header & 0x0F; fixPkt.word_en = tmp_header & 0x0F;
fixPkt.word_cnts = Efuse_CalculateWordCnts(fixPkt.word_en); fixPkt.word_cnts = Efuse_CalculateWordCnts(fixPkt.word_en);
if (!hal_EfuseFixHeaderProcess(pAdapter, efuseType, &fixPkt, &efuse_addr)) if (!hal_EfuseFixHeaderProcess(pAdapter, &fixPkt, &efuse_addr))
return false; return false;
} else { } else {
ret = true; ret = true;
...@@ -557,7 +557,7 @@ static bool hal_EfusePgPacketWrite2ByteHeader(struct adapter *pAdapter, u8 efuse ...@@ -557,7 +557,7 @@ static bool hal_EfusePgPacketWrite2ByteHeader(struct adapter *pAdapter, u8 efuse
return ret; return ret;
} }
static bool hal_EfusePgPacketWrite1ByteHeader(struct adapter *pAdapter, u8 efuseType, u16 *pAddr, struct pgpkt *pTargetPkt) static bool hal_EfusePgPacketWrite1ByteHeader(struct adapter *pAdapter, u16 *pAddr, struct pgpkt *pTargetPkt)
{ {
bool ret = false; bool ret = false;
u8 pg_header = 0, tmp_header = 0; u8 pg_header = 0, tmp_header = 0;
...@@ -584,7 +584,7 @@ static bool hal_EfusePgPacketWrite1ByteHeader(struct adapter *pAdapter, u8 efuse ...@@ -584,7 +584,7 @@ static bool hal_EfusePgPacketWrite1ByteHeader(struct adapter *pAdapter, u8 efuse
fixPkt.offset = (tmp_header >> 4) & 0x0F; fixPkt.offset = (tmp_header >> 4) & 0x0F;
fixPkt.word_en = tmp_header & 0x0F; fixPkt.word_en = tmp_header & 0x0F;
fixPkt.word_cnts = Efuse_CalculateWordCnts(fixPkt.word_en); fixPkt.word_cnts = Efuse_CalculateWordCnts(fixPkt.word_en);
if (!hal_EfuseFixHeaderProcess(pAdapter, efuseType, &fixPkt, &efuse_addr)) if (!hal_EfuseFixHeaderProcess(pAdapter, &fixPkt, &efuse_addr))
return false; return false;
} }
...@@ -592,7 +592,7 @@ static bool hal_EfusePgPacketWrite1ByteHeader(struct adapter *pAdapter, u8 efuse ...@@ -592,7 +592,7 @@ static bool hal_EfusePgPacketWrite1ByteHeader(struct adapter *pAdapter, u8 efuse
return ret; return ret;
} }
static bool hal_EfusePgPacketWriteData(struct adapter *pAdapter, u8 efuseType, u16 *pAddr, struct pgpkt *pTargetPkt) static bool hal_EfusePgPacketWriteData(struct adapter *pAdapter, u16 *pAddr, struct pgpkt *pTargetPkt)
{ {
u16 efuse_addr = *pAddr; u16 efuse_addr = *pAddr;
u8 badworden; u8 badworden;
...@@ -614,16 +614,15 @@ static bool hal_EfusePgPacketWriteData(struct adapter *pAdapter, u8 efuseType, u ...@@ -614,16 +614,15 @@ static bool hal_EfusePgPacketWriteData(struct adapter *pAdapter, u8 efuseType, u
static bool static bool
hal_EfusePgPacketWriteHeader( hal_EfusePgPacketWriteHeader(
struct adapter *pAdapter, struct adapter *pAdapter,
u8 efuseType,
u16 *pAddr, u16 *pAddr,
struct pgpkt *pTargetPkt) struct pgpkt *pTargetPkt)
{ {
bool ret = false; bool ret = false;
if (pTargetPkt->offset >= EFUSE_MAX_SECTION_BASE) if (pTargetPkt->offset >= EFUSE_MAX_SECTION_BASE)
ret = hal_EfusePgPacketWrite2ByteHeader(pAdapter, efuseType, pAddr, pTargetPkt); ret = hal_EfusePgPacketWrite2ByteHeader(pAdapter, pAddr, pTargetPkt);
else else
ret = hal_EfusePgPacketWrite1ByteHeader(pAdapter, efuseType, pAddr, pTargetPkt); ret = hal_EfusePgPacketWrite1ByteHeader(pAdapter, pAddr, pTargetPkt);
return ret; return ret;
} }
...@@ -667,7 +666,7 @@ static bool hal_EfuseCheckIfDatafollowed(struct adapter *pAdapter, u8 word_cnts, ...@@ -667,7 +666,7 @@ static bool hal_EfuseCheckIfDatafollowed(struct adapter *pAdapter, u8 word_cnts,
return ret; return ret;
} }
static bool hal_EfusePartialWriteCheck(struct adapter *pAdapter, u8 efuseType, u16 *pAddr, struct pgpkt *pTargetPkt) static bool hal_EfusePartialWriteCheck(struct adapter *pAdapter, u16 *pAddr, struct pgpkt *pTargetPkt)
{ {
bool ret = false; bool ret = false;
u8 i, efuse_data = 0, cur_header = 0; u8 i, efuse_data = 0, cur_header = 0;
...@@ -754,20 +753,19 @@ bool Efuse_PgPacketWrite(struct adapter *pAdapter, u8 offset, u8 word_en, u8 *pD ...@@ -754,20 +753,19 @@ bool Efuse_PgPacketWrite(struct adapter *pAdapter, u8 offset, u8 word_en, u8 *pD
{ {
struct pgpkt targetPkt; struct pgpkt targetPkt;
u16 startAddr = 0; u16 startAddr = 0;
u8 efuseType = EFUSE_WIFI;
if (Efuse_GetCurrentSize(pAdapter) >= EFUSE_MAP_LEN_88E) if (Efuse_GetCurrentSize(pAdapter) >= EFUSE_MAP_LEN_88E)
return false; return false;
hal_EfuseConstructPGPkt(offset, word_en, pData, &targetPkt); hal_EfuseConstructPGPkt(offset, word_en, pData, &targetPkt);
if (!hal_EfusePartialWriteCheck(pAdapter, efuseType, &startAddr, &targetPkt)) if (!hal_EfusePartialWriteCheck(pAdapter, &startAddr, &targetPkt))
return false; return false;
if (!hal_EfusePgPacketWriteHeader(pAdapter, efuseType, &startAddr, &targetPkt)) if (!hal_EfusePgPacketWriteHeader(pAdapter, &startAddr, &targetPkt))
return false; return false;
if (!hal_EfusePgPacketWriteData(pAdapter, efuseType, &startAddr, &targetPkt)) if (!hal_EfusePgPacketWriteData(pAdapter, &startAddr, &targetPkt))
return false; return false;
return true; return true;
...@@ -857,22 +855,22 @@ void efuse_WordEnableDataRead(u8 word_en, u8 *sourdata, u8 *targetdata) ...@@ -857,22 +855,22 @@ void efuse_WordEnableDataRead(u8 word_en, u8 *sourdata, u8 *targetdata)
} }
/* Read All Efuse content */ /* Read All Efuse content */
static void Efuse_ReadAllMap(struct adapter *pAdapter, u8 efuseType, u8 *Efuse) static void Efuse_ReadAllMap(struct adapter *pAdapter, u8 *Efuse)
{ {
efuse_power_switch(pAdapter, false, true); efuse_power_switch(pAdapter, false, true);
efuse_ReadEFuse(pAdapter, efuseType, 0, EFUSE_MAP_LEN_88E, Efuse); efuse_ReadEFuse(pAdapter, 0, EFUSE_MAP_LEN_88E, Efuse);
efuse_power_switch(pAdapter, false, false); efuse_power_switch(pAdapter, false, false);
} }
/* Transfer current EFUSE content to shadow init and modify map. */ /* Transfer current EFUSE content to shadow init and modify map. */
void EFUSE_ShadowMapUpdate(struct adapter *pAdapter, u8 efuseType) void EFUSE_ShadowMapUpdate(struct adapter *pAdapter)
{ {
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter); struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
if (pEEPROM->bautoload_fail_flag) if (pEEPROM->bautoload_fail_flag)
memset(pEEPROM->efuse_eeprom_data, 0xFF, EFUSE_MAP_LEN_88E); memset(pEEPROM->efuse_eeprom_data, 0xFF, EFUSE_MAP_LEN_88E);
else else
Efuse_ReadAllMap(pAdapter, efuseType, pEEPROM->efuse_eeprom_data); Efuse_ReadAllMap(pAdapter, pEEPROM->efuse_eeprom_data);
} }
...@@ -235,12 +235,12 @@ void Hal_InitPGData88E(struct adapter *padapter) ...@@ -235,12 +235,12 @@ void Hal_InitPGData88E(struct adapter *padapter)
if (!pEEPROM->bautoload_fail_flag) { /* autoload OK. */ if (!pEEPROM->bautoload_fail_flag) { /* autoload OK. */
if (!is_boot_from_eeprom(padapter)) { if (!is_boot_from_eeprom(padapter)) {
/* Read EFUSE real map to shadow. */ /* Read EFUSE real map to shadow. */
EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI); EFUSE_ShadowMapUpdate(padapter);
} }
} else {/* autoload fail */ } else {/* autoload fail */
/* update to default value 0xFF */ /* update to default value 0xFF */
if (!is_boot_from_eeprom(padapter)) if (!is_boot_from_eeprom(padapter))
EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI); EFUSE_ShadowMapUpdate(padapter);
} }
} }
......
...@@ -23,9 +23,6 @@ ...@@ -23,9 +23,6 @@
#define PGPKT_DATA_SIZE 8 #define PGPKT_DATA_SIZE 8
#define EFUSE_WIFI 0
#define EFUSE_BT 1
/* E-Fuse */ /* E-Fuse */
#define EFUSE_MAP_SIZE 512 #define EFUSE_MAP_SIZE 512
#define EFUSE_MAX_SIZE 256 #define EFUSE_MAX_SIZE 256
...@@ -60,13 +57,12 @@ u8 Efuse_CalculateWordCnts(u8 word_en); ...@@ -60,13 +57,12 @@ u8 Efuse_CalculateWordCnts(u8 word_en);
u8 efuse_OneByteRead(struct adapter *adapter, u16 addr, u8 *data); u8 efuse_OneByteRead(struct adapter *adapter, u16 addr, u8 *data);
u8 efuse_OneByteWrite(struct adapter *adapter, u16 addr, u8 data); u8 efuse_OneByteWrite(struct adapter *adapter, u16 addr, u8 data);
void efuse_ReadEFuse(struct adapter *Adapter, u8 efuseType, u16 _offset, void efuse_ReadEFuse(struct adapter *Adapter, u16 _offset, u16 _size_byte, u8 *pbuf);
u16 _size_byte, u8 *pbuf);
int Efuse_PgPacketRead(struct adapter *adapt, u8 offset, u8 *data); int Efuse_PgPacketRead(struct adapter *adapt, u8 offset, u8 *data);
bool Efuse_PgPacketWrite(struct adapter *adapter, u8 offset, u8 word, u8 *data); bool Efuse_PgPacketWrite(struct adapter *adapter, u8 offset, u8 word, u8 *data);
void efuse_WordEnableDataRead(u8 word_en, u8 *sourdata, u8 *targetdata); void efuse_WordEnableDataRead(u8 word_en, u8 *sourdata, u8 *targetdata);
u8 Efuse_WordEnableDataWrite(struct adapter *adapter, u16 efuse_addr, u8 Efuse_WordEnableDataWrite(struct adapter *adapter, u16 efuse_addr,
u8 word_en, u8 *data); u8 word_en, u8 *data);
void EFUSE_ShadowMapUpdate(struct adapter *adapter, u8 efusetype); void EFUSE_ShadowMapUpdate(struct adapter *adapter);
#endif #endif
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