Source
...
Target
Commits (17)
  • Jeffrey Lee's avatar
    Rework USB driver makefile & cmhg files to avoid constant rebuilds of USBDriver.h · 0531a2c1
    Jeffrey Lee authored
    Detail:
      Limitations in the way CMHG was being told which message file to use meant that the makefile was constructed in a way that would automatically delete usbmodhead.h/.o after they were built, to protect against OHCIDriver or EHCIDriver causing the file to be built referencing the wrong messages file.
      However since each component uses a unique messages filename, and each component has its own CMHG file, there was absolutely no need for this - all that was needed was to update the CMHG files to reference the correct messages file directly.
      ROM builds are now a minute or two faster because of this, which is quite welcome since I can often find myself doing 30+ builds a day.
    Admin:
      Tested by building Tungsten ROM and diffing new modules against old; no differences detected.
      Not tagged.
    
    
    Version 0.49. Not tagged
    0531a2c1
  • Jeffrey Lee's avatar
    Fix USBDriver's handling of PointerV. Increase module version numbers/dates. · c5f29964
    Jeffrey Lee authored
    Detail:
      build/c/usbmouse - USBDriver's PointerReason_Request handler now correctly restores the IRQ state to that of the caller, instead of unconditionally enabling IRQs. It also correctly intercepts the vector instead of passing it on to other claimants.
      build/Version - This fake VersionNum file hasn't been touched in a long time, leading to some newer versions of the USB modules being released with version numbers identical to their predecessors. This has now been fixed, so that each module has had its version increased by 0.01 and date increased to that of the last (functional) change.
    Admin:
      Tested on rev C2 beagleboard
    
    
    Version 0.50. Tagged as 'NetBSD-0_50'
    c5f29964
  • Ben Avison's avatar
    Support for USB short packages · 7ca6fbdc
    Ben Avison authored
    Detail:
      * DeviceFSCallDevice_TransferInfo and notation of padded bytes
      * Added (updated) documentation
    Admin:
      Provided by Thomas Milius
    
    Version 0.51. Tagged as 'NetBSD-0_51'
    7ca6fbdc
  • Jeffrey Lee's avatar
    Update EHCI driver to NetBSD latest (as of 10/07/2010), improve DeviceFS interface · eb6607d0
    Jeffrey Lee authored
    Detail:
      EHCI driver update:
        dev/usb/c/ehci - Updated to latest NetBSD version, except for revisions 1.134 and 1.135 which are too invasive to merge in without updating the rest of the USB stack. This new version brings lots of bug fixes, and adds (untested on RISC OS) support for EHCI isochronous transfers.
        dev/usb/h/ehcivar - Updated to latest NetBSD version, except for the sc_bus splitting that was held back from the ehci.c update
        dev/usb/h/usb, dev/usb/h/usbdi, dev/usb/usbdivar - partial update to latest as required/possible
        dev/usb/c/usb_quirks, dev/usb/h/ehcireg, dev/usb/h/usb_mem, dev/usb/h/usb_quirks, dev/usb/h/usbhid, dev/usb/usbdevs, dev/usb/devlist2h.awk, dev/wscons/h/wsconsio, dev/wscons/h/wsmousevar - Updated to latest NetBSD versions
        dev/usb/c/usbroothub_subr, dev/usb/h/usbroothub_subr - New files brought in from NetBSD sources for use with new EHCI driver
        build/objehcidriver - Added usbroorhub_subr to EHCI driver
        dev/usb/h/usb_port - Added extra dummy functions as required by new EHCI driver
        dev/build/c/port - Added extra parameter to callout_init as required by new EHCI driver
      DeviceFS improvements:
        build/c/usbmodule - Added DeviceFSCallDevice_GetHandles2 as a replacement for Thomas Milius's backwards-incompatible GetHandles changes. Added DeviceFSCallDevice_GetSetOptions call to control RX padding and TX force-short-xfer features. These features can also be controlled at endpoint creation time by new fields in the filename. Also fixed packet padding to not fill the buffer with garbage or potentially crash when the padded area is more than one packet in length.
      New bus registration API:
        Changes made to the data structures that are shared between the modules means that new checks are needed to ensure USB modules with incompatible APIs are not used with one another.
        build/h/usbdivar - Since this seems to be the file containing the main structures that are shared, it now has a #define at the top indicating the first version of the USBDriver module that implemented the data structures within. This version number is used to check that the driver modules are compatible.
        build/cmhg/usbmodhead, build/h/usbdriver, build/c/usbmodule - Add a new SWI, USBDriver_Version, to return the version number of the USBDriver module. Used for both intra-stack API version checks and can be useful for external code that wants to query DeviceFS feature availability.
        build/c/usbmodule, build/c/ehcimodule, build/c/ohcimodule - Updated USBDriver_RegisterBus SWI and the code that calls it to pass the API version number (as defined in usbdivar.h) to USBDriver when attempting to reigster the bus. USBDriver then ensures the version matches that of itself, and if not refuses to allow the bus to register. EHCI & OHCI modules also check that USBDriver is new enough to implement this behaviour via the USBDriver_Version SWI.
      And finally:
        build/version - Incremented module version numbers.
        build/doc/usb - Updated with details of new features
    Admin:
      Tested in ROM softload on Iyonix & beagleboard. Beagleboard hub issues seem to be resolved, and there are no new bugs that I can see.
    
    
    Version 0.52. Tagged as 'NetBSD-0_52'
    eb6607d0
  • Jeffrey Lee's avatar
    Update hid.c, ums.c to latest (ish), update usbmouse.c, add TouchBook touchpad fix · f3df0153
    Jeffrey Lee authored
    Detail:
      dev/usb/c/hid, dev/usb/h/hid, dev/usb/c/ums - Updated to latest NetBSD versions (actually the version that was used for the recent core/EHCI update, so not 100% latest)
      build/c/usbmouse, dev/wscons/h/wsmousevar - Updated RISC OS USB mouse driver to be similar to the new NetBSD version. Also reformatted file to use tab char instead of inconsistent numbers of spaces for indentation.
      build/c/usbmouse, dev/usb/usbdevs - Added fix for broken TouchBook touchpad behaviour.
    Admin:
      Tested with various mice on a beagleboard, and with the TouchBook touchpad.
      We should now have support for the W axis of mice, but that code is untested since I don't have any suitable mice to hand.
    
    
    Version 0.53. Tagged as 'NetBSD-0_53'
    f3df0153
  • Steve Revill's avatar
    Minor bugfix and documentation improvements. · 68888ee8
    Steve Revill authored
    Detail:
      I have done some minor changes to the USB documenation in a few points
      and corrected a smaller bug inside the USB alias handling (used release
      instead interface).
    Author:
      Thomas Milius
    
    Version 0.54. Tagged as 'NetBSD-0_54'
    68888ee8
  • Steve Revill's avatar
    Revert previous commit as it has already been superceded. · 62f5d8e8
    Steve Revill authored
    Version 0.55. Tagged as 'NetBSD-0_55'
    62f5d8e8
  • Jeffrey Lee's avatar
    Fix a few USBDriver bugs · 3c10a2b1
    Jeffrey Lee authored
    Detail:
      build/c/usbdi - Fix compiler warning in usbd_clear_endpoint_stall()
      build/c/usbmodule - Fix detach_device() to deregister any pending attach callback for the detaching device. Fixes crash seen when inserting 16GB USB stick into EHCI port of rev C2 beagleboard (a current surge or something causes the stick to immediately disconnect then reconnect, but the disconnect occurs before the initial attach callback)
      build/c/usbmodule - Fix device_initialise() to use a timeout of 0 if no timeout was specified in the DeviceFS special field
      build/c/usbmodule - Fix the new read_cb() buffer padding logic to only pad up to totalcount instead of filling the entire buffer
    Admin:
      Tested on rev C2 beagleboard.
      This seems to fix the problems that were preventing Steffen Huber's USB CD code from working properly.
    
    
    Version 0.56. Tagged as 'NetBSD-0_56'
    3c10a2b1
  • Jeffrey Lee's avatar
    Fix modules so resources don't get included twice in ROM builds · 32bcd2b5
    Jeffrey Lee authored
    Detail:
      A couple of the USB modules were including their resources both in the Messages module and within themselves, leading to wasted ROM space
      build/OBJOHCIDriver, build/OBJUSBDriver - Tweaked makefiles so that ohcimsgs.o and usbmsgs.o only get built/linked for RAM builds
      build/c/usbmodule - Fix erroneous attempt to free non-registered resource files in ROM builds
      Version - Increased OHCIDriver & USBDriver version numbers
    Admin:
      Tested with Iyonix ROM softload. Saves approx 48k of ROM space.
      Fixes bug #265
    
    
    Version 0.57. Tagged as 'NetBSD-0_57'
    32bcd2b5
  • Ben Avison's avatar
    Build fix · 21c07dfd
    Ben Avison authored
    Detail:
      A couple of source files now have a dependency on an auto-generated
      header file, dev/usb/usbdevs.h. Normally you get away with this, because
      it's created during the export_hdrs phase. But if the first build you do
      on a freshly checked-out build tree includes a rom phase, then srcbuild
      cleans the component between the export_hdrs and rom phases, so the rom
      phase fails. Fixed by adding a couple of static dependencies to Makefile.
    Admin:
      Tested manually.
    
    Version 0.58. Tagged as 'NetBSD-0_58'
    21c07dfd
  • Jeffrey Lee's avatar
    Add the ability to build the USB drivers as HAL-compatible static libraries · 4ca937fd
    Jeffrey Lee authored
    Detail:
      build/Makefile, build/OBJEHCIDriver, build/OBJOHCIDriver, build/OBJUSBDriver - Modified makefiles to build the HAL libs during the export libs phase
      build/!MkHAL,fd7 - Handy script for building the HAL libs
      build/Hdr/usbhal - Header containing definitions for the assembler code. Also gets exported so that HALs know how much workspace to reserve.
      build/c/usbhal - HAL version of usbmodule.c & port.c. Also contains the keyboard scan code, adapted from the code in the Tungsten HAL.
      build/s/porthal - Assembler versions of some port.c routines that were easier to do in assembler than C
      build/s/halheap - OS_Heap code that's been adapted for use in the HAL. Could easily be changed into a standalone library instead of being part of the HAL USB libs. Supports memory-efficient allocation of aligned blocks.
      build/c/ehcihal - HAL version of ehcimodule.c. Currently only supports EHCI controllers exposed via HAL_USBControllerInfo (i.e. no PCI support)
      build/c/ehcimodule, build/c/ohcimodule, build/c/port - Moved riscos_irq_clear into port.c. Removed unused microtime() function.
      build/c/usbmouse - Strip out some debug-related code in non-debug builds
      build/Version - Updated version numbers
      dev/usb/c/ehci, dev/usb/h/ehcivar - Adapted to add support for the HAL build. Apart from the base changes, the code has also been tweaked to significantly reduce the amount of memory used at runtime by the HAL version of the driver.
      dev/usb/c/hid, dev/usb/c/uhub, dev/usb/c/usb, dev/usb/c/usb_quirks, dev/usb/c/usb_subr, dev/usb/c/usbdi, dev/usb/c/usbdi_util, dev/usb/c/usbroothub_subr - Changes to support HAL builds. Mainly disabling bits that won't work in the HAL or disabling bits for RISC OS in general if they weren't being used in the first place.
      dev/usb/c/ohci, dev/usb/h/ohcivar - Basic changes to support HAL builds. However HAL OHCI support is still incomplete.
      dev/usb/h/usb_port - Added support for the HAL build. Also tweaked logprintf definition to get rid of logprintf calls entirely in non-debug builds.
      dev/usb/h/usbdivar - Added support for the HAL build.
      dev/usb/h/usbhal - New header used by the HAL build. Gets included by every C file to ensure the compiler doesn't use sb, and contains structs/macros to allow access to the shared workspace.
    Admin:
      HAL & non-HAL builds tested on rev C2 BB, rev A2 BB-xM, rev C1 TouchBook.
      Non-HAL builds tested with Iyonix ROM softload.
      Needs latest Kernel source for OSEntries.h export.
    
    
    Version 0.59. Tagged as 'NetBSD-0_59'
    4ca937fd
  • Jeffrey Lee's avatar
    Update to work with zero page relocation. Remove ability to cancel transfers by pressing escape · ab69b3d9
    Jeffrey Lee authored
    Detail:
      build/c/port - Removed ability to cancel transfers by pressing escape. Too dangerous for things like mass storage devices, and the code won't work anyway for the common case of being in the wimp
      build/s/triggercbs - Try using OS_ReadSysInfo 6 to get IRQsema ptr before falling back on legacy address
      build/Version - Updated version numbers
    Admin:
      Tested on rev A2 BB-xM
    
    
    Version 0.60. Tagged as 'NetBSD-0_60'
    ab69b3d9
  • Jeffrey Lee's avatar
    Fix null pointer access in OHCIDriver · 6a444648
    Jeffrey Lee authored
    Detail:
      build/c/ohcimodule - Not all PCI_ReadInfo calls were checking for null pointers afterwards, leading to strncpy being called with a null source
      build/Version - Updated OCHIDriver version number
    Admin:
      Tested in Iyonix ROM softload
    
    
    Version 0.61. Tagged as 'NetBSD-0_61'
    6a444648
  • Jeffrey Lee's avatar
    Update HAL USB code for new HAL_KbdScanInterrupt behaviour. Fix data aborts... · 68f485b5
    Jeffrey Lee authored
    Update HAL USB code for new HAL_KbdScanInterrupt behaviour. Fix data aborts during keyboard scanning.
    
    Detail:
      build/c/usbhal, build/h/usbhal - Updated USBHAL_KbdScanInterrupt to behave the same way HAL_KbdScanInterrupt is now expected to behave.
      build/c/ehci, build/c/ohci - Fixed some root hub emulation code which was writing to a global structure before copying it into the destination buffer. Although this works fine in ROM modules it was causing data aborts in the USB HAL libraries due to lack of automatic RW data relocation by the compiler.
      build/Version - Updated version numbers
    Admin:
      Tested on rev C2 BB.
    
    
    Version 0.62. Tagged as 'NetBSD-0_62'
    68f485b5
  • Jeffrey Lee's avatar
    Fix memory overwrites in root hub emulation · d3628750
    Jeffrey Lee authored
    Detail:
      dev/usb/c/ehci, dev/usb/c/ohci - Fixed device descriptor and config descriptor reads writing outside the destination buffer if the buffer was small enough.
      build/Version - Incremented EHCI & OHCI version numbers & dates
    Admin:
      Tested in OMAP3 ROM & Iyonix ROM softload
    
    
    Version 0.63. Tagged as 'NetBSD-0_63'
    d3628750
  • Jeffrey Lee's avatar
    Improve scrollwheel handling · aa5a3fc0
    Jeffrey Lee authored
    Detail:
      build/c/usbmouse - Scrollwheel code now only sends scroll requests in a given direction if the window has an appropriate scroll bar.
      build/Version - Incremented USBDriver version number
    Admin:
      Tested in OMAP3 ROM
      Fixes issue reported on forums where it was possible to scroll filer windows horizontally if you used a mouse with a 'w' axis
    
    
    Version 0.64. Tagged as 'NetBSD-0_64'
    aa5a3fc0
  • Jeffrey Lee's avatar
    Add workaround for what looks like a bug in the DM37x EHCI controller · 2230ce20
    Jeffrey Lee authored
    Detail:
      dev/usb/c/ehci - Force all EHCI data buffers to be 512 byte aligned.
      This is a workaround for what I believe is a bug in the DM37x EHCI controller - It looks like if the last packet of a bulk in transfer is a short packet, and that packet crosses a page boundary, then the second half of the packet doesn't seem to be written out to the correct address in memory.
      Version - increased EHCI module version number
    Admin:
      Tested on rev A2 BB-xM
      Fixes issue reported on forums with unreliable USB ethernet:
      http://www.riscosopen.org/forum/fourms/5/topics/828#posts-9691
    
    
    Version 0.65. Tagged as 'NetBSD-0_65'
    2230ce20
