do not try an adapter more than once if there are failures Reference: /n/atom/patch/applied/igbeonce Date: Mon Apr 7 22:52:36 CES 2014 Signed-off-by: quanstro@quanstr.net --- /sys/src/nix/k10/etherigbe.c Mon Apr 7 22:52:36 2014 +++ /sys/src/nix/k10/etherigbe.c Mon Apr 7 22:52:36 2014 @@ -1935,8 +1935,7 @@ Ctlr *ctlr; void *mem; - p = nil; - while(p = pcimatch(p, 0, 0)){ + for(p = nil; p = pcimatch(p, 0, 0); ){ if(p->ccrb != 0x02 || p->ccru != 0) continue; @@ -1974,9 +1973,10 @@ break; case 0x00: case 0xFF: - print("igbe: unusable CLS; using 32 bytes\n"); - pcicfgw8(p, PciCLS, 32/4); - continue; + print("igbe: resetting CLS %d->%d bytes\n", cls*4, 32); + cls = 32/4; + pcicfgw8(p, PciCLS, cls); + break; case 0x08: case 0x10: break; @@ -2011,9 +2011,12 @@ igbepnp(Ether* edev) { Ctlr *ctlr; + static int once; - if(igbectlrhead == nil) + if(once == 0){ + once = 1; igbepci(); + } /* * Any adapter matches if no edev->port is supplied,