瀏覽代碼

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

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 年之前
父節點
當前提交
323bf186fb
共有 2 個文件被更改,包括 6 次插入3 次删除
  1. 4
    3
      src/drivers/usb/xhci.c
  2. 2
    0
      src/drivers/usb/xhci.h

+ 4
- 3
src/drivers/usb/xhci.c 查看文件

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

+ 2
- 0
src/drivers/usb/xhci.h 查看文件

@@ -1038,6 +1038,8 @@ struct xhci_device {
1038 1038
 	void *regs;
1039 1039
 	/** Name */
1040 1040
 	const char *name;
1041
+	/** Quirks */
1042
+	unsigned int quirks;
1041 1043
 
1042 1044
 	/** Capability registers */
1043 1045
 	void *cap;

Loading…
取消
儲存