1. 09 Apr, 2019 4 commits
  2. 21 Feb, 2019 2 commits
    • spiiroin's avatar
      [configfs] Make control details configurable. JB#44679 · 9ae49bb2
      spiiroin authored
      Configfs support was orginally developed in Sony XA2 context. Now it turns
      out some details need tweaking to make it work with other devices.
      
      Make location of configfs control file hierarchy, configuration and
      functions to use tweakable via usb-moded configuration files.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      9ae49bb2
    • spiiroin's avatar
      [settings] Do not write dynamic data to /etc. Fixes JB#38241 · 0e9f72cb
      spiiroin authored
      While combining all configuration data into /etc/usb-moded/usb-moded.ini
      works as expected when new configuration files are installed to the device,
      it also means that 1) uninstalling / updating configuration files has no
      effect and 2) /etc can't reside on a read-only file-system.
      
      Maintain "delta to static configuration" and store it outside /etc - in
      /var/lib/usb-moded/usb-moded.ini, so that also changes in / removal of
      existing configuration files are handled in deterministic manner.
      
      If /etc/usb-moded/usb-moded.ini exists, migrate data from it and then remove
      the now unnecessary file.
      
      Streamline handling of non-existing configuration and remove functions made
      redundant in the process.
      
      Note: The "read from filesystem on each setting access" is retained for now
      to avoid regression is situations where such behavior might be expected.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      0e9f72cb
  3. 20 Feb, 2019 1 commit
  4. 05 Sep, 2018 6 commits
  5. 24 Aug, 2018 3 commits
    • spiiroin's avatar
      [usb_moded] Refactor entering/leaving usb mode. JB#41748 · 64350689
      spiiroin authored
      Split mode switching to three layers: Tracking cable connection state,
      choosing target mode, and performing required actions to activate
      the chosen mode.
      
      Try to minimize places where layer borders are crossed - which should
      work also as an enabler for moving blocking actions to separate thread
      later on.
      
      Arrange logic in such manner that usb gadget is always configured as
      being able to serve some function - fallback being the dummy mass_storage
      function used for charging.
      
      Deprecate command line options that serve no useful purpose after the
      changes.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      64350689
    • spiiroin's avatar
      [usb_moded] Normalize multiline comments · 7a386e38
      spiiroin authored
      Just to make it easier for editor to handle automatic indentation, make
      all C comment continuation lines start with whitespace followed by '*'.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      7a386e38
    • spiiroin's avatar
      [usb_moded] Add configfs support. Fixes JB#42083 · 692c2cb3
      spiiroin authored
      Add custom Makefile for faster smoke-test rebuilds without spending time
      in configure, autotools, document generation and/or rolling rpm packages.
      
      Add multiple include protection to all header files.
      
      Move function prototypes away from header files that included in the
      development package.
      
      Mass rename functions to have a prefix giving context for the function.
      For the most part the prefix is derived from the name of the compilation
      module containing the function.
      
      Mass normalize indentation to four spaces in all source files.
      
      Augment author lists on each source file based on git committers.
      
      Remove "inline" attributes from not-really-inlineable functions.
      
      Remove .gitignore.
      
      Remove unused modules-android.c source file.
      
      Define _GNU_SOURCE for whole build rather than in individual files.
      
      Fix resource leaks here and there.
      
      Try to avoid hard-coding android usb paths.
      
      Add configfs backend for usb cadget configuration.
      
      Probe supported backends (configfs, android usb, or kmod) on usb-moded
      startup and make them mutually exclusive with each other.
      
      Allow configfs and android usb control structures some time to show up
      if usb-moded is started during device bootup.
      
      Refactor udev event listener to utilize a state machine. Simplifies
      book keeping and makes pc/charger detection heuristics easier to control.
      
      Refactor mode selection to utilize three interconnected mini state machines.
      Allows separating logically wanted mode from mode programmed to usb and
      mode exposed over D-Bus.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      692c2cb3
  6. 28 Mar, 2018 1 commit
  7. 08 Mar, 2018 2 commits
  8. 11 Aug, 2017 1 commit
  9. 07 Jul, 2016 4 commits
  10. 11 May, 2016 1 commit
  11. 29 Apr, 2016 1 commit
    • spiiroin's avatar
      [dbus] Handle missing mode setting gracefully. Fixes MER#1576 · 1aadb958
      spiiroin authored
      If usb mode setting is not present in usb-moded.ini and override is not
      specified in kernel command line, get_mode_setting() will return null.
      The handler for "get_config" D-Bus method call does not check the return
      value and using the null value triggers abort from sanity checks at
      libdbus. Attempting to pass NULL as string via D-Bus causes abort.
      
      Use MODE_UNDEFINED as fallback in case the setting value is not defined.
      
      Also remove potential memory leaks in the code used for determining the
      mode setting value and use correct function for releasing the resulting
      dynamically allocated string.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      1aadb958
  12. 06 Apr, 2016 1 commit
  13. 04 Apr, 2016 1 commit
  14. 26 Dec, 2015 1 commit
  15. 15 Dec, 2015 3 commits
  16. 03 Aug, 2015 2 commits
  17. 27 May, 2015 1 commit
  18. 26 May, 2015 1 commit
  19. 28 Apr, 2015 1 commit
  20. 02 Jan, 2015 1 commit
  21. 11 Nov, 2014 1 commit
  22. 07 Nov, 2014 1 commit