reactos.git
12 years ago[USBOHCI]
Johannes Anderwald [Tue, 24 May 2011 17:57:00 +0000 (17:57 +0000)]
[USBOHCI]
- Add sanity checks
- Preserve  command status value when notifying the hc that a control / bulk endpoint was added
- Re-enable root hub notification interrupt when reset port has been completed
- Dispatch processing to USBQeueu when DoneHead event arrives
- Scan endpoints to find the logical endpoint which was completed by the hardware
- Signal completion to IUSBRequest by calling CompletionCallback
- Create a final transfer descriptor which is linked to the endpoint descriptor
- Control transfers now appear to be working (Device retrieves device descriptor / configuration descriptor and succeeds in setting device address)
- Configuration parsing code needs more work now (currently fails there due to invalid / unexpected configuration descriptor from device)

svn path=/branches/usb-bringup/; revision=51888

12 years ago[USBOHCI]
Johannes Anderwald [Tue, 24 May 2011 12:51:03 +0000 (12:51 +0000)]
[USBOHCI]
- Enable global power mode
- Wait untill reset is complete
- Clear reset complete bit when reset is done
- Enable port
- Reset port now works
- USBOHCI still hangs after adding first control request, needs more investigation

svn path=/branches/usb-bringup/; revision=51883

12 years ago[USBOHCI]
Johannes Anderwald [Mon, 23 May 2011 17:42:52 +0000 (17:42 +0000)]
[USBOHCI]
- Start implementing control transfers
- Move initialization of usb queue after the bulk / control head endpoints have been created
- Add interface functions to retrieve bulk / control head endpoint descriptors
- Add macros for setting transfer descriptors field (taken from Haiku)
- Partly implement IUSBQueue::AddUSBRequest for control / bulk transfers
- Create endpoint descriptor for control request and link setup descriptor to it
- Link setup descriptors to data descriptor / status descriptor
- WIP (needs fixes)

svn path=/branches/usb-bringup/; revision=51864

12 years ago[USBOHCI]
Johannes Anderwald [Mon, 23 May 2011 11:29:55 +0000 (11:29 +0000)]
[USBOHCI]
- Fix bug in calculating offset of status register
- Start implementing deferred processing routine
- Signal status change when new device is arrived
- Implement basic GetPortStatus
- Start implementing SetPortFeature, ClearPortStatus
- ResetPort not yet fully working, WIP

svn path=/branches/usb-bringup/; revision=51858

12 years ago[OHCI]
Johannes Anderwald [Sun, 22 May 2011 20:48:50 +0000 (20:48 +0000)]
[OHCI]
- Add check that controller is functional state
- enable interrupts after the controller has been started
- partly implement isr routine

svn path=/branches/usb-bringup/; revision=51852

12 years ago[USBOHCI]
Johannes Anderwald [Sun, 22 May 2011 19:36:13 +0000 (19:36 +0000)]
[USBOHCI]
- Start of OHCI support
- Based on new usbehci driver and Haiku USB Stack
- Driver initializes the controller and retrieve number of ports

svn path=/branches/usb-bringup/; revision=51851

12 years ago[USBEHCI]
Johannes Anderwald [Fri, 20 May 2011 15:06:39 +0000 (15:06 +0000)]
[USBEHCI]
- Enable sync frame list

svn path=/branches/usb-bringup/; revision=51827

12 years ago[USBEHCI]
Johannes Anderwald [Fri, 20 May 2011 14:47:15 +0000 (14:47 +0000)]
[USBEHCI]
- 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

12 years ago[USBSTOR]
Michael Martin [Tue, 17 May 2011 11:26:25 +0000 (11:26 +0000)]
[USBSTOR]
- Add error handling to USBSTOR_CSWCompletionRoutine for errors that can be recovered via reset of pipe/port/controller. Only pipe reset is attempted. WIP.

svn path=/branches/usb-bringup/; revision=51808

12 years ago[USBSTOR]
Johannes Anderwald [Sun, 15 May 2011 17:57:02 +0000 (17:57 +0000)]
[USBSTOR]
- Implement retrieving serial number from device
- Use serial number to format instance id and retrieve in StorageDeviceProperty requests
- Silence traces

svn path=/branches/usb-bringup/; revision=51770

12 years ago[USBSTOR]
Johannes Anderwald [Sun, 15 May 2011 14:59:16 +0000 (14:59 +0000)]
[USBSTOR]
- Add asserts
- Rewrite queue methods to accept the FDO only
- Fix multiple synchronization bugs
- Don't start next irp before current irp has completed
- Use contiouslogicalbytes blocks from srb
- Should fix race conditions

svn path=/branches/usb-bringup/; revision=51764

12 years ago[USBSTOR]
Johannes Anderwald [Sun, 15 May 2011 12:49:17 +0000 (12:49 +0000)]
[USBSTOR]
- Fix one more warning

svn path=/branches/usb-bringup/; revision=51760

12 years ago[USBSTOR]
Johannes Anderwald [Sun, 15 May 2011 12:47:54 +0000 (12:47 +0000)]
[USBSTOR]
- Silence warnings
- Silence traces
- Add asserts
- Add code to detect usb reset in progress. In that case cancel the request
- Add more code to synchronize urb action
- WIP, still hangs are observed

svn path=/branches/usb-bringup/; revision=51759

12 years ago[USBSTOR]
Michael Martin [Sun, 15 May 2011 11:23:16 +0000 (11:23 +0000)]
[USBSTOR]
- Start implementing error handling.
- On errors use a worker thread to attempt a recovery. If successful restart the operation that failed.
- If STALL_PID is received reset the pipe of the device.
- Not entered into code path yet. WIP.

svn path=/branches/usb-bringup/; revision=51754

12 years ago[USBSTOR]
Michael Martin [Sun, 15 May 2011 08:23:32 +0000 (08:23 +0000)]
[USBSTOR]
- USBSTOR_SendRequest: The buffer for read/write may not be NonPagedPool, which is documented as a requirement for using MmBuildMdlForNonPagedPool. Also locking the buffers pages is also not an option as the routine is called at DISPATCH_LEVEL.
It so happens that Irp->MdlAddress is valid for read/write operations. Use it instead of procedure above.
- Add a sanity check to make sure the Mdl does describe the transfer buffer.
Fixes IRQL_NOT_LESS_OR_EQUAL bugcheck in windows. These changes also may fixed writing to device.

svn path=/branches/usb-bringup/; revision=51752

12 years ago[USBSTOR]
Johannes Anderwald [Sat, 14 May 2011 18:09:00 +0000 (18:09 +0000)]
[USBSTOR]
- Start implementing queued srb handling
- Implement SRB_FUNCTION_RELEASE_QUEUE, SRB_FUNCTION_FLUSH, SRB_FUNCTION_FLUSH_QUEUE
- WIP, not yet working perfectly

svn path=/branches/usb-bringup/; revision=51739

12 years ago[USBSTOR]
Johannes Anderwald [Fri, 13 May 2011 14:44:24 +0000 (14:44 +0000)]
[USBSTOR]
- Start implementing write command
- Disabled for now as it causes corruptions

svn path=/branches/usb-bringup/; revision=51695

12 years ago[USBSTOR]
Johannes Anderwald [Fri, 13 May 2011 14:04:38 +0000 (14:04 +0000)]
[USBSTOR]
- Fix bug in read command, which uses wrong format. LBA address is stored in the CDB10 struct
- Don't build the mdl for nonpaged pool if the driver passes an mdl (i/o paging requests)
- Usbstor can now list disk contents and browse files when used in Windows XP
- Need to implement SCSIOP_WRITE to write files

svn path=/branches/usb-bringup/; revision=51694

12 years ago[USBSTOR]
Johannes Anderwald [Fri, 13 May 2011 13:37:50 +0000 (13:37 +0000)]
[USBSTOR]
- Handle SCSIOP_MEDIUM_REMOVAL
- Handle paging i/o requests. These request don't provide a data buffer in the srb, but the buffer is stored in the irp' mdl
- Fix the hack for unimplemented Mode Sense command
- Usbstor now completes initializes and receives read requests
- Still need to fix read request, as Windows XP fails to recognize the disk format, WIP

svn path=/branches/usb-bringup/; revision=51693

12 years ago[USBSTOR]
Michael Martin [Fri, 13 May 2011 09:14:28 +0000 (09:14 +0000)]
[USBSTOR]
- Add a check at USBSTOR_FdoHandleStartDevice to make sure the device uses Bulk Transfers.
- Use macros for initializing the Urbs. The macros ensure that the proper fields of the URB are set correctly.
Fixes failing of getting device descriptor and getting devices BlockLength.

svn path=/branches/usb-bringup/; revision=51691

12 years ago[USBHUB_NEW]
Michael Martin [Thu, 12 May 2011 23:31:32 +0000 (23:31 +0000)]
[USBHUB_NEW]
- Only get the string descriptors if they are available. Fixes crash when using usb mouse and keyboards in windows.

svn path=/branches/usb-bringup/; revision=51688

12 years ago[USBEHCI_NEW]
Michael Martin [Thu, 12 May 2011 13:35:06 +0000 (13:35 +0000)]
[USBEHCI_NEW]
- 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

12 years ago[USBHUB_NEW]
Michael Martin [Thu, 12 May 2011 12:58:07 +0000 (12:58 +0000)]
[USBHUB_NEW]
- Implement IOCTL_INTERNAL_USB_GET_PORT_STATUS.
- Fixes to comments

svn path=/branches/usb-bringup/; revision=51683

