- Fix initialization bugs for EHCI controllers
- Try again to release ownership of low-speed devices after reset
- Wait for the port reset to complete
svn path=/branches/usb-bringup-trunk/; revision=55232
- Fix GetPortStatus() and remove the cached status stuff (except for reset that we have to cache because the EHCI spec has no port reset complete bit)
svn path=/branches/usb-bringup-trunk/; revision=55188
- Use the same lock in the IUSBQueue as in the IDMAMemoryManager
- add debug traces (default off)
svn path=/branches/usb-bringup-trunk/; revision=55110
- Implement device disconnect indication for usbehci and usbohci
- Implement device removal for FDOs and PDOs in usbstor and usbhub
svn path=/branches/usb-bringup-trunk/; revision=55080
- Add usbd to bootcd because usbohci depends on it
- Make device interface creation failure a non-fatal error so the port drivers start successfully in 1st stage
svn path=/branches/usb-bringup-trunk/; revision=55034
- Pass memory manager to USBQueue object
- Fix bug in memory manager which did not check if an allocation equals page size
- Implement interrupt queue head array with frequencys of 1ms up to 32ms
- Store queue heads in the sync schedule array
- WIP
svn path=/branches/usb-bringup/; revision=51826
- Modify BuildBulkTransferQueueHead to support TransferBufferLengths larger than PAGE_SIZE * 5.
- Acquire a SpinLock before adding QueueHeads to AsyncList and PendingList.
- Dont request a new QueueHead for incomplete transfers in QueueHeadCompletion, as the memory for the just completed QueueHead has not been released yet. Doing so overwrites the m_TransferDescriptor[x] members with new address resulting in memory leaks. Instead request a new QueueHead after the QueueHead has been freed in QueueHeadCleanup.
- Fix a bug where a QueueHead was removed from the m_CompletedRequestAsyncList instead of the m_PendingRequestAsyncList.
- Temporary hackfix InternalCalculateTransferLength to return the TransferBufferLength. This hack will be removed as soon as possible.
- With these changes the hub and ehci driver allow viewing content of and transfers to/from usb disks.
svn path=/branches/usb-bringup/; revision=51684
- When clearing feature port reset, remove the flag from Change and if the port is hardware enabled set the enable flag in Status.
- When checking port status, if Change has any flags set an SCE request most be completed. Verified while writing usbhub driver in xp.
- Probably fixes a case where an endless loop of completing SCE requests.
svn path=/branches/usb-bringup/; revision=51642
- Invoke status change callback at passive level
- Fill out usb descriptor struct instead passing everything in char array
- Use 1 byte interrupt endpoint packet size for hub for now
- Fill in interface information when SelectConfiguration request is passed. Fixes sce callback and pool corruptions
- Return device descriptor in USBHI_QueryDeviceInformation
- Tested in WinXP with special pool enabled & overrun support
svn path=/branches/usb-bringup/; revision=51572
- Store number of bytes transferred in the transfer descriptors
- Perform queue head completion when the door bell ring has been acknowledged. Fixes race condition between multiple irps in the async list
- Fix calculation of transfer length when the request is an bulk in operation
- Use EndPointDescriptor member to access transfer type / pid direction
- Use MmGetSystemAddressForMdlSafe to retrieve system address for urb buffer
- Fix check if first transfer buffer finishes on first size if the size is of page_size
- With these changes and little luck and good weather, usb mass storage devices have been seen to work in Windows XP SP3
- Code inspired of mjmartin usbehci driver and Haiku's usb stack
svn path=/branches/usb-bringup/; revision=51506
- Port URB_FUNCTION_CLASS_INTERFACE from mjmartin usbehci driver
- Fix typo in interface declaration
- Disable assert for now
- Return irp status pending when irp is added to the queue
- Fix bug in InternalGetPidDirection
- More work on the bulk transfers, not yet working
svn path=/branches/usb-bringup/; revision=51501
- Fix a type causing CommitIrp to fail.
- Add a sanity check in StatusChangeEndpointCallBack to check that a pending SCE irp is queued.
- Start Implementing Bulk Transfers. Needs more work.
svn path=/branches/usb-bringup/; revision=51493
- Set the NakCountReload to 0 in the QueueHead that is set in the Async register, as this is a dead QueueHead marked as halted and does not need it.
- Set the Async register in StartController. Note: The Async and Periodic registers can only be modified when the controller is stopped.
- Driver now works in Qemu.
svn path=/branches/usb-bringup/; revision=51491
- hub_controller.cpp: Change RtlSetBit and RtlClearBit to RtlSetBtis and RtlClearBits for Win2k compatibility.
svn path=/branches/usb-bringup/; revision=51488
- Implement retrieving device / configuration descriptor for usb devices
- Based on mjmartin usbehci driver
- Mass storage device found wizard now pops up (fails to install - WIP)
svn path=/branches/usb-bringup/; revision=51478
- Move error checking if controller reported an error inside the door bell ring check block
- Extend interface of IUSBRequest to include DeviceAddress, which is needed to retrieve configuration descriptor of newly set address
- Allocate CtrlSetup from nonpaged pool
- Release setup packet on cleanup
- Devices now receive an device address
- Currently asserts while retrieving configuration descriptor as this code path is not yet existant
*** Assertion failed: Urb->UrbHeader.UsbdDeviceHandle == NULL
*** Source File: d:\usb-bringup\drivers\usb\usbehci_new\hub_controller.cpp, line 1118
svn path=/branches/usb-bringup/; revision=51477
- Change interface to return real async queue head
- Set the async queue head register after the controller has been started
- Enable async queue in StartController
- Port DumpDeviceDescriptor from mjmartin usbehci driver
- Remove pseudo queue head from usb queue, instead use the real async queue head exported from IUSBHardwareDevice
- Get physical address for transfer data in BuildControlTransferQueueHead
- Retrieving device descriptor now ~works, currently stops at setting device address (needs more work)
svn path=/branches/usb-bringup/; revision=51476
- Check if the current request type is supported (currently only control is supported, bulk will be implemented soon)
- Fix bug in IUSBRequest::CreateQueueHead
- Code runs now until first device descriptor get request (async / periodic queue not yet enabled)
- mjmartin usbehci status not yet reached
- Let the fun now begin ;)
svn path=/branches/usb-bringup/; revision=51474
- Cache port status & port change settings because it appears that some ehci controllers do not store the status reset register bit correctly
- This commit is a temporary solutions, needs to be reworked
- Return correct status from HandleClassOther
- Handle IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION to return status success
svn path=/branches/usb-bringup/; revision=51473
- Return the physical address of the async queue head in CUSBHardwareDevice::GetAsyncListRegister
- Remove superflous entries from queue head structure, they are processed within IUSBRequest class
- Remove USBHI_GetPortHackFlags, this function has been deprecated
- Add interface functions for IUSBRequest / IUSBQueue
- Callback into IUSBQueue when a hardware interrupt arrives
- Implement callback function to check for completed queue heads / free completed queue head depending on the Async Advance interrupt bit
svn path=/branches/usb-bringup/; revision=51466
- Create member for storing the request object
- Add interface function which is invoked when the queue head should be freed
- Add support functions which deal with completed queue heads
svn path=/branches/usb-bringup/; revision=51440
hub_controller:
- Implement StatusChangeEndpointCallBack called by HardwareDevice class when port status has changed on controller.
- Move Status Change Endpoint query code to IQueryStatusChageEndpoint as it is also needed by StatusChangeEndpointCallBack.
usb_request:
- Implement InternalCreateUsbRequest.
usb_queue:
- Implement CreateUsbRequest and AddUsbRequest
hardware:
- Implement GetAsyncListRegister and GetPeriodicListRegister.
- Implement SetStatusChangeEndpointCallBack for setting callback and context. Call the callback when a port status changes.
- Initialize the UsbQueue after creating the AsyncQueueHead, as the UsbQueue calls will call back with GetAsyncListRegister.
svn path=/branches/usb-bringup/; revision=51407
- Fix warning because comparing signed vs unsigned
- Implement function for retrieving the device descriptor
- Implement function for retrieving a configuration descriptor (including contained interface descriptor and endpoint descriptor)
- Cleanup interface for IUSBRequest:
- When caller initializes IUSBRequest with an IRP, then the operation mode is asynchronously. Therefore when the request is completed, IUSBRequest::ShouldReleaseRequestAfterCompletion will return true, which makes IUSBQueue call Release on IUSBRequest
- When the caller initializes IUSBRequest with an setup packet, the operation mode is synchronously. After submitting the IUSBRequest to queue, the caller should call IUSBRequest::GetResultStatus. This function will then block untill the operation has been completed. However, the caller needs to call Release() as those requests are not cleaned up by the IUSBQueue
svn path=/branches/usb-bringup/; revision=51406
- Initialize the MemoryManager only after allocating a CommonBuffer to pass to it.
- Create a QueueHead to put into the AsyncList Register.
svn path=/branches/usb-bringup/; revision=51402
- hub_controller: Implement Status Change Endpoint for RootHub.
Handling the URB can return STATUS_PENDING, as in the new SCE code. Check for this before completing the Irp.
Uncomment calls to PortStatus, SetPortFeature, and ClearPortStatus now that they are implemented.
- For function receiving a port number check that its not larger than the actual number of ports on the controller.
svn path=/branches/usb-bringup/; revision=51401
- Move USB_REQUEST_SET_FEATURE / USB_REQUEST_GET_FEATURE flags to header file.
- Remove QueueHead and Descriptor creation as its in UsbRequest.
- Move DMACommon Buffer allocation back to UsbHardwareDevice class.
- Implement Port Handling functions GetPortStatus, ClearPortStatus and SetPortFeature.
- Implement GetUSBQueue for returning pointer to UsbQueue and GetDMA to return DMAMemoryManager.
- Fix a typo in one of the defines for Port Register Flags.
svn path=/branches/usb-bringup/; revision=51397