Add some code which is compatible for NEWCARD. It makes manufacturer

id transfer from pccardd.

Reviewed by: imp
This commit is contained in:
Takeshi Shibagaki 2002-02-20 14:42:36 +00:00
parent c0f91d512b
commit 9198b952b5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=90967
4 changed files with 18 additions and 0 deletions

View File

@ -142,6 +142,9 @@ struct dev_desc {
int iosize; /* Length of I/O ports */
int irqmask; /* Interrupt number(s) to allocate */
int flags; /* Device flags */
u_int manufacturer; /* Manufacturer ID */
u_int product; /* Product ID */
u_int prodext; /* Product ID (extended) */
u_char misc[128]; /* For any random info */
};
#define DEV_DESC_HAS_SIZE 1

View File

@ -234,6 +234,9 @@ allocate_driver(struct slot *slt, struct dev_desc *desc)
devi->running = 1;
devi->slt = slt;
bcopy(desc->misc, devi->misc, sizeof(desc->misc));
devi->manufacturer = desc->manufacturer;
devi->product = desc->product;
devi->prodext = desc->prodext;
resource_list_init(&devi->resources);
child = device_add_child(pccarddev, devi->name, desc->unit);
if (child == NULL) {

View File

@ -308,6 +308,15 @@ pccard_read_ivar(device_t bus, device_t child, int which, uintptr_t *result)
case PCCARD_IVAR_ETHADDR:
bcopy(devi->misc, result, ETHER_ADDR_LEN);
return (0);
case PCCARD_IVAR_VENDOR:
*(u_int32_t *) result = devi->manufacturer;
return (0);
case PCCARD_IVAR_PRODUCT:
*(u_int32_t *) result = devi->product;
return (0);
case PCCARD_IVAR_PRODEXT:
*(u_int16_t *) result = devi->prodext;
return (0);
}
return (ENOENT);
}

View File

@ -89,6 +89,9 @@ struct pccard_devinfo {
u_char name[128];
int running; /* Current state of driver */
u_char misc[128]; /* For any random info */
u_int manufacturer; /* Manufacturer ID */
u_int product; /* Product ID */
u_int prodext; /* Product ID (extended) */
struct slot *slt; /* Back pointer to slot */
struct resource_list resources;