]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[xhci] Record device-specific quirks in xHCI device structure
authorMichael Brown <mcb30@ipxe.org>
Thu, 18 Jun 2015 14:05:54 +0000 (15:05 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 18 Jun 2015 14:05:54 +0000 (15:05 +0100)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/usb/xhci.c
src/drivers/usb/xhci.h

index fa496698cd03a229557a8064805cc40024e25725..4f506dbc275e7fbc58dc69db7e84e2d939f1c3ea 100644 (file)
@@ -3197,6 +3197,7 @@ static int xhci_probe ( struct pci_device *pci ) {
                goto err_alloc;
        }
        xhci->name = pci->dev.name;
+       xhci->quirks = pci->id->driver_data;
 
        /* Fix up PCI device */
        adjust_pci_device ( pci );
@@ -3218,7 +3219,7 @@ static int xhci_probe ( struct pci_device *pci ) {
        xhci_legacy_claim ( xhci );
 
        /* Fix Intel PCH-specific quirks, if applicable */
-       if ( pci->id->driver_data & XHCI_PCH )
+       if ( xhci->quirks & XHCI_PCH )
                xhci_pch_fix ( xhci, pci );
 
        /* Reset device */
@@ -3254,7 +3255,7 @@ static int xhci_probe ( struct pci_device *pci ) {
  err_alloc_bus:
        xhci_reset ( xhci );
  err_reset:
-       if ( pci->id->driver_data & XHCI_PCH )
+       if ( xhci->quirks & XHCI_PCH )
                xhci_pch_undo ( xhci, pci );
        xhci_legacy_release ( xhci );
        iounmap ( xhci->regs );
@@ -3276,7 +3277,7 @@ static void xhci_remove ( struct pci_device *pci ) {
        unregister_usb_bus ( bus );
        free_usb_bus ( bus );
        xhci_reset ( xhci );
-       if ( pci->id->driver_data & XHCI_PCH )
+       if ( xhci->quirks & XHCI_PCH )
                xhci_pch_undo ( xhci, pci );
        xhci_legacy_release ( xhci );
        iounmap ( xhci->regs );
index 078798ad18bd2640726ff2dd49f4abfe9e4a5d3d..e35ef514e2ff05a126ae43ff807e4ced61a5221c 100644 (file)
@@ -1038,6 +1038,8 @@ struct xhci_device {
        void *regs;
        /** Name */
        const char *name;
+       /** Quirks */
+       unsigned int quirks;
 
        /** Capability registers */
        void *cap;