From 017eb5560d4cf7342f250d7ad6ac862d57cef800 Mon Sep 17 00:00:00 2001 From: sakumisu <1203593632@qq.com> Date: Fri, 19 Apr 2024 13:03:54 +0800 Subject: [PATCH] fix missing busid --- class/hub/usbh_hub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/class/hub/usbh_hub.c b/class/hub/usbh_hub.c index cf2b1ab8..55a1e29d 100644 --- a/class/hub/usbh_hub.c +++ b/class/hub/usbh_hub.c @@ -91,7 +91,7 @@ static int _usbh_hub_get_hub_descriptor(struct usbh_hub *hub, uint8_t *buffer) if (ret < 0) { return ret; } - memcpy(buffer, g_hub_buf, USB_SIZEOF_HUB_DESC); + memcpy(buffer, g_hub_buf[hub->bus->busid], USB_SIZEOF_HUB_DESC); return ret; } #if 0 @@ -108,11 +108,11 @@ static int _usbh_hub_get_status(struct usbh_hub *hub, uint8_t *buffer) setup->wIndex = 0; setup->wLength = 2; - ret = usbh_control_transfer(hub->parent, setup, g_hub_buf); + ret = usbh_control_transfer(hub->parent, setup, g_hub_buf[hub->bus->busid]); if (ret < 0) { return ret; } - memcpy(buffer, g_hub_buf, 2); + memcpy(buffer, g_hub_buf[hub->bus->busid], 2); return ret; } #endif