From 3b06ca8566fb90eaf4118144ea4750cea914ea9f Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 29 Jul 2013 02:32:16 +0200 Subject: ether82563: make link status work for 82567 on the 82567, reading any phy register just gives 0 back. however, the card works just fine and no action is required to (re-)start auto negotiation. so we add maclproc() which just reads the speed setting and link status from the mac status register instead of reading the phy registers. we'v probably seen this symptom on other cards (link: 0) like 82566. we should test if we can make link status work on these cards as well by just using the maclproc(). --- sys/src/9/pc/ether82563.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sys/src/9/pc/ether82563.c b/sys/src/9/pc/ether82563.c index 7f2ed3d0e..6fea78ce8 100644 --- a/sys/src/9/pc/ether82563.c +++ b/sys/src/9/pc/ether82563.c @@ -1280,6 +1280,31 @@ serdeslproc(void *v) } } +static void +maclproc(void *v) +{ + uint i; + Ctlr *c; + Ether *e; + + e = v; + c = e->ctlr; + + for(;;){ + i = csr32r(c, Status); + e->link = (i & Lu) != 0; + i = (i >> 6) & 3; /* link speed 6:7 */ + if(e->link == 0) + i = 3; + c->speeds[i]++; + e->mbps = speedtab[i]; + c->lim = 0; + i82563im(c, Lsc); + c->lsleep++; + sleep(&c->lrendez, i82563lim, c); + } +} + static void i82563attach(Ether *edev) { @@ -1329,6 +1354,8 @@ i82563attach(Ether *edev) kproc(name, pcslproc, edev); /* phy based serdes */ else if(cttab[ctlr->type].flag & F79phy) kproc(name, phyl79proc, edev); + else if(ctlr->type == i82567) + kproc(name, maclproc, edev); /* use mac link status */ else kproc(name, phylproc, edev); -- cgit v1.2.3