summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-07-29 02:32:16 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-07-29 02:32:16 +0200
commit3b06ca8566fb90eaf4118144ea4750cea914ea9f (patch)
treefb43596dfc484a236ffc75a27e971bc1311345c5
parentc23715d2686823cc6821b218eb9e12691d9506fd (diff)
downloadplan9front-3b06ca8566fb90eaf4118144ea4750cea914ea9f.tar.xz
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().
-rw-r--r--sys/src/9/pc/ether82563.c27
1 files changed, 27 insertions, 0 deletions
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
@@ -1281,6 +1281,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)
{
char name[KNAMELEN];
@@ -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);