12 years ago[USBSTOR]
Johannes Anderwald [Wed, 11 May 2011 03:49:15 +0000 (03:49 +0000)]
[USBSTOR]
- Rewrite scsi method to act asynchronous

svn path=/branches/usb-bringup/; revision=51673

12 years ago[USBHUB_NEW]
Michael Martin [Wed, 11 May 2011 02:25:11 +0000 (02:25 +0000)]
[USBHUB_NEW]
- Save PortNumber in child device extensions as its needed when PNP request device capabilities.
- Handle IOCTL_INTERNAL_USB_SUBMIT_URB request by creating a new Irp and passing the Urb down to the miniport.
- Now working with our ehci driver, we at least see a usb driver and can browse directory in Windows, though doing so results in assert as ehci doesnt support transfers over 5 Pages yet. Fix coming soon.

svn path=/branches/usb-bringup/; revision=51672

12 years ago[USBSTOR]
Johannes Anderwald [Tue, 10 May 2011 23:26:56 +0000 (23:26 +0000)]
[USBSTOR]
- Partly implement test unit command

svn path=/branches/usb-bringup/; revision=51671

12 years ago[USBHUB_NEW]
Michael Martin [Mon, 9 May 2011 10:48:00 +0000 (10:48 +0000)]
[USBHUB_NEW]
- Forgotten change in 51641. Fixes build of usbhub.

svn path=/branches/usb-bringup/; revision=51657

12 years ago[USBSTOR]
Johannes Anderwald [Sun, 8 May 2011 22:18:55 +0000 (22:18 +0000)]
[USBSTOR]
- Start implementing SCSI read

svn path=/branches/usb-bringup/; revision=51654

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Sun, 8 May 2011 19:33:41 +0000 (19:33 +0000)]
[USBEHCI_NEW]
- Fix retrieving drive capacity
- Fix ufi command structures

svn path=/branches/usb-bringup/; revision=51649

12 years ago[USBEHCI_NEW]
Michael Martin [Sun, 8 May 2011 12:42:15 +0000 (12:42 +0000)]
[USBEHCI_NEW]
- 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

12 years ago[USBHUB_NEW]
Michael Martin [Sun, 8 May 2011 12:24:26 +0000 (12:24 +0000)]
[USBHUB_NEW]
- Implement constructing CompatibleIds string using device descriptor. However, if the Class of the device descriptor is 0, then Class, SubClass and Prot which make up this string must come from the Interface.
- Change Ids and Descriptions to Unicode Strings.
- Move the creating of Id strings to one place, CreateDeviceIds, and called it at device creation.

svn path=/branches/usb-bringup/; revision=51641

12 years ago[USBHUB_NEW]
Michael Martin [Sat, 7 May 2011 16:10:09 +0000 (16:10 +0000)]
[USBHUB_NEW]
- Some devices implement a default Language, LangId of 0. Some do not. Use LangId 0x0409 (English) until LangId is implemented.
- Remove an unused variable.

svn path=/branches/usb-bringup/; revision=51622

12 years ago[USBHUB_NEW]
Michael Martin [Sat, 7 May 2011 14:49:02 +0000 (14:49 +0000)]
[USBHUB_NEW]
- The lower level driver completes the SCE IRP whenever the change state has been modified for a port. When handling the SCE IRP completion only check for flags in change state. The Change flags must be cleared else the hub driver will get non stop SCE IRP completions.
- Allocate IRP from Pool vice calling IoAllocateIrp. Dont free the IRP in the completion routine as the port driver, oddly, frees them.
- GetUsbDeviceDescriptor: Remove use of MDL and use only buffer instead to make our new usbehci happy.
- When calling the interface routines, correctly use the BusContext returned from the interface instead of the RootHubPdo. This worked on windows as it just happened they were the same.
- Implement RootHubInitCallbackFunction, which only job currently is to send the first SCE IRP.
- For Start Device for child device objects fake success for now. Will be implemented later.
- Implement returning IRP_MN_QUERY_IDs, IRP_MN_QUERY_DEVICE_TEXTs and IRP_MN_QUERY_BUS_INFORMATION.
- Add basic handling for IRP_MJ_POWER.
- Misc code changes.

svn path=/branches/usb-bringup/; revision=51620

12 years ago[USBSTOR]
Johannes Anderwald [Fri, 6 May 2011 17:23:19 +0000 (17:23 +0000)]
[USBSTOR]
- Implement SCSI mode sense

svn path=/branches/usb-bringup/; revision=51609

12 years ago[USBSTOR]
Johannes Anderwald [Fri, 6 May 2011 16:25:01 +0000 (16:25 +0000)]
[USBSTOR]
- Implement retrieving drive capacity
- Use constant from scsi.h instead of defining own format
- Don't reset returned parameters length to zero, as ioctl handler might set it

svn path=/branches/usb-bringup/; revision=51608

12 years ago[USBSTOR]
Johannes Anderwald [Fri, 6 May 2011 13:29:27 +0000 (13:29 +0000)]
[USBSTOR]
- Implement retrieving adapter descriptor (IOCTL_STORAGE_QUERY_PROPERTY)
- Implement retrieving device descriptor (IOCTL_STORAGE_QUERY_PROPERTY)
- Next Function to implement is SRB_FUNCTION_EXECUTE_SCSI

svn path=/branches/usb-bringup/; revision=51607

12 years ago[USBSTOR]
Johannes Anderwald [Thu, 5 May 2011 00:39:00 +0000 (00:39 +0000)]
[USBSTOR]
- Rename common device extension, it conflicts with classpnp.h header structures
- Start implementing disk ioctls
- Implement SRB_FUNCTION_CLAIM_DEVICE, SRB_FUNCTION_RELEASE_DEVICE

svn path=/branches/usb-bringup/; revision=51585

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Thu, 5 May 2011 00:35:56 +0000 (00:35 +0000)]
[USBEHCI_NEW]
- Silence debug flood

svn path=/branches/usb-bringup/; revision=51584

12 years ago[USBSTOR]
Johannes Anderwald [Wed, 4 May 2011 23:14:32 +0000 (23:14 +0000)]
[USBSTOR]
- Make DeviceId generation to match ms usbstor
- Don't hardcode the device type in USBSTOR_PdoHandleQueryHardwareId
- Don't hardcode device type in USBSTOR_PdoHandleQueryCompatibleId
- Hackfix generation of instance id
- Add comments
- Cleanup code
- Usbstor now receives ioctl from disk.sys

svn path=/branches/usb-bringup/; revision=51582

12 years ago[USBHUB_NEW]
Michael Martin [Wed, 4 May 2011 21:45:55 +0000 (21:45 +0000)]
[USBHUB_NEW]
- Add UsbDeviceHandle to child device extensions structure to be passed with URB requests.
- Reimplement the Worker Thread DeviceStatusChangeThread called on SCE completion. Each SetFeature and ClearFeature resend SCE request.
Only create the usb child device if the PortStatusChange member of the device extensions was modified.
- Implement CreateUsbChildDeviceObject used for creating a deviceobject for the USB device and initializing it.
- Implement GetUsbStringDescriptor for getting DeviceId, TextDescription and InstanceId from USB Device.
- Move the initial QueryStatusChangeEndpoint to after the hub device receives start pnp.
- USBHUB driver is now back to the same functionality of previous version. Showing the device wizard for connected devices.

svn path=/branches/usb-bringup/; revision=51581

12 years ago[USBSTOR]
Johannes Anderwald [Wed, 4 May 2011 20:19:33 +0000 (20:19 +0000)]
[USBSTOR]
- Rewrite hardware id / instance id matching
- Implement support for compatible id
- UsbStor still not attached to disk.sys, needs more research on how to get this done

svn path=/branches/usb-bringup/; revision=51580

12 years ago[USBHUB_NEW]
Michael Martin [Wed, 4 May 2011 12:58:42 +0000 (12:58 +0000)]
[USBHUB_NEW]
- Change parameter name for DeviceObject in functions to clearify which device object is to received IRPs.
- Fix a typo in GetPortStatusAndChange that caused the function to return nothing for status and change.
- Call QueryStatusChangeEndpoint to send the first SCE request in Query Bus Releations.
- Complete implementation of StatusChangeEndpointCompletion. Queue a work item for DeviceStatusChangeThread, which will be used to initialize the usb device and create related device objects.

svn path=/branches/usb-bringup/; revision=51576

12 years ago[USBSTOR]
Johannes Anderwald [Wed, 4 May 2011 12:33:01 +0000 (12:33 +0000)]
[USBSTOR]
- Don't free device descriptor if it failed to acquire it
- Don't move out of usb configuration array. Found by special pool
- Fix bug when storing interface information which lead to a overwrite
- Implement retrieving generic type for device
- Fix bugs in QueryDeviceId
- Implement querying hardware ids
- Implement querying instance ids
- With these changes, usbstor now initializes and create pdo, which is also enumerated
- Needs more code / fixes so that disk.sys attaches to usbstor
- WIP

svn path=/branches/usb-bringup/; revision=51575

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Wed, 4 May 2011 12:09:07 +0000 (12:09 +0000)]
[USBEHCI_NEW]
- Fix warnings
- Fix mingw build

svn path=/branches/usb-bringup/; revision=51573

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Wed, 4 May 2011 11:49:00 +0000 (11:49 +0000)]
[USBEHCI_NEW]
- 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

12 years ago[USBHUB_NEW]
Michael Martin [Wed, 4 May 2011 01:08:37 +0000 (01:08 +0000)]
[USBHUB_NEW]
- Add UsbHub_New to build.

