USB: configfs: Don't send DISCONNECT uevent during unbind
Windows XP host takes upto 6 seconds to enumerate RNDIS composition when RNDIS (tethering) is enabled while in MTP/PTP composition. This results in Userpsace Tethering enable timeout (1 second) causing RNDIS enumeration failure and falls back to default composition. Workaround the issue by not sending disconnect event to userspace on composition switch (MTP/PTP to RNDIS). Send the disconnect event from USB bus reset so that userspace enable timer starts from bus reset. Change-Id: I2d1fcaa0704e369204fbba4eceb8ba9b1c525b41 Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
This commit is contained in:
parent
aedf62a2ba
commit
43c0d001bc
1 changed files with 5 additions and 1 deletions
|
@ -87,6 +87,7 @@ struct gadget_info {
|
|||
struct usb_composite_driver composite;
|
||||
struct usb_composite_dev cdev;
|
||||
bool use_os_desc;
|
||||
bool unbinding;
|
||||
char b_vendor_code;
|
||||
char qw_sign[OS_STRING_QW_SIGN_LEN];
|
||||
#ifdef CONFIG_USB_CONFIGFS_UEVENT
|
||||
|
@ -283,9 +284,11 @@ static int unregister_gadget(struct gadget_info *gi)
|
|||
if (!gi->udc_name)
|
||||
return -ENODEV;
|
||||
|
||||
gi->unbinding = true;
|
||||
ret = usb_gadget_unregister_driver(&gi->composite.gadget_driver);
|
||||
if (ret)
|
||||
return ret;
|
||||
gi->unbinding = false;
|
||||
kfree(gi->udc_name);
|
||||
gi->udc_name = NULL;
|
||||
return 0;
|
||||
|
@ -1561,7 +1564,8 @@ static void android_disconnect(struct usb_gadget *gadget)
|
|||
acc_disconnect();
|
||||
#endif
|
||||
gi->connected = 0;
|
||||
schedule_work(&gi->work);
|
||||
if (!gi->unbinding)
|
||||
schedule_work(&gi->work);
|
||||
composite_disconnect(gadget);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue