diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c index da99b2bc8d01..610ce4cbe388 100644 --- a/sys/dev/pccard/pccard.c +++ b/sys/dev/pccard/pccard.c @@ -975,6 +975,9 @@ pccard_read_ivar(device_t bus, device_t child, int which, u_char *result) case PCCARD_IVAR_PRODUCT: *(u_int32_t *) result = sc->card.product; break; + case PCCARD_IVAR_PRODEXT: + *(u_int16_t *) result = sc->card.prodext; + break; case PCCARD_IVAR_FUNCTION: *(u_int32_t *) result = func->function; break; diff --git a/sys/dev/pccard/pccard_cis.c b/sys/dev/pccard/pccard_cis.c index 957c66c3a83f..9690ba47fbf2 100644 --- a/sys/dev/pccard/pccard_cis.c +++ b/sys/dev/pccard/pccard_cis.c @@ -712,6 +712,15 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg) } state->card->manufacturer = pccard_tuple_read_2(tuple, 0); state->card->product = pccard_tuple_read_2(tuple, 2); + /* + * This is for xe driver. But not better. + * In PC Card Standard, + * Manufacturer ID: 2byte. + * Product ID: 2byte usually, but no limited. + */ + if (tuple->length == 5 ) { + state->card->prodext = pccard_tuple_read_1(tuple, 4); + } DPRINTF(("CISTPL_MANFID\n")); break; case PCCARD_CISTPL_FUNCID: diff --git a/sys/dev/pccard/pccardvar.h b/sys/dev/pccard/pccardvar.h index d25091c674fa..e5e384942f09 100644 --- a/sys/dev/pccard/pccardvar.h +++ b/sys/dev/pccard/pccardvar.h @@ -180,6 +180,7 @@ struct pccard_card { #define PCMCIA_VENDOR_INVALID -1 int32_t product; #define PCMCIA_PRODUCT_INVALID -1 + int16_t prodext; u_int16_t error; #define PCMCIA_CIS_INVALID { NULL, NULL, NULL, NULL } STAILQ_HEAD(, pccard_function) pf_head; @@ -322,6 +323,7 @@ enum { PCCARD_IVAR_ETHADDR, /* read ethernet address from CIS tupple */ PCCARD_IVAR_VENDOR, PCCARD_IVAR_PRODUCT, + PCCARD_IVAR_PRODEXT, PCCARD_IVAR_FUNCTION_NUMBER, PCCARD_IVAR_VENDOR_STR, /* CIS string for "Manufacturer" */ PCCARD_IVAR_PRODUCT_STR,/* CIS strnig for "Product" */ @@ -341,6 +343,7 @@ pccard_get_ ## A(device_t dev, T *t) \ PCCARD_ACCESSOR(ether, ETHADDR, u_int8_t) PCCARD_ACCESSOR(vendor, VENDOR, u_int32_t) PCCARD_ACCESSOR(product, PRODUCT, u_int32_t) +PCCARD_ACCESSOR(prodext, PRODEXT, u_int16_t) PCCARD_ACCESSOR(function_number,FUNCTION_NUMBER, u_int32_t) PCCARD_ACCESSOR(function, FUNCTION, u_int32_t) PCCARD_ACCESSOR(vendor_str, VENDOR_STR, char *)