diff options
| author | Michael Sevakis <jethead71@rockbox.org> | 2009-01-13 16:27:35 +0000 |
|---|---|---|
| committer | Michael Sevakis <jethead71@rockbox.org> | 2009-01-13 16:27:35 +0000 |
| commit | 6da8b4eb4925f167588c868a64d2d057ca3bf85f (patch) | |
| tree | 1441169e97f7ece3422a49e51dc512c8be0b31ae /firmware/usbstack/usb_storage.c | |
| parent | 30414d56c9f8b4fc35ac2918c4d22e5e2ded0eb6 (diff) | |
| download | rockbox-6da8b4eb4925f167588c868a64d2d057ca3bf85f.zip rockbox-6da8b4eb4925f167588c868a64d2d057ca3bf85f.tar.gz rockbox-6da8b4eb4925f167588c868a64d2d057ca3bf85f.tar.bz2 rockbox-6da8b4eb4925f167588c868a64d2d057ca3bf85f.tar.xz | |
USB retweaking: Take out the USB_REQUEST/RELEASE_DISK scheme and simply ask the USB core whether or not any drivers require exclusive access at the moment of connect. Doing anthing else just produces nasty effects on Windows because it expects some communication just for enabling the PHY and not allowing it to mount volumes if a thread doesn't ack causes annoying error message boxes. Make behavior of each USB type identical from the system perspective. Some miscellaneous changes (simplify, ata->storage naming, define only used USB_* enums values were possible).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19762 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/usbstack/usb_storage.c')
| -rw-r--r-- | firmware/usbstack/usb_storage.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c index 8a49151..a70681d 100644 --- a/firmware/usbstack/usb_storage.c +++ b/firmware/usbstack/usb_storage.c @@ -293,6 +293,7 @@ static bool check_disk_present(IF_MV_NONVOID(int volume)) #endif } +#if 0 static void try_release_ata(void) { /* Check if there is a connected drive left. If not, @@ -310,6 +311,7 @@ static void try_release_ata(void) usb_release_exclusive_ata(); } } +#endif #ifdef HAVE_HOTSWAP void usb_storage_notify_hotswap(int volume,bool inserted) @@ -320,9 +322,7 @@ void usb_storage_notify_hotswap(int volume,bool inserted) } else { ejected[volume] = true; - try_release_ata(); } - } #endif @@ -334,7 +334,6 @@ void usb_storage_reconnect(void) for(i=0;i<NUM_VOLUMES;i++) ejected[i] = !check_disk_present(IF_MV(i)); logf("%s", __func__); - usb_request_exclusive_ata(); } } @@ -682,7 +681,6 @@ static void handle_scsi(struct command_block_wrapper* cbw) #ifdef HAVE_HOTSWAP if(storage_removable(lun) && !storage_present(lun)) { ejected[lun] = true; - try_release_ata(); } #endif @@ -699,7 +697,7 @@ static void handle_scsi(struct command_block_wrapper* cbw) switch (cbw->command_block[0]) { case SCSI_TEST_UNIT_READY: logf("scsi test_unit_ready %d",lun); - if(!usb_exclusive_ata()) { + if(!usb_exclusive_storage()) { send_csw(UMS_STATUS_FAIL); cur_sense_data.sense_key=SENSE_NOT_READY; cur_sense_data.asc=ASC_MEDIUM_NOT_PRESENT; @@ -885,7 +883,6 @@ static void handle_scsi(struct command_block_wrapper* cbw) { logf("scsi eject"); ejected[lun]=true; - try_release_ata(); } } } |