Commit graph

62 commits

Author SHA1 Message Date
Johannes Anderwald 3a5a6bf017 [USBSTOR]
- Read Capacity cmd length is 10 bytes

svn path=/branches/usb-bringup-trunk/; revision=55531
2012-02-10 21:42:42 +00:00
Johannes Anderwald cf494ea401 [HIDCLASS]
- Check if attaching to device stack failed. In that case fail the request
[HIDUSB]
- Always set SupriseRemovalOk
[USBCCGP] [HIDCLASS] [USBHUB] [USBSTOR]
- Check if the pdo is still in the pdo list. Only call IoDeleteDevice in that case

svn path=/branches/usb-bringup-trunk/; revision=55429
2012-02-05 15:36:00 +00:00
Cameron Gutman e7484d185a [PCI][HIDCLASS][HIDUSB][KBDHID][MOUHID][USBCCGP][USBOHCI][USBEHCI][USBHUB][USBSTOR]
- Handle query remove IRPs
- Fix some other removal bugs

svn path=/branches/usb-bringup-trunk/; revision=55399
2012-02-03 22:59:53 +00:00
Johannes Anderwald 59de50814d [USBSTOR]
- Add sanity checks
- Check if device needs CDB padding and return error in that case

svn path=/branches/usb-bringup-trunk/; revision=55381
2012-02-02 19:37:38 +00:00
Cameron Gutman f53d09f118 [USBSTOR]
- Add forgotten event initialization from last usbstor commit

svn path=/branches/usb-bringup-trunk/; revision=55352
2012-01-31 15:59:59 +00:00
Cameron Gutman 823a29d5e3 [USBSTOR]
- Fix handling of SRB_FUNCTION_FLUSH and SRB_FUNCTION_SHUTDOWN to prevent data loss

svn path=/branches/usb-bringup-trunk/; revision=55350
2012-01-31 15:33:32 +00:00
Cameron Gutman 2b79f855e1 [USBSTOR]
- Handle SRB_FUNCTION_SHUTDOWN successfully (failing it results in a stack overflow due to a bug in disk.sys)
- Fixes the crash during shutdown after using a USB drive

svn path=/branches/usb-bringup-trunk/; revision=55315
2012-01-30 04:18:59 +00:00
Cameron Gutman bc7a50b969 [USBSTOR]
- Set the correct transfer direction value in the CBW
- Fixes the infamous system hang that occurred when writing to a USB drive

svn path=/branches/usb-bringup-trunk/; revision=55223
2012-01-26 20:02:42 +00:00
Cameron Gutman 38758cfacb [USBSTOR]
- USBD_SHORT_TRANSFER_OK is only a valid flag if USBD_TRANSFER_DIRECTION_IN is also set 

svn path=/branches/usb-bringup-trunk/; revision=55222
2012-01-26 19:30:46 +00:00
Cameron Gutman 75676e7e49 [USBSTOR]
- Use the correct USBD_TRANSFER_DIRECTION value for write operations

svn path=/branches/usb-bringup-trunk/; revision=55169
2012-01-25 06:09:24 +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 6fab1a7c6a [USBSTOR]
- Fix a bug in SRB queuing

svn path=/branches/usb-bringup-trunk/; revision=55166
2012-01-25 01:46:35 +00:00
Cameron Gutman e3d0e34a18 [USBSTOR]
- Get the actual value for the removable media bit instead of hardcoding it to true

svn path=/branches/usb-bringup-trunk/; revision=55165
2012-01-25 01:09:59 +00:00
Cameron Gutman 131dbc69a7 [USBSTOR]
- Don't lie about removable media support for anything except hard drives

svn path=/branches/usb-bringup-trunk/; revision=55160
2012-01-25 00:03:18 +00:00
Cameron Gutman 11e87a17ea [USBSTOR]
- Rewrite pending SRB handling and change some behavior of the IRP queue
- The caller is no longer responsible for checking whether it can call USBSTOR_QueueNextRequest; frozen IRP queue and pending SRB are both handled for them
- It's no longer required for the caller of USBSTOR_QueueTerminateRequest to know whether the SRB was active (which was impossible before when handling a cancellation)
- Many potential race issues with IRP cancellation are eliminated
- Debugging hung SRBs is much easier now that pointer to the active one is stored in the FDO

svn path=/branches/usb-bringup-trunk/; revision=55157
2012-01-24 23:04:31 +00:00
Cameron Gutman 2f5db208de [USBSTOR]
- Fix broken IRP error handling and leaking memory

svn path=/branches/usb-bringup-trunk/; revision=55155
2012-01-24 22:28:44 +00:00
Cameron Gutman a65fd45042 [USBSTOR]
- Release the spinlock before returning (accidentally removed)

svn path=/branches/usb-bringup-trunk/; revision=55152
2012-01-24 21:33:51 +00:00
Cameron Gutman 94f1525447 [USBSTOR]
- Fix cancellation for IRPs that have already been dispatched for processing by IoStartNextPacket
- Don't complete IRPs with the IRP list lock held
- Clear the cancel routine before completing the IRP

svn path=/branches/usb-bringup-trunk/; revision=55138
2012-01-24 04:39:09 +00:00
Johannes Anderwald 33e7325e17 [USBSTOR]
- Silent traces

svn path=/branches/usb-bringup-trunk/; revision=55118
2012-01-23 16:22:33 +00:00
Johannes Anderwald 99926db97d [USBSTOR]
- Fix attempt #2  the offset bug
- fix identation

svn path=/branches/usb-bringup-trunk/; revision=55089
2012-01-23 02:58:52 +00:00
Johannes Anderwald 8baf90438a [USBSTOR]
- Fix bug in usbstor, which did not take the offset into account

