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:
Wu, Xiaoguang
2018-04-10 19:04:52 +08:00
committed by lijinxia
parent 7687a3d0d7
commit 0181d19a61
2 changed files with 62 additions and 1 deletions

View File

@@ -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;
}