Add accessor/ivar for the "function". This is so we can generically
match disks and serial ports and maybe others.
This commit is contained in:
parent
b8ce799cc4
commit
dc8e185f93
@ -867,6 +867,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_FUNCTION:
|
||||
*(u_int32_t *) result = func->function;
|
||||
break;
|
||||
case PCCARD_IVAR_FUNCTION_NUMBER:
|
||||
if (!func) {
|
||||
device_printf(bus, "No function number, bug!\n");
|
||||
|
@ -316,7 +316,8 @@ enum {
|
||||
PCCARD_IVAR_VENDOR_STR, /* CIS string for "Manufacturer" */
|
||||
PCCARD_IVAR_PRODUCT_STR,/* CIS strnig for "Product" */
|
||||
PCCARD_IVAR_CIS3_STR,
|
||||
PCCARD_IVAR_CIS4_STR
|
||||
PCCARD_IVAR_CIS4_STR,
|
||||
PCCARD_IVAR_FUNCTION
|
||||
};
|
||||
|
||||
#define PCCARD_ACCESSOR(A, B, T) \
|
||||
@ -331,6 +332,7 @@ PCCARD_ACCESSOR(ether, ETHADDR, u_int8_t)
|
||||
PCCARD_ACCESSOR(vendor, VENDOR, u_int32_t)
|
||||
PCCARD_ACCESSOR(product, PRODUCT, u_int32_t)
|
||||
PCCARD_ACCESSOR(function_number,FUNCTION_NUMBER, u_int32_t)
|
||||
PCCARD_ACCESSOR(function, FUNCTION, u_int32_t)
|
||||
PCCARD_ACCESSOR(vendor_str, VENDOR_STR, char *)
|
||||
PCCARD_ACCESSOR(product_str, PRODUCT_STR, char *)
|
||||
PCCARD_ACCESSOR(cis3_str, CIS3_STR, char *)
|
||||
|
Loading…
Reference in New Issue
Block a user