summaryrefslogtreecommitdiffstats
path: root/firmware/usbstack/usb_storage.c
AgeCommit message (Collapse)AuthorFilesLines
2009-06-26ignore write data if the length doesn't match what we expect. This avoids ↵Frank Gevaerts1-0/+1
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-05-23Reorganise USB stack defines. Now config.h decides which class drivers get ↵Frank Gevaerts1-4/+0
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-20Don't force double-buffering for sd devices. They apparently are not faster ↵Frank Gevaerts1-1/+7
with it, ans possibly actually slower git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20999 a1c6a512-1295-4272-9138-f99709370657
2009-05-19Use different read and write buffer sizes. Due to interaction between common ↵Frank Gevaerts1-20/+26
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-18Speed up USB storage by being a bit smarter in ordering transfer setupsFrank Gevaerts1-5/+12
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20982 a1c6a512-1295-4272-9138-f99709370657
2009-05-16Add working USB HID driver, by Tomer Shalev (part of his GSoC work).Frank Gevaerts1-5/+6
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-11fix send_command_result() size checking for the SCSI_REQUEST_SENSE case ↵Frank Gevaerts1-1/+2
(thanks to Tomer Shalev, FS#10203) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20914 a1c6a512-1295-4272-9138-f99709370657
2009-04-18USB related Cosmetics, whitespace and readability fixes (FS#10147 by Tomer ↵Frank Gevaerts1-100/+91
Shalev) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20737 a1c6a512-1295-4272-9138-f99709370657
2009-04-18Allow class drivers to reuse the core data buffer for control transfers. ↵Frank Gevaerts1-2/+2
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-18Add a PACK_DESCRIPTOR macro to make the class drivers a bit more readable ↵Frank Gevaerts1-12/+9
(FS#10145 by Tomer Shalev) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20733 a1c6a512-1295-4272-9138-f99709370657
2009-04-05Revert r20617 for nowMaurus Cuelenaere1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20624 a1c6a512-1295-4272-9138-f99709370657
2009-04-04Don't leave LOGF_ENABLE enabled...Maurus Cuelenaere1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20619 a1c6a512-1295-4272-9138-f99709370657
2009-04-04Use the audio buffer in USB storage for ISP1583-having targetsMaurus Cuelenaere1-3/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20617 a1c6a512-1295-4272-9138-f99709370657
2009-03-29Commit FS#10015 - Use chained transfer descriptor to speed up USB transfers ↵Frank Gevaerts1-4/+5
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-11Don't swamp the system with broadcast messages that nobody is listening to ↵Frank Gevaerts1-0/+2
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-08Allow the user to leave MSC mode by pressing the USB POWER button (the one ↵Frank Gevaerts1-5/+16
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-02-28send the USB broadcast events at a less busy timeFrank Gevaerts1-2/+13
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20142 a1c6a512-1295-4272-9138-f99709370657
2009-02-28Also broadcast transfer information for use by fancy USB screensFrank Gevaerts1-0/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20140 a1c6a512-1295-4272-9138-f99709370657
2009-02-28Leave "usb mode" when all LUNs are ejected againFrank Gevaerts1-22/+8
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20139 a1c6a512-1295-4272-9138-f99709370657
2009-02-28Adds the possibility to show nice "do not disconnect" screens/icons on the ↵Frank Gevaerts1-2/+15
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-24remove SERIALIZE_WRITES. The reason for it (the SD bug) is gone, so there's ↵Frank Gevaerts1-17/+0
no point in keeping this git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20098 a1c6a512-1295-4272-9138-f99709370657
2009-02-22Commit my patch from FS#9940 - fix the invalid active flags in the Gigabeat ↵Dave Chapman1-0/+23
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-11Make basic cache functions into calls, and get rid of ↵Michael Sevakis1-1/+1
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-01-21Fix RAM disk when no audio buffer is availableMaurus Cuelenaere1-1/+5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19814 a1c6a512-1295-4272-9138-f99709370657
2009-01-21USB storage driver:Maurus Cuelenaere1-2/+2
* 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-19USB detection changes. c200/e200: Consider USB to be powered when charger is ↵Michael Sevakis1-1/+1
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-13USB retweaking: Take out the USB_REQUEST/RELEASE_DISK scheme and simply ask ↵Michael Sevakis1-6/+3
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-12improve handling of unimplemented commandsFrank Gevaerts1-1/+5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19755 a1c6a512-1295-4272-9138-f99709370657
2008-12-31correct wrong logfFrank Gevaerts1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19627 a1c6a512-1295-4272-9138-f99709370657
2008-12-13Add a disconnect handler for usb storage. It doesn't do anything yet, but it ↵Frank Gevaerts1-0/+5
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-11-02implement single-driver storage layer with macros instead of inlinesFrank Gevaerts1-8/+8
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18975 a1c6a512-1295-4272-9138-f99709370657
2008-11-01Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do ↵Frank Gevaerts1-76/+49
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-10-31cleanup storage definesFrank Gevaerts1-2/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18950 a1c6a512-1295-4272-9138-f99709370657
2008-10-20add optional USB mass storage from ramdisk. This can be useful for developmentFrank Gevaerts1-0/+38
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18849 a1c6a512-1295-4272-9138-f99709370657
2008-10-03disable logf againFrank Gevaerts1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18704 a1c6a512-1295-4272-9138-f99709370657
2008-10-03reorganise the USB stack a bit to allow for easier integration of non-ARC ↵Frank Gevaerts1-29/+41
controller drivers git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18703 a1c6a512-1295-4272-9138-f99709370657
2008-09-14Simplify & fix the MMC driver. After more than 3 years I found that the MMC ↵Jens Arnold1-1/+1
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-08-31revert r18327, as it introduces serious issues on non-sd players (like ipods)Frank Gevaerts1-14/+6
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18370 a1c6a512-1295-4272-9138-f99709370657
2008-08-28Make usb_storage work on all targets againFrank Gevaerts1-0/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18357 a1c6a512-1295-4272-9138-f99709370657
2008-08-21Use cached memory for ata_write_sectors(). This seems to finally fix FS#8663Frank Gevaerts1-6/+11
Thanks to Martin Ritter for finding out that the uncached accesses were somehow causing this SERIALIZE_WRITES can probably be removed, but this requires a bit more testing first git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18327 a1c6a512-1295-4272-9138-f99709370657
2008-07-09define SERIALIZE_WRITES for all HAVE_ATA_SD, not just the sansasFrank Gevaerts1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18001 a1c6a512-1295-4272-9138-f99709370657
2008-07-09Don't do overlapping USB transactions and SD writes. This seems to avoid FS#8663Frank Gevaerts1-1/+19
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17997 a1c6a512-1295-4272-9138-f99709370657
2008-06-28Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg1-2/+4
later. We still need to hunt down snippets used that are not. 1324 modified files... http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-05-13Preparing for the Philips SA9200 part 2. Since the SA9200 doesn't have a ↵Mark Arigo1-1/+1
microsd card (no hotswap), use HAVE_ATA_SD for the Sansa flash driver so we don't rely on HAVE_HOTSWAP in some places. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17488 a1c6a512-1295-4272-9138-f99709370657
2008-05-06typo fixes (; instead of , at the end of two assignments) (same as r17398 ↵Frank Gevaerts1-2/+2
for usb_serial. lesson learned : always check if there are similar bugs elsewhere) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17400 a1c6a512-1295-4272-9138-f99709370657
2008-05-05Convert the whole codebase to UTF-8, except docs/COMMITTERS and ↵Nicolas Pennequin1-1/+1
tools/creative.c, which need checking. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17369 a1c6a512-1295-4272-9138-f99709370657
2008-05-03Added missing usb #includes to usb source files.Bertrik Sikken1-0/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17309 a1c6a512-1295-4272-9138-f99709370657
2008-04-26- change the usb class driver framework to allow for device classes with ↵Frank Gevaerts1-11/+18
more than one interface or more than one endpoint pair - move the charging-only dummy driver out of usb_core git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17252 a1c6a512-1295-4272-9138-f99709370657
2008-04-24Commit whole Creative Zen Vision:M target tree + all related firmware/ Maurus Cuelenaere1-1/+1
changes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17241 a1c6a512-1295-4272-9138-f99709370657
2008-04-18UMS for the Gigabeat S. Bootloader USB mode. Has a couple quirks 1) First ↵Michael Sevakis1-5/+16
plug has problems if cold. Replug if it doesn't connect or not at high speed 2) Linux doesn't like the odd bootable flag value used in the partitions so it won't mount but Windows works. Fix minor OTG driver bugs and clean up device memory handling. Generic name for ARC controller driver. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17154 a1c6a512-1295-4272-9138-f99709370657