Commit graph

29 commits

Author SHA1 Message Date
Johannes Anderwald 4cbccecd5c [USBOHCI]
- Check if the transfer descriptors reported errors and propagate the error in the urb status field
- OHCI now reports error which the class driver are handling
- Allocate device descriptor from non paged pool to prevent possible alignment problems
- Fix checking of completed transfer descriptors
- Fix double freeing of descriptors
- Cleanup endpoints when the halted bit is set by the host controllers
- Check for the endpoint direction in the data descriptor
- Setup descriptor needs buffer rounding set

svn path=/branches/usb-bringup-trunk/; revision=55389
2012-02-03 09:52:29 +00:00
Cameron Gutman 087dfd04c9 [USBOHCI]
- Fix device enumeration on boot

svn path=/branches/usb-bringup-trunk/; revision=55380
2012-02-02 18:29:30 +00:00
Cameron Gutman 5ab8673f32 [USBEHCI][USBOHCI]
- Wait 100 milliseconds for the port power and insertion to stabilize
- Wait for the 10 millisecond "recovery" period after reset

svn path=/branches/usb-bringup-trunk/; revision=55367
2012-02-01 12:16:47 +00:00
Cameron Gutman 9b540bf8a8 [USBOHCI]
- Attempt to fix reset race conditions

svn path=/branches/usb-bringup-trunk/; revision=55231
2012-01-27 05:20:37 +00:00
Cameron Gutman b4c6fa3b4c [USBOHCI]
- Wait the required time for the port to be ready after powering it up

svn path=/branches/usb-bringup-trunk/; revision=55196
2012-01-26 04:35:04 +00:00
Cameron Gutman c60ff01cc6 [USBOHCI]
- Properly dismiss the enable status changed interrupt to avoid an interrupt storm after a device is disconnected

svn path=/branches/usb-bringup-trunk/; revision=55189
2012-01-26 01:46:06 +00:00
Cameron Gutman 23f71216c4 [USBOHCI]
- Fix and enable the proper GetPortStatus implementation
- Remove the old hacked cached port status mess

svn path=/branches/usb-bringup-trunk/; revision=55185
2012-01-25 23:56:29 +00:00
Johannes Anderwald 84e941632b [USBOHCI]
- Disable GetPortStatus implementation
- Fix build

svn path=/branches/usb-bringup-trunk/; revision=55182
2012-01-25 19:56:35 +00:00
Cameron Gutman 25d8cf82c9 [USBOHCI]
- Fix StartController() to perform initialization according to OHCI spec
- Fixes the infamous OHCI initialization hang on real hardware

svn path=/branches/usb-bringup-trunk/; revision=55181
2012-01-25 19:46:44 +00:00
Johannes Anderwald 219fac4641 [USBOHCI]
- Add alignment check

svn path=/branches/usb-bringup-trunk/; revision=55176
2012-01-25 18:56:56 +00:00
Johannes Anderwald 58dab5a63b [USBOHCI]
- No need to turn off interrupts 
- Check if bios is active
- Check for timeouts when resetting host controller

svn path=/branches/usb-bringup-trunk/; revision=55171
2012-01-25 09:50:04 +00:00
Cameron Gutman 6c55f96de8 [USBOHCI]
- Don't turn off interrupts before setting the OHCI_OWNERSHIP_CHANGE_REQUEST bit because it prevents the SMM driver from receiving the interrupt that tells it to give up ownership of the host controller
- This fix should be merged to Haiku also which has the same bug

svn path=/branches/usb-bringup-trunk/; revision=55170
2012-01-25 06:35:00 +00:00
Johannes Anderwald a0dc4083ad [USBSTOR]
- Add debug trace
[USBOHCI]
- Implement proper GetPortStatus
[USBHUB]
- Reset all connected ports before sending first SCE
- USB Devices present before booting are now detected with OHCI controller. EHCI code is present but not yet activated

svn path=/branches/usb-bringup-trunk/; revision=55167
2012-01-25 03:39:57 +00:00
Cameron Gutman d55c9c5101 [USB-BRINGUP-TRUNK]
- Restore the frame interval register after a reset as per OHCI spec

svn path=/branches/usb-bringup-trunk/; revision=55112
2012-01-23 15:53:25 +00:00
Cameron Gutman 437353f8cd [USB-BRINGUP-TRUNK]
- Compute the frame interval correctly
- Fixes a deadlock on real hardware after enabling interrupts

svn path=/branches/usb-bringup-trunk/; revision=55094
2012-01-23 10:10:51 +00:00
Johannes Anderwald 7ec08a5b86 [USBOHCI]
- Implement interrupt routing

svn path=/branches/usb-bringup-trunk/; revision=55085
2012-01-23 00:36:00 +00:00
Cameron Gutman a1bb133fae [USB-BRINGUP-TRUNK]
- 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
2012-01-22 21:58:06 +00:00
Cameron Gutman d8d06f0903 [USB-BRINGUP-TRUNK]
- Fix usbohci build

svn path=/branches/usb-bringup-trunk/; revision=55032
2012-01-20 23:19:18 +00:00
Johannes Anderwald 7e231e2c92 [USBOHCI]
- Silence a few traces
- Add a hack for handling  URB_FUNCTION_CLASS_INTERFACE. The hid bus driver performs this request with zero buffer length, which is not valid. Needs more investigation

svn path=/branches/usb-bringup/; revision=54777
2011-12-29 10:13:36 +00:00
Johannes Anderwald f73caa061d [USBOHCI]
- More traces to fix isochronous problem
- Fix broken assert found by mjmartin

svn path=/branches/usb-bringup/; revision=52004
2011-05-30 06:55:32 +00:00
Johannes Anderwald 2231c8333a [USBOHCI]
- Implement function to retrieve isochronous head endpoint descriptor
- Implement function to retrieve current frame number
- Set isochronous descriptor flag for head endpoint
- Implement retrieve device status for devices
- Implement retrieve class status from device
- Partly implement isochronous descriptor handling in usb queue
- Start implementing isochronous transfers in ISUBRequest
- Code currently not tested as the Virtual Machine with XP + ReactOS usbohci driver brings down the host system when starting the iso transfers. Ironically it crashes in MS usbohci driver


svn path=/branches/usb-bringup/; revision=51957
2011-05-27 13:04:55 +00:00
Johannes Anderwald 9aff3e967c [USBOHCI]
- Set up periodic threshold (90 %)
- Add function to retrieve interrupt endpoints
- Add function to retrieve specific descriptors from interface. These are used by HID devices such as mice / keyboards
- Add function to retrieve interrupt interval
- Enqueue all endpoint descriptors at the end of the associated queue
- Only notify hardware of insertion when it is an bulk / control request
- Scan interrupt endpoint list to find the completed transfer descriptor
- Add debugging function to print out linked endpoint descriptors
- Interrupt transfers are now implemented. 
- Tested in Windows XP SP3 + Vbox 4.04 + Microsoft 5-Button Mouse. The HID mouse installs, initializes and starts up. Unfortunately the mouse does not work as expected yet

svn path=/branches/usb-bringup/; revision=51922
2011-05-26 12:37:18 +00:00
Johannes Anderwald 667b425b6c [USBOHCI]
- Remove dead code
- Silence traces
- Pass status & DoneHead as parameters to dpc routine
- Move IUSBRequest cleanup code into new function and use it for bulk / control transfer cleanup
- Fix bugs in AllocateEndpointDescriptor. It did not take the device address into account. It also did not respect the direction of the descriptor
- Implement support for bulk transfer requests
- Handle irp completion in CompletionCallback
- Tested in Windows XP SP3 + Vbox 4.04 + USB2.0 disabled + ReactOS usbstor + USB mass storage device
- OHCI Mass storage support is now also ready
- Next interrupt transfers

svn path=/branches/usb-bringup/; revision=51917
2011-05-26 02:15:11 +00:00
Johannes Anderwald e24bfbfa91 [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
2011-05-24 17:57:00 +00:00
Johannes Anderwald b275073474 [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
2011-05-24 12:51:03 +00:00
Johannes Anderwald f75cb3d51d [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
2011-05-23 17:42:52 +00:00
Johannes Anderwald c5acda628c [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
2011-05-23 11:29:55 +00:00
Johannes Anderwald 89d52d98bb [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
2011-05-22 20:48:50 +00:00
Johannes Anderwald d4c4a2e080 [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
2011-05-22 19:36:13 +00:00