[realtek] Use read-modify-write to check for C+ Command register
Some bits in the C+ Command register are always one. Testing for the presence of the register must allow for this. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
77afdc5643
commit
0e61beb26f
|
@ -879,8 +879,9 @@ static void realtek_detect ( struct realtek_nic *rtl ) {
|
||||||
* Try to enable C+ mode and PCI Dual Address Cycle (for
|
* Try to enable C+ mode and PCI Dual Address Cycle (for
|
||||||
* 64-bit systems), if supported.
|
* 64-bit systems), if supported.
|
||||||
*/
|
*/
|
||||||
cpcr = ( RTL_CPCR_DAC | RTL_CPCR_MULRW | RTL_CPCR_CPRX |
|
cpcr = readw ( rtl->regs + RTL_CPCR );
|
||||||
RTL_CPCR_CPTX );
|
cpcr |= ( RTL_CPCR_DAC | RTL_CPCR_MULRW | RTL_CPCR_CPRX |
|
||||||
|
RTL_CPCR_CPTX );
|
||||||
writew ( cpcr, rtl->regs + RTL_CPCR );
|
writew ( cpcr, rtl->regs + RTL_CPCR );
|
||||||
check_cpcr = readw ( rtl->regs + RTL_CPCR );
|
check_cpcr = readw ( rtl->regs + RTL_CPCR );
|
||||||
|
|
||||||
|
@ -890,7 +891,7 @@ static void realtek_detect ( struct realtek_nic *rtl ) {
|
||||||
rtl->have_phy_regs = 1;
|
rtl->have_phy_regs = 1;
|
||||||
rtl->tppoll = RTL_TPPOLL_8169;
|
rtl->tppoll = RTL_TPPOLL_8169;
|
||||||
} else {
|
} else {
|
||||||
if ( check_cpcr == cpcr ) {
|
if ( ( check_cpcr == cpcr ) && ( cpcr != 0xffff ) ) {
|
||||||
DBGC ( rtl, "REALTEK %p appears to be an RTL8139C+\n",
|
DBGC ( rtl, "REALTEK %p appears to be an RTL8139C+\n",
|
||||||
rtl );
|
rtl );
|
||||||
rtl->tppoll = RTL_TPPOLL_8139CP;
|
rtl->tppoll = RTL_TPPOLL_8139CP;
|
||||||
|
|
Reference in New Issue