forked from KolibriOS/kolibrios
reduced time-out for auto negotiation, bugfixes.
git-svn-id: svn://kolibrios.org@4803 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
2d5fb32931
commit
6ee815481f
@ -287,10 +287,10 @@ end virtual
|
|||||||
|
|
||||||
macro udelay msec {
|
macro udelay msec {
|
||||||
|
|
||||||
push esi
|
push esi ecx
|
||||||
mov esi, msec
|
mov esi, msec
|
||||||
call Sleep
|
call Sleep
|
||||||
pop esi
|
pop ecx esi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -648,6 +648,7 @@ probe:
|
|||||||
cmp [tpc.mcfg], MCFG_METHOD_02
|
cmp [tpc.mcfg], MCFG_METHOD_02
|
||||||
jne @f
|
jne @f
|
||||||
DEBUGF 1,"Set MAC Reg C+CR Offset 0x82h = 0x01h\n"
|
DEBUGF 1,"Set MAC Reg C+CR Offset 0x82h = 0x01h\n"
|
||||||
|
set_io 0
|
||||||
set_io 0x82
|
set_io 0x82
|
||||||
mov al, 0x01
|
mov al, 0x01
|
||||||
out dx, al
|
out dx, al
|
||||||
@ -673,23 +674,24 @@ probe:
|
|||||||
; Enable auto-negotiation and restart auto-nigotiation
|
; Enable auto-negotiation and restart auto-nigotiation
|
||||||
WRITE_GMII_REG PHY_CTRL_REG, PHY_Enable_Auto_Nego or PHY_Restart_Auto_Nego
|
WRITE_GMII_REG PHY_CTRL_REG, PHY_Enable_Auto_Nego or PHY_Restart_Auto_Nego
|
||||||
|
|
||||||
udelay 100
|
udelay 1 ; 100
|
||||||
mov ecx, 10000
|
mov ecx, 200 ; 10000
|
||||||
|
DEBUGF 1, "Waiting for auto-negotiation to complete\n"
|
||||||
; wait for auto-negotiation process
|
; wait for auto-negotiation process
|
||||||
@@: dec ecx
|
@@: dec ecx
|
||||||
jz @f
|
jz @f
|
||||||
set_io 0
|
set_io 0
|
||||||
READ_GMII_REG PHY_STAT_REG
|
READ_GMII_REG PHY_STAT_REG
|
||||||
udelay 100
|
udelay 1 ; 100
|
||||||
test eax, PHY_Auto_Neco_Comp
|
test eax, PHY_Auto_Neco_Comp
|
||||||
jz @b
|
jz @b
|
||||||
set_io REG_PHYstatus
|
set_io REG_PHYstatus
|
||||||
in al, dx
|
in al, dx
|
||||||
jmp @f
|
jmp @f
|
||||||
.tbi_dis:
|
.tbi_dis:
|
||||||
udelay 100
|
udelay 1 ; 100
|
||||||
@@:
|
@@:
|
||||||
|
DEBUGF 1, "auto-negotiation complete\n"
|
||||||
|
|
||||||
;***************************************************************************
|
;***************************************************************************
|
||||||
; Function
|
; Function
|
||||||
@ -703,7 +705,7 @@ probe:
|
|||||||
align 4
|
align 4
|
||||||
reset:
|
reset:
|
||||||
|
|
||||||
DEBUGF 1,"reset\n"
|
DEBUGF 1,"resetting\n"
|
||||||
|
|
||||||
lea eax, [device.tx_ring]
|
lea eax, [device.tx_ring]
|
||||||
mov [tpc.TxDescArrays], eax
|
mov [tpc.TxDescArrays], eax
|
||||||
@ -728,6 +730,7 @@ reset:
|
|||||||
; Set link state to unknown
|
; Set link state to unknown
|
||||||
mov [device.state], ETH_LINK_UNKOWN
|
mov [device.state], ETH_LINK_UNKOWN
|
||||||
|
|
||||||
|
DEBUGF 2,"init OK!\n"
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user