mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 12:53:09 +00:00
[USBHUB]
- Missed a fix from last commit - Wait for the device status change work item to complete - The USB stack is now properly constructed for USB booting svn path=/branches/usb-bringup-trunk/; revision=55339
This commit is contained in:
parent
475fe08f3c
commit
be54f427e6
2 changed files with 18 additions and 21 deletions
|
@ -260,8 +260,6 @@ DeviceStatusChangeThread(
|
||||||
PORT_STATUS_CHANGE PortStatus;
|
PORT_STATUS_CHANGE PortStatus;
|
||||||
LONG PortId;
|
LONG PortId;
|
||||||
|
|
||||||
static LONG failsafe = 0;
|
|
||||||
|
|
||||||
DPRINT1("Entered DeviceStatusChangeThread, Context %x\n", Context);
|
DPRINT1("Entered DeviceStatusChangeThread, Context %x\n", Context);
|
||||||
|
|
||||||
WorkItemData = (PWORK_ITEM_DATA)Context;
|
WorkItemData = (PWORK_ITEM_DATA)Context;
|
||||||
|
@ -408,20 +406,7 @@ DeviceStatusChangeThread(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
KeSetEvent(&WorkItemData->Event, IO_NO_INCREMENT, FALSE);
|
||||||
// FIXME: Still in testing
|
|
||||||
//
|
|
||||||
failsafe++;
|
|
||||||
if (failsafe > 100)
|
|
||||||
{
|
|
||||||
DPRINT1("SCE completed over 100 times but no action has been taken to clear the Change of any ports.\n");
|
|
||||||
//
|
|
||||||
// Return and dont send any more SCE Requests
|
|
||||||
//
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ExFreePool(WorkItemData);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Send another SCE Request
|
// Send another SCE Request
|
||||||
|
@ -460,6 +445,7 @@ StatusChangeEndpointCompletion(
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
}
|
}
|
||||||
WorkItemData->Context = RealDeviceObject;
|
WorkItemData->Context = RealDeviceObject;
|
||||||
|
KeInitializeEvent(&WorkItemData->Event, NotificationEvent, FALSE);
|
||||||
DPRINT1("Initialize work item\n");
|
DPRINT1("Initialize work item\n");
|
||||||
ExInitializeWorkItem(&WorkItemData->WorkItem, DeviceStatusChangeThread, (PVOID)WorkItemData);
|
ExInitializeWorkItem(&WorkItemData->WorkItem, DeviceStatusChangeThread, (PVOID)WorkItemData);
|
||||||
|
|
||||||
|
@ -468,6 +454,16 @@ StatusChangeEndpointCompletion(
|
||||||
//
|
//
|
||||||
ExQueueWorkItem(&WorkItemData->WorkItem, DelayedWorkQueue);
|
ExQueueWorkItem(&WorkItemData->WorkItem, DelayedWorkQueue);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Wait for the work item
|
||||||
|
//
|
||||||
|
KeWaitForSingleObject(&WorkItemData->Event,
|
||||||
|
Executive,
|
||||||
|
KernelMode,
|
||||||
|
FALSE,
|
||||||
|
NULL);
|
||||||
|
ExFreePool(WorkItemData);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Return more processing required so the IO Manger doesn’t try to mess with IRP just freed
|
// Return more processing required so the IO Manger doesn’t try to mess with IRP just freed
|
||||||
//
|
//
|
||||||
|
@ -1823,6 +1819,11 @@ USBHUB_FdoHandlePnp(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
// Send the first SCE Request
|
||||||
|
//
|
||||||
|
QueryStatusChangeEndpoint(DeviceObject);
|
||||||
|
|
||||||
//
|
//
|
||||||
// reset ports
|
// reset ports
|
||||||
//
|
//
|
||||||
|
@ -1848,11 +1849,6 @@ USBHUB_FdoHandlePnp(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Send the first SCE Request
|
|
||||||
//
|
|
||||||
QueryStatusChangeEndpoint(DeviceObject);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ExFreePool(Urb);
|
ExFreePool(Urb);
|
||||||
|
|
|
@ -44,6 +44,7 @@ typedef struct _PORT_STATUS_CHANGE
|
||||||
typedef struct _WORK_ITEM_DATA
|
typedef struct _WORK_ITEM_DATA
|
||||||
{
|
{
|
||||||
WORK_QUEUE_ITEM WorkItem;
|
WORK_QUEUE_ITEM WorkItem;
|
||||||
|
KEVENT Event;
|
||||||
PVOID Context;
|
PVOID Context;
|
||||||
} WORK_ITEM_DATA, *PWORK_ITEM_DATA;
|
} WORK_ITEM_DATA, *PWORK_ITEM_DATA;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue