summaryrefslogtreecommitdiff
path: root/firmware/usbstack (follow)
Commit message (Collapse)AuthorAge
* Make sure usb class driver disconnect() functions are called properly.Frank Gevaerts2014-01-05
| | | | | | | | | disconnect() needs to be called exactly once per call to init_connection(). In case of bus resets, disconnect() was not called, which led to leaking alloc_maximum() allocated buflib handles, which led to buflib running out of memory to allocate. Change-Id: I03025da578dc54e48b6de6bd3e3f40feae7220a6
* Check that core_alloc_maximum() returned something useful, and panic if notFrank Gevaerts2014-01-05
| | | | Change-Id: I7ae40db0f81d1d51742501936b13b387f94a25e5
* playback,talk: Share audiobuffer via core_alloc_maximum().Thomas Martitz2013-12-23
| | | | | | | | | | | | | | | | This fixes the radioart crash that was the result of buffering.c working on a freed buffer at the same time as buflib (radioart uses buffering.c for the images). With this change the buffer is owned by buflib exclusively so this cannot happen. As a result, audio_get_buffer() doesn't exist anymore. Callers should call core_alloc_maximum() directly. This buffer needs to be protected as usual against movement if necessary (previously it was not protected at all which cased the radioart crash), To get most of it they can adjust the willingness of the talk engine to give its buffer away (at the expense of disabling voice interface) with the new talk_buffer_set_policy() function. Change-Id: I52123012208d04967876a304451d634e2bef3a33
* Cleanup MV/MD macros a little.Michael Sevakis2013-08-17
| | | | | | | | | | When using variadic macros there's no need for IF_MD2/IF_MV2 to deal with function parameters. IF_MD/IF_MV are enough. Throw in IF_MD_DRV/ID_MV_VOL that return the parameter if MD/MV, or 0 if not. Change-Id: I7605e6039f3be19cb47110c84dcb3c5516f2c3eb
* Fix response length calculation for SCSI_REPORT_LUNSBertrik Sikken2013-08-12
| | | | | | | | Change-Id: I1167851bae20d9275eb2f441ce9dc73c8b2f09b1 Reviewed-on: http://gerrit.rockbox.org/488 Reviewed-by: Frank Gevaerts <frank@gevaerts.be> Reviewed-by: Bertrik Sikken <bertrik@sikken.nl> Tested-by: Bertrik Sikken <bertrik@sikken.nl>
* usb stack: add more verbose debug logf()sMarcin Bukat2013-07-24
| | | | Change-Id: I087aefd2854978813c7e4ed7ef7da400f3692e39
* usb_storage: make it a bit more correctAmaury Pouly2013-07-24
| | | | | | Add stall when unknown SCSI command is hit Change-Id: Icbeea905cd262ab296fb34470e54c665b8bab488
* usb_core: rework handling of clear featureAmaury Pouly2013-07-24
| | | | Change-Id: Icb1e973aa5fd8520eff0796aa8164e0a988d9107
* imx233: fix ocotop/debug and usb-core for stmp3600Amaury Pouly2013-06-24
| | | | | | | | Currently we don't know where the serial number is stored on the stmp3600. It is probably using the laser fuses but this needs to be investigated Change-Id: I1ac25e38b8f65635abb68788ceb65df0a740dabd
* imx233: rewrite ocotp using new register headersAmaury Pouly2013-06-16
| | | | Change-Id: I3c622119a1e296ec6b3f35f27e81b5118ab7f6cc
* FS#12854 - ipod-time-sync sets wrong dayBoris Gjenero2013-05-17
| | | | Change-Id: I8ac7561119e51774b9aee377e7373a7e830a5780
* usb: add support for hardware handled SET ADDR/CONFIGAmaury Pouly2012-12-07
| | | | | | | | | | | | | | | | | | | | | | | Some USB controllers like the one of the Rockchip 27xx handle some requests in pure hardware. This is especially a problem for two of them: - SET ADDR which is used by our core to track the DEFAULT/ADDRESS state and is required for the drivers to work properly - SET CONFIG which is used by our core to initialise the drivers by calling init_connection() In these cases we need a way to notify the core that such requests happened. We do this by exporting two functions which directly notify the core about these requests and perform the necessary init steps required without doing the actual USB transfers. Special care is needed because these functions could be called from an interrupt handler. For this reason we still use the usb_queue and introduce new IDs so that they are processed in order and safely. No functional change is intended, both in the usbstack and on targets without such quirks. Change-Id: Ie42feffd4584e88bf37cff018b627f333dca1140
* Fill USB serial number descriptor on imx233 targets.Amaury Pouly2012-05-31
| | | | | | | | Compute a serial number using the ocotp OPS bits like the OF. Also add a comment about the first character of serial number being a indicator of the enabled interfaces. Change-Id: I9b90aed4e3b803f12fec003c9bc8ee8a046f4e42
* fix a mistake of 803408f18 spotted by n1sRafaël Carré2012-05-07
| | | | | When the source string terminates (with a 0) we pad the rest of the destination with spaces.
* missing constRafaël Carré2012-05-07
|
* simplify yearday_to_daymonth()Rafaël Carré2012-05-07
|
* simplify copy_paddedRafaël Carré2012-05-07
|
* Reorganise USB initialisation to not depend on a specific enumeration ↵Frank Gevaerts2012-01-04
| | | | | | | | | | sequence, by Bartosz Fabianowski, with minor tweaks by Michael Sevakis (FS#12497) FreeBSD apparently sends a SET_ADDRESS first, which confused our code. This patch fixes that, and also simplifies the connection handling a bit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31582 a1c6a512-1295-4272-9138-f99709370657
* usb-target.h: removeRafaël Carré2011-12-31
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31498 a1c6a512-1295-4272-9138-f99709370657
* usb_core: Fix typo in commentMichael Sparmann2011-12-31
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31482 a1c6a512-1295-4272-9138-f99709370657
* The AMSv1 driver limitation that disallows 64K transfers is a USB core ↵Frank Gevaerts2011-12-31
| | | | | | limitation, not a CPU limitation, so use the appropriate defines to test for it git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31476 a1c6a512-1295-4272-9138-f99709370657
* usb PACK_DATA: use a static inline to enable type checkingRafaël Carré2011-12-29
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31467 a1c6a512-1295-4272-9138-f99709370657
* usb_hid: fix r31457Rafaël Carré2011-12-29
| | | | | | | | | | descriptor_hid_get() updates its parameter so we need to take its address the update is hidden inside PACK_DATA macro Fix HID on the Fuze+ Reported by jlbiasini git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31466 a1c6a512-1295-4272-9138-f99709370657
* USB HID: cosmetics / simplificationsRafaël Carré2011-12-28
| | | | | | | | | | Declare loop variables inside for() ala C99 Remove useless casts Remove one level of pointer indirection in descriptor_hid_get() Simplify a few switch() Align case on the same level than switch git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31457 a1c6a512-1295-4272-9138-f99709370657
* Commit to certain names for cache coherency APIs and discard the aliases.Michael Sevakis2011-12-17
| | | | | | | Wouldn't surprise me a bit to get some non-green. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31339 a1c6a512-1295-4272-9138-f99709370657
* Remove USB time sync code when there's no RTC.Boris Gjenero2011-12-16
| | | | | | | | | Without an RTC, Rockbox doesn't keep time. In that situation, USB time sync previously did nothing but reported success. After this change, the USB time sync request won't be recognized on those targets. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31319 a1c6a512-1295-4272-9138-f99709370657
* Oops, fixed the wrong lineAmaury Pouly2011-12-15
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31275 a1c6a512-1295-4272-9138-f99709370657
* Remove two useless variable and hopefully finally fix redAmaury Pouly2011-12-15
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31274 a1c6a512-1295-4272-9138-f99709370657
* Add support for for per-drive logical sector size. This allows targets to ↵Amaury Pouly2011-12-15
| | | | | | have a different logical sector size for the internal storage and the sd card, like on the fuze+ for example. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31270 a1c6a512-1295-4272-9138-f99709370657
* FS#12378 : Remove various unused code, and comment out some unused code and ↵Boris Gjenero2011-12-14
| | | | | | data for reference or future use. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31256 a1c6a512-1295-4272-9138-f99709370657
* Use array index 'i' only -after- bounds checkThomas Jarosch2011-10-21
| | | | | | Reported by cppcheck git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30815 a1c6a512-1295-4272-9138-f99709370657
* Add "USB Hide Internal Drive" option for multidrive devices with software usb.Frank Gevaerts2011-09-09
| | | | | | | | This option allows accessing the card slot from "dumb" USB hosts like some car audio systems that do not handle multi-LUN devices. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30489 a1c6a512-1295-4272-9138-f99709370657
* Fix tabs in .c and .h files in firmware/ Bertrik Sikken2011-05-08
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29832 a1c6a512-1295-4272-9138-f99709370657
* iPod Classic CE-ATA Support (Part 2 of 4: Remove on-stack sector buffers, ↵Michael Sparmann2011-02-27
| | | | | | and replace them with a single statically allocated sector buffer that's arbitrated amongst users) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29445 a1c6a512-1295-4272-9138-f99709370657
* Add a higher level USB detection that prevents fraudulent bus resets from ↵Michael Sevakis2011-01-17
| | | | | | causing USB mode to be entered. Enable for SA9200 only at this time. Also, for SA9200, use the bus power GPIO rather than the 'connector inserted' GPIO to detect the cable. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29068 a1c6a512-1295-4272-9138-f99709370657
* Bootloader USB mode for PP502x. Enable only on GoGear SA9200 for the time ↵Michael Sevakis2011-01-15
| | | | | | being. Add HAVE_BOOTLOADER_USB_MODE to config if BOOTLOADER is defined to enable it. Clean up some kernel stuff a little to support it. Mess up a bunch of other stuff (hopefully not too badly). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29053 a1c6a512-1295-4272-9138-f99709370657
* Gigabeat S: Make it a removable mass-storage device. Windows will assign a ↵Michael Sevakis2011-01-05
| | | | | | drive to only the main data partition by default. To access the bootloader partition instead, press 'Vol -' while it connects (in bootloader and firmware). Hopefully doesn't break anything for anyone. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28972 a1c6a512-1295-4272-9138-f99709370657
* Handle disk errors properly in USB storage driver. Fixes FS#10873Frank Gevaerts2010-12-04
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28733 a1c6a512-1295-4272-9138-f99709370657
* Fix outdated commentFrank Gevaerts2010-10-02
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28196 a1c6a512-1295-4272-9138-f99709370657
* usb: remove unused variable and correctly stall on unhandled control requestsAmaury Pouly2010-09-20
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28121 a1c6a512-1295-4272-9138-f99709370657
* Fix set_serial_descriptor() for targets with as3543Rafaël Carré2010-09-06
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28013 a1c6a512-1295-4272-9138-f99709370657
* usb_storage seems to be working now, enable USE_ROCKBOX_USB on C200v2, other ↵Tobias Diedrich2010-06-22
| | | | | | AMSv1 untested. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27039 a1c6a512-1295-4272-9138-f99709370657
* remane hotswap.* to sdmmc.*. The contents have nothing at all to do with ↵Frank Gevaerts2010-06-05
| | | | | | hotswapping things git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26598 a1c6a512-1295-4272-9138-f99709370657
* New USB charging system, part 2 - "Force" charging modeTorne Wuff2010-06-05
| | | | | | | Enable support for the "force" mode of USB charging. This should work on Gigabeat S and Nano2g (and any other future target which has a RB usb stack and supports charging) - if a host connection is not detected within 10 seconds of USB insertion, assume that the connected device is an AC charger and charge anyway, if the user has specified "force" as the mode. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26594 a1c6a512-1295-4272-9138-f99709370657
* New USB charging system, part 1 - API rework and user-visible setting updateTorne Wuff2010-06-05
| | | | | | | | | | | | | | | 1) "Charge during USB connection" option is now tristate: off/on/force. Currently "force" behaves just like "on", but in future it will allow charging even when it was not possible to positively identify a charger. 2) The H300 code has been adjusted to use the new system but there should be no functional differences, it already had the USB charging option and its USB/charging support is hardware controlled. 3) The Gigabeat S code has been adjusted to use the new system: the player now has the USB charging option, which wasn't previously available. The player will only charge at full speed when allowed to do so by a working USB host, so USB AC adapters won't work very well; however, they didn't work before either, so this is not a change in functionality. 4) The iPod Nano 2G code has been adjusted to use the new system: it already had the USB charging option. Using a USB AC adapter won't charge at full speed any more (it did before) - the old implementation was equivalent to the not-yet-implemented "force" option in the new system. No other target should be affected. Support for the "force" mode and support for at least some other iPod models will come in a future commit :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26570 a1c6a512-1295-4272-9138-f99709370657
* revert part of r26176 to avoid large static allocationRafaël Carré2010-05-19
| | | | | | we still need to convert uncached addresses to physical addresses git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26177 a1c6a512-1295-4272-9138-f99709370657
* as3525: don't use IRAM for usb, and avoid usb storage using uncached ↵Rafaël Carré2010-05-19
| | | | | | | | addresses behind our back No need for special address handling, all addresses are equal to their physical address git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26176 a1c6a512-1295-4272-9138-f99709370657
* Enforce the 80-char limit to make everyone happy.Amaury Pouly2010-04-13
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25619 a1c6a512-1295-4272-9138-f99709370657
* - Forget a cosmetic change.Amaury Pouly2010-04-13
| | | | | | - Interface number is in lower half of wIndex for interface control requests. Upper half is reserved and used in other protocols. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25618 a1c6a512-1295-4272-9138-f99709370657
* Attempt to have a consistent coding convention in usb_core.cAmaury Pouly2010-04-13
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25617 a1c6a512-1295-4272-9138-f99709370657