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().
This commit is contained in:
cinap_lenrek 2013-07-29 02:32:16 +02:00
parent c23715d268
commit 3b06ca8566

View file

@ -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);