1. 04 Apr, 2021 1 commit
    • Colin Granville's avatar
      Modifications for Isochronous transfers · 7a980925
      Colin Granville authored
        * usbmodule.c - isochronous api modifications
        * usb_subr.c - datatoggle fix. (NetBSD revision 1.179)
        * USB.Doc -  samplerate and samplesize special fields documented.
        Tested on ArmX6, pi b+ and pi 4, Pandaboard, BeagleBoard
  2. 04 Jul, 2020 2 commits
    • Robert Sprowson's avatar
      Change to unsigned physical addresses · 4fe3bcbc
      Robert Sprowson authored
      The prototype for vtophys returns an unsigned value (specifically an unsigned long for ARM in src/sys/arch/arm/include/types.h though for us int and long are both the same). This ensures any promotions to wider than 32b don't end up sign extending.
      Version 1.31. Tagged as 'USBDriver-1_31'
    • Robert Sprowson's avatar
      Update USB device database · c8227a54
      Robert Sprowson authored
      usbdevs from NetBSD 1.783.
      usb_quirks.c from NetBSD 1.83, and also rename USB_PRODUCT_QUALCOMM_CDMA_MSM to account for the vendor name changing in usbdevs.
  3. 20 Apr, 2020 1 commit
    • Jeffrey Lee's avatar
      Don't send scrollwheel events to the Wimp · 8d06c374
      Jeffrey Lee authored
      All scroll wheel events are now sent to PointerV 9 (WheelChange), along
      with any extra mouse buttons. This will allow us to centralise Wimp
      scrollwheel logic in the WindowScroll module.
      Version 1.30. Tagged as 'USBDriver-1_30'
  4. 11 Mar, 2020 1 commit
  5. 19 May, 2018 1 commit
    • ROOL's avatar
      Fix for alternate selection · e2163bbc
      ROOL authored
        1) If the alt setting had been changed from 0 it couldn't be changed back to 0.
        2) The alt value that usbd_set_interface takes should be an index into
           the number of alternate settings (altidx) not idesc->bAlternateSetting.
        3) usbd_set_interface returns an error (USBD_IN_USE) if pipes are open
           on the interface when you try to change it. We should return this error
           if the alternate setting can't be changed as the alternate setting would
           be wrong.
        Replace uses of usbd_set_interface() with a new function which correctly maps alternate number to alternate index, and propagates errors back to the caller.
        Submission from Colin Granville.
      Version 1.29. Tagged as 'USBDriver-1_29'
  6. 17 Mar, 2018 1 commit
  7. 20 Jan, 2018 1 commit
    • ROOL's avatar
      Send service call to announce USBDriver dead · 955a64dd
      ROOL authored
        Service_USB subreason 5 now announces the USBDriver has finalised, HCDs will be able to use this to do any cleanup they desire.
        usbmodule.c - Add service, remove and detach buses. Also, fix accidental dereference of address 1 in config_detach().
        USBDevFS.h & Doc/USB - Add service.
        Requires TCPIPLibs-5_63 for the safe queue removal macros.
        Submission from Colin Granville.
      Version 1.27. Tagged as 'USBDriver-1_27'
  8. 13 Jan, 2018 1 commit
    • ROOL's avatar
      Fix asynchronous endpoint stall function and tidy up · 36bb9aad
      ROOL authored
        Add missing brace which otherwise meant only the line
          req.bmRequestType = UT_WRITE_ENDPOINT;
        was conditional, rather than the following 6 lines.
        The confusing set of #ifdef __riscos/#endif was masking a missed call to cleartoggle() which would leave the controller and device out of sync.
        Tidy this up, and apply similar to usbd_clear_endpoint_stall() for clarity.
        usbdi.c - as detailed above, based on a submission from Colin Granville, with edits.
        usbmodule.c - delete unused DEVICEFSISBROKEN switch, the bug to which it refers was fixed in DeviceFS-0_63 in 2003.
      Version 1.26. Tagged as 'USBDriver-1_26'
  9. 18 Nov, 2017 1 commit
    • ROOL's avatar
      Remove duplicate define · d84d00b5
      ROOL authored
        OHCI_DEBUG shouldn't be set here.
        Submission for USB bounty.
      Version 1.25. Tagged as 'USBDriver-1_25'
  10. 15 Oct, 2017 1 commit
  11. 07 Oct, 2017 1 commit
    • ROOL's avatar
      Clear up duplicate/unused OHCI/EHCI source files · c81481e7
      ROOL authored
        Remove the (now) unused sources from when this component produced multiple targets. See Controllers/OHCIDriver & Controllers/EHCIDriver for the live copies.
        Remove unset USBHAL defines.
        Simplify the Makefile and !Mk* scripts.
        No longer export usbroothub_subr.h.
        Add a porting type "device_t" to usb_port.h.
        Submission for USB bounty.
      Version 1.23. Tagged as 'USBDriver-1_23'
  12. 03 Sep, 2017 1 commit
    • Robert Sprowson's avatar
      Align docs with alias variable reality · be85a92e
      Robert Sprowson authored
      The documentation of the Alias$@USBDevice variables barely made sense, and examples not that consistent - improve this.
      Fix step 1 of the alias handling to match the docs (this was fixed previously in revision 1.34 but accidentally overwritten in 1.35 less than an hour later).
      Add a check for malloc() failing in low memory situations.
      Tested with a couple of USB devices and alias variables containing 'echo' commands.
      Version 1.22. Tagged as 'USBDriver-1_22'
  13. 19 Aug, 2017 1 commit
    • ROOL's avatar
      Changes to header exports · 4758af08
      ROOL authored
        Export usbroothub_subr.h, for those HC's that might need it.
        Export C version of usbhal.h, in addition to the assembler Hdr version, for MUSBDriver.
        Eliminate the dependency on opt_usbverbose.h - an empty header file - by merging the change from usb_subr.c revision 1.186 from NetBSD which guards it with internal _KERNEL_OPT (unset).
        Submission for USB bounty.
      Version 1.21. Tagged as 'USBDriver-1_21'
  14. 30 Jul, 2017 1 commit
    • ROOL's avatar
      Remove OHCIDriver & EHCIDriver as targets · 333fc509
      ROOL authored
        Makefile and !Mk* updated, and corresponding unused files put in the attic.
        Add an interim OHCIHALLib and EHCIHALLib target so that the HAL library variant still builds.
        Split messages into CmdHelp and Messages per a normal C component.
        Remove unused wsconsio/wsmousevar porting headers, no longer used.
        Submission for USB bounty.
        Note, the version number of the resulting module will jump to match the top level VersionNum file.
      Version 1.20. Tagged as 'USBDriver-1_20'
  15. 15 Jul, 2017 1 commit
    • ROOL's avatar
      Get a new tag · 57d31931
      ROOL authored
        This is a (server side) copy of the component previously called RiscOS/Sources/HWSupport/USB/NetBSD to be used for ongoing development, retaining the significant revision history.
        Submission for USB bounty.
  16. 18 Mar, 2017 1 commit
    • ROOL's avatar
      Missing newline from device info printout · bf77d323
      ROOL authored
        During internationalisation, the last line lost its newline.
        Submission from Colin Granville.
      Version 1.19. Tagged as 'NetBSD-1_19'
  17. 17 Dec, 2016 1 commit
    • ROOL's avatar
      Messages fixes, internationalisation, minor clean ups · 6460aa49
      ROOL authored
        USBDriver was performing unnecessary messages file reopening on Service_ResourceFSStarted (MessageTrans does this itself), remove this.
        Internationalised USBDriver, in particular its *Commands.
        Fixed standalone builds to output the messages file objects in the right place (Makefile mistake).
        Changed OHCIDriver and EHCIDriver to use allocated error bases rather than 0.
        Sync'd, where possible, the OHCIDriver and EHCIDriver sources which share a common heritage. Tentative shared interrupt support fixes for non-PCI attached controllers. Comment blocks & indentation improved.
        Export min() macro in usb_port.h.
        CMHG updated to not listen for unwanted services.
        Submission for USB bounty.
        Tested on Pandaboard and Pi 2. OHCIDriver untested but low risk.
      Version 1.18. Tagged as 'NetBSD-1_18'
  18. 10 Dec, 2016 1 commit
    • ROOL's avatar
      Case change to match documentation · 7a2b2a81
      ROOL authored
        DeRegisterBus->DeregisterBus. Since clients calling this SWI are compiled C or assembler, this doesn't affect existing modules which remain binary compatible.
        Submission for USB bounty.
      Version 1.17. Tagged as 'NetBSD-1_17'
  19. 21 Jun, 2016 1 commit
    • Jeffrey Lee's avatar
      Revise TouchBook touchpad fix · 6360b406
      Jeffrey Lee authored
        build/c/usbmouse - Because the touchpad sends data that's consistent with a Boot protocol mouse, the data it sends is shorter than the expected size. This can result in bogus scroll wheel data being read from off the end of the buffer. Fix this by completely ignoring the report descriptor that the device returns and instead using a descriptor that's consistent with a Boot protocol mouse.
        build/Version - Increase USBDriver version number
        Tested on TouchBook
        Fixes issue seen where garbage data at the end of the buffer would result in windows scrolling for every mouse interrupt
      Version 1.16. Tagged as 'NetBSD-1_16'
  20. 02 Jun, 2016 1 commit
    • Robert Sprowson's avatar
      Fix for uninitialised wMaxPacketSize causing enumeration FS failure · dcef3f13
      Robert Sprowson authored
      The order of the new device enumeration means we have the initial device descriptor (hence bMaxPacketSize) but don't compute wMaxPacketSize until after addressing.
      The XHCI HC needs this value by the addressing stage in order to setup the control endpoint context (other HC don't need it until later) so the specific case of a full speed device whose endpoint 0 has a non default max packet size would be set up using the default (of 64), then when the full device descriptor is requested the packet looks like a short transfer and the transaction ends having only collected (eg) 8 bytes. This would then appear as vendor &0000 product &0000 and not get any further.
      Tested on Titanium.
      Version 1.15. Tagged as 'NetBSD-1_15'
  21. 06 May, 2016 1 commit
    • Jeffrey Lee's avatar
      Use HAL_TimerIRQClear in HAL library · 8755ffc9
      Jeffrey Lee authored
        build/c/usbhal - Don't assume HAL_IRQClear will clear the timer interrupt, use HAL_TimerIRQClear as well.
        Tested on BB-xM
      Version 1.14. Tagged as 'NetBSD-1_14'
  22. 02 May, 2016 1 commit
  23. 26 Mar, 2016 2 commits
  24. 04 Mar, 2016 3 commits
    • ROOL's avatar
      Revert accidental commits · 0cd6671a
      ROOL authored
        These changes are currently subject to rework via the normal submissions channel.
    • John Ballance's avatar
      Updated module versions to better identify recent changes · 30334cb8
      John Ballance authored
      Version 1.11. Tagged as 'NetBSD-1_11'
    • John Ballance's avatar
      Fixes for Isochronous data transfer · c7052860
      John Ballance authored
      	frontend isochronous changes
      	forces reads to always be multiple of maxpacket
      	datatoggle fix
      	panic fix
      	usbd_transfer changed so that bufrem is passed the xfer pointer instead of the buffer pointer
      	fixed missing braces in usbd_clear_endpoint_stall
      The HS (USB2) isochronous as been rewritten and isochronous split transactions - FS (USB1) over a HS Connection - has been added
      Changes to the NetBSD backend to get isochronous transfers working on a OHCI device. While it did have isochronous support it wasn't working properly.
        Submitted by Colin Granville
      Tested in iMx6
      Version 1.10. Tagged as 'NetBSD-1_10'
  25. 17 Nov, 2015 1 commit
    • Robert Sprowson's avatar
      Don't build a veneer that points to nothing · 4a445ff6
      Robert Sprowson authored
      The safety struct fillers added in OHCIDriver 0.44 and EHCIDriver 0.30 respectively were being carefully replaced by veneers to nothing. Skip veneer generation is the method isn't implemented.
      Version 1.09. Tagged as 'NetBSD-1_09'
  26. 15 Nov, 2015 2 commits
    • ROOL's avatar
      Init structures for OHCI & EHCI unused members · 15af186e
      ROOL authored
        Play safe, put NULLs in for the unused HC overrides.
      Version 1.08. Not tagged
    • ROOL's avatar
      Add support for HC with hardware enumerate phase · 25810b20
      ROOL authored
        Support controllers such as the XHCI which perform some steps of enumeration themselves in hardware, thereby needing some steps of the software enumeration to be bypassed.
          Internally permit addr of 0, to represent the root hub, since the controller is responsible for allocating 1+. Merged from NetBSD 1.144.
          Test pointers against NULL not 0. Merged from NetBSD 1.191.
          Add 4 new bus methods, for prior to enumeration, address assignment phase, post enumeration fixup, and device removal.
          Prototypes of 4 new bus methods.
        HC API version number bumped.
        Submission from Elesar.
      Version 1.08. Tagged as 'NetBSD-1_08'
  27. 12 Nov, 2015 1 commit
    • Robert Sprowson's avatar
      Resolve porting mistake on initial bus registration · 3ced0223
      Robert Sprowson authored
      On first registering a new bus in the the NetBSD build of the code usb_kthread_create(usb_create_event_thread, sc) is called which in turn creates the main event thread ("usb_event_thread").
      The first thing usb_event_thread() does is set
        sc->sc_bus->needs_explore = 1;
      however in the RISC OS version of the code (usb.c around line 254) only the first action is performed, no discover happens.
      This change schedules a callback via usb_needs_explore_callback() which in turn calls discover_callback() when the OS is next free, which calls usb_discover() for each bus in an equivalent way to NetBSD's event thread. There's then no longer any need for the special one-shot 11s rediscover callback, only the repeating 30s rediscover is needed.
      For reference, the places that set needs_explore in this version are all in usb.c
        Line 254: set, but doesn't schedule a callback, as noted above
        Line 339: code not compiled for __riscos
        Line 548: set, does schedule a callback
        Line 727: cleared, in usb_discover()
        Line 743: set, does schedule a callback
        Line 756: code not called in RISC OS
      NetBSD uses 500ms initial delay before discover, then 60s between discovers (or until requested by a hub, whichever is sooner).
      RISC OS has a periodic callback of 30s (in usbmodule.c) and an initial discover of however long it is from the bus being registered until callbacks next fire usb_event_thread(), assumed ~500ms.
      Version 1.07. Tagged as 'NetBSD-1_07'
  28. 09 Nov, 2015 1 commit
    • Ben Avison's avatar
      Fix HAL breakages caused by HAL_USBPortPower calls · 09c2d619
      Ben Avison authored
        In version 1.05, the USB library which is exported for the use of the HAL
        keyboard scan code unconditionally required the HAL_USBPortPower symbol.
        Not all HALs provide that entry point; for those that didn't, they would
        no longer link. Fixed by use of a bit of magic assembler.
        Verified that OMAP3 ROM now builds again.
      Version 1.06. Tagged as 'NetBSD-1_06'
  29. 04 Nov, 2015 1 commit
  30. 28 Sep, 2015 1 commit
    • Robert Sprowson's avatar
      Internationalisation, help, and syntax improvments · 2f96fb78
      Robert Sprowson authored
      Assign a proper error number and translate "Incompatible USBDriver version".
      Don't bother internationalising the *commands which are for debug builds only.
      Rephrase the help for USBQuirk so it makes sense, and trim the unmatched '<' from the syntax example.
      Bracket the USBDiscover help with the same switch that governs the code, which has been disabled for over a decade.
      Version 1.04. Tagged as 'NetBSD-1_04'
  31. 17 Sep, 2015 1 commit
    • ROOL's avatar
      Update table of device quirks · 02ba7000
      ROOL authored
        From NetBSD usb_quirks.c revision 1.81.
        usbmodule: NULL is for pointer types, not ints.
        usb_quirks: Group the RISC OS specific ones together, disable the non applicable UQ_APPLE_ISO ones, UQ_LOST_CS_DESC doesn't apply either but is only used for USB modem drivers not ported here. Untangle ifdefs around usbd_find_quirk().
        Removed unused source file ums.c
      Version 1.03. Tagged as 'NetBSD-1_03'
  32. 24 Aug, 2015 1 commit
  33. 23 Aug, 2015 1 commit
    • Robert Sprowson's avatar
      Build fix · d86cd0ec
      Robert Sprowson authored
      In products using OHCIDriver/EHCIDriver when they came to do a header export would overwrite the USBDriver header with an empty one.
  34. 22 Aug, 2015 2 commits
    • ROOL's avatar
      Allow the endpoint validation string to include a direction flag · 1d4b111e
      ROOL authored
      However, internally we get that info from the descriptor, so mask it off.
      Submission from Colin Granville.
      No version number bump, it's already been incremented today.
      Version 1.01. Tagged as 'NetBSD-1_01'
    • Robert Sprowson's avatar
      Add some missing struct members · 2318e734
      Robert Sprowson authored
      From NetBSD dev/usb/usbdivar.h 1.109.
      As these extra members change the struct layout, bump the API version number too. Having carefully analysed which headers are actually required by host controllers (in NetBSD-0_98) also be explicit about them in Hdr/USBDriver rather than the former vague comment in h/usbdivar.
        Relocate API define here.
        Include USBDriver.h to get the API define.
        Add struct members from recent NetBSD.
      Version 1.00. Tagged as 'NetBSD-1_00'