Commit graph

92 commits

Author SHA1 Message Date
Frank Gevaerts
7a73a9cd4e don't start waiting for the new command in send_csw(). Although on the USB level this is entirely correct, and about 10% to 15% faster, usb_storage_transfer_complete() could get slightly confused by this.
The proper fix is obviously to make usb_storage_transfer_complete() not get confused, but that's a lot more work, and I prefer things to be correct to them being a bit faster right now


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24333 a1c6a512-1295-4272-9138-f99709370657
2010-01-25 22:33:53 +00:00
Andree Buschmann
bfc129a592 Fix even more tabs
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24155 a1c6a512-1295-4272-9138-f99709370657
2010-01-03 10:35:31 +00:00
Bertrik Sikken
799a0a5cd4 Simplify some boolean expressions that compare directly against 'true'
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24144 a1c6a512-1295-4272-9138-f99709370657
2010-01-02 16:03:30 +00:00
Jeffrey Goode
9d842683eb Comment out LOGF_ENABLE defines everywhere, replace evil comments
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23497 a1c6a512-1295-4272-9138-f99709370657
2009-11-03 16:25:03 +00:00
Michael Sparmann
d03fe64dcf iPod Nano 2G USB support based on the S3C6400X datasheet. Disabled by default for now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23285 a1c6a512-1295-4272-9138-f99709370657
2009-10-20 06:37:07 +00:00
Frank Gevaerts
bad510ad10 Change control handling to start expecting host packets before sending data to the host. This makes the handling less timing sensitive on some controllers
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23263 a1c6a512-1295-4272-9138-f99709370657
2009-10-19 16:21:50 +00:00
Frank Gevaerts
7d11b7ac03 get rid of one hardcoded 512. SECTOR_SIZE is still there. It should probably move up (to storage.h?) so fat and usb storage can share it
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22869 a1c6a512-1295-4272-9138-f99709370657
2009-10-01 20:33:52 +00:00
Frank Gevaerts
ceccec503e Move yearday_to_daymonth() to usb_storage.c. It's the only user, this function is pretty specific, and it seems to be the cleanest way to avoid ram usage increases for unrelated targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22259 a1c6a512-1295-4272-9138-f99709370657
2009-08-11 20:03:59 +00:00
Frank Gevaerts
2dc50471ca Consolidate day of week calculation
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22258 a1c6a512-1295-4272-9138-f99709370657
2009-08-11 19:30:19 +00:00
Frank Gevaerts
61cf783371 Fix "statement with no effect" warning
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22256 a1c6a512-1295-4272-9138-f99709370657
2009-08-11 18:07:14 +00:00
Frank Gevaerts
ed73a3274c Add support for setting the clock using a special SCSI command. This is the same method that itunes uses, and there are host-side tools for it (e.g. libgpod)
Flyspray: FS#10514
Author: Laurent Papier and myself



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22255 a1c6a512-1295-4272-9138-f99709370657
2009-08-11 17:54:47 +00:00
Frank Gevaerts
c0a5a67387 Commit FS#9545, storage cleanup and multi-driver support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21933 a1c6a512-1295-4272-9138-f99709370657
2009-07-17 22:28:49 +00:00
Frank Gevaerts
057a5802cd ignore write data if the length doesn't match what we expect. This avoids the data corruption caused by FS#10319, but doesn't solve the root cause yet (patch by Martin Ritter)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21521 a1c6a512-1295-4272-9138-f99709370657
2009-06-26 15:14:49 +00:00
Frank Gevaerts
c61a75173b Reorganise USB stack defines. Now config.h decides which class drivers get enabled instead of usb_core.h
Also enable HID, and use that as the dummy class instead of charging-only for controllers that have working interrupt transfers.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21053 a1c6a512-1295-4272-9138-f99709370657
2009-05-23 14:30:20 +00:00
Frank Gevaerts
fba4be213f Don't force double-buffering for sd devices. They apparently are not faster with it, ans possibly actually slower
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20999 a1c6a512-1295-4272-9138-f99709370657
2009-05-20 16:57:17 +00:00
Frank Gevaerts
792a7a6086 Use different read and write buffer sizes. Due to interaction between common transfer sizes used by most OSes (64k) and the double-buffering system we use for writes, writes need a smaller buffer to make sure that USB and disk I/O can overlap.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20988 a1c6a512-1295-4272-9138-f99709370657
2009-05-19 18:51:03 +00:00
Frank Gevaerts
c8d6a02c5a Speed up USB storage by being a bit smarter in ordering transfer setups
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20982 a1c6a512-1295-4272-9138-f99709370657
2009-05-18 19:45:24 +00:00
Frank Gevaerts
69a4117c1d Add working USB HID driver, by Tomer Shalev (part of his GSoC work).
This needs support for usb interrupt transfers, so there are some changes in various USB drivers as well (only usb-drv-arc supports it at this point, others won't have working HID yet).

HID is disabled for now, as the apps/ part is not included yet.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20962 a1c6a512-1295-4272-9138-f99709370657
2009-05-16 15:30:09 +00:00
Frank Gevaerts
685cee87be fix send_command_result() size checking for the SCSI_REQUEST_SENSE case (thanks to Tomer Shalev, FS#10203)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20914 a1c6a512-1295-4272-9138-f99709370657
2009-05-11 23:00:56 +00:00
Frank Gevaerts
00b407b04f USB related Cosmetics, whitespace and readability fixes (FS#10147 by Tomer Shalev)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20737 a1c6a512-1295-4272-9138-f99709370657
2009-04-18 21:32:41 +00:00
Frank Gevaerts
3314f389ba Allow class drivers to reuse the core data buffer for control transfers. This doesn't make much difference right now, but it should keep HID memory usage lower (once HID is ready) (FS#10146 by Tomer Shalev)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20735 a1c6a512-1295-4272-9138-f99709370657
2009-04-18 20:40:50 +00:00
Frank Gevaerts
ab09322b7a Add a PACK_DESCRIPTOR macro to make the class drivers a bit more readable (FS#10145 by Tomer Shalev)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20733 a1c6a512-1295-4272-9138-f99709370657
2009-04-18 20:04:52 +00:00
Maurus Cuelenaere
697869e892 Revert r20617 for now
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20624 a1c6a512-1295-4272-9138-f99709370657
2009-04-05 13:11:38 +00:00
Maurus Cuelenaere
b4f6b259ef Don't leave LOGF_ENABLE enabled...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20619 a1c6a512-1295-4272-9138-f99709370657
2009-04-04 20:58:39 +00:00
Maurus Cuelenaere
2ca376cce8 Use the audio buffer in USB storage for ISP1583-having targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20617 a1c6a512-1295-4272-9138-f99709370657
2009-04-04 18:16:36 +00:00
Frank Gevaerts
0ece30a726 Commit FS#10015 - Use chained transfer descriptor to speed up USB transfers on PP and iMX31
(not exactly the same. This one actually works)



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20570 a1c6a512-1295-4272-9138-f99709370657
2009-03-29 19:56:21 +00:00
Frank Gevaerts
105fe0679d Don't swamp the system with broadcast messages that nobody is listening to yet anyway.
Also, these messages should probably be done in a different way, like an update every second (or maybe half-second)
This should fix FS#10006


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20294 a1c6a512-1295-4272-9138-f99709370657
2009-03-11 20:54:32 +00:00
Frank Gevaerts
871db6f5d9 Allow the user to leave MSC mode by pressing the USB POWER button (the one that's used to go to usb power mode on plugin) when the host OS hasn't locked the device.
This only works for devices that expose a removable device, so for now the gigabeat S is out of luck.
(slightly modified from FS#9993)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20244 a1c6a512-1295-4272-9138-f99709370657
2009-03-08 18:45:19 +00:00
Frank Gevaerts
ec602b7e75 send the USB broadcast events at a less busy time
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20142 a1c6a512-1295-4272-9138-f99709370657
2009-02-28 19:39:28 +00:00
Frank Gevaerts
3b141d9c80 Also broadcast transfer information for use by fancy USB screens
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20140 a1c6a512-1295-4272-9138-f99709370657
2009-02-28 16:25:07 +00:00
Frank Gevaerts
afedfcf44e Leave "usb mode" when all LUNs are ejected again
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20139 a1c6a512-1295-4272-9138-f99709370657
2009-02-28 15:16:54 +00:00
Frank Gevaerts
b6a1af2a9b Adds the possibility to show nice "do not disconnect" screens/icons on the USB screen. A proof-of-concept for the actual screen is at FS#9969
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20138 a1c6a512-1295-4272-9138-f99709370657
2009-02-28 14:47:18 +00:00
Frank Gevaerts
80410f21b9 remove SERIALIZE_WRITES. The reason for it (the SD bug) is gone, so there's no point in keeping this
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20098 a1c6a512-1295-4272-9138-f99709370657
2009-02-24 18:30:32 +00:00
Dave Chapman
dff46d20e6 Commit my patch from FS#9940 - fix the invalid active flags in the Gigabeat S MBR on the fly in the UMS driver. It is hypothosized that actually changing these on the disk will make the OF more likely to reformat the data partition during recovery - but that is not confirmed. So we play it safe.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20085 a1c6a512-1295-4272-9138-f99709370657
2009-02-22 18:25:16 +00:00
Michael Sevakis
21f0c9a282 Make basic cache functions into calls, and get rid of CACHE_FUNCTION_WRAPPERS and CACHE_FUNCTIONS_AS_CALL macros. Rename flush/invalidate_icache to cpucache_flush/invalidate. They're inlined only if an implementation isn't provided by defining HAVE_CPUCACHE_FLUSH/INVALIDATE.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19971 a1c6a512-1295-4272-9138-f99709370657
2009-02-11 12:55:51 +00:00
Maurus Cuelenaere
868a4bdbc3 Fix RAM disk when no audio buffer is available
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19814 a1c6a512-1295-4272-9138-f99709370657
2009-01-21 20:52:35 +00:00
Maurus Cuelenaere
f1c6c3a754 USB storage driver:
* Move RAM disk buffer allocation #ifdef below
 * Don't use the audio buffer for bootloaders


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19812 a1c6a512-1295-4272-9138-f99709370657
2009-01-21 20:22:40 +00:00
Michael Sevakis
616c98b38f USB detection changes. c200/e200: Consider USB to be powered when charger is plugged but detect USB connection by bus reset. When received, disconnect and restart the driver fully enabled. imx31: Fix hack used to make initial connect succeeded-- set PHY type before initial reset. General: Move some target code out of usb-drv-arc.c and implement it in respective usb sources and CPU headers so things stay clean.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19797 a1c6a512-1295-4272-9138-f99709370657
2009-01-19 13:41:25 +00:00
Michael Sevakis
6da8b4eb49 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
2009-01-13 16:27:35 +00:00
Frank Gevaerts
bbd33a0a7d improve handling of unimplemented commands
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19755 a1c6a512-1295-4272-9138-f99709370657
2009-01-12 21:22:26 +00:00
Frank Gevaerts
a2e80d573c correct wrong logf
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19627 a1c6a512-1295-4272-9138-f99709370657
2008-12-31 17:36:57 +00:00
Frank Gevaerts
19dfe330a1 Add a disconnect handler for usb storage. It doesn't do anything yet, but it will apparently be needed to reset the audio buffer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19418 a1c6a512-1295-4272-9138-f99709370657
2008-12-13 14:49:44 +00:00
Frank Gevaerts
430343bca7 implement single-driver storage layer with macros instead of inlines
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18975 a1c6a512-1295-4272-9138-f99709370657
2008-11-02 01:14:46 +00:00
Frank Gevaerts
2f8a0081c6 Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do that, it also introduces sd_*, nand_*, and mmc_*.
This should be a good first step to allow multi-driver targets, like the Elio (ATA/SD), or the D2 (NAND/SD).


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18960 a1c6a512-1295-4272-9138-f99709370657
2008-11-01 16:14:28 +00:00
Frank Gevaerts
19d1cacb1a cleanup storage defines
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18950 a1c6a512-1295-4272-9138-f99709370657
2008-10-31 21:25:04 +00:00
Frank Gevaerts
b0b3f0339a add optional USB mass storage from ramdisk. This can be useful for development
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18849 a1c6a512-1295-4272-9138-f99709370657
2008-10-20 21:49:59 +00:00
Frank Gevaerts
20e704ba78 disable logf again
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18704 a1c6a512-1295-4272-9138-f99709370657
2008-10-03 22:49:36 +00:00
Frank Gevaerts
478fc5baed reorganise the USB stack a bit to allow for easier integration of non-ARC controller drivers
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18703 a1c6a512-1295-4272-9138-f99709370657
2008-10-03 22:43:16 +00:00
Jens Arnold
b1a584a1b6 Simplify & fix the MMC driver. After more than 3 years I found that the MMC specs were a bit misleading, and the 'large' MMC which state a block size of 1024 or 2048 bytes and no partial read and/or partial write capability are happily accepting a block size of 512 bytes. So go KISS and remove all the variable/partial block handling code. This fixes the driver for the Transcend 4GB MMCplus, which doesn't cope when we actually set the 2048 byte block size it states. It also makes write operations involving small blocks faster and more reliable. * Note: The 4GB Transcend still doesn't work when plugged at boot, but works when hotplugged.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18515 a1c6a512-1295-4272-9138-f99709370657
2008-09-14 20:33:24 +00:00
Frank Gevaerts
ab7cfd2855 revert r18327, as it introduces serious issues on non-sd players (like ipods)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18370 a1c6a512-1295-4272-9138-f99709370657
2008-08-31 15:11:04 +00:00