[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cdi-devel] [PATCH v3 00/10] USB support
This series adds some long-missing USB drivers to the CDI repository
(and defines the required interfaces).
For now, it only supports control and bulk transfers (which are enough
for mass storage devices), no hotplugging, no suspend/resume, neither a
lot of other things. So among others, there is no USB keyboard support.
Maybe writing the driver and implementing support for it in the USB bus
driver would not be so difficult, but I'm really hesitant to define the
necessary CDI interface for it (CDI.hid? CDI.keyboard? CDI.serial?).
The drivers added by this series are an EHCI driver, a USB 2.0 bus
driver (including a hub driver), and a bulk-only mass storage driver
(with a SCSI interface; should be the right thing to drive your average
thumb drive (and maybe even HDDs), but will not work for e.g. USB floppy
drives).
I tested these drivers using µxoµcota and týndur in qemu and on three
real machines.
v3:
- Patch 2: Documentation translation, different parameter order for
CDI_UPCAST
- Patch 3: Added
- Patch 5: Dropped comment about lun_count == 0 meaning one LUN
- Patch 6: Documentation translation
- Patch 7:
- Additional macros for previously magic values
- Some stricter integer types
- Dropped cdi_usb_provide_hc()
- Patch 8:
- Macros instead of magic values
- Use CDI_CONDITION_WAIT() macro for most timeouts
- Drop bus mastering / MMIO enable
- Check whether the MMIO area could be found
- Try to force BIOS handoff if the clean way is unsucessful
- Drop mem_barrier()
- Register IRQ only after initialization is complete
- Different CDI_UPCAST parameter order
- Patch 9:
- More macros instead of magic values
- Different CDI_UPCAST parameter order
- Patch 10:
- More macros instead of magic values
- Different CDI_UPCAST parameter order
git-backport-diff against v2:
Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively
001/10:[----] [--] 'Makefile: Heed Makefile.conf'
002/10:[0075] [FC] 'cdi/misc: Add CDI_UPCAST and endianness functions'
003/10:[down] 'cdi/misc: Add cdi_elapsed_ms()'
004/10:[----] [--] 'cdi/scsi, cdi.h: Remove týndur-specific fields'
005/10:[0002] [FC] 'cdi/scsi: Add support for multiple LUNs'
006/10:[0098] [FC] 'cdi.h: Add cdi_handle_bus_device()'
007/10:[0093] [FC] 'cdi/usb: Add headers'
008/10:[0410] [FC] 'ehci: Add EHCI driver'
009/10:[0065] [FC] 'usb: Add USB 2.0 bus driver'
010/10:[0051] [FC] 'usb-storage: Add USB mass storage driver'
Max Reitz (10):
Makefile: Heed Makefile.conf
cdi/misc: Add CDI_UPCAST and endianness functions
cdi/misc: Add cdi_elapsed_ms()
cdi/scsi, cdi.h: Remove týndur-specific fields
cdi/scsi: Add support for multiple LUNs
cdi.h: Add cdi_handle_bus_device()
cdi/usb: Add headers
ehci: Add EHCI driver
usb: Add USB 2.0 bus driver
usb-storage: Add USB mass storage driver
Makefile | 4 +-
ehci/ehci.c | 643 ++++++++++++++++++++++++++++++++
ehci/ehci.h | 290 ++++++++++++++
ehci/main.c | 68 ++++
include/cdi.h | 117 +++++-
include/cdi/misc.h | 228 +++++++++++
include/cdi/scsi.h | 11 +-
include/cdi/usb-structures.h | 174 +++++++++
include/cdi/usb.h | 208 +++++++++++
include/cdi/usb_hcd.h | 159 ++++++++
usb-storage/main.c | 76 ++++
usb-storage/usb-storage.c | 216 +++++++++++
usb-storage/usb-storage.h | 60 +++
usb/main.c | 61 +++
usb/usb-hubs.h | 78 ++++
usb/usb.c | 871 +++++++++++++++++++++++++++++++++++++++++++
usb/usb.h | 86 +++++
17 files changed, 3340 insertions(+), 10 deletions(-)
create mode 100644 ehci/ehci.c
create mode 100644 ehci/ehci.h
create mode 100644 ehci/main.c
create mode 100644 include/cdi/usb-structures.h
create mode 100644 include/cdi/usb.h
create mode 100644 include/cdi/usb_hcd.h
create mode 100644 usb-storage/main.c
create mode 100644 usb-storage/usb-storage.c
create mode 100644 usb-storage/usb-storage.h
create mode 100644 usb/main.c
create mode 100644 usb/usb-hubs.h
create mode 100644 usb/usb.c
create mode 100644 usb/usb.h
--
2.4.0