1. 06 Sep, 2018 2 commits
  2. 05 Sep, 2018 25 commits
  3. 29 Aug, 2018 1 commit
  4. 27 Aug, 2018 2 commits
  5. 24 Aug, 2018 10 commits
    • spiiroin's avatar
      [configfs] Add support for mass-storage mode. JB#42083 · e072697a
      spiiroin authored
      Implement enter/leave mass-storage mode functionality also for the
      configfs backend.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      e072697a
    • spiiroin's avatar
      [usb_moded] Reject mtp_mode if mtp daemon can't be started · a7af998e
      spiiroin authored
      Gadget is programmed according to mtp_mode requirements
      regardless of availability of mtp daemon - which leaves
      non-functional mtp_mode supposedly active.
      
      Switch to fallback mode if mtp daemon can't be started.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      a7af998e
    • spiiroin's avatar
      [usb_moded] Fix mode-switch failure handling · 439360bf
      spiiroin authored
      Using MODE_CHARGING_FALLBACK as mode switch failure fallback
      causes retriggering of "ask" mode. And overriding only higher
      level state data leads to subtle issues later on.
      
      Use MODE_CHARGING as failure fallback, and override both
      high and low level mode state info when requested mode can't
      be activated.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      439360bf
    • spiiroin's avatar
      [udev] Ignore stale events received while blocked in mode transition · d6c8a598
      spiiroin authored
      Mode transition blocks udev event processing. If user disconnects and
      reconnects the cable multiple times during the blockade, usb-moded
      will act on stale events that might not reflect the actual state of
      the usb connection.
      
      Handle disconnects immediately, but delay acting on connects so that
      sequences of multiple disconnects and connects get compressed into
      single transition to undefined mode possibly followed by single
      transition to appropriated connected mode.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      d6c8a598
    • spiiroin's avatar
      [usb_moded] Expose mode switch as "busy" during transition · f8d0985c
      spiiroin authored
      Especially switch to mtp_mode can take a long time to finish.
      
      Use transitional "busy" mode as an enabler for ui showing a spinner when
      mode change takes long enough to cause confusion for users.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      f8d0985c
    • spiiroin's avatar
      [usb_moded] Explicitly start/stop mtp daemon. Fixes JB#41748 · 041d46de
      spiiroin authored
      The mtp functionality is started roughly as follows:
      
      1. usb-moded completes whole gadget configuration, and then
      2. signals mtp mode activation on D-Bus
      3. msyncd sees the mode change and loads mtp plugin
      4. mtp plugin writes endpoint configuration, and then
      5. scans storage ares to enumerate files exposed via mtp, but
      6. does not really respond to ptp/mtp requests until storages are ready
      
      The problems are:
      
      While the above sequence has worked with with android usb, it does cause
      timing issues for usb enumeration and longer than expected response times
      from pc side mtp initiator point of view.
      
      Additionally when configfs is used, the gadget configuration can't even
      be completed before mtp daemon gets a chance to write configuration data
      to the control endpoint.
      
      To remedy the situation the following changes are made:
      
      1. buteo-mtp-qt5-sync-plugin package is removed from the system -> mtp
         functionality is no longer handled by msyncd process
      
      2. mtp daemon is made to enumerate storage content before writing config
         data to control endpoint -> when usb enumeration is possible, mtp
         daemon is already ready to handle commands from initiator
      
      3. usb-moded explicitly starts/stops mtp daemon when it is about to
         activate/deactivate mtp_mode -> usb stays configured in charging
         mode until it is ready to handle mtp
      
      This patch handles step (3). Step (2) is in buteo-mtp-qt5 >= 0.5.0,
      and (1) needs to be fixed in device specific package configuration.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      041d46de
    • spiiroin's avatar
      [android] Use wrapper function for all sysfs writes. JB#41748 · 7896a728
      spiiroin authored
      Writing empty string gets ignored. This causes problems for example
      when switching from mass-storage mode to charging only as the
      lua/file attribute does not get cleared.
      
      Use a wrapper function to append a linefeed to strings written to sysfs.
      This avoids zero length writes and makes behavior similar to how
      redirected echo from command line works.
      
      Also tweak unexpected-sysfs-content-change tracker so that it ignores
      changes in whitespace.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      7896a728
    • 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
      [dyn-config] Drop unused syfs_path and sysfs_reset_value attributes · 6848228a
      spiiroin authored
      All "normal" modes ignore syfs_path and sysfs_reset_value configuration
      values.
      
      Remove redundant lines from sample configuration files and adjust
      configuration file sanity checking rules.
      
      Also fix a GKeyFile leak on error path in dynconfig_read_mode_file().
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      6848228a
    • spiiroin's avatar
      [dyn-config] Align config parsing for readability · 9dd55147
      spiiroin authored
      Long member and key names, and interleaved debug logging makes the config
      parsing code difficult to read.
      
      Add whitespace to increase ease visual inspection. Move debug logging
      to occur after each configuration block has been parsed.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      9dd55147