From bf038c87af5ff076ace1bd7a51bb9b79c75db5e3 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 22 Jul 2002 06:58:24 +0000 Subject: [PATCH] Copy cis strings into the kernel. --- usr.sbin/pccard/pccardd/cardd.c | 22 +++++++++++++--------- usr.sbin/pccard/pccardd/cardd.h | 2 ++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/usr.sbin/pccard/pccardd/cardd.c b/usr.sbin/pccard/pccardd/cardd.c index c2431bf3f64d..9e8af7f44214 100644 --- a/usr.sbin/pccard/pccardd/cardd.c +++ b/usr.sbin/pccard/pccardd/cardd.c @@ -358,16 +358,18 @@ escape: 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. diff --git a/usr.sbin/pccard/pccardd/cardd.h b/usr.sbin/pccard/pccardd/cardd.h index afd87320acc5..b39df25407c9 100644 --- a/usr.sbin/pccard/pccardd/cardd.h +++ b/usr.sbin/pccard/pccardd/cardd.h @@ -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 */