mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-10 15:39:38 +00:00
rtl8188eu: Fix endedness of EEPROM readout for BE machines
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
9f59c77b0f
commit
77e8b5de91
1 changed files with 17 additions and 31 deletions
|
@ -293,7 +293,7 @@ void efuse_read_phymap_from_txpktbuf(
|
||||||
u32 start = 0, passing_time = 0;
|
u32 start = 0, passing_time = 0;
|
||||||
u8 reg_0x143 = 0;
|
u8 reg_0x143 = 0;
|
||||||
u8 reg_0x106 = 0;
|
u8 reg_0x106 = 0;
|
||||||
u32 lo32 = 0, hi32 = 0;
|
__le32 lo32 = 0, hi32 = 0;
|
||||||
u16 len = 0, count = 0;
|
u16 len = 0, count = 0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
u16 limit = *size;
|
u16 limit = *size;
|
||||||
|
@ -329,51 +329,39 @@ void efuse_read_phymap_from_txpktbuf(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
lo32 = rtw_read32(adapter, REG_PKTBUF_DBG_DATA_L);
|
/* data from EEPROM needs to be in LE */
|
||||||
hi32 = rtw_read32(adapter, REG_PKTBUF_DBG_DATA_H);
|
lo32 = cpu_to_le32(rtw_read32(adapter, REG_PKTBUF_DBG_DATA_L));
|
||||||
|
hi32 = cpu_to_le32(rtw_read32(adapter, REG_PKTBUF_DBG_DATA_H));
|
||||||
|
|
||||||
if(i==0)
|
if (i == 0) {
|
||||||
{
|
/* Although lenc is only used in a debug statement,
|
||||||
#if 1 //for debug
|
* do not remove it as the rtw_read16() call consumes
|
||||||
u8 lenc[2];
|
* 2 bytes from the EEPROM source.
|
||||||
u16 lenbak, aaabak;
|
*/
|
||||||
u16 aaa;
|
u16 lenc = rtw_read16(adapter, REG_PKTBUF_DBG_DATA_L);
|
||||||
lenc[0] = rtw_read8(adapter, REG_PKTBUF_DBG_DATA_L);
|
|
||||||
lenc[1] = rtw_read8(adapter, REG_PKTBUF_DBG_DATA_L+1);
|
|
||||||
|
|
||||||
aaabak = le16_to_cpup((u16*)lenc);
|
len = le32_to_cpu(lo32) & 0x0000ffff;
|
||||||
lenbak = le16_to_cpu(*((u16*)lenc));
|
limit = (len - 2 < limit) ? len - 2 : limit;
|
||||||
aaa = le16_to_cpup((u16*)&lo32);
|
|
||||||
#endif
|
|
||||||
len = le16_to_cpu(*((u16*)&lo32));
|
|
||||||
|
|
||||||
limit = (len-2<limit)?len-2:limit;
|
DBG_871X("%s len:%u, lenc:%u\n", __func__, len, lenc);
|
||||||
|
|
||||||
DBG_871X("%s len:%u, lenbak:%u, aaa:%u, aaabak:%u\n", __FUNCTION__, len, lenbak, aaa, aaabak);
|
memcpy(pos, ((u8*)&lo32)+2, (limit>=count+2)?2:limit-count);
|
||||||
|
|
||||||
_rtw_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 {
|
||||||
}
|
memcpy(pos, ((u8*)&lo32), (limit>=count+4)?4:limit-count);
|
||||||
else
|
|
||||||
{
|
|
||||||
_rtw_memcpy(pos, ((u8*)&lo32), (limit>=count+4)?4:limit-count);
|
|
||||||
count+=(limit>=count+4)?4:limit-count;
|
count+=(limit>=count+4)?4:limit-count;
|
||||||
pos=content+count;
|
pos=content+count;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(limit>count && len-2>count) {
|
if(limit>count && len-2>count) {
|
||||||
_rtw_memcpy(pos, (u8*)&hi32, (limit>=count+4)?4:limit-count);
|
memcpy(pos, (u8*)&hi32, (limit>=count+4)?4:limit-count);
|
||||||
count+=(limit>=count+4)?4:limit-count;
|
count+=(limit>=count+4)?4:limit-count;
|
||||||
pos=content+count;
|
pos=content+count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(limit<=count || len-2<=count)
|
if(limit<=count || len-2<=count)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -381,10 +369,8 @@ void efuse_read_phymap_from_txpktbuf(
|
||||||
|
|
||||||
DBG_871X("%s read count:%u\n", __FUNCTION__, count);
|
DBG_871X("%s read count:%u\n", __FUNCTION__, count);
|
||||||
*size = count;
|
*size = count;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static s32 iol_read_efuse(
|
static s32 iol_read_efuse(
|
||||||
struct adapter *padapter,
|
struct adapter *padapter,
|
||||||
u8 txpktbuf_bndy,
|
u8 txpktbuf_bndy,
|
||||||
|
|
Loading…
Reference in a new issue