--- qemu/roms/seabios/src/usb-hub.c 2018/04/24 18:27:28 1.1.1.1 +++ qemu/roms/seabios/src/usb-hub.c 2018/04/24 19:43:41 1.1.1.2 @@ -31,7 +31,7 @@ set_port_feature(struct usbhub_s *hub, i req.wIndex = port + 1; req.wLength = 0; mutex_lock(&hub->lock); - int ret = send_default_control(hub->pipe, &req, NULL); + int ret = send_default_control(hub->usbdev->defpipe, &req, NULL); mutex_unlock(&hub->lock); return ret; } @@ -46,7 +46,7 @@ clear_port_feature(struct usbhub_s *hub, req.wIndex = port + 1; req.wLength = 0; mutex_lock(&hub->lock); - int ret = send_default_control(hub->pipe, &req, NULL); + int ret = send_default_control(hub->usbdev->defpipe, &req, NULL); mutex_unlock(&hub->lock); return ret; } @@ -61,7 +61,7 @@ get_port_status(struct usbhub_s *hub, in req.wIndex = port + 1; req.wLength = sizeof(*sts); mutex_lock(&hub->lock); - int ret = send_default_control(hub->pipe, &req, sts); + int ret = send_default_control(hub->usbdev->defpipe, &req, sts); mutex_unlock(&hub->lock); return ret; } @@ -158,21 +158,21 @@ static struct usbhub_op_s HubOp = { // Configure a usb hub and then find devices connected to it. int -usb_hub_init(struct usb_pipe *pipe) +usb_hub_init(struct usbdevice_s *usbdev) { ASSERT32FLAT(); if (!CONFIG_USB_HUB) return -1; struct usb_hub_descriptor desc; - int ret = get_hub_desc(pipe, &desc); + int ret = get_hub_desc(usbdev->defpipe, &desc); if (ret) return ret; struct usbhub_s hub; memset(&hub, 0, sizeof(hub)); - hub.pipe = pipe; - hub.cntl = pipe->cntl; + hub.usbdev = usbdev; + hub.cntl = usbdev->defpipe->cntl; hub.powerwait = desc.bPwrOn2PwrGood * 2; hub.portcount = desc.bNbrPorts; hub.op = &HubOp;