svn path=/branches/usb-bringup/; revision=51570

12 years ago[USBHUB_NEW]
Michael Martin [Wed, 4 May 2011 01:07:21 +0000 (01:07 +0000)]
[USBHUB_NEW]
- Start work on reimplementing UsbHub driver.
- Implement SubmitRequestToRootHub, QueryStatusChangeEndpoint, QueryInterface, GetPortStatusAndChange, SetPortFeature and ClearPortFeature.Handle QueryBusRelations.
- Partially implement PNP handling for FDO. When starting the device get all the information about the RootHub the driver will need and enable Power on all ports.
- Partially implement PNP handling for PDO, QueryId and QueryDeviceText.
- WIP

svn path=/branches/usb-bringup/; revision=51569

12 years ago[USBSTOR]
Johannes Anderwald [Tue, 3 May 2011 19:40:03 +0000 (19:40 +0000)]
[USBSTOR]
- Implement retrieving string device type from SCSI device type
- Handle BusQueryDeviceId
- Implement support routines for sending CBW / CSW / Data
- Implement retrieving device type (SCSI inquiry request)
- WIP

svn path=/branches/usb-bringup/; revision=51567

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Tue, 3 May 2011 00:15:23 +0000 (00:15 +0000)]
[USBEHCI_NEW]
- Remove function declaration
[USBSTOR]
- Start on usbstor driver (USB Mass Storage Driver)
- Implement reading device descriptor / configuration descriptor
- Implement scanning of configuration descriptor for bulk in / bulk out endpoints
- Implement selecting configuration and interface and verify selected interface
- Implement reading max lun and create child device object for each lun
- Handle PnP requests for functional device object
- Implement support routines to send urb's to lower device object (usbhub)
- Start implementing PDO routines

svn path=/branches/usb-bringup/; revision=51563

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Sat, 30 Apr 2011 18:46:10 +0000 (18:46 +0000)]
[USBEHCI_NEW]
- Silence usb bulk control traces

svn path=/branches/usb-bringup/; revision=51507

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Sat, 30 Apr 2011 17:44:43 +0000 (17:44 +0000)]
[USBEHCI_NEW]
- 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

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Sat, 30 Apr 2011 08:04:35 +0000 (08:04 +0000)]
[USBEHCI_NEW]
- 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

12 years ago[USBEHCI_NEW]
Michael Martin [Fri, 29 Apr 2011 13:16:03 +0000 (13:16 +0000)]
[USBEHCI_NEW]
- 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

12 years ago[USBEHCI_NEW]
Michael Martin [Fri, 29 Apr 2011 06:14:44 +0000 (06:14 +0000)]
[USBEHCI_NEW]
- 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

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Fri, 29 Apr 2011 03:17:57 +0000 (03:17 +0000)]
[USBEHCI_NEW]
- Fix SelectConfiguration / SelectInterface
- By mjmartin

svn path=/branches/usb-bringup/; revision=51490

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Fri, 29 Apr 2011 02:46:04 +0000 (02:46 +0000)]
[USBEHCI_NEW]
- Implement SelectInterface / SelectConfiguration based on mjmartin usbehci driver
- Initialization runs untill SelectInterface request
- Tested with WinXP SP2

svn path=/branches/usb-bringup/; revision=51489

12 years ago[USBEHCI_NEW]
Michael Martin [Fri, 29 Apr 2011 02:19:10 +0000 (02:19 +0000)]
[USBEHCI_NEW]
- hub_controller.cpp: Change RtlSetBit and RtlClearBit to RtlSetBtis and RtlClearBits for Win2k compatibility.

svn path=/branches/usb-bringup/; revision=51488

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Thu, 28 Apr 2011 23:59:53 +0000 (23:59 +0000)]
[USBEHCI_NEW]
- Remove assert for unknown clear feature
- Implement retrieving string descriptors, based on mjmartin usbehci driver
- Start implementing USBHI_RestoreUsbDevice
- Fixup device stack in USBHI_SetDeviceHandleData. Needs more investigation

svn path=/branches/usb-bringup/; revision=51487

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Thu, 28 Apr 2011 17:45:32 +0000 (17:45 +0000)]
[USBEHCI_NEW]
- 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

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Thu, 28 Apr 2011 16:40:07 +0000 (16:40 +0000)]
[USBEHCI_NEW]
- 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

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Thu, 28 Apr 2011 15:16:33 +0000 (15:16 +0000)]
[USBEHCI_NEW]
- 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

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Thu, 28 Apr 2011 13:13:13 +0000 (13:13 +0000)]
[USBEHCI_NEW]
- 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

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Thu, 28 Apr 2011 12:41:16 +0000 (12:41 +0000)]
[USBEHCI_NEW]
- 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

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Wed, 27 Apr 2011 16:23:42 +0000 (16:23 +0000)]
[USBEHCI_NEW]
- 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

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Sun, 24 Apr 2011 09:26:22 +0000 (09:26 +0000)]
[USBEHCI_NEW]
- Fix build
- Implement retrieving configuration descriptor (USBHI_GetUsbDescriptors)
- Implement function to build a setup packet from urb (taken from mjmartin usbehci driver)

