diff --git a/devicemodel/hw/pci/xhci.c b/devicemodel/hw/pci/xhci.c index 869fc6eba..56ae8d08f 100644 --- a/devicemodel/hw/pci/xhci.c +++ b/devicemodel/hw/pci/xhci.c @@ -500,15 +500,6 @@ pci_xhci_native_usb_dev_conn_cb(void *hci_data, void *dev_data) UPRINTF(LDBG, "%04x:%04x %d-%d connecting.\r\n", native_vid, native_pid, native_bus, native_port); - /* FIXME: will support usb3 in future */ - if (xdev->native_assign_ports[native_bus] && - usb_native_is_ss_port(native_bus)) { - UPRINTF(LDBG, "%04x:%04x %d-%d be ignored due to superspeed" - " device hasn't support yet\r\n", native_vid, - native_pid, native_bus, native_port); - goto errout; - } - if (!xdev->native_assign_ports[native_bus] || !xdev->native_assign_ports[native_bus][native_port]) { UPRINTF(LDBG, "%04x:%04x %d-%d doesn't belong to this vm, bye." @@ -783,7 +774,6 @@ pci_xhci_port_chg(struct pci_xhci_vdev *xdev, int port, int conn) return -1; } - /* TODO: add USB 3.0 port state */ if (conn == 0) { reg->portsc &= ~XHCI_PS_CCS; reg->portsc |= (XHCI_PS_CSC | diff --git a/devicemodel/hw/platform/usb_pmapper.c b/devicemodel/hw/platform/usb_pmapper.c index 175bf1d2f..8b772d6ec 100644 --- a/devicemodel/hw/platform/usb_pmapper.c +++ b/devicemodel/hw/platform/usb_pmapper.c @@ -762,9 +762,9 @@ usb_dev_init(void *pdata, char *opt) if (port == 0) goto errout; - switch (desc.bcdUSB) { /* TODO: implemnt USB3.0 */ + switch (desc.bcdUSB) { case 0x300: - ver = 2; break; + ver = 3; break; case 0x200: case 0x110: ver = 2; break; diff --git a/devicemodel/include/usb_core.h b/devicemodel/include/usb_core.h index b652a1196..64ca72458 100644 --- a/devicemodel/include/usb_core.h +++ b/devicemodel/include/usb_core.h @@ -34,7 +34,15 @@ #include #include "types.h" -#define USB_MAX_XFER_BLOCKS 256 +/* FIXME: + * There are some huge data requests which need more than 256 TRBs in a single + * transfer, so it is neccessary to expand it. + * But this is not final solution, this size should be dynamically changed + * according to the native xhci driver's adjust of trb segements. + * By default, the native xhci driver use two segments which contain 2 * 256 + * trbs, so 1024 is enough currently. + */ +#define USB_MAX_XFER_BLOCKS 1024 #define USB_XFER_OUT 0 #define USB_XFER_IN 1