Add u_int16 prodext value in CISTPL_MANF_ID. This gets a fifth byte
when manufacturer id tuple length is 5. This change is for xe driver. This is a dirty hack. But there is no better idea. Reviewd by: imp
This commit is contained in:
parent
287698b4f1
commit
57ffbd6e54
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=90964
@ -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;
|
||||
|
@ -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:
|
||||
|
@ -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 *)
|
||||
|
Loading…
Reference in New Issue
Block a user