svn path=/branches/usb-bringup/; revision=51443

12 years ago[USBEHCI_NEW]
Johannes Anderwald [Sat, 23 Apr 2011 19:36:23 +0000 (19:36 +0000)]
[USBEHCI_NEW]
- 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

13 years ago[USBEHCI_NEW]
Michael Martin [Wed, 20 Apr 2011 04:30:22 +0000 (04:30 +0000)]
[USBEHCI_NEW]
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

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Tue, 19 Apr 2011 18:35:40 +0000 (18:35 +0000)]
[USBEHCI_NEW]
- 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

13 years ago[USBEHCI_NEW]
Michael Martin [Tue, 19 Apr 2011 15:06:26 +0000 (15:06 +0000)]
[USBEHCI_NEW]
- 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

13 years ago[USBEHCI_NEW]
Michael Martin [Tue, 19 Apr 2011 13:57:32 +0000 (13:57 +0000)]
[USBEHCI_NEW]
- 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

13 years ago[USBEHCI_NEW]
Michael Martin [Tue, 19 Apr 2011 07:36:44 +0000 (07:36 +0000)]
[USBEHCI_NEW]
- Forgotten changes in r51397.

svn path=/branches/usb-bringup/; revision=51398

13 years ago[USBEHCI_NEW]
Michael Martin [Tue, 19 Apr 2011 06:56:30 +0000 (06:56 +0000)]
[USBEHCI_NEW]
- 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

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Tue, 19 Apr 2011 01:21:10 +0000 (01:21 +0000)]
[USBEHCI_NEW]
- Null terminate buffer from IOCTL_USB_GET_ROOT_HUB_NAME, fixes usbview problems
- Implement URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER, IUSBHardware needs more work
- Silence debug traces
- Start implementing IUSBRequest interfaces
- Complete unhandled major irp with status success

svn path=/branches/usb-bringup/; revision=51396

13 years ago[USBEHCI_NEW]
Michael Martin [Mon, 18 Apr 2011 11:34:02 +0000 (11:34 +0000)]
[USBEHCI_NEW]
- Use PQUEUE_HEAD as the Head of pending list  and Async (Active) list vice using PLIST_ENTRY.
- Implement linking/unlinking a QueueHead to these Head QueueHeads.
- Implement chain linking/unlinking of QueueHeads. Thr plan being to used these functions during DMA operations to pull a number of QueueHeads from the pending list to place into the Async list for execution.
- Will look for optimization in these functions later.

svn path=/branches/usb-bringup/; revision=51390

13 years ago[USBEHCI_NEW]
Michael Martin [Mon, 18 Apr 2011 00:06:37 +0000 (00:06 +0000)]
[USBEHCI_NEW]
- Use LIST_ENTRY in QueueHeads and Descriptors vice Next and Previous Pointers.
- Add functions to interface for setting AsyncListRegister and PeriodicListRegister.
- USBHardwareDevice: Initialize USBQueue when handling PNPStart.
- USBQueue: Allocate Common Buffer and use it to Create and Initialize DmaMemoryManager object.
- USBQueue: Implement CreateQueueHead and CreateDescriptor.

svn path=/branches/usb-bringup/; revision=51388

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Sun, 17 Apr 2011 22:38:32 +0000 (22:38 +0000)]
[USBEHCI_NEW]
- Add interface function GetHubControllerSymbolicLink
- Implement IOCTL_USB_GET_ROOT_HUB_NAME for usbview

svn path=/branches/usb-bringup/; revision=51387

13 years ago[USBEHCI_NEW]
Michael Martin [Sun, 17 Apr 2011 22:06:20 +0000 (22:06 +0000)]
[USBEHCI_NEW]
- Update interfaces with new methods needed for UsbHardWare class.
- Remove GetDmaMemoryManager as the DmaMemory will only be needed by UsbQueue class.
- GetDeviceDetails: Only fill in a parameter if its not null.
- Start implementing UsbQueue class.

svn path=/branches/usb-bringup/; revision=51386

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Sun, 17 Apr 2011 21:35:25 +0000 (21:35 +0000)]
[USBEHCI_NEW]
- Implement IRP_MN_QUERY_DEVICE_RELATIONS for hub controller object
- Implement stub handler for URB_FUNCTION_CLASS_OTHER, URB_FUNCTION_SELECT_CONFIGURATION
- Partly implement URB_FUNCTION_GET_STATUS_FROM_DEVICE
- Return success from unimplemented USBHI_Initialize20Hub routine
- based on mjmartin usbehci driver
- Tested in Windows XP SP2

