diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-01-09 06:41:37 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-01-09 06:41:37 +0100 |
commit | d1665eaf4df7dbdfef4e349b73bb1082bae18828 (patch) | |
tree | aabbf35d9e464b42ed734b500bbe1c4300c72e2e | |
parent | 77438f99c83b3d3965a5672cbe6618f65c30b9b4 (diff) |
add intel 82598 10gb ethernet to pcf and pccpuf configuration, add support for 82599 (from sources)
-rw-r--r-- | sys/src/9/pc/ether82598.c | 34 | ||||
-rw-r--r-- | sys/src/9/pc/pccpuf | 1 | ||||
-rw-r--r-- | sys/src/9/pc/pcf | 1 |
3 files changed, 22 insertions, 14 deletions
diff --git a/sys/src/9/pc/ether82598.c b/sys/src/9/pc/ether82598.c index 393982c16..b7f4682c5 100644 --- a/sys/src/9/pc/ether82598.c +++ b/sys/src/9/pc/ether82598.c @@ -264,7 +264,7 @@ typedef struct { Pcidev *p; Ether *edev; u32int *reg; - u32int *reg3; + u32int *regmsi; uchar flag; int nrd; int ntd; @@ -888,8 +888,9 @@ interrupt(Ureg*, void *v) static void scan(void) { - ulong io, io3; - void *mem, *mem3; + ulong io, iomsi; + void *mem, *memmsi; + int pciregs, pcimsix; Ctlr *c; Pcidev *p; @@ -901,10 +902,15 @@ scan(void) case 0x10b6: /* 82598 backplane */ case 0x10dd: /* 82598 at cx4 */ case 0x10ec: /* 82598 at cx4 dual port */ + pcimsix = 3; + break; + case 0x10fb: /* 82599 */ + pcimsix = 4; break; default: continue; } + pciregs = 0; if(nctlr == nelem(ctlrtab)){ print("i82598: too many controllers\n"); return; @@ -914,30 +920,30 @@ scan(void) print("i82598: can't allocate memory\n"); continue; } - io = p->mem[0].bar & ~0xf; - mem = vmap(io, p->mem[0].size); + io = p->mem[pciregs].bar & ~0xf; + mem = vmap(io, p->mem[pciregs].size); if(mem == nil){ - print("i82598: can't map %#p\n", p->mem[0].bar); + print("i82598: can't map regs %#p\n", p->mem[pciregs].bar); free(c); continue; } - io3 = p->mem[3].bar & ~0xf; - mem3 = vmap(io3, p->mem[3].size); - if(mem3 == nil){ - print("i82598: can't map %#p\n", p->mem[3].bar); - vunmap(mem, p->mem[0].size); + iomsi = p->mem[pcimsix].bar & ~0xf; + memmsi = vmap(iomsi, p->mem[pcimsix].size); + if(memmsi == nil){ + print("i82598: can't map msi-x regs %#p\n", p->mem[pcimsix].bar); + vunmap(mem, p->mem[pciregs].size); free(c); continue; } c->p = p; c->reg = (u32int*)mem; - c->reg3 = (u32int*)mem3; + c->regmsi = (u32int*)memmsi; c->rbsz = Rbsz; if(reset(c)){ print("i82598: can't reset\n"); free(c); - vunmap(mem, p->mem[0].size); - vunmap(mem3, p->mem[3].size); + vunmap(mem, p->mem[pciregs].size); + vunmap(memmsi, p->mem[pcimsix].size); continue; } pcisetbme(p); diff --git a/sys/src/9/pc/pccpuf b/sys/src/9/pc/pccpuf index d8a48881c..1795e6542 100644 --- a/sys/src/9/pc/pccpuf +++ b/sys/src/9/pc/pccpuf @@ -52,6 +52,7 @@ link ether82543gc pci ether82563 pci ether82557 pci + ether82598 pci ether83815 pci etherdp83820 pci etherbcm pci diff --git a/sys/src/9/pc/pcf b/sys/src/9/pc/pcf index 74bac70f3..31e90139b 100644 --- a/sys/src/9/pc/pcf +++ b/sys/src/9/pc/pcf @@ -54,6 +54,7 @@ link # ether82543gc pci ether82557 pci ether82563 pci + ether82598 pci ether83815 pci etherbcm pci etherdp83820 pci |