**/Hdr/** gitlab-language=armasm linguist-language=armasm linguist-detectable=true
**/s/** gitlab-language=armasm linguist-language=armasm linguist-detectable=true **/s/** gitlab-language=armasm linguist-language=armasm linguist-detectable=true
**/c/** gitlab-language=c linguist-language=c linguist-detectable=true **/c/** gitlab-language=c linguist-language=c linguist-detectable=true
**/h/** gitlab-language=c linguist-language=c linguist-detectable=true **/h/** gitlab-language=c linguist-language=c linguist-detectable=true
......
/* (0.49) /* (0.65)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 0.49 #define Module_MajorVersion_CMHG 0.65
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 02 Oct 2009 #define Module_Date_CMHG 18 Dec 2011
#define Module_MajorVersion "0.49" #define Module_MajorVersion "0.65"
#define Module_Version 49 #define Module_Version 65
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "02 Oct 2009" #define Module_Date "18 Dec 2011"
#define Module_ApplicationDate "02-Oct-09" #define Module_ApplicationDate "18-Dec-11"
#define Module_ComponentName "NetBSD" #define Module_ComponentName "NetBSD"
#define Module_ComponentPath "mixed/RiscOS/Sources/HWSupport/USB/NetBSD" #define Module_ComponentPath "mixed/RiscOS/Sources/HWSupport/USB/NetBSD"
#define Module_FullVersion "0.49" #define Module_FullVersion "0.65"
#define Module_HelpVersion "0.49 (02 Oct 2009)" #define Module_HelpVersion "0.65 (18 Dec 2011)"
#define Module_LibraryVersionInfo "0:49" #define Module_LibraryVersionInfo "0:65"
| Copyright 2011 Castle Technology Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine export PHASE=hdrs COMPONENT=USBDriver THROWBACK=-throwback
amu_machine export PHASE=libs COMPONENT=USBDriver THROWBACK=-throwback
amu_machine export PHASE=hdrs COMPONENT=OHCIDriver THROWBACK=-throwback
amu_machine export PHASE=libs COMPONENT=OHCIDriver THROWBACK=-throwback
amu_machine export PHASE=hdrs COMPONENT=EHCIDriver THROWBACK=-throwback
amu_machine export PHASE=libs COMPONENT=EHCIDriver THROWBACK=-throwback
This diff is collapsed.
; Copyright 2011 Castle Technology Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; HAL USB workspace structure
; This workspace shouldn't be poked directly by the HAL. The only reason
; it gets exported is to allow USBHAL_WS_Size to be read, to allow the
; correct amount of memory to be reserved in the HAL workspace at sb
; USBHAL_WorkspaceOffset should then be set to the offset of this memory
; Note: This must be kept in sync with the matching C struct in dev/usb/usbhal.h
^ 0
USBHAL_WS_Heap_Normal # 4 ; Heap structure for malloc & free
USBHAL_WS_Heap_NCNB # 4 ; Heap structure for malloc_contig & free_contig
USBHAL_WS_allbuses # 8 ; TAILQ of buses
USBHAL_WS_usbbus_no # 4 ; Next number to use
USBHAL_WS_monotonictime # 4 ; Centisecond counter equivalent to OS_ReadMonotonicTime
USBHAL_WS_callouts # 4 ; Head of callouts list
USBHAL_WS_irqsema # 4 ; nonzero when processing interrupts
USBHAL_WS_rediscover # 4 ; re_discover callout
USBHAL_WS_t_handles # 4 ; tsleep handle list
USBHAL_WS_t_locks # 4 ; tsleep lock list
USBHAL_WS_nhandles # 4 ; tsleep handle count
USBHAL_WS_kbdflags # 4 ; Sticky keyboard scan bits
USBHAL_WS_callbacks # 4 ; Array of callbacks
USBHAL_WS_nextcb # 4 ; Index of next callback to run
USBHAL_WS_numcb # 4 ; Number of callbacks
USBHAL_WS_Size # 0
END
...@@ -29,7 +29,7 @@ USBDIR = <Lib$Dir>.USB ...@@ -29,7 +29,7 @@ USBDIR = <Lib$Dir>.USB
CINCLUDES = -Itbox:,TCPIPLibs:,^.,OS: CINCLUDES = -Itbox:,TCPIPLibs:,^.,OS:
CDEFINES += ${CDEBUG} -DKERNEL -D_KERNEL -Dpaddr_t=int -D__P(A)=A -DKLD_MODULE -DDISABLE_PACKED CDEFINES += ${CDEBUG} -DKERNEL -D_KERNEL -Dpaddr_t=int -D__P(A)=A -DKLD_MODULE -DDISABLE_PACKED
CMHGINCLUDES = ${CINCLUDES} CMHGINCLUDES = ${CINCLUDES}
CMHGDEFINES = -DMSGLOC=${MSGLOC} ${CDEBUG} CMHGDEFINES = ${CDEBUG}
CFLAGS += -ff -wp -wc -zm -zps1 CFLAGS += -ff -wp -wc -zm -zps1
LDFLAGS = -LIST maps.${TARGET} -MAP -Xref -Symbols rm.sym${TARGET} LDFLAGS = -LIST maps.${TARGET} -MAP -Xref -Symbols rm.sym${TARGET}
...@@ -50,6 +50,7 @@ UNAME= "RISC_OS" ...@@ -50,6 +50,7 @@ UNAME= "RISC_OS"
clean: clean:
${WIPE} o ${WFLAGS} ${WIPE} o ${WFLAGS}
${WIPE} o_hal ${WFLAGS}
${WIPE} aif ${WFLAGS} ${WIPE} aif ${WFLAGS}
${WIPE} aof ${WFLAGS} ${WIPE} aof ${WFLAGS}
${WIPE} rm ${WFLAGS} ${WIPE} rm ${WFLAGS}
...@@ -69,13 +70,14 @@ all: o._dirs ...@@ -69,13 +70,14 @@ all: o._dirs
export: export_${PHASE} export: export_${PHASE}
export_libs: export_libs: ${USBDIR}.o.${COMPONENT}
@echo ${COMPONENT}: export complete (libs) @echo ${COMPONENT}: export complete (libs)
export_hdrs: ^.dev.usb.h.usbdevs export_hdrs: ^.dev.usb.h.usbdevs
${MKDIR} ${USBDIR}.dev.usb.h ${MKDIR} ${USBDIR}.dev.usb.h
${MKDIR} ${USBDIR}.h ${MKDIR} ${USBDIR}.h
${MKDIR} ${USBDIR}.sys.h ${MKDIR} ${USBDIR}.sys.h
${MKDIR} ${USBDIR}.Hdr
${CP} ^.dev.usb.h.usb ${USBDIR}.dev.usb.h.usb ${CPFLAGS} ${CP} ^.dev.usb.h.usb ${USBDIR}.dev.usb.h.usb ${CPFLAGS}
${CP} ^.dev.usb.h.usbdevs ${USBDIR}.dev.usb.h.usbdevs ${CPFLAGS} ${CP} ^.dev.usb.h.usbdevs ${USBDIR}.dev.usb.h.usbdevs ${CPFLAGS}
${CP} ^.dev.usb.h.usbdi ${USBDIR}.dev.usb.h.usbdi ${CPFLAGS} ${CP} ^.dev.usb.h.usbdi ${USBDIR}.dev.usb.h.usbdi ${CPFLAGS}
...@@ -83,6 +85,7 @@ export_hdrs: ^.dev.usb.h.usbdevs ...@@ -83,6 +85,7 @@ export_hdrs: ^.dev.usb.h.usbdevs
${CP} h.USBDevFS ${USBDIR}.h.USBDevFS ${CPFLAGS} ${CP} h.USBDevFS ${USBDIR}.h.USBDevFS ${CPFLAGS}
${CP} ^.sys.h.device ${USBDIR}.sys.h.device ${CPFLAGS} ${CP} ^.sys.h.device ${USBDIR}.sys.h.device ${CPFLAGS}
${CP} ^.VersionNum ${USBDIR}.NetBSDVersion ${CPFLAGS} ${CP} ^.VersionNum ${USBDIR}.NetBSDVersion ${CPFLAGS}
${CP} Hdr.usbhal ${USBDIR}.Hdr.usbhal ${CPFLAGS}
@echo ${COMPONENT}: export complete (hdrs) @echo ${COMPONENT}: export complete (hdrs)
resources: resources_${COMPONENT} resources: resources_${COMPONENT}
...@@ -105,6 +108,7 @@ resources_USBDriver: LocalRes:USBDriver ${DEVICELIST} ...@@ -105,6 +108,7 @@ resources_USBDriver: LocalRes:USBDriver ${DEVICELIST}
o._dirs: o._dirs:
${MKDIR} o ${MKDIR} o
${MKDIR} o_hal
${MKDIR} aif ${MKDIR} aif
${MKDIR} aof ${MKDIR} aof
${MKDIR} rm ${MKDIR} rm
...@@ -124,12 +128,8 @@ usbmodule.o usbkboard.o: usbmodhead.h ...@@ -124,12 +128,8 @@ usbmodule.o usbkboard.o: usbmodhead.h
Resources.<Locale>.USBDevs: bin.makedevs ^.dev.usb.h.usbdevs ^.dev.usb.h.usbdevs_data Resources.<Locale>.USBDevs: bin.makedevs ^.dev.usb.h.usbdevs ^.dev.usb.h.usbdevs_data
${RUN}bin.makedevs > Resources.<Locale>.USBDevs ${RUN}bin.makedevs > Resources.<Locale>.USBDevs
# Remove the usbmodhead after creating the SWI table because if OHCIDriver
# makes it then it has the wrong messages file in it
USBDriver.h: usbmodhead.h USBDriver.h: usbmodhead.h
${SED} -n "/define USBDriver_/p" h.usbmodhead > h.USBDriver ${SED} -n "/define USBDriver_/p" h.usbmodhead > h.USBDriver
${RM} h.usbmodhead
${RM} o.usbmodhead
bin.makedevs: c.makedevs ${CLIB} ${DIRS} bin.makedevs: c.makedevs ${CLIB} ${DIRS}
${MAKE} -f makedevs/mk COMPONENT=makedevs THROWBACK=${THROWBACK} ${MAKE} -f makedevs/mk COMPONENT=makedevs THROWBACK=${THROWBACK}
...@@ -143,6 +143,15 @@ ohcimsgs.o: Resources.<Locale>.OHCIMessages ...@@ -143,6 +143,15 @@ ohcimsgs.o: Resources.<Locale>.OHCIMessages
ehcimsgs.o: Resources.<Locale>.EHCIMessages ehcimsgs.o: Resources.<Locale>.EHCIMessages
resgen resource_files o.ehcimsgs Resources.<Locale>.EHCIMessages ${MSGLOC} resgen resource_files o.ehcimsgs Resources.<Locale>.EHCIMessages ${MSGLOC}
# HAL libraries:
.SUFFIXES: .o_hal
.c.o_hal:; ${CC} -APCS 3/nofp/noswst -wp -ff -DUSBHAL -c -depend !Depend -DKERNEL -D_KERNEL -Dpaddr_t=int -D__P(A)=A -DKLD_MODULE -DDISABLE_PACKED ${CINCLUDES} ${THROWBACK} -o $@ $<
.s.o_hal:; ${AS} ${ASFLAGS} -APCS 3/nofp/noswst -o $@ $<
${USBDIR}.o.${COMPONENT}: ${OBJS_HAL} ${DIRS}
${MKDIR} ${USBDIR}.o
${AR} ${ARFLAGS} ${USBDIR}.o.${COMPONENT} ${OBJS_HAL}
# RISC OS debug: # RISC OS debug:
aif.${COMPONENT}: ${RAM_OBJS} ${RAM_LIBS} ${CLIB} ${DIRS} aif.${COMPONENT}: ${RAM_OBJS} ${RAM_LIBS} ${CLIB} ${DIRS}
link -base 0 -aif -bin -d -o $@ ${RAM_OBJS} ${RAM_LIBS} ${CLIB} link -base 0 -aif -bin -d -o $@ ${RAM_OBJS} ${RAM_LIBS} ${CLIB}
...@@ -165,5 +174,7 @@ bbe-usb: bbe-generic ...@@ -165,5 +174,7 @@ bbe-usb: bbe-generic
${CP} rom_link_v.${TARGET} ${VERBATIMROMLINK} ${CPFLAGS} ${CP} rom_link_v.${TARGET} ${VERBATIMROMLINK} ${CPFLAGS}
BBE_Export_File ^.VersionNum BBE_Export_File ^.VersionNum
# Static dependencies:
o.makedevs o.usbmouse: ^.dev.usb.h.usbdevs
# Dynamic dependencies: # Dynamic dependencies:
...@@ -8,4 +8,10 @@ ehci.o \ ...@@ -8,4 +8,10 @@ ehci.o \
port.o \ port.o \
call_veneer.o \ call_veneer.o \
\ \
triggercbs.o triggercbs.o \
usbroothub_subr.o
OBJS_HAL = \
o_hal.ehci \
o_hal.usbroothub_subr \
o_hal.ehcihal
...@@ -4,5 +4,9 @@ ohcimodule.o \ ...@@ -4,5 +4,9 @@ ohcimodule.o \
ohci.o \ ohci.o \
port.o \ port.o \
call_veneer.o \ call_veneer.o \
triggercbs.o \ triggercbs.o
ohcimsgs.o
\ No newline at end of file RAM_OBJS = ${OBJS} ohcimsgs.o
OBJS_HAL = \
o_hal.ohci
...@@ -13,5 +13,17 @@ usbkboard.o \ ...@@ -13,5 +13,17 @@ usbkboard.o \
hid.o \ hid.o \
bufman.o \ bufman.o \
triggercbs.o \ triggercbs.o \
call_veneer.o \ call_veneer.o
usbmsgs.o
RAM_OBJS = ${OBJS} usbmsgs.o
OBJS_HAL = \
o_hal.usb \
o_hal.usbdi \
o_hal.usb_subr \
o_hal.usbdi_util \
o_hal.usb_quirks \
o_hal.uhub \
o_hal.porthal \
o_hal.halheap \
o_hal.usbhal
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
VersionNum file really,as a work around define them here so the CMHG VersionNum file really,as a work around define them here so the CMHG
file remains unaltered */ file remains unaltered */
#define OHCIDriverModule_Module_Date_CMHG 31 Dec 2005 #define OHCIDriverModule_Module_Date_CMHG 04 Dec 2011
#define OHCIDriverModule_MajorVersion_CMHG 0.29 #define OHCIDriverModule_MajorVersion_CMHG 0.37
#define EHCIDriverModule_Module_Date_CMHG 15 May 2005 #define EHCIDriverModule_Module_Date_CMHG 18 Dec 2011
#define EHCIDriverModule_MajorVersion_CMHG 0.14 #define EHCIDriverModule_MajorVersion_CMHG 0.21
#define USBDriverModule_Module_Date_CMHG 22 Feb 2006 #define USBDriverModule_Module_Date_CMHG 10 Dec 2011
#define USBDriverModule_MajorVersion_CMHG 0.47 #define USBDriverModule_MajorVersion_CMHG 0.55
/* Copyright 2011 Castle Technology Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* HAL version of ehcimodule.c */
#include <dev/usb/usbhal.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <machine/bus.h>
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdivar.h>
#include <dev/usb/ehcireg.h>
#include <dev/usb/ehcivar.h>
#include "Global/RISCOS.h"
#include "Global/Services.h"
#include "Global/HALEntries.h"
/* Have to avoid including stdio as there's a clash with the BSD stuff */
#define __stdio_h
#include "DebugLib/DebugLib.h"
#include "service.h"
#include "oslib/devicefs.h"
typedef struct
{
int type;
int flags;
void *hw;
int devno;
} usbinfo;
extern size_t HAL_USBControllerInfo(int idx,usbinfo *info,size_t size);
extern int HAL_IRQEnable(int device);
extern int HAL_IRQDisable(int device);
extern void HAL_IRQClear(int device);
extern device_ptr_t register_bus(device_ptr_t bus);
static void init_device(usbinfo *info,int idx)
{
ehci_softc_t *ehci = malloc(sizeof(ehci_softc_t));
memset(ehci,0,sizeof(ehci_softc_t));
sprintf(ehci->sc_bus.bdev.dv_xname,"EHCI%d",idx);
ehci->sc_irqdevno = info->devno;
ehci->sc_ncomp = 2;
/* Abuse iot & ioh members to store base addr & flags */
ehci->iot = (bus_space_tag_t) info->hw;
ehci->ioh = (bus_space_handle_t) info->flags;
ehci_init(ehci);
/* Enable IRQ */
HAL_IRQEnable(ehci->sc_irqdevno);
/* Register with USBDriver */
register_bus((device_ptr_t) ehci);
}
void USBHAL_EHCIDriver_Init(void)
{
/* Find and initialise all controllers. Note that this currently only
supports controllers exposed via HAL_USBControllerInfo */
int idx=0;
do {
usbinfo info;
size_t usbinfolen = HAL_USBControllerInfo(idx,&info,sizeof(info));
if((usbinfolen >= sizeof(info)) && (info.type == 1))
init_device(&info,idx);
else if(!usbinfolen)
return;
idx++;
} while(1);
}
int usbhal_ehci_do_intr(struct usbd_bus *bus,int irqdevno)
{
ehci_softc_t *sc = (ehci_softc_t *)bus;
if(irqdevno != sc->sc_irqdevno)
return 0;
int ret = ehci_intr(sc);
return ret;
}
void usbhal_ehci_shutdown(struct usbd_bus *bus)
{
ehci_softc_t *sc = (ehci_softc_t *)bus;
/* Disable IRQ */
HAL_IRQDisable(sc->sc_irqdevno);
/* Reset controller */
EOWRITE4(sc, EHCI_USBCMD, 0);
EOWRITE4(sc, EHCI_USBCMD, EHCI_CMD_HCRESET);
EOREAD4(sc, EHCI_USBCMD);/* flush the command */
/* Wait a bit */
delay(1000);
/* Clear any lingering IRQ */
HAL_IRQClear(sc->sc_irqdevno);
}
/* #define these because I'm feeling lazy */
#define ehci_base ((volatile int *)iot)
#define registers_32bit (((int)ioh) & 8)
void bus_space_write_4 (bus_space_tag_t iot, bus_space_handle_t ioh, int o, int x)
{
ehci_base[o>>2] = x;
}
int bus_space_read_4 (bus_space_tag_t iot, bus_space_handle_t ioh, int o)
{
return ehci_base[o>>2];
}
void bus_space_write_2 (bus_space_tag_t iot, bus_space_handle_t ioh, int o, int x)
{
if (registers_32bit)
{
x &= 0xFFFF;
if (o&2)
ehci_base[o>>2]=(ehci_base[o>>2]&0xFFFF)|(x<<16);
else
ehci_base[o>>2]=(ehci_base[o>>2]&0xFFFF0000)|x;
}
else
((uint16_t*) ehci_base)[o>>1] = x;
}
int bus_space_read_2 (bus_space_tag_t iot, bus_space_handle_t ioh, int o)
{
if (registers_32bit)
{
if (o&2)
return ((uint32_t*)ehci_base)[o>>2]>>16;
else
return ((uint32_t*)ehci_base)[o>>2]&0xFFFF;
}
return ((uint16_t*) ehci_base)[o>>1];
}
void bus_space_write_1 (bus_space_tag_t iot, bus_space_handle_t ioh, int o, int x)
{
if (registers_32bit)
{
x &= 0xFF;
int t = ehci_base[o>>2];
t &= ~(0xFF<<((o&3)*8));
t |= x<<((o&3)*8);
ehci_base[o>>2] = t;
}
else
((uint8_t*) ehci_base)[o] = x;
}
int bus_space_read_1 (bus_space_tag_t iot, bus_space_handle_t ioh, int o)
{
if (registers_32bit)
return (((uint32_t*)ehci_base)[o/4]>>((o&3)*8))&0xff;
return ((uint8_t*) ehci_base)[o];
}
...@@ -65,7 +65,7 @@ void* private_word; ...@@ -65,7 +65,7 @@ void* private_word;
volatile int* ehci_base; volatile int* ehci_base;
ehci_softc_t ehci_soft; ehci_softc_t ehci_soft;
struct device * usb_soft; struct device * usb_soft = NULL;
extern int * init_veneer (void); extern int * init_veneer (void);
//extern void* resource_files (void); //extern void* resource_files (void);
#ifdef EHCI_DEBUG #ifdef EHCI_DEBUG
...@@ -142,23 +142,21 @@ int unhandled_irqs; ...@@ -142,23 +142,21 @@ int unhandled_irqs;
int registers_32bit=0; //(used with rhenium) int registers_32bit=0; //(used with rhenium)
#endif /* RHENIUM */ #endif /* RHENIUM */
_kernel_oserror* register_bus(void *in,struct device **out)
//_kernel_oserror* bus_register (_kernel_swi_regs* r, void* pw, void* h) {
//{ *out = NULL;
// /* register with the usbdriver module if it's already resident */ /* Check USBDriver is new enough */
// dprintf (("", "Registering with USB driver\n")); int version;
// _kernel_oserror *e = _swix(USBDriver_Version,_OUT(0),&version);
// memset (&ehci_soft, 0, sizeof ehci_soft); if(e)
// sprintf (ehci_soft.sc_bus.bdev.dv_xname, "EHCI%d", instance); return e;
// /* fix n companions */ if(version < RISCOS_USBDRIVER_API_VERSION)
// ehci_soft.sc_ncomp = 2; return (_kernel_oserror*)"\0\0\0\0USBDriver too old";
// ehci_init (&ehci_soft); /* Now attempt to register */
// e = _swix(USBDriver_RegisterBus, _INR(0,1)|_OUT(0),in,RISCOS_USBDRIVER_API_VERSION,out);
// _swix (USBDriver_RegisterBus, _IN(0)|_OUT(0), if(e) *out = NULL;
// &ehci_soft, &usb_soft); return e;
// }
// return NULL;
//}
_kernel_oserror* new_instance (_kernel_swi_regs* r, void* pw, void* h) _kernel_oserror* new_instance (_kernel_swi_regs* r, void* pw, void* h)
{ {
...@@ -172,16 +170,15 @@ _kernel_oserror* new_instance (_kernel_swi_regs* r, void* pw, void* h) ...@@ -172,16 +170,15 @@ _kernel_oserror* new_instance (_kernel_swi_regs* r, void* pw, void* h)
/* register with the usbdriver module if it's already resident */ /* register with the usbdriver module if it's already resident */
dprintf (("", "Registering with USB driver\n")); dprintf (("", "Registering with USB driver\n"));
e = register_bus(&ehci_soft, &usb_soft);
// memset (&ehci_soft, 0, sizeof ehci_soft); if (e)
// sprintf (ehci_soft.sc_bus.bdev.dv_xname, "EHCI%d", instance); {
// /* fix n companions */ dprintf (("", "Failed to register: %s\n", e->errmess));
// ehci_soft.sc_ncomp = 2; }
// ehci_init (&ehci_soft); else
{
_swix (USBDriver_RegisterBus, _IN(0)|_OUT(0), dprintf (("", "Registering with USB driver-done\n"));
&ehci_soft, &usb_soft); }
dprintf (("", "Registering with USB driver-done\n"));
// allow enough space for name, % and number, then space, and // allow enough space for name, % and number, then space, and
...@@ -203,19 +200,6 @@ _kernel_oserror* new_instance (_kernel_swi_regs* r, void* pw, void* h) ...@@ -203,19 +200,6 @@ _kernel_oserror* new_instance (_kernel_swi_regs* r, void* pw, void* h)
_kernel_oserror *module_init(const char *cmd_tail, int podule_base, void *pw) { _kernel_oserror *module_init(const char *cmd_tail, int podule_base, void *pw) {
_kernel_oserror* e = 0; _kernel_oserror* e = 0;
#ifdef EHCI_DEBUG
// struct dev_struct {
// devicefs_device dev;
// int null;
// char name[32];
// }* dev = NULL;
#endif
callx_init (pw); callx_init (pw);
...@@ -348,27 +332,6 @@ _kernel_oserror *module_init(const char *cmd_tail, int podule_base, void *pw) { ...@@ -348,27 +332,6 @@ _kernel_oserror *module_init(const char *cmd_tail, int podule_base, void *pw) {
#ifdef EHCI_DEBUG #ifdef EHCI_DEBUG
usbdebug = ehcidebug = atoi (getenv ("ehcidebug")); usbdebug = ehcidebug = atoi (getenv ("ehcidebug"));
irq0 = gettime () / 1000; irq0 = gettime () / 1000;
// dev = calloc (sizeof *dev, 1);
// strcpy (dev->name, ehci_soft.sc_bus.bdev.dv_xname);
//
// dev->dev.name_offset = dev->name - (char*) dev;
// dev->dev.flags = 3;
// dev->dev.tx_flags = 0x8;
// dev->dev.tx_buffer_size = 0;
// dev->dev.rx_flags = 0x8;
// dev->dev.rx_buffer_size = 1024;
//
// e = _swix (DeviceFS_Register, _INR (0, 7) | _OUT(0),
// 4,
// dev,
// driver_entry,
// NULL,
// pw,
// NULL,
// INT_MAX, // XXX should be -1, but that doesn't seem to work
// INT_MAX,
// &irq_device);
#endif #endif
_swix (OS_ClaimDeviceVector, _INR(0,4), _swix (OS_ClaimDeviceVector, _INR(0,4),
...@@ -385,6 +348,7 @@ _kernel_oserror *module_init(const char *cmd_tail, int podule_base, void *pw) { ...@@ -385,6 +348,7 @@ _kernel_oserror *module_init(const char *cmd_tail, int podule_base, void *pw) {
memset (&ehci_soft, 0, sizeof ehci_soft); memset (&ehci_soft, 0, sizeof ehci_soft);
sprintf (ehci_soft.sc_bus.bdev.dv_xname, "EHCI%d", instance); sprintf (ehci_soft.sc_bus.bdev.dv_xname, "EHCI%d", instance);
ehci_soft.sc_irqdevno = device_number;
/* fix n companions */ /* fix n companions */
ehci_soft.sc_ncomp = 2; ehci_soft.sc_ncomp = 2;
...@@ -455,17 +419,16 @@ void module_services(int service_number, _kernel_swi_regs *r, void *pw) ...@@ -455,17 +419,16 @@ void module_services(int service_number, _kernel_swi_regs *r, void *pw)
case Service_USBDriver_Starting: case Service_USBDriver_Starting:
if (usb_soft == NULL) if (usb_soft == NULL)
{ {
dprintf (("", "Registering with USB driver from svcecall\n"));
_kernel_oserror *e = register_bus(&ehci_soft,&usb_soft);
if(e)
{
dprintf (("", "Registering with USB driver from svcecall\n")); dprintf (("", "Failed to register: %s\n", e->errmess));
_swix (USBDriver_RegisterBus, _IN(0)|_OUT(0), }
&ehci_soft, &usb_soft); else
dprintf (("", "Registering with USB driver from svcecall-done\n")); {
dprintf (("", "Registering with USB driver from svcecall-done\n"));
}
} }
break; break;
case Service_USBDriver_Dying: case Service_USBDriver_Dying:
...@@ -841,11 +804,6 @@ softintr (_kernel_swi_regs* r, void* pw) ...@@ -841,11 +804,6 @@ softintr (_kernel_swi_regs* r, void* pw)
return 1; return 1;
} }
void riscos_irqclear()
{
_swix(OS_Hardware, _IN(0)|_INR(8,9), device_number, 0, EntryNo_HAL_IRQClear);
}
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
//#ifdef EHCI_DEBUG //#ifdef EHCI_DEBUG
// //
......
...@@ -76,7 +76,7 @@ void* private_word; ...@@ -76,7 +76,7 @@ void* private_word;
volatile int* ohci_base; volatile int* ohci_base;
ohci_softc_t ohci_soft; ohci_softc_t ohci_soft;
struct device * usb_soft; struct device * usb_soft=NULL;
extern int * init_veneer (void); extern int * init_veneer (void);
extern void* resource_files (void); extern void* resource_files (void);
#ifdef OHCI_DEBUG #ifdef OHCI_DEBUG
...@@ -275,21 +275,26 @@ int do_ohci_perror(int port) ...@@ -275,21 +275,26 @@ int do_ohci_perror(int port)
#endif /* RHENIUM */ #endif /* RHENIUM */
//_kernel_oserror* bus_register (_kernel_swi_regs* r, void* pw, void* h) _kernel_oserror* register_bus(void *in,struct device **out)
//{ {
// /* register with the usbdriver module if it's already resident */ *out = NULL;
// dprintf (("", "Registering with USB driver\n")); /* Check USBDriver is new enough */
// _swix (USBDriver_RegisterBus, _IN(0)|_OUT(0), int version;
// &ohci_soft, &usb_soft); _kernel_oserror *e = _swix(USBDriver_Version,_OUT(0),&version);
// dprintf (("", "Registering with USB driver-done\n")); if(e)
// return e;
// return NULL; if(version < RISCOS_USBDRIVER_API_VERSION)
//} return (_kernel_oserror*)"\0\0\0\0USBDriver too old";
// /* Now attempt to register */
e = _swix(USBDriver_RegisterBus, _INR(0,1)|_OUT(0),in,RISCOS_USBDRIVER_API_VERSION,out);
if(e) *out = NULL;
return e;
}
_kernel_oserror* new_instance (_kernel_swi_regs* r, void* pw, void* h) _kernel_oserror* new_instance (_kernel_swi_regs* r, void* pw, void* h)
{ {
_kernel_oserror * e; _kernel_oserror * e;
char* v; char* v=NULL;
(void) r; (void) r;
(void) pw; (void) pw;
...@@ -315,9 +320,15 @@ _kernel_oserror* new_instance (_kernel_swi_regs* r, void* pw, void* h) ...@@ -315,9 +320,15 @@ _kernel_oserror* new_instance (_kernel_swi_regs* r, void* pw, void* h)
#endif /* RHENIUM */ #endif /* RHENIUM */
/* now we know the root hub info, register it with USBDriver */ /* now we know the root hub info, register it with USBDriver */
dprintf (("", "Init-Registering with USB driver\n")); dprintf (("", "Init-Registering with USB driver\n"));
_swix (USBDriver_RegisterBus, _IN(0)|_OUT(0), e = register_bus(&ohci_soft, &usb_soft);
&ohci_soft, &usb_soft); if (e)
dprintf (("", "Init-Registering with USB driver-done\n")); {
dprintf (("", "Failed to register: %s\n", e->errmess));
}
else
{
dprintf (("", "Init-Registering with USB driver-done\n"));
}
/* allow enough space for name, % and number, then space, and /* allow enough space for name, % and number, then space, and
another number */ another number */
...@@ -501,6 +512,7 @@ _kernel_oserror *module_init(const char *cmd_tail, int podule_base, void *pw) { ...@@ -501,6 +512,7 @@ _kernel_oserror *module_init(const char *cmd_tail, int podule_base, void *pw) {
memset (&ohci_soft, 0, sizeof ohci_soft); memset (&ohci_soft, 0, sizeof ohci_soft);
sprintf (ohci_soft.sc_bus.bdev.dv_xname, "OHCI%d", instance); sprintf (ohci_soft.sc_bus.bdev.dv_xname, "OHCI%d", instance);
ohci_soft.sc_irqdevno = device_number;
#ifdef RHENIUM #ifdef RHENIUM
...@@ -510,6 +522,7 @@ _kernel_oserror *module_init(const char *cmd_tail, int podule_base, void *pw) { ...@@ -510,6 +522,7 @@ _kernel_oserror *module_init(const char *cmd_tail, int podule_base, void *pw) {
{ {
#endif /* RHENIUM */ #endif /* RHENIUM */
_swix (PCI_ReadInfo, _INR(0,3), (1<<16), &v, 4, pci_device); _swix (PCI_ReadInfo, _INR(0,3), (1<<16), &v, 4, pci_device);
if (v == 0) v = (char *)" ";
strncpy (ohci_soft.sc_vendor, v, sizeof ohci_soft.sc_vendor-1); strncpy (ohci_soft.sc_vendor, v, sizeof ohci_soft.sc_vendor-1);
// [sizeof ohci_soft.sc_vendor - 1] = '\0'; // [sizeof ohci_soft.sc_vendor - 1] = '\0';
#ifdef RHENIUM #ifdef RHENIUM
...@@ -704,10 +717,16 @@ void module_services(int service_number, _kernel_swi_regs *r, void *pw) ...@@ -704,10 +717,16 @@ void module_services(int service_number, _kernel_swi_regs *r, void *pw)
{ {
if(ohci_soft.sc_vendor[0]!='\0') // (means svce_PCI has happened) if(ohci_soft.sc_vendor[0]!='\0') // (means svce_PCI has happened)
{ /* we're here in callback.. so foo we go */ { /* we're here in callback.. so foo we go */
dprintf (("", "Registering with USB driver from svcecall \n")); dprintf (("", "Registering with USB driver from svcecall\n"));
_swix (USBDriver_RegisterBus, _IN(0)|_OUT(0), _kernel_oserror *e = register_bus(&ohci_soft,&usb_soft);
&ohci_soft, &usb_soft); if(e)
dprintf (("", "Registering with USB driver from svcecall-done\n")); {
dprintf (("", "Failed to register: %s\n", e->errmess));
}
else
{
dprintf (("", "Registering with USB driver from svcecall-done\n"));
}
} }
} }
break; break;
...@@ -725,6 +744,7 @@ void module_services(int service_number, _kernel_swi_regs *r, void *pw) ...@@ -725,6 +744,7 @@ void module_services(int service_number, _kernel_swi_regs *r, void *pw)
{ {
#endif /* RHENIUM */ #endif /* RHENIUM */
_swix (PCI_ReadInfo, _INR(0,3), (1<<16), &v, 4, pci_device); _swix (PCI_ReadInfo, _INR(0,3), (1<<16), &v, 4, pci_device);
if (v == 0) v = (char *)" ";
strncpy (ohci_soft.sc_vendor, v, sizeof ohci_soft.sc_vendor-1); strncpy (ohci_soft.sc_vendor, v, sizeof ohci_soft.sc_vendor-1);
// [sizeof ohci_soft.sc_vendor - 1] = '\0'; // [sizeof ohci_soft.sc_vendor - 1] = '\0';
#ifdef RHENIUM #ifdef RHENIUM
...@@ -1035,8 +1055,3 @@ softintr (_kernel_swi_regs* r, void* pw) ...@@ -1035,8 +1055,3 @@ softintr (_kernel_swi_regs* r, void* pw)
ohci_softintr ((void*) r->r[0]); ohci_softintr ((void*) r->r[0]);
return 0; return 0;
} }
void riscos_irqclear()
{
_swix(OS_Hardware, _IN(0)|_INR(8,9), device_number, 0, EntryNo_HAL_IRQClear);
}
...@@ -12,6 +12,11 @@ ...@@ -12,6 +12,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* This is the module version of port.c
For the HAL version, see usbhal.c and porthal.s
*/
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
...@@ -122,14 +127,6 @@ delay (int d) ...@@ -122,14 +127,6 @@ delay (int d)
_swix (OS_Hardware, _IN(0)|_INR(8,9), d, 0, EntryNo_HAL_CounterDelay); _swix (OS_Hardware, _IN(0)|_INR(8,9), d, 0, EntryNo_HAL_CounterDelay);
} }
void
microtime(struct timeval *thetime)
{
uint64_t t = gettime ();
thetime->tv_sec = (unsigned long) (t / 1000000000);
thetime->tv_usec = (unsigned long) ((t / 1000) % 1000000);
}
void void
selrecord(struct proc *selector, struct selinfo *selinfo) selrecord(struct proc *selector, struct selinfo *selinfo)
{ {
...@@ -179,8 +176,9 @@ extern int private_word; ...@@ -179,8 +176,9 @@ extern int private_word;
extern void callout_veneer (void); extern void callout_veneer (void);
void void
callout_init (struct callout* c) callout_init (struct callout* c,int ignored)
{ {
(void)ignored;
#ifdef USB_DEBUG0 #ifdef USB_DEBUG0
if (usbdebug > 15) dprintf (("Port", "callout init %p\n", c)); if (usbdebug > 15) dprintf (("Port", "callout init %p\n", c));
#endif #endif
...@@ -287,26 +285,20 @@ int tsleep (void* ident, int priority, const char* wmesg, int timo, int noblock) ...@@ -287,26 +285,20 @@ int tsleep (void* ident, int priority, const char* wmesg, int timo, int noblock)
t_locks[i] = 0; t_locks[i] = 0;
/* wait until the lock is free */ /* wait until the lock is free */
int flags = 0;
_kernel_irqs_on (); _kernel_irqs_on ();
if (timo) { if (timo) {
do { do {
triggercbs (); triggercbs ();
t2 = gettime (); t2 = gettime ();
_swix (OS_ReadEscapeState, _OUT(_FLAGS), &flags);
} }
while ((t_locks[i] == 0) && (t2 < t1) && ((flags & _C) == 0)); while ((t_locks[i] == 0) && (t2 < t1));
} }
else else
{ {
while (t_locks[i] == 0 && (flags & _C) == 0) while (t_locks[i] == 0)
{ {
/* allow foreground process to function while we're waiting */
/* if (noblock) _swix (OS_UpCall, _INR(0,1), 6, &t_locks[i]);*/
/*// _swix (OS_UpCall, _INR(0,1), 6, &t_locks[i]);*/
triggercbs (); triggercbs ();
_swix (OS_ReadEscapeState, _OUT(_FLAGS), &flags);
} }
#ifdef USB_DEBUG0 #ifdef USB_DEBUG0
t2 = gettime (); t2 = gettime ();
...@@ -314,11 +306,6 @@ int tsleep (void* ident, int priority, const char* wmesg, int timo, int noblock) ...@@ -314,11 +306,6 @@ int tsleep (void* ident, int priority, const char* wmesg, int timo, int noblock)
} }
_kernel_irqs_off (); _kernel_irqs_off ();
if (flags & _C)
{
_kernel_osbyte (126, 0, 0);
}
t_handles[i] = 0; t_handles[i] = 0;
#ifdef USB_DEBUG0 #ifdef USB_DEBUG0
...@@ -469,3 +456,8 @@ void softintr_disestablish (void* p) ...@@ -469,3 +456,8 @@ void softintr_disestablish (void* p)
free (p); free (p);
} }
#endif #endif
void riscos_irqclear(int devno)
{
_swix(OS_Hardware, _IN(0)|_INR(8,9), devno, 0, EntryNo_HAL_IRQClear);
}
This diff is collapsed.
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* Changed 17.02.2010 TM DeviceFSCallDevice_TransferInfo and notation of padded bytes. */
#include "usbmodhead.h" #include "usbmodhead.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
...@@ -66,8 +67,11 @@ ...@@ -66,8 +67,11 @@
#define DeviceFSCallDevice_GetHandles 0x80000003 #define DeviceFSCallDevice_GetHandles 0x80000003
#define DeviceFSCallDevice_GetLocation 0x80000004 #define DeviceFSCallDevice_GetLocation 0x80000004
#define DeviceFSCallDevice_ClearStall 0x80000005 #define DeviceFSCallDevice_ClearStall 0x80000005
#define DeviceFSCallDevice_TransferInfo 0x80000006
#define DeviceFSCallDevice_GetHandles2 0x80000007
#define DeviceFSCallDevice_GetSetOptions 0x80000008
/* Was this used by the Castle podule at some time? - JL
#define DeviceFSCallDevice_GetConfig 0x80000001 #define DeviceFSCallDevice_GetConfig 0x80000001
#define DeviceFSCallDevice_SetConfig 0x80000002 #define DeviceFSCallDevice_SetConfig 0x80000002
#define DeviceFSCallDevice_GetAltInterface 0x80000003 #define DeviceFSCallDevice_GetAltInterface 0x80000003
...@@ -78,6 +82,7 @@ ...@@ -78,6 +82,7 @@
#define DeviceFSCallDevice_GetInterfaceDesc 0x80000008 #define DeviceFSCallDevice_GetInterfaceDesc 0x80000008
#define DeviceFSCallDevice_GetEndpointDesc 0x80000009 #define DeviceFSCallDevice_GetEndpointDesc 0x80000009
#define DeviceFSCallDevice_GetString 0x8000000a #define DeviceFSCallDevice_GetString 0x8000000a
*/
struct ugen_softc; struct ugen_softc;
...@@ -114,6 +119,11 @@ struct devstream { ...@@ -114,6 +119,11 @@ struct devstream {
int bandwidth; /* isochronous bandwidth */ int bandwidth; /* isochronous bandwidth */
int residue; int residue;
int dying; int dying;
int padded_bytes; /* only greater 0 in case of short packages */
int flags; /* Flags altered by the GetSetOptions call */
#define FLAG_NOPAD 1
#define FLAG_SHORT 2
#define FLAG_VALIDMASK 3 /* Which bits can be modified */
struct isoc_buffer * isoc; struct isoc_buffer * isoc;
}; };
...@@ -335,9 +345,9 @@ _kernel_oserror *module_init(const char *cmd_tail, int podule_base, void *pw) ...@@ -335,9 +345,9 @@ _kernel_oserror *module_init(const char *cmd_tail, int podule_base, void *pw)
#else #else
/* if standalone then this happens in the service call handler */ /* if standalone then this happens in the service call handler */
e = messages_update (&mod_messages); e = messages_update (&mod_messages);
if (e) goto error0; if (e) return e;
e = messages_update (&usbdev_messages); e = messages_update (&usbdev_messages);
if (e) goto error1; if (e) goto error;
#endif #endif
#ifdef USB_DEBUG #ifdef USB_DEBUG
...@@ -358,12 +368,10 @@ _kernel_oserror *module_init(const char *cmd_tail, int podule_base, void *pw) ...@@ -358,12 +368,10 @@ _kernel_oserror *module_init(const char *cmd_tail, int podule_base, void *pw)
return 0; return 0;
#ifndef STANDALONE #ifndef STANDALONE
error1: error:
_swix (MessageTrans_CloseFile, _IN(0), &mod_messages); _swix (MessageTrans_CloseFile, _IN(0), &mod_messages);
error0:
_swix (ResourceFS_DeregisterFiles, _IN (0), resource_files ());
#endif
return e; return e;
#endif
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
...@@ -439,7 +447,7 @@ _kernel_oserror* RegisterNewDevice(struct ugen_softc * softc,int no) ...@@ -439,7 +447,7 @@ _kernel_oserror* RegisterNewDevice(struct ugen_softc * softc,int no)
driver_entry, driver_entry,
softc, softc,
private_word, private_word,
"endpoint/Ninterface/Nalternate/Nreport/Ncontrol,isochronous,bulk,interrupt/Susbtimeout/Nsize/N", "endpoint/Ninterface/Nalternate/Nreport/Ncontrol,isochronous,bulk,interrupt/Susbtimeout/Nsize/Nnopad/Sshort/S",
#ifdef DEVICEFSISBROKEN #ifdef DEVICEFSISBROKEN
INT_MAX, // should be -1, but that doesn't seem to work INT_MAX, // should be -1, but that doesn't seem to work
INT_MAX, INT_MAX,
...@@ -1060,11 +1068,11 @@ static void deregister_bus (device_ptr_t bus) ...@@ -1060,11 +1068,11 @@ static void deregister_bus (device_ptr_t bus)
_kernel_oserror *module_swis(int swi_offset, _kernel_swi_regs *r, void *pw) _kernel_oserror *module_swis(int swi_offset, _kernel_swi_regs *r, void *pw)
{ {
switch (swi_offset) { switch (swi_offset) {
// case USBDriver_Register:
// break;
// case USBDriver_DeRegister:
// break;
case USBDriver_RegisterBus - USBDriver_00: case USBDriver_RegisterBus - USBDriver_00:
/* R1 now contains internal API version number
This check should be made more permissive when appropriate */
if(r->r[1] != RISCOS_USBDRIVER_API_VERSION)
return (_kernel_oserror *)"\0\0\0\0Incompatible USBDriver version";
r->r[0] = (int) register_bus ((device_ptr_t) r->r[0]); r->r[0] = (int) register_bus ((device_ptr_t) r->r[0]);
break; break;
...@@ -1088,6 +1096,9 @@ _kernel_oserror *module_swis(int swi_offset, _kernel_swi_regs *r, void *pw) ...@@ -1088,6 +1096,9 @@ _kernel_oserror *module_swis(int swi_offset, _kernel_swi_regs *r, void *pw)
usb_schedsoftintr (*(void**) (bus + 1)); usb_schedsoftintr (*(void**) (bus + 1));
} }
break; break;
case USBDriver_Version - USBDriver_00:
r->r[0] = Module_VersionNumber;
break;
default: default:
return error_BAD_SWI; return error_BAD_SWI;
} }
...@@ -1334,7 +1345,6 @@ int detach_hub (struct device* hub) ...@@ -1334,7 +1345,6 @@ int detach_hub (struct device* hub)
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#ifdef OBSOLETE_SERVICE_CALLS #ifdef OBSOLETE_SERVICE_CALLS
/* returns non-zero if not handed */ /* returns non-zero if not handed */
char* service_call (usbd_device_handle dev, int unit, int link) char* service_call (usbd_device_handle dev, int unit, int link)
...@@ -1718,6 +1728,8 @@ int detach_device (struct device* dev, int d) ...@@ -1718,6 +1728,8 @@ int detach_device (struct device* dev, int d)
_swix (DeviceFS_Deregister, _IN(0), udev->sc_devfs); _swix (DeviceFS_Deregister, _IN(0), udev->sc_devfs);
dprintf (("", "deregistered driver %p\n", udev->sc_devfs)); dprintf (("", "deregistered driver %p\n", udev->sc_devfs));
} }
/* Cancel any pending callbacks attached to this device */
callx_remove_callback(announce_device,udev);
free (udev); free (udev);
return 0; return 0;
} }
...@@ -1953,6 +1965,8 @@ typedef struct device_valid { ...@@ -1953,6 +1965,8 @@ typedef struct device_valid {
uint32_t ep_type; uint32_t ep_type;
uint32_t timeout; uint32_t timeout;
uint32_t size; uint32_t size;
uint32_t nopad;
uint32_t shortflag;
} device_valid; } device_valid;
static void find_interface_and_endpoint static void find_interface_and_endpoint
...@@ -2073,7 +2087,10 @@ static _kernel_oserror* device_initialise ...@@ -2073,7 +2087,10 @@ static _kernel_oserror* device_initialise
str->report = valid->report; str->report = valid->report;
/* usb timeout, used for transfers */ /* usb timeout, used for transfers */
str->timeout = valid->timeout; str->timeout = (valid->timeout==0xdeaddead?0:valid->timeout);
/* New flags to work around deficencies in the DeviceFS interface */
str->flags = (valid->nopad?0:FLAG_NOPAD)|(valid->shortflag?0:FLAG_SHORT);
/* see if an interface was specified, if not then look for the interface /* see if an interface was specified, if not then look for the interface
with the endpoint specified */ with the endpoint specified */
...@@ -2301,7 +2318,7 @@ void start_write (struct devstream* str) ...@@ -2301,7 +2318,7 @@ void start_write (struct devstream* str)
{ {
#ifdef DMA_FROM_BUFFER #ifdef DMA_FROM_BUFFER
usbd_setup_xfer(str->xfer, str->pipe, str, usbd_setup_xfer(str->xfer, str->pipe, str,
(void*) r.r[2], r.r[3], USBD_NO_COPY, 500, write_cb); (void*) r.r[2], r.r[3], USBD_NO_COPY | (str->flags & FLAG_SHORT?USBD_FORCE_SHORT_XFER:0), 500, write_cb);
#else #else
usbd_setup_xfer( usbd_setup_xfer(
str->xfer, str->xfer,
...@@ -2309,7 +2326,7 @@ void start_write (struct devstream* str) ...@@ -2309,7 +2326,7 @@ void start_write (struct devstream* str)
str, str,
(void*) str->buffer_id, (void*) str->buffer_id,
r.r[2], r.r[2],
0, (str->flags & FLAG_SHORT?USBD_FORCE_SHORT_XFER:0),
str->timeout, str->timeout,
write_cb); write_cb);
...@@ -2357,47 +2374,39 @@ static void read_cb(usbd_xfer_handle xfer, usbd_private_handle priv, ...@@ -2357,47 +2374,39 @@ static void read_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
return; return;
} }
if((str->flags & FLAG_NOPAD) || (str->count == str->totalcount))
{
/* Whatever happened, we're finished */
return;
}
/* only start another transfer if we haven't finished the transfer and /* only start another transfer if we haven't finished the transfer and
this is not a interrupt endpoint (the BSD framework restarts this is not a interrupt endpoint (the BSD framework restarts
repeating transfers) */ repeating transfers) */
/* if we've got a number of bytes including a part packet, then /* if we've got a number of bytes including a part packet, then
transfer must have ended.. else.. try more */ transfer must have ended.. else.. try more */
// if(!xfer->pipe->repeat) if (xfer->actlen % UGETW(xfer->pipe->endpoint->edesc->wMaxPacketSize))
// {
// if(xfer->actlen < xfer->length)
// {
// char zero[ UGETW(xfer->pipe->endpoint->edesc->wMaxPacketSize)];
// memset (zero, 0, sizeof zero);
// /* fill up the rest of the request with garbage! */
// _kernel_swi_regs r;
// r.r[0] = BM_InsertBlock;
// r.r[1] = (int) str->buffer_id;
// r.r[2] = (int) zero;
// r.r[3] = str->totalcount - str->count;
// dprintf (("", "Fill insert %x bytes\n",r.r[3]));
// CallBufMan (&r);
// }
// else if (str->count != str->totalcount)
// {
// dprintf (("", "Starting read from callback\n"));
// start_read (str);
// }
// }
if ((xfer->actlen % UGETW(xfer->pipe->endpoint->edesc->wMaxPacketSize))
&& str->count != str->totalcount)
{ {
/* required due to DeviceFS concept. */
char zero[ UGETW(xfer->pipe->endpoint->edesc->wMaxPacketSize)]; char zero[ UGETW(xfer->pipe->endpoint->edesc->wMaxPacketSize)];
/* Note difference for later correction by application */
int remain = str->padded_bytes = str->totalcount - str->count;
memset (zero, 0, sizeof zero); memset (zero, 0, sizeof zero);
/* fill up the rest of the request with garbage! */ /* fill up the rest of the request with garbage! */
_kernel_swi_regs r; _kernel_swi_regs r;
r.r[0] = BM_InsertBlock; r.r[0] = BM_InsertBlock;
r.r[1] = (int) str->buffer_id; r.r[1] = (int) str->buffer_id;
r.r[2] = (int) zero; while(remain > 0)
r.r[3] = str->totalcount - str->count; {
CallBufMan (&r); r.r[2] = (int) zero;
r.r[3] = min(remain,UGETW(xfer->pipe->endpoint->edesc->wMaxPacketSize));
remain -= r.r[3];
CallBufMan (&r);
if(r.r[3])
break; /* Buffer was full - what do we do here? Try and insert the extra padding as more space becomes available? For now, just do what the old code did and give up */
}
} }
else if (str->count != str->totalcount && !xfer->pipe->repeat) else if (!xfer->pipe->repeat)
{ {
dprintf (("", "Starting read from callback\n")); dprintf (("", "Starting read from callback\n"));
start_read (str); start_read (str);
...@@ -2718,7 +2727,9 @@ _kernel_oserror* get_handles ...@@ -2718,7 +2727,9 @@ _kernel_oserror* get_handles
struct ugen_softc* udev, struct ugen_softc* udev,
int fs, int fs,
int* buf, int* buf,
int* dvfs int* dvfs,
struct devstream ** str,
devicefs_device** sc_devfs
) )
{ {
int devfs; int devfs;
...@@ -2732,6 +2743,8 @@ _kernel_oserror* get_handles ...@@ -2732,6 +2743,8 @@ _kernel_oserror* get_handles
{ {
if (dvfs) *dvfs = devfs; if (dvfs) *dvfs = devfs;
if (buf) *buf = udev->str[i]->buffer; if (buf) *buf = udev->str[i]->buffer;
if (str) *str=udev->str[i];
if (sc_devfs) *sc_devfs=udev->sc_devfs;
return NULL; return NULL;
} }
} }
...@@ -2798,6 +2811,53 @@ _kernel_oserror* clear_endpoint_stall ...@@ -2798,6 +2811,53 @@ _kernel_oserror* clear_endpoint_stall
return uerror (E_NoStream); return uerror (E_NoStream);
} }
_kernel_oserror* get_transfer_info
(
struct devstream* str,
int* count,
int* totalcount,
int* status,
int* padded_buffer_bytes
)
{
if (!str) {
return uerror (E_NoStream);
}
*count=str->count;
*totalcount=str->totalcount;
switch(str->xfer->status) {
case USBD_NORMAL_COMPLETION: {
*status=1;
}
break;
case USBD_IN_PROGRESS: {
*status=0;
}
break;
default: {
*status=-1;
}
}
*padded_buffer_bytes=str->padded_bytes;
return NULL;
}
_kernel_oserror* getset_options
(
struct devstream* str,
int* eor,
int* and
)
{
if (!str) {
return uerror (E_NoStream);
}
int new = ((str->flags & *and) ^ *eor) & FLAG_VALIDMASK;
*eor = str->flags;
str->flags = *and = new;
return NULL;
}
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
_kernel_oserror* driver (_kernel_swi_regs* r, void* pw) _kernel_oserror* driver (_kernel_swi_regs* r, void* pw)
...@@ -2848,6 +2908,7 @@ _kernel_oserror* driver (_kernel_swi_regs* r, void* pw) ...@@ -2848,6 +2908,7 @@ _kernel_oserror* driver (_kernel_swi_regs* r, void* pw)
break; break;
case DeviceFSCallDevice_RxWakeUp: case DeviceFSCallDevice_RxWakeUp:
str->count = 0; str->count = 0;
str->padded_bytes=0;
/* total length has always been passed in R3, although not documented */ /* total length has always been passed in R3, although not documented */
str->totalcount = r->r[3]; str->totalcount = r->r[3];
dprintf (("main", "wakeup read, resetting count to %d, totalcount to %d\n", dprintf (("main", "wakeup read, resetting count to %d, totalcount to %d\n",
...@@ -2963,7 +3024,7 @@ _kernel_oserror* driver (_kernel_swi_regs* r, void* pw) ...@@ -2963,7 +3024,7 @@ _kernel_oserror* driver (_kernel_swi_regs* r, void* pw)
return get_buffer_space (udev, r->r[2], r->r + 3, r->r + 4); return get_buffer_space (udev, r->r[2], r->r + 3, r->r + 4);
break; break;
case DeviceFSCallDevice_GetHandles: case DeviceFSCallDevice_GetHandles:
return get_handles (udev, r->r[2], r->r + 3, r->r + 4); return get_handles (udev, r->r[2], r->r + 3, r->r + 4, NULL, NULL);
break; break;
case DeviceFSCallDevice_GetLocation: case DeviceFSCallDevice_GetLocation:
return get_location (udev, (char*) r->r[3]); return get_location (udev, (char*) r->r[3]);
...@@ -2971,10 +3032,18 @@ _kernel_oserror* driver (_kernel_swi_regs* r, void* pw) ...@@ -2971,10 +3032,18 @@ _kernel_oserror* driver (_kernel_swi_regs* r, void* pw)
case DeviceFSCallDevice_ClearStall: case DeviceFSCallDevice_ClearStall:
return clear_endpoint_stall (udev, r->r[2]); return clear_endpoint_stall (udev, r->r[2]);
break; break;
case DeviceFSCallDevice_TransferInfo:
return get_transfer_info (str, r->r + 0, r->r + 1, r->r + 3, r->r + 4);
break;
case DeviceFSCallDevice_GetHandles2:
return get_handles (udev, r->r[2], r->r + 3, r->r + 4, (struct devstream **) ((int *) r->r + 5), (devicefs_device**) ((int *) r->r + 6));
break;
case DeviceFSCallDevice_GetSetOptions:
return getset_options (str, r->r + 3, r->r + 4);
break;
} }
return NULL; return NULL;
} }
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
This diff is collapsed.
...@@ -29,9 +29,7 @@ help-string: EHCIDriver EHCIDriverModule_MajorVersion_CMHG ...@@ -29,9 +29,7 @@ help-string: EHCIDriver EHCIDriverModule_MajorVersion_CMHG
date-string: EHCIDriverModule_Module_Date_CMHG date-string: EHCIDriverModule_Module_Date_CMHG
#define HELPFILE(M) "Resources:$." #M international-help-file: "Resources:$.Resources.EHCIDriver.Messages"
#define XHELPFILE(M) HELPFILE(M)
international-help-file: XHELPFILE(MSGLOC)
#ifdef EHCI_DEBUG #ifdef EHCI_DEBUG
command-keyword-table: module_commands command-keyword-table: module_commands
......
...@@ -32,9 +32,7 @@ help-string: OHCIDriver OHCIDriverModule_MajorVersion_CMHG ...@@ -32,9 +32,7 @@ help-string: OHCIDriver OHCIDriverModule_MajorVersion_CMHG
date-string: OHCIDriverModule_Module_Date_CMHG date-string: OHCIDriverModule_Module_Date_CMHG
#define HELPFILE(M) "Resources:$." #M international-help-file: "Resources:$.Resources.OHCIDriver.Messages"
#define XHELPFILE(M) HELPFILE(M)
international-help-file: XHELPFILE(MSGLOC)
#ifdef OHCI_DEBUG #ifdef OHCI_DEBUG
command-keyword-table: module_commands command-keyword-table: module_commands
......
...@@ -31,9 +31,7 @@ help-string: USBDriver USBDriverModule_MajorVersion_CMHG ...@@ -31,9 +31,7 @@ help-string: USBDriver USBDriverModule_MajorVersion_CMHG
date-string: USBDriverModule_Module_Date_CMHG date-string: USBDriverModule_Module_Date_CMHG
#define HELPFILE(M) "Resources:$." #M international-help-file: "Resources:$.Resources.USBDriver.Messages"
#define XHELPFILE(M) HELPFILE(M)
international-help-file: XHELPFILE(MSGLOC)
command-keyword-table: module_commands command-keyword-table: module_commands
...@@ -80,43 +78,8 @@ swi-decoding-table: USBDriver, ...@@ -80,43 +78,8 @@ swi-decoding-table: USBDriver,
DeRegisterBus, DeRegisterBus,
InsertTransfer, InsertTransfer,
TransferComplete, TransferComplete,
ScheduleSoftInterrupt ScheduleSoftInterrupt,
; IOCtl, Version
; OpenPipe,
; ClosePipe,
; Transfer,
; AllocXfer,
; FreeXfer,
; SetupXfer,
; SetupDefaultXfer,
; SetupIsocXfer,
; GetXferStatus,
; Interface2EndpointDescriptor,
; AbortPipe,
; ClearEndpointStall,
; ClearEndpointStallAsync,
; EndpointCount,
; Interface2DeviceHandle,
; Device2InterfaceHandle,
; Pipe2DeviceHandle,
; AllocBuffer,
; Freebuffer,
; GetBuffer,
; SyncTransfer,
; OpenPipeIntr,
; DoRequest,
; DoRequestAsync,
; DoRequestFlags,
; GetInterfaceDescriptor,
; GetConfigDescriptor,
; SetInterface,
; FillDeviceInfo,
; GetInterfaceAltindex,
; FindIdesc,
; FindEdesc,
; DevInfo,
; GetEndpointDescriptor,
; ReloadDeviceDesc
generic-veneers: driver_entry/driver generic-veneers: driver_entry/driver
......