svn path=/branches/usb-bringup/; revision=51385

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Sun, 17 Apr 2011 19:23:13 +0000 (19:23 +0000)]
[USBEHCI_NEW]
- Setup a default device descriptor for the root hub and initialize it with vendor & product id
- Partly implement URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE, URB_FUNCTION_CLASS_DEVICE
- based on mjmartin usbehci

svn path=/branches/usb-bringup/; revision=51384

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Sun, 17 Apr 2011 08:20:40 +0000 (08:20 +0000)]
[USBEHCI_NEW]
- Fix bug in CDMAMemoryManager initialization, which calculated the bitmap length wrong
- Create interface IUSBDevice, which will be used to abstract connected usb devices
- Implement support functions for the device interface.
- Implement USBHI_CreateUsbDevice, USBHI_InitializeUsbDevice, USBHI_GetUsbDescriptors, USBHI_RemoveUsbDevice, USBHI_GetExtendedHubInformation, USBHI_RootHubInitNotification, USBHI_SetDeviceHandleData, USBDI_GetUSBDIVersion, USBDI_IsDeviceHighSpeed
- Partly implement USBHI_QueryDeviceInformation
- Based on mjmartin usbehci

svn path=/branches/usb-bringup/; revision=51372

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Sat, 16 Apr 2011 12:26:06 +0000 (12:26 +0000)]
[USBEHCI_NEW]
- Implement IDMAMemoryManager interface, with IDMAMemoryManager::Allocate, IDMAMemoryManager::Free
- Fix interface of IDMAMemoryManager
- Will be used by IUSBHardwareDevice

svn path=/branches/usb-bringup/; revision=51369

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Sat, 16 Apr 2011 09:47:43 +0000 (09:47 +0000)]
[USBEHCI_NEW]
- Add reference count when the hub controller is created. Necessary to prevent the controller from getting deleted when the hub driver performs interface reference removes
- Implement IRP_MN_QUERY_ID, based on mjmartin ehci driver
- Fix bug in IRP_MN_QUERY_BUS_INFORMATION, it is supposed to return a PNP_BUS_INFORMATION not a simple guid
- Implement IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE, IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO, IOCTL_INTERNAL_USB_GET_HUB_COUNT based on mjmartin ehci driver
- Add interfaces for communicating with the hub driver
- Dispatch internal device requests not wmi requests (EHCI_Dispatch)

svn path=/branches/usb-bringup/; revision=51368

13 years ago[USBEHCI_NEW]
Michael Martin [Sat, 16 Apr 2011 06:59:45 +0000 (06:59 +0000)]
[USBEHCI_NEW]
- Change VendorId and DeviceId to the same size as PciConfig members, PUSHORT.
- Add support function GetBusInterface.
- Implement GetDeviceDetails and ResetPort.

svn path=/branches/usb-bringup/; revision=51367

13 years ago[USBEHCI_NEW]
Michael Martin [Sat, 16 Apr 2011 05:55:02 +0000 (05:55 +0000)]
[USBEHCI_NEW]
- Add flags for Port Status Control Register and remove structiures for Port Status Control Register.
- Remove USB Status Register and use the flags instead.
- Remove functions that are not used and never will be.
- Implement InterruptServiceRoutine and Deffered Procedure Routine.
- Partially implement port status change to detect device insert and removal.

svn path=/branches/usb-bringup/; revision=51366

13 years ago[USBEHCI_NEW]
Michael Martin [Sat, 16 Apr 2011 02:20:23 +0000 (02:20 +0000)]
[USBEHCI_NEW]
- Add flags and structures needed for communicating with controller and handling schedules.
- Add support routines for modifying operational registers on controller.
- Implement getting the controller capabilties, starting and stopping the controller.

svn path=/branches/usb-bringup/; revision=51365

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Fri, 15 Apr 2011 17:57:24 +0000 (17:57 +0000)]
[USBEHCI_NEW]
- Create Interface IDispatchIrp which is used to handle ioctl requests
- Partly implement IHubController interface

svn path=/branches/usb-bringup/; revision=51355

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Fri, 15 Apr 2011 15:45:09 +0000 (15:45 +0000)]
[USBEHCI_NEW]
- Define tag for allocations
- Fixes assert hit in ReactOS
- Fix typo in IHubController interface declaration

svn path=/branches/usb-bringup/; revision=51353

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Fri, 15 Apr 2011 14:58:50 +0000 (14:58 +0000)]
[USBEHCI_NEW]
- Fix IOCTL_GET_HCD_DRIVERKEY_NAME implementation
- Now needs IOCTL_USB_GET_ROOT_HUB_NAME to get further in usbview
- Tested in Windows XP SP2

