add intel 82598 10gb ethernet to pcf and pccpuf configuration, add support for 82599 (from sources)
This commit is contained in:
parent
77438f99c8
commit
d1665eaf4d
3 changed files with 22 additions and 14 deletions
|
@ -264,7 +264,7 @@ typedef struct {
|
||||||
Pcidev *p;
|
Pcidev *p;
|
||||||
Ether *edev;
|
Ether *edev;
|
||||||
u32int *reg;
|
u32int *reg;
|
||||||
u32int *reg3;
|
u32int *regmsi;
|
||||||
uchar flag;
|
uchar flag;
|
||||||
int nrd;
|
int nrd;
|
||||||
int ntd;
|
int ntd;
|
||||||
|
@ -888,8 +888,9 @@ interrupt(Ureg*, void *v)
|
||||||
static void
|
static void
|
||||||
scan(void)
|
scan(void)
|
||||||
{
|
{
|
||||||
ulong io, io3;
|
ulong io, iomsi;
|
||||||
void *mem, *mem3;
|
void *mem, *memmsi;
|
||||||
|
int pciregs, pcimsix;
|
||||||
Ctlr *c;
|
Ctlr *c;
|
||||||
Pcidev *p;
|
Pcidev *p;
|
||||||
|
|
||||||
|
@ -901,10 +902,15 @@ scan(void)
|
||||||
case 0x10b6: /* 82598 backplane */
|
case 0x10b6: /* 82598 backplane */
|
||||||
case 0x10dd: /* 82598 at cx4 */
|
case 0x10dd: /* 82598 at cx4 */
|
||||||
case 0x10ec: /* 82598 at cx4 dual port */
|
case 0x10ec: /* 82598 at cx4 dual port */
|
||||||
|
pcimsix = 3;
|
||||||
|
break;
|
||||||
|
case 0x10fb: /* 82599 */
|
||||||
|
pcimsix = 4;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
pciregs = 0;
|
||||||
if(nctlr == nelem(ctlrtab)){
|
if(nctlr == nelem(ctlrtab)){
|
||||||
print("i82598: too many controllers\n");
|
print("i82598: too many controllers\n");
|
||||||
return;
|
return;
|
||||||
|
@ -914,30 +920,30 @@ scan(void)
|
||||||
print("i82598: can't allocate memory\n");
|
print("i82598: can't allocate memory\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
io = p->mem[0].bar & ~0xf;
|
io = p->mem[pciregs].bar & ~0xf;
|
||||||
mem = vmap(io, p->mem[0].size);
|
mem = vmap(io, p->mem[pciregs].size);
|
||||||
if(mem == nil){
|
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);
|
free(c);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
io3 = p->mem[3].bar & ~0xf;
|
iomsi = p->mem[pcimsix].bar & ~0xf;
|
||||||
mem3 = vmap(io3, p->mem[3].size);
|
memmsi = vmap(iomsi, p->mem[pcimsix].size);
|
||||||
if(mem3 == nil){
|
if(memmsi == nil){
|
||||||
print("i82598: can't map %#p\n", p->mem[3].bar);
|
print("i82598: can't map msi-x regs %#p\n", p->mem[pcimsix].bar);
|
||||||
vunmap(mem, p->mem[0].size);
|
vunmap(mem, p->mem[pciregs].size);
|
||||||
free(c);
|
free(c);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
c->p = p;
|
c->p = p;
|
||||||
c->reg = (u32int*)mem;
|
c->reg = (u32int*)mem;
|
||||||
c->reg3 = (u32int*)mem3;
|
c->regmsi = (u32int*)memmsi;
|
||||||
c->rbsz = Rbsz;
|
c->rbsz = Rbsz;
|
||||||
if(reset(c)){
|
if(reset(c)){
|
||||||
print("i82598: can't reset\n");
|
print("i82598: can't reset\n");
|
||||||
free(c);
|
free(c);
|
||||||
vunmap(mem, p->mem[0].size);
|
vunmap(mem, p->mem[pciregs].size);
|
||||||
vunmap(mem3, p->mem[3].size);
|
vunmap(memmsi, p->mem[pcimsix].size);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
pcisetbme(p);
|
pcisetbme(p);
|
||||||
|
|
|
@ -52,6 +52,7 @@ link
|
||||||
ether82543gc pci
|
ether82543gc pci
|
||||||
ether82563 pci
|
ether82563 pci
|
||||||
ether82557 pci
|
ether82557 pci
|
||||||
|
ether82598 pci
|
||||||
ether83815 pci
|
ether83815 pci
|
||||||
etherdp83820 pci
|
etherdp83820 pci
|
||||||
etherbcm pci
|
etherbcm pci
|
||||||
|
|
|
@ -54,6 +54,7 @@ link
|
||||||
# ether82543gc pci
|
# ether82543gc pci
|
||||||
ether82557 pci
|
ether82557 pci
|
||||||
ether82563 pci
|
ether82563 pci
|
||||||
|
ether82598 pci
|
||||||
ether83815 pci
|
ether83815 pci
|
||||||
etherbcm pci
|
etherbcm pci
|
||||||
etherdp83820 pci
|
etherdp83820 pci
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue