1. 17 Apr, 2024 5 commits
    • ROOL's avatar
      Fix for race condition with ShareFS on some CDC adapters at 1Gbps · 911b9469
      ROOL authored
      Detail:
        ShareFS (using UDP) could get in a race condition when pushing files > 4kB
        to a remote share. The transmit buffer was large enough to send multiple
        frames without checking for any receives, so the acknowledge from the remote
        share was lost. Retry logic within ShareFS concluded the frames should be
        resent, with the same result - no ack - followed by resending. The computer
        would consume 100% of CPU time retrying until the cable was unplugged.
        Protocols using TCP were not affected due to window size negotiation inherent
        in that connection type.
        Reduce the transmit buffer size to 2048 bytes (+1 for a workaround for
        DeviceFS 0.69 and earlier) to match 3 of the other EtherUSB backends. This
        gives chance to check the receive queue between transmitted frames.
      
        Use symbolic names for arguments to usb_control().
      
        Increase the module version number reported to InetSetup by the AutoSense
        utility. This ensures that if a module with CDC support is softloaded and
        configured then on restart the RMEnsure in Choices:Internet.Startup will not
        leave the user without an interface if an older copy is present in ROM.
      Admin:
        Submission for USB bounty.
      
      Version 0.43. Tagged as 'EtherUSB-0_43'
      911b9469
    • ROOL's avatar
      Automatically set configuration of certain CDC devices · 5c174b02
      ROOL authored
      Detail:
        Some communication devices have several configurations, including a CDC one
        which is not the default selected. Add these to the the products match
        mechanism (using table entries, or system variables) so that EtherUSB can
        automatically select the correct configuration when encountered.
      
        The configuration change is made on a callback when trying to open the CDC
        device, which on first pass returns a failure error. This is because at the
        time USBDriver sends the 'Attached' service call we can't issue star
        commands which affect the USB stack without the risk of a reentrancy problem.
        Once idle the callback fires and sets the configuration and the new
        descriptors can be read safely for a second pass at opening.
      
        If EtherUSB is subsequently killed, restore the default device configuration
        so the system is back in the state in which it was found - this avoids a hang
        with devices which don't start up in the CDC configuration by default.
      Admin:
        Add a rule for debug to account for makefile changes in BuildSys 7.91.
      5c174b02
    • Thomas Milius's avatar
      Improvements to CDC-ECM to increase range of supported devices · 23286355
      Thomas Milius authored
      Detail:
        Allow class CDC-ECM and those whose top level class is 0.0:0 too.
        Open an interrupt pipe in order to get status notifications, use this to
        populate the device abilities/status more accurately.
        When querying the MAC address, parse the language table before requesting
        the string.
        MTU correctly calculated.
        Log improvements to help debugging.
      23286355
    • Thomas Milius's avatar
      3c85b405
    • Thomas Milius's avatar
      e4583842
  2. 23 Aug, 2023 1 commit
    • Ben Avison's avatar
      Rewrite rules for AutoSense disc install · 1f23b0f9
      Ben Avison authored
      BuildSys 7.91 changes how top-level phony rules are overridden.
      In this component, the `install` and `standalone` targets are redefined
      after `CModule` is included, so they will be affected.
      
      Version 0.42. Not tagged
      1f23b0f9
  3. 28 Nov, 2020 1 commit
  4. 02 Apr, 2020 1 commit
    • Robert Sprowson's avatar
      Copy MAC in network byte order · e35e9d36
      Robert Sprowson authored
      EtherUSB stores the MAC internally in network byte order, except when the address is obtained via OS_ReadSysInfo 4, when it was stored reversed. This problem lay hidden because the only ROM in which EtherUSB is able to get an address that way is the Pi, whose HAL returned the address in the wrong order too.
      Requires HAL_BCM2835-0_84.
      
      Version 0.42. Tagged as 'EtherUSB-0_42'
      e35e9d36
  5. 21 Mar, 2018 1 commit
    • Jeffrey Lee's avatar
      Add SMSC78xx support · 13a680d5
      Jeffrey Lee authored
      Detail:
        c/smsc78xx, c/module, c/products, h/backends, Makefile - Add SMSC78xx driver, for the chip used in the Raspberry Pi 3B+
        c/config, c/mii, h/mii - Add support for gigabit MIIs & associated (auto) configuration
        c/net, h/net - Handle gigabit link types. Pass verbose flag through to backend info function.
        c/smsc95xx - Make configure_link const-correct
        Resources/UK/CmdHelp - Update *EJConfig syntaxt text to include 1000 option
        Resources/UK/Messages - Add 78xx backend name & device-specific info tokens
      Admin:
        Tested on Raspberry Pi 3B & 3B+
        Manually configured gigabit links aren't supported yet
        Gigabit half-duplex isn't supported (78xx MAC limitation)
        For the 78xx, manually-configured full-duplex links appear to suffer terrible RX performance (as seen on 95xx). All supported auto modes appear to work correctly.
      
      
      Version 0.41. Tagged as 'EtherUSB-0_41'
      13a680d5
  6. 10 Feb, 2018 1 commit
    • Jeffrey Lee's avatar
      Fix pegasus backend. Update *ejconfig syntax message. · c010df2c
      Jeffrey Lee authored
      Detail:
        c/pegasus - Add mii_abilities() call to fix backend not working since extra sanity checks were added to config_parse_arguments() in EtherUSB 0.39. Also switch over to using the common status callback code, and provide a configure function.
        Resources/UK/CmdHelp - Update *ejconfig syntax message, since it was missing some things like 'noauto'.
      Admin:
        Tested on beagleboard
        Fixes pegasus backend not working since EtherUSB 0.39:
        https://www.riscosopen.org/forum/forums/4/topics/10119
      
      
      Version 0.40. Tagged as 'EtherUSB-0_40'
      c010df2c
  7. 18 Jan, 2018 1 commit
    • Jeffrey Lee's avatar
      Improvements to SMSC 95xx backend and common MII handling · 0c3e4b43
      Jeffrey Lee authored
      Detail:
        c/smsc95xx - Convert code to use the common MII backend. Reduce verbosity of debug output. Fix two sets of status callbacks running (callback_status_adapter + device_status). Tweak/refactor a couple of other bits as necessary in order to get 10M links working reliably.
        c/mii, h/mii, h/net - Allow backends to indicate their level of support for PAUSE functionality, so that we can advertise it correctly when performing auto-negotiation (previously no pause ability would have been advertised)
        c/config - Ensure config_parse_arguments passes through the PAUSE capabilities to the output net_config_t. Use the (currently unused) ERR_BAD_CONFIG for if autonegotiation is disabled but either speed or duplex setting not specified (avoids MII code or backends getting confused as to what options they should use)
        Resources/UK/Messages - Tweak wording of ERR_BAD_CONFIG so that it's more sensible for the new usage
        doc/!ReadMe - Remove the note about 10M links not being supported by the SMSC 95xx backend. Update the changelog to point people towards CVS for recent changes.
      Admin:
        Tested on PandaBoard + Raspberry Pi 3, using SMSC 95xx and AX88772 devices
        SMSC testing results:
        * Previously, 10M links were non-functional
        * Previously, manually-configured 100M full duplex links would suffer terrible performance
        * Previously, any attempt to reconfigure a link on Pi 3 would result in a "Device broken or misbehaving" error? (or at least, that's how 0.38 is behaving for me now)
        * Now, all combinations of configuration (speed + link + auto/noauto) appear to work correctly, except for manually-configured full-duplex links, which still suffer from terrible performance
        AX88772 was used to verify MII changes haven't broken anything for other backends; testing showed no significant differences to previous version (all speed + link + auto/noauto modes working)
        Resolves ticket #342:
        https://www.riscosopen.org/tracker/tickets/342
        Note that currently the SMSC 95xx backend is the only backend to advertise PAUSE functionality via the common MII code; a future improvement would be to set up the other backends appropriately (set correct flags in net_abilities_t)
      
      
      Version 0.39. Tagged as 'EtherUSB-0_39'
      0c3e4b43
  8. 21 Oct, 2017 1 commit
    • ROOL's avatar
      Speed reporting and buffer sizing for SMSC75xx backend · 7c68562c
      ROOL authored
      Detail:
        net.c: added support for 1000Mb speed
        smsc75xx.c: reduced MAX_RX_FIFOSIZE to 16k (avoids problems with Kernel keyboard scanning);
                    corrected determination of ethernet speed (read from SMC75XX_MAC_CR register)
        net.h: added net_speed_1000Mb (in net_speed_t) and speed_1000Mb (in struct net_abilities_t)
        Messages: added Sp1000 and Dit21 for supporting 1000Mb speed
      Admin:
        Submission from Colin Granville.
      
      Version 0.38. Tagged as 'EtherUSB-0_38'
      7c68562c
  9. 14 Apr, 2016 1 commit
    • Jeffrey Lee's avatar
      Don't pass silly error numbers to MsgTrans · ca056eb1
      Jeffrey Lee authored
      Detail:
        c/module - Don't pass silly error numbers to MessageTrans_ErrorLookup - the kernel will now fault them.
      Admin:
        Tested on Raspberry Pi 3
      
      
      Version 0.37. Tagged as 'EtherUSB-0_37'
      ca056eb1
  10. 29 Feb, 2016 1 commit
    • Ben Avison's avatar
      Support ARMv8 · 93607b1f
      Ben Avison authored
      Detail:
        This module previously used both SWP and SWPB instructions, which have
        been withdrawn in ARMv8. Now use SyncLib to provide the equivalent
        functionality, which will use LDREX/STREX or LDREXB/STREXB instead when
        appropriate.
      Admin:
        Tested on Raspberry Pi 3.
      
      Version 0.36. Tagged as 'EtherUSB-0_36'
      93607b1f
  11. 19 Dec, 2015 1 commit
    • ROOL's avatar
      Add support for AX88772B variants · 1af39f01
      ROOL authored
      Detail:
        More careful manipulation of the control register, and extra entries in the product lookup table, adding support for AX88772B controllers.
        Added EUI48 check function, blank MAC addresses are now replaced by locally generated ones in dongles so cheap they don't have one of their own.
      Admin:
        Submission from Colin Granville.
      
      Version 0.35. Tagged as 'EtherUSB-0_35'
      1af39f01
  12. 12 Dec, 2015 1 commit
    • ROOL's avatar
      Improve resilience to USB stack hot swapping · 7615a6e8
      ROOL authored
      Detail:
        Listen out for different service calls so EtherUSB keeps connected even if DeviceFS/USBDriver/HC backends get restarted.
      Admin:
        Submission from Colin Granville.
      
      Version 0.34. Tagged as 'EtherUSB-0_34'
      7615a6e8
  13. 20 Oct, 2015 1 commit
    • ROOL's avatar
      Buffer size correction · d2c9c431
      ROOL authored
      Cut and paste mistake from smsc95xx during review.
      
      Version 0.33. Tagged as 'EtherUSB-0_33'
      d2c9c431
  14. 17 Oct, 2015 1 commit
    • ROOL's avatar
      Addition of SMSC 75xx backend · 916f46c0
      ROOL authored
      Support for USB product ids 0x7500 and 0x7505.
      Submission from Colin Granville.
      
      Version 0.32. Tagged as 'EtherUSB-0_32'
      916f46c0
  15. 05 Sep, 2015 1 commit
    • ROOL's avatar
      Further throughput improvements · 2a3029ff
      ROOL authored
      ax88772.c:
        Modified to work with changes made to net.c and usb.c.
        Increased buffer sizes, allow more than one packet receipt.
      ax88172.c/mcs7830.c/pegasus.c:
        Modified to work with changes made to net.c and usb.c.
      smsc95xx.c:
        Copyright header simplified by using pronoun form "the copyright holders" rather than repeating this list.
        Modified to work with changes made to net.c and usb.c.
        Reading of MAC address from EEPROM fixed.
      products.c:
        Added SMSC9730 device id (uses smsc95xx backend).
      net.c/net.h:
        tx_queue removed, all transmit buffering is now done in the USB code.
      usb.c:
        Function usb_write() blocks until room is available, or times out.
        Use USBDriver header rather than defining local SWI numbers.
      Messages:
        Renamed DescSMC token to DescSMC9.
        Removed redundant Stat7 statistic.
      
      Submission from Colin Granville.
      Tested on Pi B+ and OMAP3, not tested on OMAP4, but believed to markedly improve its performance over version 0.30.
      
      Version 0.31. Tagged as 'EtherUSB-0_31'
      2a3029ff
  16. 11 Jan, 2015 1 commit
    • Robert Sprowson's avatar
      Correction to CMHG veneer types · f9c8c1d4
      Robert Sprowson authored
      The FSCV, FindV, UpcallV handlers were marked as generic veneers rather than vector handlers.
      Spotted by Colin Granville.
      
      Version 0.30. Tagged as 'EtherUSB-0_30'
      f9c8c1d4
  17. 30 Aug, 2014 2 commits
    • Robert Sprowson's avatar
      No need for CUSTOMEXP · a399495f
      Robert Sprowson authored
      Retagged as EtherUSB-0_29.
      a399495f
    • Robert Sprowson's avatar
      Step change improvement in transmit speed 'usb_upcall_hook_handler' removed... · b8d504fe
      Robert Sprowson authored
      Step change improvement in transmit speed 'usb_upcall_hook_handler' removed filling of tx pipe. This fixes problems of the tx pipe being very slow. It was never needed anyway.
      
      When transmitting, the tx pipe is driven by inserts from the socket driver and transfering that data to USB kicks USB writes into action.
      Underflow isn't a problem USB will send as data arrives in the buffer.
      Submission from Colin Granville.
      
      Testing with a Raspberry Pi connected via LanManFS to a WinXP server *COPYing a 10MB file from SDFS to Windows, and *COPYing it back to null:
        EtherUSB 0.26  uplink   0.07 MB/s
                       downlink 2.96 MB/s
        This version   uplink   1.31 MB/s
                       downlink 3.05 MB/s
      inspection in Wireshark shows no dropped TCP segments or ACKs during the test, previously duplicated ACKs and missing segments would cause most of the uplink slowness while the TCP/IP stack backed off for ~1.5s.
      Note: other filing systems and use cases may vary.
      In the case of the SMSC91xx backend, ticket #342 remains - sending to a 10Mbps server (even if through a 100Mbps switch) causes dropped segments/duplicated ACKs as before.
      
      usb.c: upcall handler change as above.
      smsc91xx.c: typos in comments and debug ammended.
      
      
      Version 0.29. Tagged as 'EtherUSB-0_29'
      b8d504fe
  18. 24 Aug, 2014 3 commits
    • Robert Sprowson's avatar
      Propagate ERR_TX_BLOCKED up the stack · 3b43c5e3
      Robert Sprowson authored
      Errors from net_attempt_transmit() are now passed back to the Internet module.
      Fix from Colin Granville.
      
      Version 0.28. Tagged as 'EtherUSB-0_28'
      3b43c5e3
    • Robert Sprowson's avatar
      Define ETHER_ADDR_LEN · f98c8ddd
      Robert Sprowson authored
      There's an element of duplication between the definitions of net.h and those in TCPIPLibs:net/ethernet.h which would be better to resolve, but for now just mirror its definition locally.
      Not tagged.
      f98c8ddd
    • Robert Sprowson's avatar
      Fixes to reads in the AX88772 backend 'read_packet' changed to read more than... · 9a1629e1
      Robert Sprowson authored
      Fixes to reads in the AX88772 backend 'read_packet' changed to read more than 1 ethernet packet. The device actually operates in burst mode so reads can contain more than 1 ethernet packet, the previous version assumed only ever 1 so dropped others.
      
      Size of usb buffer passed to usb_open was reduced as it didn't help being bigger so may as well save memory.
      Submission from Colin Granville.
      
      Version 0.27. Tagged as 'EtherUSB-0_27'
      9a1629e1
  19. 13 Oct, 2013 1 commit
    • Robert Sprowson's avatar
      Internationalised · cbe1e977
      Robert Sprowson authored
      AutoSense script updated to be able to parse both the hardwired english output (0.08-0.25 inclusive) and internationalised text (0.26+).
      Tested RAM loaded on a Raspberry Pi.
      
      Version 0.26. Tagged as 'EtherUSB-0_26'
      cbe1e977
  20. 04 Oct, 2013 1 commit
  21. 07 Apr, 2013 1 commit
    • Jeffrey Lee's avatar
      Add more ways of specifying device configuration. Adjust unit number... · 3a804700
      Jeffrey Lee authored
      Add more ways of specifying device configuration. Adjust unit number allocation & SMSC MAC handling.
      
      Detail:
        c/smsc95xx - Adjust MAC handling some more:
          - Unit number check removed from EtherUSB$MAC_Configured code in fill_arbitraryMAC(), to increase compatibility with previous version
          - EtherUSB$MAC_Configured check is now performed before the devices currently-programmed MAC is checked; this should ensure it always takes priority over the other methods (especially when reiniting EtherUSB after setting the variable)
          - OS_ReadSysInfo 4 & machine ID hash checks remain in their previous place, after the currently-programmed MAC check
        c/config, h/config:
          - Add support for using EtherUSB$VP_* and EtherUSB$Loc_* system variables to configure devices, by specifying USB vendor/product IDs or USB device tree locations, respectively.
          - Allow config_reserved_units() to select a devices unit number by looking for VP_ or Loc_ system variables.
        c/net, h/net:
          - Add USB device vendor & product ID, and device tree location, to net_device_t struct.
          - Display vendor/product ID & device tree location in verbose ejinfo output
          - Adjust unit number selection: Attempt to select a unit number before calling backend->start, so that the unit number can be used in MAC allocation if required (i.e. by net_default_mac()).
          - Change net_default_mac() to use OS_ReadSysInfo 5 instead of OS_ReadSysInfo 2; OS_ReadSysInfo 2 strips out the first and last byte of the ID, making the psuedo-unique MAC somewhat less unique.
        c/usb, h/usb - Add utility function for reading the location of a device within the USB device tree.
      Admin:
        Tested on BB-xM, Raspberry Pi
        Overriding MAC via EtherUSB$MAC_Configured now works as expected (was previously failing due to unit number being MODULE_MAX_UNITS)
        Unit number reservation/selection & device configuration via all three variable types (MAC, VP, Loc) verified
      
      
      Version 0.24. Tagged as 'EtherUSB-0_24'
      3a804700
  22. 02 Apr, 2013 1 commit
    • Jeffrey Lee's avatar
      Remove redundant code · 99a0710d
      Jeffrey Lee authored
      Detail:
        c/smsc95xx - Removed old code that was setting the MAC address via OS_ReadSysInfo 4. Code now correctly uses the logic described previously.
      Admin:
        Tested on Raspberry Pi
      
      
      Version 0.23. Retagged as 'EtherUSB-0_23'
      99a0710d
  23. 01 Apr, 2013 1 commit
    • Jeffrey Lee's avatar
      Improve SMSC MAC selection · 1f4e8718
      Jeffrey Lee authored
      Detail:
        c/net, h/net - Make net_default_mac() non-static. Add net_machine_mac() function for looking up MAC by OS_ReadSysInfo 4.
        c/smsc95xx - Change MAC selection logic. Old order was OS_ReadSysInfo 4 -> EtherUSB$MAC_Configured -> 100% hardcoded default. New order is EtherUSB$MAC_Configured -> OS_ReadSysInfo 4 -> hashed machine ID + unit number -> hardcoded default (with unit number). This new logic means BB-xM's should now have unique MACs instead of all sharing the same MAC.
      Admin:
        Tested on BB-xM, Raspberry Pi. Raspberry Pi retains the MAC that's specified by the firmware, while the BB-xM now uses the hashed machine ID instead of the hardcoded default.
        Based on changes supplied by Willi Theiss.
      
      
      Version 0.23. Tagged as 'EtherUSB-0_23'
      1f4e8718
  24. 31 Oct, 2012 1 commit
    • Jeffrey Lee's avatar
      Tidy up some debugging code · 1d8b6bbc
      Jeffrey Lee authored
      Detail:
        c/net, c/usb - Tidy up some debugging code so it's only active in debug builds.
      Admin:
        Changes supplied by Willi Theiss, to fix hangs on restart (on OMAP4) when the SysLog module is active.
        Tested locally on BB-xM
      
      
      Version 0.22. Tagged as 'EtherUSB-0_22'
      1d8b6bbc
  25. 09 Sep, 2012 1 commit
    • Jeffrey Lee's avatar
      Protect against memory corruption caused by devicefs streams being unexepectedly closed · 831bd79b
      Jeffrey Lee authored
      Detail:
        c/cmodule, c/usb, cmhg/EtherUSBHdr, h/usb - Sit on FSControlV & FindV so we can watch for file closures and catch any attempt to close our devicefs streams. Also need to sit on Service_Reset to make sure FileSwitch doesn't get the vector calls before us.
        If the device streams get closed without our notice, then the next attempt to write to a buffer (or potentially read from one?) via the direct buffer manager calls will result in RMA corruption.
      Admin:
        Tested on Raspberry Pi with high processor vectors
        Fixes occasional data aborts while sat on "shutdown complete" screen (since *shutdown will close the devicefs streams)
      
      
      Version 0.21. Tagged as 'EtherUSB-0_21'
      831bd79b
  26. 26 Aug, 2012 1 commit
  27. 24 Jun, 2012 1 commit
    • Jeffrey Lee's avatar
      Fix null pointer dereference · 393406f8
      Jeffrey Lee authored
      Detail:
        c/net - In set_inet_variables(), no check was being made for whether OS_ReadVarVal returned an error or not, resulting in a null pointer dereference if <Inet$EtherType> does exist
      Admin:
        Tested on Raspberry Pi with high processor vectors
      
      
      Version 0.19. Tagged as 'EtherUSB-0_19'
      393406f8
  28. 19 May, 2012 6 commits