Browse Source

[xhci] Record device-specific quirks in xHCI device structure

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
323bf186fb
2 changed files with 6 additions and 3 deletions
  1. 4
    3
      src/drivers/usb/xhci.c
  2. 2
    0
      src/drivers/usb/xhci.h

+ 4
- 3
src/drivers/usb/xhci.c View File

3197
 		goto err_alloc;
3197
 		goto err_alloc;
3198
 	}
3198
 	}
3199
 	xhci->name = pci->dev.name;
3199
 	xhci->name = pci->dev.name;
3200
+	xhci->quirks = pci->id->driver_data;
3200
 
3201
 
3201
 	/* Fix up PCI device */
3202
 	/* Fix up PCI device */
3202
 	adjust_pci_device ( pci );
3203
 	adjust_pci_device ( pci );
3218
 	xhci_legacy_claim ( xhci );
3219
 	xhci_legacy_claim ( xhci );
3219
 
3220
 
3220
 	/* Fix Intel PCH-specific quirks, if applicable */
3221
 	/* Fix Intel PCH-specific quirks, if applicable */
3221
-	if ( pci->id->driver_data & XHCI_PCH )
3222
+	if ( xhci->quirks & XHCI_PCH )
3222
 		xhci_pch_fix ( xhci, pci );
3223
 		xhci_pch_fix ( xhci, pci );
3223
 
3224
 
3224
 	/* Reset device */
3225
 	/* Reset device */
3254
  err_alloc_bus:
3255
  err_alloc_bus:
3255
 	xhci_reset ( xhci );
3256
 	xhci_reset ( xhci );
3256
  err_reset:
3257
  err_reset:
3257
-	if ( pci->id->driver_data & XHCI_PCH )
3258
+	if ( xhci->quirks & XHCI_PCH )
3258
 		xhci_pch_undo ( xhci, pci );
3259
 		xhci_pch_undo ( xhci, pci );
3259
 	xhci_legacy_release ( xhci );
3260
 	xhci_legacy_release ( xhci );
3260
 	iounmap ( xhci->regs );
3261
 	iounmap ( xhci->regs );
3276
 	unregister_usb_bus ( bus );
3277
 	unregister_usb_bus ( bus );
3277
 	free_usb_bus ( bus );
3278
 	free_usb_bus ( bus );
3278
 	xhci_reset ( xhci );
3279
 	xhci_reset ( xhci );
3279
-	if ( pci->id->driver_data & XHCI_PCH )
3280
+	if ( xhci->quirks & XHCI_PCH )
3280
 		xhci_pch_undo ( xhci, pci );
3281
 		xhci_pch_undo ( xhci, pci );
3281
 	xhci_legacy_release ( xhci );
3282
 	xhci_legacy_release ( xhci );
3282
 	iounmap ( xhci->regs );
3283
 	iounmap ( xhci->regs );

+ 2
- 0
src/drivers/usb/xhci.h View File

1038
 	void *regs;
1038
 	void *regs;
1039
 	/** Name */
1039
 	/** Name */
1040
 	const char *name;
1040
 	const char *name;
1041
+	/** Quirks */
1042
+	unsigned int quirks;
1041
 
1043
 
1042
 	/** Capability registers */
1044
 	/** Capability registers */
1043
 	void *cap;
1045
 	void *cap;

Loading…
Cancel
Save