1. 24 Aug, 2018 7 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
      [android] Normalize numerical id-values to lower case hex. JB#41748 · 18efbfcc
      spiiroin authored
      Configfs wants to have numbers in '0xbeef' form while android usb wants to
      have 'beef'. Normalizing the output to expected format allows either form
      to be used in usb-moded configuration files.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      18efbfcc
    • spiiroin's avatar
      [android] Refactor android usb handling module. JB#41748 · 4f9ffa6d
      spiiroin authored
      Make it logically match what is available in configfs module.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      4f9ffa6d
    • spiiroin's avatar
      [usb_moded] Drop --android-bootup-function option. JB#41748 · 4f53cf48
      spiiroin authored
      The target is to always have android usb enabled with valid function, so
      this workaround is not relevant anymore.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      4f53cf48
    • 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
      [mtp-mode] Require buteo-mtp-qt5 · 154bc19c
      spiiroin authored
      The "buteo-mtp" package name is probably old qt4 package that does not
      exist anymore.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      154bc19c
    • 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
  2. 06 Jun, 2018 2 commits
  3. 05 Jun, 2018 3 commits
  4. 04 Apr, 2018 2 commits
  5. 29 Mar, 2018 3 commits
  6. 28 Mar, 2018 7 commits
  7. 14 Mar, 2018 2 commits
  8. 08 Mar, 2018 2 commits
  9. 04 Dec, 2017 2 commits
  10. 01 Dec, 2017 2 commits
    • spiiroin's avatar
      [udev] Do not exit if cable state can't be determined · 22bcd9f4
      spiiroin authored
      If usb-moded exits when it can't deduce cable connect state, it will
      be restarted by systemd. As the usb-moded restarts are not going to
      change how the udev status looks like, this repeats until systemd
      moves the usb-moded service to failed state.
      
      Do not exit and assume no usb-cable is connected. In addition to not
      triggering restart spree, this has the additional benefit that the
      usb-moded dbus interface stays available and signaling not-connected
      state.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      22bcd9f4
    • spiiroin's avatar
      [udev] Suppress repetitive property warnings. Fixes JB#40394 · 0d5a10b7
      spiiroin authored
      Usb-moded expects to see POWER_SUPPLY_PRESENT and POWER_SUPPLY_TYPE
      properties defined for usb power-supply devices. When this is not
      the case, it emits warnings and applies various fallbacks. Since the
      properties get re-evaluated periodically, this also leads to the
      same warnings being repeated.
      
      Refactor the code so that in default verbosity the property warnings
      are emitted only during what looks like cable connect / disconnect.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      0d5a10b7
  11. 15 Nov, 2017 2 commits
  12. 14 Nov, 2017 1 commit
  13. 23 Aug, 2017 3 commits
  14. 18 Aug, 2017 2 commits