kern/51333: Pass missing CIS data into OLDCARD PCMCIA drivers
Scott Mitchell
scott+freebsd at fishballoon.org
Wed Apr 23 14:50:18 PDT 2003
>Number: 51333
>Category: kern
>Synopsis: Pass missing CIS data into OLDCARD PCMCIA drivers
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Apr 23 14:50:15 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: Scott Mitchell
>Release: FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
FreeBSD orac 5.0-CURRENT FreeBSD 5.0-CURRENT #3: Wed Apr 9 00:07:38 BST 2003 scott at tuatara:/local/0/obj/local/0/-CURRENT/src/sys/ORAC i386
>Description:
The OLDCARD PCMCIA code (in sys/pccard and usr.sbin/pccard) does not pass the
two 'additional info' strings from a card's 'version info' CIS tuple into
drivers attached using OLDCARD. Furthermore, neither these strings or the
'vendor' and 'product' strings from the same tuple are available to drivers
even when they are copied into the kernel-side code, due to a lack of ivar
accessors for these strings. These strings are required in order to identify
certain cards supported by the xe driver.
The attached patch updates pccardd and the kernel-side code to make all four
strings available to drivers. Note that this also requires a line to be added
to sys/dev/pccard/pccardvar.h for the CIS4_STR ivar tag.
>How-To-Repeat:
>Fix:
Index: sys/dev/pccard/pccardvar.h
===================================================================
RCS file: /home/ncvs/src/sys/dev/pccard/pccardvar.h,v
retrieving revision 1.34
diff -u -r1.34 pccardvar.h
--- sys/dev/pccard/pccardvar.h 14 Nov 2002 05:15:50 -0000 1.34
+++ sys/dev/pccard/pccardvar.h 8 Apr 2003 23:20:21 -0000
@@ -358,6 +358,7 @@
PCCARD_ACCESSOR(vendor_str, VENDOR_STR, char *)
PCCARD_ACCESSOR(product_str, PRODUCT_STR, char *)
PCCARD_ACCESSOR(cis3_str, CIS3_STR, char *)
+PCCARD_ACCESSOR(cis4_str, CIS4_STR, char *)
/* shared memory flags */
enum {
Index: sys/pccard/cardinfo.h
===================================================================
RCS file: /home/ncvs/src/sys/pccard/cardinfo.h,v
retrieving revision 1.28
diff -u -r1.28 cardinfo.h
--- sys/pccard/cardinfo.h 22 Jul 2002 06:46:10 -0000 1.28
+++ sys/pccard/cardinfo.h 8 Apr 2003 22:35:20 -0000
@@ -147,6 +147,8 @@
uint8_t misc[DEV_MISC_LEN]; /* For any random info */
uint8_t manufstr[DEV_MAX_CIS_LEN];
uint8_t versstr[DEV_MAX_CIS_LEN];
+ uint8_t cis3str[DEV_MAX_CIS_LEN];
+ uint8_t cis4str[DEV_MAX_CIS_LEN];
uint32_t manufacturer; /* Manufacturer ID */
uint32_t product; /* Product ID */
uint32_t prodext; /* Product ID (extended) */
Index: sys/pccard/pccard.c
===================================================================
RCS file: /home/ncvs/src/sys/pccard/pccard.c,v
retrieving revision 1.157
diff -u -r1.157 pccard.c
--- sys/pccard/pccard.c 3 Mar 2003 12:15:53 -0000 1.157
+++ sys/pccard/pccard.c 8 Apr 2003 23:17:32 -0000
@@ -223,6 +223,8 @@
bcopy(desc->misc, devi->misc, sizeof(desc->misc));
strcpy(devi->manufstr, desc->manufstr);
strcpy(devi->versstr, desc->versstr);
+ strcpy(devi->cis3str, desc->cis3str);
+ strcpy(devi->cis4str, desc->cis4str);
devi->manufacturer = desc->manufacturer;
devi->product = desc->product;
devi->prodext = desc->prodext;
Index: sys/pccard/pccard_nbk.c
===================================================================
RCS file: /home/ncvs/src/sys/pccard/pccard_nbk.c,v
retrieving revision 1.42
diff -u -r1.42 pccard_nbk.c
--- sys/pccard/pccard_nbk.c 31 Jul 2002 20:01:11 -0000 1.42
+++ sys/pccard/pccard_nbk.c 8 Apr 2003 23:06:16 -0000
@@ -322,6 +322,18 @@
case PCCARD_IVAR_PRODEXT:
*(u_int16_t *) result = devi->prodext;
return (0);
+ case PCCARD_IVAR_VENDOR_STR:
+ *(char **) result = devi->manufstr;
+ break;
+ case PCCARD_IVAR_PRODUCT_STR:
+ *(char **) result = devi->versstr;
+ break;
+ case PCCARD_IVAR_CIS3_STR:
+ *(char **) result = devi->cis3str;
+ break;
+ case PCCARD_IVAR_CIS4_STR:
+ *(char **) result = devi->cis4str;
+ break;
}
return (ENOENT);
}
Index: sys/pccard/slot.h
===================================================================
RCS file: /home/ncvs/src/sys/pccard/slot.h,v
retrieving revision 1.37
diff -u -r1.37 slot.h
--- sys/pccard/slot.h 22 Jul 2002 06:46:10 -0000 1.37
+++ sys/pccard/slot.h 8 Apr 2003 22:34:07 -0000
@@ -91,6 +91,8 @@
uint8_t misc[DEV_MISC_LEN]; /* For any random info */
uint8_t manufstr[DEV_MAX_CIS_LEN];
uint8_t versstr[DEV_MAX_CIS_LEN];
+ uint8_t cis3str[DEV_MAX_CIS_LEN];
+ uint8_t cis4str[DEV_MAX_CIS_LEN];
uint32_t manufacturer; /* Manufacturer ID */
uint32_t product; /* Product ID */
uint32_t prodext; /* Product ID (extended) */
Index: usr.sbin/pccard/pccardd/cardd.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/pccard/pccardd/cardd.c,v
retrieving revision 1.78
diff -u -r1.78 cardd.c
--- usr.sbin/pccard/pccardd/cardd.c 30 Dec 2002 21:18:14 -0000 1.78
+++ usr.sbin/pccard/pccardd/cardd.c 8 Apr 2003 22:38:06 -0000
@@ -370,6 +370,10 @@
strlcpy(sp->manufstr, sp->cis->manuf, sizeof(sp->manufstr));
if (sp->cis->vers)
strlcpy(sp->versstr, sp->cis->vers, sizeof(sp->versstr));
+ if (sp->cis->add_info1)
+ strlcpy(sp->cis3str, sp->cis->add_info1, sizeof(sp->cis3str));
+ if (sp->cis->add_info2)
+ strlcpy(sp->cis4str, sp->cis->add_info2, sizeof(sp->cis4str));
if (cp->ether) {
struct ether *e = 0;
@@ -994,6 +998,8 @@
drv.prodext = sp->prodext;
strlcpy(drv.manufstr, sp->manufstr, sizeof(drv.manufstr));
strlcpy(drv.versstr, sp->versstr, sizeof(drv.versstr));
+ strlcpy(drv.cis3str, sp->cis3str, sizeof(drv.cis3str));
+ strlcpy(drv.cis4str, sp->cis4str, sizeof(drv.cis4str));
/*
* If the driver fails to be connected to the device,
* then it may mean that the driver did not recognise it.
Index: usr.sbin/pccard/pccardd/cardd.h
===================================================================
RCS file: /home/ncvs/src/usr.sbin/pccard/pccardd/cardd.h,v
retrieving revision 1.29
diff -u -r1.29 cardd.h
--- usr.sbin/pccard/pccardd/cardd.h 22 Jul 2002 06:58:24 -0000 1.29
+++ usr.sbin/pccard/pccardd/cardd.h 8 Apr 2003 22:31:17 -0000
@@ -127,6 +127,8 @@
unsigned char eaddr[6]; /* If any */
char manufstr[DEV_MAX_CIS_LEN];
char versstr[DEV_MAX_CIS_LEN];
+ char cis3str[DEV_MAX_CIS_LEN];
+ char cis4str[DEV_MAX_CIS_LEN];
struct allocblk io; /* I/O block spec */
struct allocblk mem; /* Memory block spec */
int irq; /* Irq value */
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list