From 01d924b27ac1e72eba69eabecda4cf51d200d66d Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Thu, 14 Aug 2025 18:57:41 +0100 Subject: [PATCH] Replace hard-coded USB vendor ID with macro definition. --- system/usb.h | 4 ++++ system/usbhcd.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/system/usb.h b/system/usb.h index b8ca3db..942d0f2 100644 --- a/system/usb.h +++ b/system/usb.h @@ -87,6 +87,10 @@ #define HUB_PORT_LOW_SPEED 0x00000200 #define HUB_PORT_HIGH_SPEED 0x00000400 +// Vendor IDs + +#define USB_VID_AMERICAN_MEGATRENDS 0x046b + // Data structures. typedef struct __attribute__((packed)) { diff --git a/system/usbhcd.c b/system/usbhcd.c index 7c64dad..dafd6c5 100644 --- a/system/usbhcd.c +++ b/system/usbhcd.c @@ -170,7 +170,7 @@ static bool build_hub_info(const usb_hcd_t *hcd, const usb_hub_t *parent, int po static void add_hub_quirks(const usb_device_desc_t *device, usb_hub_t *hub) { - if ((device->vendor_id == 0x046b) && (device->product_id == 0xff01)) { + if ((device->vendor_id == USB_VID_AMERICAN_MEGATRENDS) && (device->product_id == 0xff01)) { // add quirk for AMI Virtual Hub - see issue #523 hub->quirks |= USB_HUB_DONT_DISABLE_PORTS; }