mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-15 22:09:06 +00:00
DM USB: xHCI: support USB hot plug out.
Implements the disconnect callback of libusb which will be called once USB device plug out. Change-Id: Ic5f072f08a92270e6e5836b49e5066da783af243 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:
@@ -864,6 +864,8 @@ static int
|
||||
usb_dev_native_sys_disconn_cb(struct libusb_context *ctx, struct libusb_device
|
||||
*ldev, libusb_hotplug_event event, void *pdata)
|
||||
{
|
||||
uint8_t port;
|
||||
|
||||
UPRINTF(LDBG, "disconnect event\r\n");
|
||||
|
||||
if (!ctx || !ldev) {
|
||||
@@ -871,8 +873,9 @@ usb_dev_native_sys_disconn_cb(struct libusb_context *ctx, struct libusb_device
|
||||
return -1;
|
||||
}
|
||||
|
||||
port = libusb_get_port_number(ldev);
|
||||
if (g_ctx.disconn_cb)
|
||||
g_ctx.disconn_cb(g_ctx.hci_data, NULL);
|
||||
g_ctx.disconn_cb(g_ctx.hci_data, &port);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user