mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-28 15:13:39 +00:00
rtl8188eu: Clean up the section that reads the EEPROM
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
ed2c3ab733
commit
15519e9bf3
1 changed files with 8 additions and 11 deletions
|
@ -245,29 +245,26 @@ static void efuse_read_phymap_from_txpktbuf(
|
||||||
rtw_usleep_os(100);
|
rtw_usleep_os(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* data from EEPROM needs to be in LE */
|
||||||
lo32 = cpu_to_le32(rtw_read32(adapter, REG_PKTBUF_DBG_DATA_L));
|
lo32 = cpu_to_le32(rtw_read32(adapter, REG_PKTBUF_DBG_DATA_L));
|
||||||
hi32 = cpu_to_le32(rtw_read32(adapter, REG_PKTBUF_DBG_DATA_H));
|
hi32 = cpu_to_le32(rtw_read32(adapter, REG_PKTBUF_DBG_DATA_H));
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
u8 lenc[2];
|
/* Although lenc is only used in a debug statement,
|
||||||
u16 lenbak, aaabak;
|
* do not remove it as the rtw_read16() call consumes
|
||||||
u16 aaa;
|
* 2 bytes from the EEPROM source.
|
||||||
lenc[0] = rtw_read8(adapter, REG_PKTBUF_DBG_DATA_L);
|
*/
|
||||||
lenc[1] = rtw_read8(adapter, REG_PKTBUF_DBG_DATA_L+1);
|
u16 lenc = rtw_read16(adapter, REG_PKTBUF_DBG_DATA_L);
|
||||||
|
|
||||||
aaabak = le16_to_cpup((__le16 *)lenc);
|
len = le32_to_cpu(lo32) & 0x0000ffff;
|
||||||
lenbak = le16_to_cpu(*((__le16 *)lenc));
|
|
||||||
aaa = le16_to_cpup((__le16 *)&lo32);
|
|
||||||
len = le16_to_cpu(*((__le16 *)&lo32));
|
|
||||||
|
|
||||||
limit = (len-2 < limit) ? len-2 : limit;
|
limit = (len-2 < limit) ? len-2 : limit;
|
||||||
|
|
||||||
DBG_88E("%s len:%u, lenbak:%u, aaa:%u, aaabak:%u\n", __func__, len, lenbak, aaa, aaabak);
|
DBG_88E("%s len:%u, lenc:%u\n", __func__, len, lenc);
|
||||||
|
|
||||||
memcpy(pos, ((u8 *)&lo32)+2, (limit >= count+2) ? 2 : limit-count);
|
memcpy(pos, ((u8 *)&lo32)+2, (limit >= count+2) ? 2 : limit-count);
|
||||||
count += (limit >= count+2) ? 2 : limit-count;
|
count += (limit >= count+2) ? 2 : limit-count;
|
||||||
pos = content+count;
|
pos = content+count;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
memcpy(pos, ((u8 *)&lo32), (limit >= count+4) ? 4 : limit-count);
|
memcpy(pos, ((u8 *)&lo32), (limit >= count+4) ? 4 : limit-count);
|
||||||
count += (limit >= count+4) ? 4 : limit-count;
|
count += (limit >= count+4) ? 4 : limit-count;
|
||||||
|
|
Loading…
Reference in a new issue