Fix a bug introduced in r216518. The ndis_subsys field holds the PCI
subdevice ID in addition to the subvendor ID. Reported by: Paul B Mahol 'onemda gmail com' Approved by: kib (mentor)
This commit is contained in:
parent
6a9e69db1b
commit
4485b7e74a
@ -110,14 +110,20 @@ ndis_devcompare(bustype, t, dev)
|
||||
struct ndis_pci_type *t;
|
||||
device_t dev;
|
||||
{
|
||||
uint16_t vid, did;
|
||||
uint32_t subsys;
|
||||
|
||||
if (bustype != PCIBus)
|
||||
return(FALSE);
|
||||
|
||||
vid = pci_get_vendor(dev);
|
||||
did = pci_get_device(dev);
|
||||
subsys = pci_get_subdevice(dev);
|
||||
subsys = (subsys << 16) | pci_get_subvendor(dev);
|
||||
|
||||
while(t->ndis_name != NULL) {
|
||||
if ((pci_get_vendor(dev) == t->ndis_vid) &&
|
||||
(pci_get_device(dev) == t->ndis_did) &&
|
||||
(pci_get_subvendor(dev) == t->ndis_subsys ||
|
||||
t->ndis_subsys == 0)) {
|
||||
if ((t->ndis_vid == vid) && (t->ndis_did == did) &&
|
||||
(t->ndis_subsys == subsys || t->ndis_subsys == 0)) {
|
||||
device_set_desc(dev, t->ndis_name);
|
||||
return(TRUE);
|
||||
}
|
||||
@ -169,6 +175,8 @@ ndis_attach_pci(dev)
|
||||
struct resource_list *rl;
|
||||
struct resource_list_entry *rle;
|
||||
struct drvdb_ent *db;
|
||||
uint16_t vid, did;
|
||||
uint32_t subsys;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
unit = device_get_unit(dev);
|
||||
@ -300,14 +308,18 @@ ndis_attach_pci(dev)
|
||||
|
||||
/* Figure out exactly which device we matched. */
|
||||
|
||||
vid = pci_get_vendor(dev);
|
||||
did = pci_get_device(dev);
|
||||
subsys = pci_get_subdevice(dev);
|
||||
subsys = (subsys << 16) | pci_get_subvendor(dev);
|
||||
|
||||
t = db->windrv_devlist;
|
||||
|
||||
while(t->ndis_name != NULL) {
|
||||
if ((pci_get_vendor(dev) == t->ndis_vid) &&
|
||||
(pci_get_device(dev) == t->ndis_did)) {
|
||||
if (t->ndis_vid == vid && t->ndis_did == did) {
|
||||
if (t->ndis_subsys == 0)
|
||||
defidx = devidx;
|
||||
else if (pci_get_subvendor(dev) == t->ndis_subsys)
|
||||
else if (t->ndis_subsys == subsys)
|
||||
break;
|
||||
}
|
||||
t++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user