mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-18 23:40:11 +00:00
DM USB: xHCI: add port sharing feature
add support for xHCI port sharing feature, which enable the ability to assign different native ports to different multi-UOSes. For example: 1-2,1-2 assigned to UOS-1. 1-1,2-1 assigned to UOS-2. Change-Id: I899070f7a8a6eb23179e41e7b1f1da24c52482b2 Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com> Reviewed-by: Shuo Liu <shuo.a.liu@intel.com> Reviewed-by: Yu Wang <yu1.wang@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -256,6 +256,7 @@ struct pci_xhci_vdev {
|
||||
|
||||
int usb2_port_start;
|
||||
int usb3_port_start;
|
||||
uint8_t *native_assign_ports[USB_NATIVE_NUM_BUS];
|
||||
};
|
||||
|
||||
/* portregs and devices arrays are set up to start from idx=1 */
|
||||
@@ -369,6 +370,26 @@ pci_xhci_native_usb_dev_conn_cb(void *hci_data, void *dev_data)
|
||||
UPRINTF(LDBG, "%X:%X %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, "%X:%X %d-%d not support usb3 device, exit.\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, "%X:%X %d-%d doesn't belong to this vm, bye.\r\n",
|
||||
native_vid, native_pid, native_bus,
|
||||
native_port);
|
||||
goto errout;
|
||||
}
|
||||
|
||||
UPRINTF(LDBG, "%X:%X %d-%d belong to this vm.\r\n", native_vid,
|
||||
native_pid, native_bus, native_port);
|
||||
|
||||
if (ue->ue_usbver == 2)
|
||||
port_start = xdev->usb2_port_start;
|
||||
else
|
||||
|
Reference in New Issue
Block a user