Changeset 635


Ignore:
Timestamp:
Jan 5, 2021, 5:34:23 PM (5 years ago)
Author:
David Azarewicz
Message:

Fixed adapter selection logic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-next/lib32/pci.c

    r629 r635  
    483483  struct pci_dev *pcidev;
    484484  struct pci_device_id IdTable;
     485  USHORT usVendor, usDevice;
    485486  int iAdapter = 0;
    486487
     
    508509      ulLast, pcidev->vendor, pcidev->device, pcidev->class, driver->name));
    509510
     511    usVendor = 0;
     512    usDevice = 0;
     513
    510514    for( iTableIx = 0; driver->id_table[iTableIx].vendor; iTableIx++)
    511515    {
     
    516520      if ( (pDriverId->device != PCI_ANY_ID) && (pDriverId->device != pcidev->device) ) continue;
    517521
     522      /* skip a duplicate device that could be matched by both and exact match and a class match */
     523      if (usVendor == pcidev->vendor && usDevice == pcidev->device) continue;
     524      usVendor = pcidev->vendor;
     525      usDevice = pcidev->device;
     526
    518527      rprintf(("pci_register_driver: matched %d %x:%x/%x with %x:%x/%x %x (%s)", iTableIx,
    519528        pcidev->vendor, pcidev->device, pcidev->class,
     
    522531      if ((iAdapterNumber >= 0) && (iAdapter < iAdapterNumber))
    523532      {
     533        rprintf(("iAdapterNumber=%x skipping iAdapter=%x", iAdapterNumber, iAdapter));
    524534        iAdapter++;
    525535        continue;
Note: See TracChangeset for help on using the changeset viewer.