1. 09 Apr, 2019 5 commits
  2. 05 Sep, 2018 3 commits
    • spiiroin's avatar
      [usb-moded] Normalize typedefs · e48f26b4
      spiiroin authored
      Use named structs / enums in typedefs.
      
      Drop "struct" from code in places where it has been made redundant due to
      having a typedef for the structure.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      e48f26b4
    • spiiroin's avatar
      [worker] Use module prefix also for static variables · 700b8f55
      spiiroin authored
      Gives context and makes locating points of use easier.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      700b8f55
    • spiiroin's avatar
      [usb-moded] Move synchronous mode switch to worker thread. Fixes JB#42757 · 57d404a3
      spiiroin authored
      Mode switching in usb-moded is done via synchronous ipc / otherwise
      blocking operations - which makes usb-moded mainloop unable to process
      for example udev events / dbus requests from clients during the swich
      and causes potentially stale events to be seen after the mode switch.
      
      Separate mode selection from mode activation so that the latter is
      executed from worker thread.
      
      Distribute existing code in manner that makes the selection vs activation,
      or mainloop / worker thread separation more apparent:
      - control.c: Mode selection logic
      - worker.c:  Mode activation logic
      
      And move miscellaneous functions that have accumulated into the main
      usb-moded module to:
      
      - common.c:  Generic helper functions
      - sigpipe.c: Asynchronous signal trapping
      
      Rename all moved functions so that they still have prefix indicating the
      containing module.
      
      Refuse synchronous sleeps in order to terminate ongoing mode switch
      if udev events / other inputs invalidate the target of transition.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      57d404a3
  3. 24 Aug, 2018 3 commits
    • spiiroin's avatar
      [modesetting] Refactor mass-storage mode handling · e659901c
      spiiroin authored
      Code duplication and interleaving of kernel module vs android usb logic
      makes it difficult to add support for configfs based systems.
      
      Use helper functions for common tasks.
      
      Use explicit checks for what backend should be used.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      e659901c
    • 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] 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
  4. 26 Apr, 2017 2 commits
  5. 28 Apr, 2015 2 commits
  6. 01 Jul, 2013 1 commit
  7. 19 Jun, 2013 1 commit
  8. 29 May, 2013 1 commit
  9. 23 Aug, 2012 1 commit
  10. 07 Aug, 2012 1 commit
  11. 10 May, 2011 1 commit
  12. 21 Apr, 2011 1 commit
  13. 06 Apr, 2011 1 commit
  14. 22 Mar, 2011 1 commit