提交 0aeb623d 编写于 作者: A Ali Bahar 提交者: Greg Kroah-Hartman

staging: r8712u: Merging Realtek's latest (v2.6.6). Rework efuse data handling.

Rework efuse data handling.
Signed-off-by: NAli Bahar <ali@internetDog.org>
Signed-off-by: NLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 07a6b037
......@@ -307,34 +307,39 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
continue;
}
for (i = 0; i < PGPKG_MAX_WORDS; i++) {
if (BIT(i) & word_en)
continue;
if (!(BIT(i) & pkt.word_en)) {
if (efuse_one_byte_read(padapter, addr,
if (BIT(i) & word_en) {
if (BIT(i) & pkt.word_en) {
if (efuse_one_byte_read(
padapter, addr,
&value) == true)
pkt.data[i*2] = value;
else
return false;
if (efuse_one_byte_read(padapter, addr + 1,
if (efuse_one_byte_read(
padapter,
addr + 1,
&value) == true)
pkt.data[i*2 + 1] = value;
pkt.data[i*2 + 1] =
value;
else
return false;
}
addr += 2;
}
}
}
if (addr != header_addr)
return false;
addr++;
/* fill original data */
for (i = 0; i < PGPKG_MAX_WORDS; i++) {
if (BIT(i) & pkt.word_en)
continue;
if (BIT(i) & pkt.word_en) {
efuse_one_byte_write(padapter, addr, pkt.data[i*2]);
efuse_one_byte_write(padapter, addr+1, pkt.data[i*2 + 1]);
efuse_one_byte_write(padapter, addr+1,
pkt.data[i*2 + 1]);
/* additional check */
if (efuse_one_byte_read(padapter, addr, &value) == false)
if (efuse_one_byte_read(padapter, addr, &value)
== false)
ret = false;
else if (pkt.data[i*2] != value) {
ret = false;
......@@ -342,7 +347,8 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
efuse_one_byte_write(padapter, addr,
pkt.data[i * 2]);
}
if (efuse_one_byte_read(padapter, addr+1, &value) == false)
if (efuse_one_byte_read(padapter, addr+1, &value) ==
false)
ret = false;
else if (pkt.data[i*2 + 1] != value) {
ret = false;
......@@ -350,6 +356,7 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
efuse_one_byte_write(padapter, addr+1,
pkt.data[i*2 + 1]);
}
}
addr += 2;
}
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册