- 09 Apr, 2019 6 commits
-
-
spiiroin authored
Enabler for having privately owned mode data in the worker thread. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
String fields in modedata_t structures are filled in via functions that return 'gchar *' pointers - adjust structure data types and release function accordingly. The modelist_free() function uses g_list_foreach() iterator and a callback function that is not appropriate for the action, and then uses a cast to hide any compiler warnings - get rid of the cast by using g_list_free_full() iterator and a suitable callback function. The modelist_load() function looks complex and indiscriminately loads all files from dynamic mode configuration directory. If there are for example editor backup files present, this can lead to hard to detect issues - simplify the logic and use glob pattern expansion to derive list of files to load. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Move functions of the same type close to each other. No functional changes. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Add Doxygen comments. No functional changes. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
The important part is that these structures contain mode data, not that they are also held in lists - make the naming reflect this. Also rename related functions accordingly. No functional changes. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Update function declaration lists. Fix some misnomers / typos in function names. No functional changes. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 08 Mar, 2019 7 commits
-
-
spiiroin authored
Bug reference was missing from commit set and bots rejected the build. [dbus] Add Qt specific annotation to usb-moded Introspect XML. JB#43928
-
spiiroin authored
-
spiiroin authored
Attempting to generate code from usb-moded introspect data with qdbusxml2cpp fails because "a{sv}" is by design mystery to it. Add annotation to tell qdbusxml2cpp that "a{sv}" is QVariantMap. And add couple of missing "\n" chars while at it. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
-
spiiroin authored
When usb-moded causes network interfaces to be brought up/down, firewall rules should be adjusted accordingly. However currently there is no way for connman to know which interface changes might be related to for example developer mode activation. Expose dynamic usb mode configuration (attributes relevant to connman) on D-Bus. Broadcast a signal whenever target mode changes (mode transition begins, or fallback mode gets activated due to mode transition errors). Also provide a method call for querying the current target configuration. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 22 Feb, 2019 2 commits
-
-
spiiroin authored
-
- 21 Feb, 2019 3 commits
-
-
spiiroin authored
Use backend_init() and backend_quit() functions for settings up and cleaning up all backends. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
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:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
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:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 20 Feb, 2019 2 commits
-
-
spiiroin authored
When debugging complex issues it can be helpful know also which thread is emitting the diagnostic message and the code path that led to the situation. This is meant to be used as a development time debugging feature and thus requires enabling during build time - otherwise all related code is excluded from usb-moded binary. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Having a deterministic way to make the process exit makes it easier to debug what happens during process startup. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 18 Feb, 2019 2 commits
-
-
spiiroin authored
-
- 07 Feb, 2019 1 commit
-
-
spiiroin authored
Some transitions such as activating mtp mode can take so long that giving user feedback becomes necessary. However as usb-moded exposes only what has happened, there is no reliable source of information for what is going on. Also, the "sig_usb_state_ind" D-Bus signal is used for transmitting both mode change notifications and transient events - which is confusing and can cause problems if new signals are ever added as there is no backwards compatible ways to tell apart mode names from event names. Add dbus query / change notifications for target mode. The target mode is changed before starting mode transition, so that processes listening to signals from usb-moded know what kind of transition is happening when the current mode changes to "busy". Add separate dbus signals for mode changes and events. The legacy "sig_usb_state_ind" is retained as-is for the sake of backwards compatibility. Also synchronize the content of D-Bus Introspect xml data provided as a file in development package and made available at runtime via D-Bus method call. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 21 Jan, 2019 1 commit
-
-
Tomi Leppänen authored
Move man page to usb-moded-doc. JB#24119 See merge request mer-core/usb-moded!42
-
- 16 Jan, 2019 1 commit
-
-
Tomi Leppänen authored
Move man page from usb-moded to doc subpackage. Rename documentation directory for better consistency with other -doc packages. Remove old debian files that are not needed. Include license file in main package. Fix bogus date in changes. Signed-off-by:
Tomi Leppänen <tomi.leppanen@jolla.com>
-
- 14 Nov, 2018 2 commits
-
-
spiiroin authored
-
- 13 Nov, 2018 3 commits
-
-
spiiroin authored
If entry to mtp mode gets aborted due to cable disconnect, it is possible that mtp daemon has already been started but it does not yet show up when probing. This can lead to leaving stray/defunct mtp daemon instances behind - which then can cause attempt to activate mtp mode after reconnect to fail. When leaving mode, stop mtp daemon if it seems to be running or we have made an attempt to start it. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Cable disconnect during mode transition is handled via the code same path as errors in mode setting actions - which leads to usb-moded declaring charging mode despite not having any usb connection. Check the latest requested usb mode on failures and use it to choose between charging and undefined fallback modes. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
The common_map_mode_to_hardware() function can return the same string that it was given as an argument. In the context of worker_execute() function this can lead to using string pointer that can get invalidated after releasing mutex. Allocate copy of target mode before releasing mutex and use it in the subsequent operations. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 12 Sep, 2018 3 commits
-
-
spiiroin authored
-
spiiroin authored
While in configfs we must start mtpd (so that it writes endpoint config) before we can enable udc, apparently the reverse applies at least in some devices utilizing android usb. When android usb backend is in use, do the gadget configuration before starting mtpd. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 06 Sep, 2018 2 commits
-
-
spiiroin authored
-
- 05 Sep, 2018 5 commits
-
-
spiiroin authored
Previously switches would block mainloop and multiple mode change requests would effectively get queued and executed one after another. Now that separate worker thread is utilized, the D-Bus requests are handled without delay and can cause termination of already ongoing transition - which is could cause problems especially if done in rapid succession. Deny mode change requests over D-Bus when already busy with mode switch, so that bailing out from ongoing transition is reserved only for dealing with unavoidable physical cable disconnect situations. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
As 'return' is not a function, do not make it look like one. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
As 'sizeof' is not a function, do not make it look like one. Also 'sizeof(char)' is redundant as it is 1 by definition. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Corrupted settings, empty lists and other hiccups can lead to usb-moded attempting to send D-Bus signal with NULL strings - which either leads to omitting signal sending when checked / crashing when not checked. To avoid crashing, make umdbus_send_signal_ex() send empty string when signal with null content is given, and add sufficient checks / diagnostic logging to umdbus_send_config_signal(). Remove null checks from common_send_hidden_modes_signal() and common_send_whitelisted_modes_signal() so that NULL set gets equated with empty set and signal broadcasting is never skipped. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
If usb-moded configuration is corrupted, it can lead to segfaults as the return value from config_get_mode_setting() is not always checked. Make config_get_mode_setting() always return a valid c-string. Use MODE_CHARGING as fallback value, and remove any alternative fallback strategies used elsewhere in the code base. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-