ether8169: fix wrong mbps setting (from qu7uux)
the first time rtl8169link is called (from rtl8169pnp), the link isn't up, so setting edev->mbps based on Phystatus register is skipped. edev->mbps is then still set at the default 100, and that ends up being what devether uses. this is why some rtl8169 cards are misprinted as 100Mbps in kmesg. later, after rtl8169link is called again from rtl8169interrupt, the link is up and edev->mbps is set to the correct value (as shown by e.g. /net/ether0/stats). so instead, set speed regardless of link status.
This commit is contained in:
parent
ca8ca008f4
commit
92aa75e879
1 changed files with 2 additions and 5 deletions
|
@ -830,15 +830,12 @@ rtl8169link(Ether* edev)
|
|||
|
||||
ctlr = edev->ctlr;
|
||||
|
||||
r = csr8r(ctlr, Phystatus);
|
||||
/*
|
||||
* Maybe the link changed - do we care very much?
|
||||
* Could stall transmits if no link, maybe?
|
||||
*/
|
||||
if(!((r = csr8r(ctlr, Phystatus)) & Linksts)){
|
||||
edev->link = 0;
|
||||
return;
|
||||
}
|
||||
edev->link = 1;
|
||||
edev->link = (r & Linksts) != 0;
|
||||
|
||||
limit = 256*1024;
|
||||
if(r & Speed10){
|
||||
|
|
Loading…
Reference in a new issue