Merge pull request #5934 from akallabeth/urbdrc_close_fix
URBDRC: Only mark closed if control is closed.
This commit is contained in:
commit
822ed3d7ff
@ -1014,11 +1014,16 @@ static int libusb_udev_is_exist(IUDEVICE* idev)
|
||||
static int libusb_udev_is_channel_closed(IUDEVICE* idev)
|
||||
{
|
||||
UDEVICE* pdev = (UDEVICE*)idev;
|
||||
IUDEVMAN* udevman;
|
||||
if (!pdev || !pdev->urbdrc)
|
||||
return 1;
|
||||
|
||||
if (pdev->urbdrc->status & URBDRC_DEVICE_CHANNEL_CLOSED)
|
||||
return 1;
|
||||
udevman = pdev->urbdrc->udevman;
|
||||
if (udevman)
|
||||
{
|
||||
if (udevman->status & URBDRC_DEVICE_CHANNEL_CLOSED)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (pdev->status & URBDRC_DEVICE_CHANNEL_CLOSED)
|
||||
return 1;
|
||||
|
@ -645,6 +645,7 @@ static BOOL udevman_initialize(IUDEVMAN* idevman, UINT32 channelId)
|
||||
if (!udevman)
|
||||
return FALSE;
|
||||
|
||||
idevman->status &= ~URBDRC_DEVICE_CHANNEL_CLOSED;
|
||||
idevman->controlChannelId = channelId;
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -612,7 +612,15 @@ static UINT urbdrc_on_close(IWTSVirtualChannelCallback* pChannelCallback)
|
||||
{
|
||||
URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*)callback->plugin;
|
||||
if (urbdrc)
|
||||
urbdrc->status |= URBDRC_DEVICE_CHANNEL_CLOSED;
|
||||
{
|
||||
IUDEVMAN* udevman = urbdrc->udevman;
|
||||
if (udevman && callback->channel_mgr)
|
||||
{
|
||||
UINT32 control = callback->channel_mgr->GetChannelId(callback->channel);
|
||||
if (udevman->controlChannelId == control)
|
||||
udevman->status |= URBDRC_DEVICE_CHANNEL_CLOSED;
|
||||
}
|
||||
}
|
||||
}
|
||||
free(callback);
|
||||
return CHANNEL_RC_OK;
|
||||
|
@ -83,7 +83,6 @@ struct _URBDRC_PLUGIN
|
||||
UINT32 vchannel_status;
|
||||
char* subsystem;
|
||||
|
||||
UINT32 status;
|
||||
wLog* log;
|
||||
};
|
||||
|
||||
@ -220,6 +219,7 @@ struct _IUDEVMAN
|
||||
|
||||
IWTSPlugin* plugin;
|
||||
UINT32 controlChannelId;
|
||||
UINT32 status;
|
||||
};
|
||||
|
||||
enum
|
||||
|
Loading…
x
Reference in New Issue
Block a user