svn path=/branches/usb-bringup-trunk/; revision=55088
2012-01-23 02:49:40 +00:00
Cameron Gutman 3de4023a19 [USB-BRINGUP-TRUNK]
- Fix a broken check that resulted in freeing the same device object twice
- Enable the IoDetachDevice call in usbstor now that the kernel bug is fixed

svn path=/branches/usb-bringup-trunk/; revision=55086
2012-01-23 00:39:28 +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
Johannes Anderwald b4a6fc90da [USBSTOR]
- Implement legacy IOCTL IOCTL_SCSI_GET_CAPABILITIES,  IOCTL_SCSI_GET_INQUIRY_DATA, IOCTL_SCSI_GET_ADDRESS
- Patch by Cameron Gutman and minor modifications

svn path=/branches/usb-bringup-trunk/; revision=55075
2012-01-22 16:39:53 +00:00
Cameron Gutman 336d055fa8 [USB-BRINGUP-TRUNK]
- Fix a BSOD during usbstor device initialization
- Enable usbstor in 1st stage

svn path=/branches/usb-bringup-trunk/; revision=55036
2012-01-21 00:31:09 +00:00
Cameron Gutman 9035fcb4a7 [USB-BRINGUP-TRUNK]
- Fix uninitialized variable use and more build errors

svn path=/branches/usb-bringup-trunk/; revision=55027
2012-01-20 22:35:52 +00:00
Cameron Gutman 3a034047fc [USB-BRINGUP-TRUNK]
- Add USB stuff to 1st stage setup

svn path=/branches/usb-bringup-trunk/; revision=55024
2012-01-20 22:04:57 +00:00
Cameron Gutman f5223ccf13 [USB-BRINGUP-TRUNK]
- Remove outdated cmake attribute

svn path=/branches/usb-bringup-trunk/; revision=55021
2012-01-20 21:28:33 +00:00
Cameron Gutman 6e24a0c6a8 [USB-BRINGUP-TRUNK]
- Merge 51335-53500

svn path=/branches/usb-bringup-trunk/; revision=55019
2012-01-20 21:07:56 +00:00
Cameron Gutman c2d0d784c7 [USB-BRINGUP-TRUNK]
- Create a branch to do a proper merge of USB work from a trunk base instead of from cmake-bringup
- In the future, DO NOT under any circumstances branch another branch. This leads to merge problems!

svn path=/branches/usb-bringup-trunk/; revision=55018
2012-01-20 20:58:46 +00:00
Cameron Gutman b8d27ea0ac [USBSTOR]
- Fix a typo so SRB_FUNCTION_RELEASE_DEVICE actually does what was intended

svn path=/branches/usb-bringup/; revision=52072
2011-06-03 05:43:41 +00:00
Cameron Gutman 392e4b95be [USBSTOR]
- Don't leave DISPATCH_LEVEL while holding a spin lock acquired at DISPATCH_LEVEL
- Synchronize cancellation checking by acquiring the cancel spin lock

svn path=/branches/usb-bringup/; revision=52071
2011-06-03 05:38:27 +00:00
Johannes Anderwald 0dede89665 [USBSTOR]
- Comment out getting usb device interface. It is currently unused and usbhub does not yet support it
- Forward pnp capabilities request to lower device object
- Fix compilation by Usurp

svn path=/branches/usb-bringup/; revision=52063
2011-06-02 15:35:04 +00:00
Johannes Anderwald da9d8082b0 [USBSTOR]
- Remove superflous declaration
- Fix bug when quering for compatible ids
- Remove unused local variable

svn path=/branches/usb-bringup/; revision=52038
2011-06-01 11:31:34 +00:00
Michael Martin ff208f7adb [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
2011-05-17 11:26:25 +00:00
Johannes Anderwald a5d0b5fdef [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
2011-05-15 17:57:02 +00:00
Johannes Anderwald e9a0c8ba68 [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
2011-05-15 14:59:16 +00:00
Johannes Anderwald 793e8870ca [USBSTOR]
- Fix one more warning

svn path=/branches/usb-bringup/; revision=51760
2011-05-15 12:49:17 +00:00
Johannes Anderwald 5c5f758afa [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
2011-05-15 12:47:54 +00:00
Michael Martin e5f521c90a [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
2011-05-15 11:23:16 +00:00
Michael Martin f1ec4fbe16 [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
2011-05-15 08:23:32 +00:00
Johannes Anderwald be12088a55 [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
2011-05-14 18:09:00 +00:00
Johannes Anderwald 3f8c058a07 [USBSTOR]
- Start implementing write command
- Disabled for now as it causes corruptions

svn path=/branches/usb-bringup/; revision=51695
2011-05-13 14:44:24 +00:00
Johannes Anderwald 89aa9d3264 [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
2011-05-13 14:04:38 +00:00
Johannes Anderwald eb228159bc [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
2011-05-13 13:37:50 +00:00
Michael Martin 98ed611448 [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
2011-05-13 09:14:28 +00:00
Johannes Anderwald b0b03bfdd1 [USBSTOR]
- Rewrite scsi method to act asynchronous

svn path=/branches/usb-bringup/; revision=51673
2011-05-11 03:49:15 +00:00
Johannes Anderwald fc298e51a5 [USBSTOR]
- Partly implement test unit command

svn path=/branches/usb-bringup/; revision=51671
2011-05-10 23:26:56 +00:00
Johannes Anderwald fc34f0177d [USBSTOR]
- Start implementing SCSI read

svn path=/branches/usb-bringup/; revision=51654
2011-05-08 22:18:55 +00:00
Johannes Anderwald 45f27e8b8c [USBEHCI_NEW]
- Fix retrieving drive capacity
- Fix ufi command structures

svn path=/branches/usb-bringup/; revision=51649
2011-05-08 19:33:41 +00:00