diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-11-01 23:39:41 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-11-01 23:39:41 +0100 |
commit | f87baec1d0369764b761e8ca26a910e982123453 (patch) | |
tree | e806c5bd5422e1ba5fed2f51508cbd3dbbb11083 /sys/src/9/pc/ether82557.c | |
parent | b41bf07867e4bc7613b1e876219c571171e389c6 (diff) |
make auto negotiation work on 82562et (thanks mischief!)
the diver used to skip auto negotiation when
auto-negotiation enable (bit 12 in command register)
was clear.
setting the bit now, which makes auto negotiation work.
we skip auto negotiation only when it was already enabled
and status regiser indicates completion (bit 9).
Diffstat (limited to 'sys/src/9/pc/ether82557.c')
-rw-r--r-- | sys/src/9/pc/ether82557.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/src/9/pc/ether82557.c b/sys/src/9/pc/ether82557.c index c16d05beb..be7971d67 100644 --- a/sys/src/9/pc/ether82557.c +++ b/sys/src/9/pc/ether82557.c @@ -1212,26 +1212,26 @@ reset(Ether* ether) */ miir(ctlr, phyaddr, 0x01); bmsr = miir(ctlr, phyaddr, 0x01); - if((miir(ctlr, phyaddr, 0) & 0x1000) && !(bmsr & 0x0020)){ - miiw(ctlr, phyaddr, 0x1A, 0x2010); - x = miir(ctlr, phyaddr, 0); - miiw(ctlr, phyaddr, 0, 0x0200|x); - for(i = 0; i < 3000; i++){ - delay(1); - if(miir(ctlr, phyaddr, 0x01) & 0x0020) - break; - } - miiw(ctlr, phyaddr, 0x1A, 0x2000); - - anar = miir(ctlr, phyaddr, 0x04); - anlpar = miir(ctlr, phyaddr, 0x05) & 0x03E0; - anar &= anlpar; - bmcr = 0; - if(anar & 0x380) - bmcr = 0x2000; - if(anar & 0x0140) - bmcr |= 0x0100; + if((miir(ctlr, phyaddr, 0) & 0x1000) && (bmsr & 0x0020)) + break; + miiw(ctlr, phyaddr, 0x1A, 0x2010); + x = miir(ctlr, phyaddr, 0); + miiw(ctlr, phyaddr, 0, 0x1200|x); + for(i = 0; i < 3000; i++){ + delay(1); + if(miir(ctlr, phyaddr, 0x01) & 0x0020) + break; } + miiw(ctlr, phyaddr, 0x1A, 0x2000); + + anar = miir(ctlr, phyaddr, 0x04); + anlpar = miir(ctlr, phyaddr, 0x05) & 0x03E0; + anar &= anlpar; + bmcr = 0; + if(anar & 0x380) + bmcr = 0x2000; + if(anar & 0x0140) + bmcr |= 0x0100; break; } |