update dids in intel ethernet drivers. Reference: /n/atom/patch/applied/intelethupd Date: Sun Feb 8 07:32:12 CET 2015 Signed-off-by: quanstro@quanstro.net --- /sys/src/nix/k10/ether82563.c Sun Feb 8 07:31:23 2015 +++ /sys/src/nix/k10/ether82563.c Sun Feb 8 07:31:25 2015 @@ -2011,7 +2011,9 @@ case 0x15a3: /* i218-v */ return i218; case 0x156f: /* i219-lm */ + case 0x15b7: /* i219-lm */ case 0x1570: /* i219-v */ + case 0x15b8: /* i219-v */ return i219; case 0x151f: /* “powerville” eeprom-less */ case 0x1521: /* copper */ --- /sys/src/nix/k10/ether82598.c Sun Feb 8 07:31:28 2015 +++ /sys/src/nix/k10/ether82598.c Sun Feb 8 07:31:30 2015 @@ -188,6 +188,7 @@ i82598, i82599, x540, + x552, Nctlrtype, }; @@ -210,6 +211,7 @@ i82598, 9*1024, Fsplitivar|Fphyoc, "i82598", i82599, 9*1024, Fphyspd|Ftxctl, "i82599", x540, 9*1024, Fphyspd|Ftxctl, "x540", + x552, 9*1024, Fphyspd|Ftxctl, "x552", }; struct Stat { @@ -897,7 +899,7 @@ for(i = 0; i < 0x40; i++) u += eeread(c, i); for(i = 3; i < 0xf; i++){ - if(c->type == x540 && (i == 4 || i == 5)) + if((c->type == x540 || c->type == x552) && (i == 4 || i == 5)) continue; p = eeread(c, i); l = eeread(c, p++); @@ -1113,10 +1115,15 @@ case 0x154a: /* x520-4 */ case 0x154d: /* x520-q1 */ case 0x1558: /* x520-q1 */ - return i82599; + return i82599; case 0x1528: /* x540-at2 “twinville” */ case 0x1560: return x540; + case 0x15aa: /* x552 backplane */ + case 0x15ab: /* x552 backplane */ + case 0x15ac: /* x552 sfp+ */ + case 0x15ad: /* x552/x557-at 10gbase-t */ + return x552; default: return -1; } --- /sys/src/9/pc/ether82563.c Sun Feb 8 07:31:34 2015 +++ /sys/src/9/pc/ether82563.c Sun Feb 8 07:31:37 2015 @@ -2011,7 +2011,9 @@ case 0x15a3: /* i218-v */ return i218; case 0x156f: /* i219-lm */ + case 0x15b7: /* i219-lm */ case 0x1570: /* i219-v */ + case 0x15b8: /* i219-v */ return i219; case 0x151f: /* “powerville” eeprom-less */ case 0x1521: /* copper */ --- /sys/src/9/pc/ether82598.c Sun Feb 8 07:31:41 2015 +++ /sys/src/9/pc/ether82598.c Sun Feb 8 07:31:43 2015 @@ -188,6 +188,7 @@ i82598, i82599, x540, + x552, Nctlrtype, }; @@ -210,6 +211,7 @@ i82598, 9*1024, Fsplitivar|Fphyoc, "i82598", i82599, 9*1024, Fphyspd|Ftxctl, "i82599", x540, 9*1024, Fphyspd|Ftxctl, "x540", + x552, 9*1024, Fphyspd|Ftxctl, "x552", }; struct Stat { @@ -882,7 +884,7 @@ { c->reg[Eerd] = EEstart|i<<2; while((c->reg[Eerd]&EEdone) == 0) - ; + pause(); return c->reg[Eerd]>>16; } @@ -897,7 +899,7 @@ for(i = 0; i < 0x40; i++) u += eeread(c, i); for(i = 3; i < 0xf; i++){ - if(c->type == x540 && (i == 4 || i == 5)) + if((c->type == x540 || c->type == x552) && (i == 4 || i == 5)) continue; p = eeread(c, i); l = eeread(c, p++); @@ -1092,6 +1094,41 @@ p->did = i>>16; } +static int +didtype(int d) +{ + switch(d){ + case 0x10c6: /* 82598 af dual port */ + case 0x10c7: /* 82598 af single port */ + case 0x10b6: /* 82598 backplane */ + case 0x10dd: /* 82598 at cx4 */ + case 0x10ec: /* 82598 at cx4 */ + return i82598; + case 0x10f7: /* 82599 kx/kx4 */ + case 0x10f8: /* 82599 backplane */ + case 0x10f9: /* 82599 cx4 */ + case 0x10fb: /* 82599 sfi/sfp+ */ + case 0x10fc: /* 82599 xaui */ + case 0x1414: /* x520 kx4 mezz */ + case 0x151c: /* 82599 base t kx/kx4 “niantic” */ + case 0x1557: /* 82599 single-port sfi*/ + case 0x154a: /* x520-4 */ + case 0x154d: /* x520-q1 */ + case 0x1558: /* x520-q1 */ + return i82599; + case 0x1528: /* x540-at2 “twinville” */ + case 0x1560: + return x540; + case 0x15aa: /* x552 backplane */ + case 0x15ab: /* x552 backplane */ + case 0x15ac: /* x552 sfp+ */ + case 0x15ad: /* x552/x557-at 10gbase-t */ + return x552; + default: + return -1; + } +} + static void scan(void) { @@ -1102,36 +1139,10 @@ Ctlr *c; Pcidev *p; - p = 0; - while(p = pcimatch(p, 0x8086, 0)){ + for(p = nil; p = pcimatch(p, 0x8086, 0);){ hbafixup(p); - switch(p->did){ - case 0x10c6: /* 82598 af dual port */ - case 0x10c7: /* 82598 af single port */ - case 0x10b6: /* 82598 backplane */ - case 0x10dd: /* 82598 at cx4 */ - case 0x10ec: /* 82598 at cx4 */ - type = i82598; - break; - case 0x10f7: /* 82599 kx/kx4 */ - case 0x10f8: /* 82599 backplane */ - case 0x10f9: /* 82599 cx4 */ - case 0x10fb: /* 82599 sfi/sfp+ */ - case 0x10fc: /* 82599 xaui */ - case 0x1414: /* x520 kx4 mezz */ - case 0x151c: /* 82599 base t kx/kx4 “niantic” */ - case 0x154a: /* x520-4 */ - case 0x154d: /* x520-q1 */ - case 0x1558: /* x520-q1 */ - type = i82599; - break; - case 0x1528: /* x540-at2 “twinville” */ - case 0x1560: - type = x540; - break; - default: + if((type = didtype(p->did)) == -1) continue; - } name = cttab[type].name; if(nctlr == nelem(ctlrtab)){ print("%s: %T: too many controllers\n", name, p->tbdf); --- /sys/src/9/pcpae/ether82563.c Sun Feb 8 07:31:47 2015 +++ /sys/src/9/pcpae/ether82563.c Sun Feb 8 07:31:50 2015 @@ -2011,7 +2011,9 @@ case 0x15a3: /* i218-v */ return i218; case 0x156f: /* i219-lm */ + case 0x15b7: /* i219-lm */ case 0x1570: /* i219-v */ + case 0x15b8: /* i219-v */ return i219; case 0x151f: /* “powerville” eeprom-less */ case 0x1521: /* copper */ --- /sys/src/9/pcpae/ether82598.c Sun Feb 8 07:31:53 2015 +++ /sys/src/9/pcpae/ether82598.c Sun Feb 8 07:31:55 2015 @@ -188,6 +188,7 @@ i82598, i82599, x540, + x552, Nctlrtype, }; @@ -210,6 +211,7 @@ i82598, 9*1024, Fsplitivar|Fphyoc, "i82598", i82599, 9*1024, Fphyspd|Ftxctl, "i82599", x540, 9*1024, Fphyspd|Ftxctl, "x540", + x552, 9*1024, Fphyspd|Ftxctl, "x552", }; struct Stat { @@ -882,7 +884,7 @@ { c->reg[Eerd] = EEstart|i<<2; while((c->reg[Eerd]&EEdone) == 0) - ; + pause(); return c->reg[Eerd]>>16; } @@ -897,7 +899,7 @@ for(i = 0; i < 0x40; i++) u += eeread(c, i); for(i = 3; i < 0xf; i++){ - if(c->type == x540 && (i == 4 || i == 5)) + if((c->type == x540 || c->type == x552) && (i == 4 || i == 5)) continue; p = eeread(c, i); l = eeread(c, p++); @@ -1092,6 +1094,41 @@ p->did = i>>16; } +static int +didtype(int d) +{ + switch(d){ + case 0x10c6: /* 82598 af dual port */ + case 0x10c7: /* 82598 af single port */ + case 0x10b6: /* 82598 backplane */ + case 0x10dd: /* 82598 at cx4 */ + case 0x10ec: /* 82598 at cx4 */ + return i82598; + case 0x10f7: /* 82599 kx/kx4 */ + case 0x10f8: /* 82599 backplane */ + case 0x10f9: /* 82599 cx4 */ + case 0x10fb: /* 82599 sfi/sfp+ */ + case 0x10fc: /* 82599 xaui */ + case 0x1414: /* x520 kx4 mezz */ + case 0x151c: /* 82599 base t kx/kx4 “niantic” */ + case 0x1557: /* 82599 single-port sfi*/ + case 0x154a: /* x520-4 */ + case 0x154d: /* x520-q1 */ + case 0x1558: /* x520-q1 */ + return i82599; + case 0x1528: /* x540-at2 “twinville” */ + case 0x1560: + return x540; + case 0x15aa: /* x552 backplane */ + case 0x15ab: /* x552 backplane */ + case 0x15ac: /* x552 sfp+ */ + case 0x15ad: /* x552/x557-at 10gbase-t */ + return x552; + default: + return -1; + } +} + static void scan(void) { @@ -1102,36 +1139,10 @@ Ctlr *c; Pcidev *p; - p = 0; - while(p = pcimatch(p, 0x8086, 0)){ + for(p = nil; p = pcimatch(p, 0x8086, 0);){ hbafixup(p); - switch(p->did){ - case 0x10c6: /* 82598 af dual port */ - case 0x10c7: /* 82598 af single port */ - case 0x10b6: /* 82598 backplane */ - case 0x10dd: /* 82598 at cx4 */ - case 0x10ec: /* 82598 at cx4 */ - type = i82598; - break; - case 0x10f7: /* 82599 kx/kx4 */ - case 0x10f8: /* 82599 backplane */ - case 0x10f9: /* 82599 cx4 */ - case 0x10fb: /* 82599 sfi/sfp+ */ - case 0x10fc: /* 82599 xaui */ - case 0x1414: /* x520 kx4 mezz */ - case 0x151c: /* 82599 base t kx/kx4 “niantic” */ - case 0x154a: /* x520-4 */ - case 0x154d: /* x520-q1 */ - case 0x1558: /* x520-q1 */ - type = i82599; - break; - case 0x1528: /* x540-at2 “twinville” */ - case 0x1560: - type = x540; - break; - default: + if((type = didtype(p->did)) == -1) continue; - } name = cttab[type].name; if(nctlr == nelem(ctlrtab)){ print("%s: %T: too many controllers\n", name, p->tbdf);