if (fakeEfuseBank == 0)
*Value = fakeEfuseContent[Offset];
else
- *Value = fakeBTEfuseContent[fakeEfuseBank-1][Offset];
+ *Value = fakeBTEfuseContent[fakeEfuseBank - 1][Offset];
return true;
}
if (fakeEfuseBank == 0) {
fakeEfuseContent[Offset] = Value;
} else {
- fakeBTEfuseContent[fakeEfuseBank-1][Offset] = Value;
+ fakeBTEfuseContent[fakeEfuseBank - 1][Offset] = Value;
}
return true;
}
}
/* Write Address */
- rtw_write8(Adapter, EFUSE_CTRL+1, (_offset & 0xff));
- readbyte = rtw_read8(Adapter, EFUSE_CTRL+2);
- rtw_write8(Adapter, EFUSE_CTRL+2, ((_offset >> 8) & 0x03) | (readbyte & 0xfc));
+ rtw_write8(Adapter, EFUSE_CTRL + 1, (_offset & 0xff));
+ readbyte = rtw_read8(Adapter, EFUSE_CTRL + 2);
+ rtw_write8(Adapter, EFUSE_CTRL + 2, ((_offset >> 8) & 0x03) | (readbyte & 0xfc));
/* Write bit 32 0 */
- readbyte = rtw_read8(Adapter, EFUSE_CTRL+3);
- rtw_write8(Adapter, EFUSE_CTRL+3, (readbyte & 0x7f));
+ readbyte = rtw_read8(Adapter, EFUSE_CTRL + 3);
+ rtw_write8(Adapter, EFUSE_CTRL + 3, (readbyte & 0x7f));
/* Check bit 32 read-ready */
retry = 0;
if (Address < contentLen) { /* E-fuse 512Byte */
/* Write E-fuse Register address bit0~7 */
temp = Address & 0xFF;
- rtw_write8(Adapter, EFUSE_CTRL+1, temp);
- Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
+ rtw_write8(Adapter, EFUSE_CTRL + 1, temp);
+ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL + 2);
/* Write E-fuse Register address bit8~9 */
temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
- rtw_write8(Adapter, EFUSE_CTRL+2, temp);
+ rtw_write8(Adapter, EFUSE_CTRL + 2, temp);
/* Write 0x30[31]= 0 */
- Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
+ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL + 3);
temp = Bytetemp & 0x7F;
- rtw_write8(Adapter, EFUSE_CTRL+3, temp);
+ rtw_write8(Adapter, EFUSE_CTRL + 3, temp);
/* Wait Write-ready (0x30[31]= 1) */
- Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
+ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL + 3);
while (!(Bytetemp & 0x80)) {
- Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
+ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL + 3);
k++;
if (k == 1000) {
k = 0;
}
/* -----------------e-fuse reg ctrl --------------------------------- */
/* address */
- rtw_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr & 0xff));
- rtw_write8(pAdapter, EFUSE_CTRL+2, ((u8)((addr>>8) & 0x03)) |
- (rtw_read8(pAdapter, EFUSE_CTRL+2) & 0xFC));
+ rtw_write8(pAdapter, EFUSE_CTRL + 1, (u8)(addr & 0xff));
+ rtw_write8(pAdapter, EFUSE_CTRL + 2, ((u8)((addr >> 8) & 0x03)) |
+ (rtw_read8(pAdapter, EFUSE_CTRL + 2) & 0xFC));
- rtw_write8(pAdapter, EFUSE_CTRL+3, 0x72);/* read cmd */
+ rtw_write8(pAdapter, EFUSE_CTRL + 3, 0x72);/* read cmd */
- while (!(0x80 & rtw_read8(pAdapter, EFUSE_CTRL+3)) && (tmpidx < 100))
+ while (!(0x80 & rtw_read8(pAdapter, EFUSE_CTRL + 3)) && (tmpidx < 100))
tmpidx++;
if (tmpidx < 100) {
*data = rtw_read8(pAdapter, EFUSE_CTRL);
/* -----------------e-fuse reg ctrl --------------------------------- */
/* address */
- rtw_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr&0xff));
- rtw_write8(pAdapter, EFUSE_CTRL+2,
- (rtw_read8(pAdapter, EFUSE_CTRL+2) & 0xFC) |
- (u8)((addr>>8) & 0x03));
+ rtw_write8(pAdapter, EFUSE_CTRL + 1, (u8)(addr & 0xff));
+ rtw_write8(pAdapter, EFUSE_CTRL + 2,
+ (rtw_read8(pAdapter, EFUSE_CTRL + 2) & 0xFC) |
+ (u8)((addr >> 8) & 0x03));
rtw_write8(pAdapter, EFUSE_CTRL, data);/* data */
- rtw_write8(pAdapter, EFUSE_CTRL+3, 0xF2);/* write cmd */
+ rtw_write8(pAdapter, EFUSE_CTRL + 3, 0xF2);/* write cmd */
- while ((0x80 & rtw_read8(pAdapter, EFUSE_CTRL+3)) && (tmpidx < 100))
+ while ((0x80 & rtw_read8(pAdapter, EFUSE_CTRL + 3)) && (tmpidx < 100))
tmpidx++;
if (tmpidx < 100)
*---------------------------------------------------------------------------*/
void efuse_WordEnableDataRead(u8 word_en, u8 *sourdata, u8 *targetdata)
{
- if (!(word_en&BIT(0))) {
+ if (!(word_en & BIT(0))) {
targetdata[0] = sourdata[0];
targetdata[1] = sourdata[1];
}
- if (!(word_en&BIT(1))) {
+ if (!(word_en & BIT(1))) {
targetdata[2] = sourdata[2];
targetdata[3] = sourdata[3];
}
- if (!(word_en&BIT(2))) {
+ if (!(word_en & BIT(2))) {
targetdata[4] = sourdata[4];
targetdata[5] = sourdata[5];
}
- if (!(word_en&BIT(3))) {
+ if (!(word_en & BIT(3))) {
targetdata[6] = sourdata[6];
targetdata[7] = sourdata[7];
}
{
int i = 0;
u16 real_content_len = 0, max_available_size = 0;
- u8 res = _FAIL ;
+ u8 res = _FAIL;
u8 (*rw8)(struct adapter *, u16, u8*);
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_REAL_CONTENT_LEN, (void *)&real_content_len, false);
if (i & 0x1) {
/* odd start */
- if (data[idx] != map[addr+idx]) {
+ if (data[idx] != map[addr + idx]) {
word_en &= ~BIT(i >> 1);
- newdata[i-1] = map[addr+idx-1];
+ newdata[i - 1] = map[addr + idx - 1];
newdata[i] = data[idx];
}
i++;
if (cnts == idx)
break;
if ((cnts - idx) == 1) {
- if (data[idx] != map[addr+idx]) {
+ if (data[idx] != map[addr + idx]) {
word_en &= ~BIT(i >> 1);
newdata[i] = data[idx];
- newdata[i+1] = map[addr+idx+1];
+ newdata[i + 1] = map[addr + idx + 1];
}
idx++;
break;
} else {
- if ((data[idx] != map[addr+idx]) ||
- (data[idx+1] != map[addr+idx+1])) {
+ if ((data[idx] != map[addr + idx]) ||
+ (data[idx + 1] != map[addr + idx + 1])) {
word_en &= ~BIT(i >> 1);
newdata[i] = data[idx];
- newdata[i+1] = data[idx + 1];
+ newdata[i + 1] = data[idx + 1];
}
idx += 2;
}
if (i & 0x1) {
/* odd start */
- if (data[idx] != map[addr+idx]) {
+ if (data[idx] != map[addr + idx]) {
word_en &= ~BIT(i >> 1);
- newdata[i-1] = map[addr+idx-1];
+ newdata[i - 1] = map[addr + idx - 1];
newdata[i] = data[idx];
}
i++;
if (cnts == idx)
break;
if ((cnts - idx) == 1) {
- if (data[idx] != map[addr+idx]) {
+ if (data[idx] != map[addr + idx]) {
word_en &= ~BIT(i >> 1);
newdata[i] = data[idx];
- newdata[i+1] = map[addr+idx+1];
+ newdata[i + 1] = map[addr + idx + 1];
}
idx++;
break;
} else {
- if ((data[idx] != map[addr+idx]) ||
- (data[idx+1] != map[addr+idx+1])) {
+ if ((data[idx] != map[addr + idx]) ||
+ (data[idx + 1] != map[addr + idx + 1])) {
word_en &= ~BIT(i >> 1);
newdata[i] = data[idx];
- newdata[i+1] = data[idx + 1];
+ newdata[i + 1] = data[idx + 1];
}
idx += 2;
}
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
*Value = pEEPROM->efuse_eeprom_data[Offset];
- *Value |= pEEPROM->efuse_eeprom_data[Offset+1]<<8;
+ *Value |= pEEPROM->efuse_eeprom_data[Offset + 1] << 8;
} /* EFUSE_ShadowRead2Byte */
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
*Value = pEEPROM->efuse_eeprom_data[Offset];
- *Value |= pEEPROM->efuse_eeprom_data[Offset+1]<<8;
- *Value |= pEEPROM->efuse_eeprom_data[Offset+2]<<16;
- *Value |= pEEPROM->efuse_eeprom_data[Offset+3]<<24;
+ *Value |= pEEPROM->efuse_eeprom_data[Offset + 1] << 8;
+ *Value |= pEEPROM->efuse_eeprom_data[Offset + 2] << 16;
+ *Value |= pEEPROM->efuse_eeprom_data[Offset + 3] << 24;
} /* efuse_ShadowRead4Byte */