--- /n/sources/plan9/sys/src/9/pc/ether82563.c Mon Mar 24 17:51:28 2014 +++ /sys/src/9/pc/ether82563.c Wed Jul 9 00:00:00 2014 @@ -433,6 +433,8 @@ i82576, i82577, i82579, + i210, + i217, }; static int rbtab[] = { @@ -448,6 +450,8 @@ ETHERMAXTU, ETHERMAXTU, 9018, + 9728, + 9728, }; static char *tname[] = { @@ -463,6 +467,8 @@ "i82576", "i82577", "i82579", + "i210", + "i217", }; struct Ctlr { @@ -786,6 +792,8 @@ x = addr[5]>>1; if(ctlr->type == i82566 || ctlr->type == i82567) x &= 31; + if(ctlr->type == i210 || ctlr->type == i217) + x &= 15; bit = ((addr[5] & 1)<<4)|(addr[4]>>4); /* * multiple ether addresses can hash to the same filter bit, @@ -845,7 +853,10 @@ int i, r; Block *bp; - csr32w(ctlr, Tctl, 0x0F<type == i210) + csr32w(ctlr, Tctl, 0x0F<tdba)); csr32w(ctlr, Tdbah, 0); @@ -865,7 +876,7 @@ r = csr32r(ctlr, Txdctl); r &= ~(WthreshMASK|PthreshMASK); r |= 4<type == i82575 || ctlr->type == i82576) + if(ctlr->type == i82575 || ctlr->type == i82576 || ctlr->type == i210) r |= Qenable; csr32w(ctlr, Tadv, 64); csr32w(ctlr, Txdctl, r); @@ -998,7 +1009,7 @@ else rctl = Lpe|Dpf|Bsize16384|Bsex|Bam|RdtmsHALF|Secrc; - if(ctlr->type == i82575 || ctlr->type == i82576){ + if(ctlr->type == i82575 || ctlr->type == i82576 || ctlr->type == i210){ /* * Setting Qenable in Rxdctl does not * appear to stick unless Ren is on. @@ -1010,7 +1021,8 @@ } csr32w(ctlr, Rctl, rctl); - if(ctlr->type == i82573 || ctlr->type == i82577 || ctlr->type == i82579) + if(ctlr->type == i82573 || ctlr->type == i82577 || ctlr->type == i82579 || + ctlr->type == i210 || ctlr->type == i217) csr32w(ctlr, Ert, 1024/8); if(ctlr->type == i82566 || ctlr->type == i82567) @@ -1038,7 +1050,7 @@ } i82563replenish(ctlr); - if(ctlr->type != i82575 || ctlr->type == i82576){ + if(ctlr->type != i82575 || ctlr->type == i82576 || ctlr->type == i210){ /* * See comment above for Qenable. * Could shuffle the code? @@ -1081,6 +1093,9 @@ csr32w(ctlr, Rctl, r); m = ctlr->nrd-1; + if(ctlr->type == i210) + csr32w(ctlr, Rxdctl, csr32r(ctlr, Rxdctl) | Qenable); + for(;;){ i82563replenish(ctlr); i82563im(ctlr, Rxt0|Rxo|Rxdmt0|Rxseq|Ack); @@ -1236,6 +1251,9 @@ a = phyread(ctlr, Phylhr) & Anf; i = (i-1) & 3; break; + case i210: + a = phyread(ctlr, Phyisr) & Ane; + break; default: a = 0; break; @@ -1594,7 +1612,8 @@ if(i82563detach(ctlr)) return -1; if(ctlr->type == i82566 || ctlr->type == i82567 || - ctlr->type == i82577 || ctlr->type == i82579) + ctlr->type == i82577 || ctlr->type == i82579 || + ctlr->type == i217) r = fload(ctlr); else r = eeload(ctlr); @@ -1631,7 +1650,7 @@ */ csr32w(ctlr, Fcal, 0x00C28001); csr32w(ctlr, Fcah, 0x0100); - if(ctlr->type != i82579) + if(ctlr->type != i82579 && ctlr->type != i210 && ctlr->type != i217) csr32w(ctlr, Fct, 0x8808); csr32w(ctlr, Fcttv, 0x0100); @@ -1709,6 +1728,20 @@ case 0x1503: /* 82579v */ type = i82579; break; + case 0x1533: /* i210-t1 */ + case 0x1534: /* i210 */ + case 0x1536: /* i210-fiber */ + case 0x1537: /* i210-backplane */ + case 0x1538: + case 0x1539: /* i211 */ + case 0x157b: /* i210 */ + case 0x157c: /* i210 */ + type = i210; + break; + case 0x153a: /* i217-lm */ + case 0x153b: /* i217-v */ + type = i217; + break; } io = p->mem[0].bar & ~0x0F; @@ -1852,6 +1885,18 @@ return pnp(e, i82579); } +static int +i210pnp(Ether *e) +{ + return pnp(e, i210); +} + +static int +i217pnp(Ether *e) +{ + return pnp(e, i217); +} + void ether82563link(void) { @@ -1863,5 +1908,7 @@ addethercard("i82573", i82573pnp); addethercard("i82575", i82575pnp); addethercard("i82579", i82579pnp); + addethercard("i210", i210pnp); + addethercard("i217", i217pnp); addethercard("igbepcie", anypnp); }