svn path=/branches/usb-bringup/; revision=51350

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Fri, 15 Apr 2011 14:13:24 +0000 (14:13 +0000)]
[USBEHCI_NEW]
- Build fix #1 for mingw
- Define cxa_pure_virtual which is required that gcc is aware that it should really use the libc++ instead of falling back to libc

svn path=/branches/usb-bringup/; revision=51348

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Thu, 14 Apr 2011 16:42:02 +0000 (16:42 +0000)]
[USBEHCI_NEW]
- Implement CHCDController::Initialize, CHCDController::HandlePnp for PDO / FDO,
- Partly implement CHCDController::HandleDeviceControl
- Based on mjmartin usbehci sources
- Driver now startups and acquires pnp resources
- Fails in HandleDeviceControl with IOCTL_GET_HCD_DRIVERKEY_NAME when usbview is launched
- Tested in Windows XP SP2 + Vmware Server 2.0.2

svn path=/branches/usb-bringup/; revision=51343

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Thu, 14 Apr 2011 13:03:01 +0000 (13:03 +0000)]
[USBEHCI_NEW]
- Fix build breakage from 51341

svn path=/branches/usb-bringup/; revision=51342

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Thu, 14 Apr 2011 12:55:41 +0000 (12:55 +0000)]
[USBEHCI_NEW]
- Implement CUSBHardwareDevice::Initialize, CUSBHardwareDevice::AcquireDeviceLock, CUSBHardwareDevice::ReleaseDeviceLock
- Partly implement CUSBHardwareDevice::PnpStart
- Code from CUSBHardwareDevice::PnpStart was taken from mjmartin usbehci implementation

svn path=/branches/usb-bringup/; revision=51341

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Thu, 14 Apr 2011 11:58:07 +0000 (11:58 +0000)]
[USBEHCI_NEW]
- Implement stubs for classes CHCDController and CUSBHardwareDevice
- Implement CreateHCDController, CreateUSBHardware
- Implement CUSBHardwareDevice::QueryInterface, CUSBHardwareDevice::AddRef, CUSBHardwareDevice::Release
- Implement CHCDController::AddRef, CHCDController::Release, CHCDController::QueryInterface

svn path=/branches/usb-bringup/; revision=51337

13 years ago[USBEHCI_NEW]
Johannes Anderwald [Thu, 14 Apr 2011 11:35:16 +0000 (11:35 +0000)]
[USBEHCI_NEW]
- Create empty USB EHCI driver in c++
- Design & review the interfaces with mjmartin
- Create stubs for creating IUSBHardwareDevice / IHCDController classes
- Implement DriverEntry, EHCI_AddDevice and EHCI_Dispatch

svn path=/branches/usb-bringup/; revision=51335

13 years ago[CMAKE]
Amine Khaldi [Wed, 13 Apr 2011 08:39:17 +0000 (08:39 +0000)]
[CMAKE]
* Sync with trunk r51323.

svn path=/branches/cmake-bringup/; revision=51329

13 years ago[USBEHCI]
Johannes Anderwald [Wed, 13 Apr 2011 01:37:14 +0000 (01:37 +0000)]
[USBEHCI]
- Re-implement DMA buffer routines. It is now faster and consumes less memory overhead per allocated memory block.
- IoGetDeviceProperty needs a PDO
- Add few comments
- No need to clear buffer twice in CreateQueueHead / CreateDescriptor

svn path=/branches/cmake-bringup/; revision=51324

13 years ago[shell32]
Giannis Adamopoulos [Tue, 12 Apr 2011 20:59:50 +0000 (20:59 +0000)]
[shell32]
- Properly arrange icons in explorer shell view window. This also fixes navigating in files with keyboard arrows

svn path=/trunk/; revision=51323

13 years ago[SHELL32]
Rafal Harabien [Tue, 12 Apr 2011 18:45:06 +0000 (18:45 +0000)]
[SHELL32]
* Return 1 in WM_ERASEBKGND when desktop is painted
* Fix background for desktop icons and their labels
* Moreover fixes explorer_new background

svn path=/trunk/; revision=51322

13 years ago[COMCTL32]
Rafal Harabien [Tue, 12 Apr 2011 18:38:38 +0000 (18:38 +0000)]
[COMCTL32]
* Sync listview to Wine 1.3.17
* Set background and text color before calling DrawFocusRect. Those colors are used by monochrome brush during painting. Tested this function in Windows and our implementation is correct. Wine has DrawFocusRect not correctly implemented and that's why they don't see this bug. Should be sent to wine (tm).

svn path=/trunk/; revision=51321

13 years ago[NPFS]
Eric Kohl [Mon, 11 Apr 2011 17:52:06 +0000 (17:52 +0000)]
[NPFS]
PATCH: Arty's fixes based on CMake branch testing. Just the NPFS code.
See issue #6103 for more details.

svn path=/trunk/; revision=51320