Copy cis strings into the kernel.

This commit is contained in:
Warner Losh 2002-07-22 06:58:24 +00:00
parent e6e2fdce18
commit bf038c87af
2 changed files with 15 additions and 9 deletions

View File

@ -358,16 +358,18 @@ card_inserted(struct slot *sp)
bzero(sp->eaddr, sizeof(sp->eaddr));
}
if (sp->cis->manufacturer && sp->cis->product) {
sp->manufacturer=sp->cis->manufacturer;
sp->product=sp->cis->product;
if(sp->cis->prodext) {
sp->prodext=sp->cis->prodext; /* For xe driver */
}
sp->manufacturer = sp->cis->manufacturer;
sp->product = sp->cis->product;
sp->prodext = sp->cis->prodext; /* For xe driver */
} else {
sp->manufacturer=0;
sp->product=0;
sp->prodext=0;
sp->manufacturer = 0;
sp->product = 0;
sp->prodext = 0;
}
if (sp->cis->manuf)
strlcpy(sp->manufstr, sp->cis->manuf, sizeof(sp->manufstr));
if (sp->cis->vers)
strlcpy(sp->versstr, sp->cis->vers, sizeof(sp->versstr));
if (cp->ether) {
struct ether *e = 0;
@ -639,7 +641,7 @@ assign_card_index(struct slot *sp, struct cis * cis)
goto next;
}
return cp; /* found */
next:
next:;
}
return cis->def_config;
}
@ -990,6 +992,8 @@ setup_slot(struct slot *sp)
drv.manufacturer = sp->manufacturer;
drv.product = sp->product;
drv.prodext = sp->prodext;
strlcpy(drv.manufstr, sp->manufstr, sizeof(drv.manufstr));
strlcpy(drv.versstr, sp->versstr, sizeof(drv.versstr));
/*
* If the driver fails to be connected to the device,
* then it may mean that the driver did not recognise it.

View File

@ -125,6 +125,8 @@ struct slot {
u_int product;
u_int prodext;
unsigned char eaddr[6]; /* If any */
char manufstr[DEV_MAX_CIS_LEN];
char versstr[DEV_MAX_CIS_LEN];
struct allocblk io; /* I/O block spec */
struct allocblk mem; /* Memory block spec */
int irq; /* Irq value */