diff options
author | Ali Bahar <ali@internetdog.org> | 2011-09-04 03:14:17 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-09-06 17:00:34 -0700 |
commit | 0aeb623d376c05a8618bf10418b9a0cb2b43e944 (patch) | |
tree | b010bdb0a08de0e610d1ab174a7ea94c7540c931 /drivers/staging/rtl8712 | |
parent | 07a6b03707d3e6c5e1de2869a79b0bdca97ee2ac (diff) | |
download | linux-0aeb623d376c05a8618bf10418b9a0cb2b43e944.tar.bz2 |
staging: r8712u: Merging Realtek's latest (v2.6.6). Rework efuse data handling.
Rework efuse data handling.
Signed-off-by: Ali Bahar <ali@internetDog.org>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rtl8712')
-rw-r--r-- | drivers/staging/rtl8712/rtl8712_efuse.c | 75 |
1 files changed, 41 insertions, 34 deletions
diff --git a/drivers/staging/rtl8712/rtl8712_efuse.c b/drivers/staging/rtl8712/rtl8712_efuse.c index 1dc12b7a2f52..b08e9a25c9c5 100644 --- a/drivers/staging/rtl8712/rtl8712_efuse.c +++ b/drivers/staging/rtl8712/rtl8712_efuse.c @@ -307,21 +307,25 @@ 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, - &value) == true) - pkt.data[i*2] = value; - else - return false; - if (efuse_one_byte_read(padapter, addr + 1, - &value) == true) - pkt.data[i*2 + 1] = value; - else - return false; + 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, + &value) == true) + pkt.data[i*2 + 1] = + value; + else + return false; + } + addr += 2; } - addr += 2; } } if (addr != header_addr) @@ -329,26 +333,29 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr) addr++; /* fill original data */ for (i = 0; i < PGPKG_MAX_WORDS; i++) { - if (BIT(i) & pkt.word_en) - continue; - efuse_one_byte_write(padapter, addr, pkt.data[i*2]); - efuse_one_byte_write(padapter, addr+1, pkt.data[i*2 + 1]); - /* additional check */ - if (efuse_one_byte_read(padapter, addr, &value) == false) - ret = false; - else if (pkt.data[i*2] != value) { - ret = false; - if (0xFF == value) /* write again */ - efuse_one_byte_write(padapter, addr, - pkt.data[i * 2]); - } - if (efuse_one_byte_read(padapter, addr+1, &value) == false) - ret = false; - else if (pkt.data[i*2 + 1] != value) { - ret = false; - if (0xFF == value) /* write again */ - efuse_one_byte_write(padapter, addr+1, - pkt.data[i*2 + 1]); + 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]); + /* additional check */ + if (efuse_one_byte_read(padapter, addr, &value) + == false) + ret = false; + else if (pkt.data[i*2] != value) { + ret = false; + if (0xFF == value) /* write again */ + efuse_one_byte_write(padapter, addr, + pkt.data[i * 2]); + } + if (efuse_one_byte_read(padapter, addr+1, &value) == + false) + ret = false; + else if (pkt.data[i*2 + 1] != value) { + ret = false; + if (0xFF == value) /* write again */ + efuse_one_byte_write(padapter, addr+1, + pkt.data[i*2 + 1]); + } } addr += 2; } |