aboutsummaryrefslogtreecommitdiff
path: root/plugins/option
AgeCommit message (Collapse)Author
2023-01-03build: move plugins directory to src/pluginsAleksander Morgado
We are going to allow including the plugin sources built within the ModemManager daemon binary; moving the sources within the daemon sources directory makes it easier.
2022-09-05core: port GRegex/GMatchInfo to use autoptr()Aleksander Morgado
The behavior of GRegex changed in 2.73.2 once it was ported from pcre1 to pcre2. In some cases it was made more strict, which is fine, in other cases it exposed some change in how it behaves on certain matches that is not extremely clear whether it's ok or not. See https://gitlab.gnome.org/GNOME/glib/-/issues/2729 See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/601 See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/621 Either way, one thing that was assumed was that initializing all GRegex/GMatchInfo variables to NULL and making sure they're NULL before they're initialized by glib (especially the GMatchInfo) was a good and safer approach. So, whenever possible, g_autoptr() is used to cleanup the allocated GMatchInfo/GRegex variables, and otherwise, g_clear_pointer() is used to ensure that no free/unref is attempted unless the given variable is not NULL, and also so that the variable is reseted to NULL after being disposed.
2022-06-09suspend: add suspend/resume support with powerd on ChromeOSRukun Mao
ModemManager handles suspend and resume signals sent from powerd Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/547
2022-05-24base-modem: add subsystem vendor ID propertyDaniele Palmas
Subsystem vendor ID can be used for identifying PCI modems, so expose the property.
2021-07-27option: disable preferred networks management in custom SIM objectAleksander Morgado
It's been observed that running CPOL? would completely break the AT port of the modules like the GIO225. Fully disable this feature in the whole option and option-hso plugins, by creating a new custom SIM object with the features disabled completely, and setup as a new shared interface object. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/404
2021-07-14hso: query profile id from hso bearer during connecting phaseAleksander Morgado
As the profile id is not really set in the base bearer object until after connected.
2021-05-26plugins: ignore reload_connection_status() where not supportedAleksander Morgado
Some of the AT-based connection methods don't have any way to query connection status, or we don't have a proper implementation for those yet. Ignore the reload operation in all those.
2021-05-23base-bearer: report connection error on network initiated disconnectionsAleksander Morgado
By default, fallback to "unknown" mobile equipment error when the modem gets disconnected by the network and we don't have any way to know a more detailed reason.
2021-04-30core: strict return type in g_object_ref()Aleksander Morgado
This is now a requirement when using glib 2.56.
2021-04-29broadband-bearer: rely on profile management for the cid selectionAleksander Morgado
There is no longer need to perform all the CID selection logic in the broadband bearer connection procedure, we can rely on the new profile management operations to do the same thing. We can do this because we're sure that all the MMBroadbandModem objects implement the MMModem3gppProfileManager interface. Additionally, given that we now provide the profile ID value as part of the MMBearerConnectResult, we no longer need a custom mm_broadband_bearer_get_3gpp_cid() as we can use the generic mm_base_bearer_get_profile_id() for the same purpose.
2021-03-04base-modem: explicitly say if NET or TTY data ports are supportedAleksander Morgado
A modem that creates exclusively bearer objects that work with NET ports (e.g. all QMI or MBIM modems) must not add any TTY port in the list of data ports. A modem that creates exclusively bearer objects that work with TTY ports (e.g. the generic modem) must not add any NET port in the list of data ports. A modem that may use both TTY and NET ports should add all in the list of data ports. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/324 Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/329
2021-02-24kernel-device: add get_interface_number() methodAleksander Morgado
We already have methods to query for interface specific attributes like class/subclass/protocol, so add a new one for the interface number, and make sure we use ATTRS{bInterfaceNumber} to load it always, instead of assuming the ID_USB_INTERFACE_NUM property is set.
2020-11-14core,plugins: consolidate connection/disconnection timeout valuesAleksander Morgado
Each different plugin or protocol had a different connection attempt value. E.g. QMI and MBIM both used 60s max for the connection attempt, while the u-blox plugin had up to 180s for ECM based connection setups. This commit consolidates all plugins and protocols to use the same timeout values for commands that may take long to respond, e.g. a connection atempt under low signal quality conditions. A value of 180s for the connection attempt steps and 120s for a disconnection attempt step is considered. Note, though, that in some cases (like a IPv4v6 setup attempt using QMI) we may have more than one such long step, so this doesn't mean that a connection attempt will always take less than 180s. Users of the connection/disconnection APIs should be able to handle the case where the attempt times out in their side (e.g. with a lower DBus request timeout), and which would not mean the actual request they did really failed. E.g. a connection attempt with a DBus timeout of 30s may fail in the user with a timeout error, but the attempt would still go on for as much as the plugin/protocol needs. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/270
2020-07-24changed default authentication algorithm to CHAPGiacinto Cifelli
CHAP is almost universal nowadays, and so it is a better default than PAP Not changed for uBlox, that prefers an error if not specified, and for Huawei, which uses NONE with user/pwd and has 2 CHAP choices
2020-04-08plugins: use logging module name as plugin nameAleksander Morgado
2020-04-08option,hso: port to use object loggingAleksander Morgado
2020-04-08modem-helpers: port supported modes filtering to use object loggingAleksander Morgado
2020-02-07iface-modem-location: common helper code to test raw gpsAleksander Morgado
2020-01-31base-modem: define new helper MMBaseModemAtCommandAllocAleksander Morgado
It has the same exact format as MMBaseModemAtCommand, but its contents are assumed heap allocated. The only real purpose of this type is to allow defining static constant MMBaseModemAtCommand variables without warnings when using -Wdiscarded-qualifiers.
2020-01-31option,hso: fix warnings with -Wsign-compareAleksander Morgado
option/mm-broadband-bearer-hso.c: In function ‘ip_config_ready’: option/mm-broadband-bearer-hso.c:128:21: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare] 128 | num != ctx->cid) { | ^~
2020-01-31helpers: new macro to CLAMP high threshold onlyAleksander Morgado
Useful when clamping a unsigned integer with low threshold set to 0, which would give us compiler warnings with -Wtype-limits when using CLAMP(), e.g.: via/mm-broadband-modem-via.c: In function ‘handle_evdo_quality_change’: /usr/include/glib-2.0/glib/gmacros.h:811:63: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits] 811 | #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) | ^ via/mm-broadband-modem-via.c:284:19: note: in expansion of macro ‘CLAMP’ 284 | quality = CLAMP (quality, 0, 100); | ^~~~~
2020-01-31option: fix warnings with -Wimplicit-fallthroughAleksander Morgado
option/mm-broadband-modem-option.c: In function ‘load_access_technologies_step’: option/mm-broadband-modem-option.c:565:18: error: this statement may fall through [-Werror=implicit-fallthrough=] 565 | ctx->step++; | ~~~~~~~~~^~ option/mm-broadband-modem-option.c:567:5: note: here 567 | case ACCESS_TECHNOLOGIES_STEP_OSSYS: | ^~~~ option/mm-broadband-modem-option.c:587:18: error: this statement may fall through [-Werror=implicit-fallthrough=] 587 | ctx->step++; | ~~~~~~~~~^~ option/mm-broadband-modem-option.c:589:5: note: here 589 | case ACCESS_TECHNOLOGIES_STEP_OWCTI: | ^~~~ option/mm-broadband-modem-option.c:600:18: error: this statement may fall through [-Werror=implicit-fallthrough=] 600 | ctx->step++; | ~~~~~~~~~^~ option/mm-broadband-modem-option.c:602:5: note: here 602 | case ACCESS_TECHNOLOGIES_STEP_LAST: | ^~~~
2020-01-31option: fix warnings with -Wdiscarded-qualifiersAleksander Morgado
option/mm-broadband-modem-option.c:978:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 978 | { "_OSSYS=1", 3, FALSE, NULL }, | ^~~~~~~~~~ option/mm-broadband-modem-option.c:979:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 979 | { "_OCTI=1", 3, FALSE, NULL }, | ^~~~~~~~~ option/mm-broadband-modem-option.c:980:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 980 | { "_OUWCTI=1", 3, FALSE, NULL }, | ^~~~~~~~~~~ option/mm-broadband-modem-option.c:981:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 981 | { "_OSQI=1", 3, FALSE, NULL }, | ^~~~~~~~~ option/mm-broadband-modem-option.c:1033:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 1033 | { "_OSSYS=0", 3, FALSE, NULL }, | ^~~~~~~~~~ option/mm-broadband-modem-option.c:1034:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 1034 | { "_OCTI=0", 3, FALSE, NULL }, | ^~~~~~~~~ option/mm-broadband-modem-option.c:1035:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 1035 | { "_OUWCTI=0", 3, FALSE, NULL }, | ^~~~~~~~~~~ option/mm-broadband-modem-option.c:1036:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 1036 | { "_OSQI=0", 3, FALSE, NULL }, | ^~~~~~~~~
2020-01-31option: fix warnings with -Wswitch-defaultAleksander Morgado
2019-11-27option: setup as loadable 'shared' utilsAleksander Morgado
2017-12-05hso: make report_connection_status() a separate logical blockAleksander Morgado
This block is a subclassed method from MMBaseBearer, which we just happen to also use as part of the 3GPP dial logic in the connection attempt. So make it a separate logical block, and call the processing of the connection attempt if one is found. This change makes it similar to the same logic in the Icera plugin.
2017-12-05hso: use a 60s timeout to wait for connection unsolicited messagesAleksander Morgado
Same amount of time as in the Icera plugin.
2017-12-05hso: port dial_3gpp() to GTaskAleksander Morgado
2017-09-20hso: port disconnect_3gpp to use GTaskBen Chan
2017-09-20hso: port get_ip_config_3gpp to use GTaskBen Chan
2017-09-20hso: port {enable,disable}_location_gathering to use GTaskBen Chan
2017-09-20hso: port location_load_capabilities to use GTaskBen Chan
2017-09-20hso: port modem_3gpp_{setup,cleanup}_unsolicited_events to use GTaskBen Chan
2017-09-20hso: port modem_create_bearer to use GTaskBen Chan
2017-09-20hso: port load_unlock_retries to use GTaskBen Chan
2017-09-20hso: port hso_custom_init to use GTaskBen Chan
2017-09-18option: remove unneeded explicit castsAleksander Morgado
2017-09-18option: port modem_3gpp_disable_unsolicited_events to use GTaskBen Chan
2017-09-18option: port modem_3gpp_enable_unsolicited_events to use GTaskBen Chan
2017-09-18option: port modem_3gpp_{setup,cleanup}_unsolicited_events to use GTaskBen Chan
2017-09-18option: port modem_after_power_up to use GTaskBen Chan
2017-09-18option: port set_current_modes to use GTaskBen Chan
2017-09-18option: port load_access_technologies to use GTaskBen Chan
2017-09-18option: port load_supported_modes to use GTaskBen Chan
2017-09-05plugin,port-probe: always cast SEND_DELAY value to guint64Aleksander Morgado
Program received signal SIGSEGV, Segmentation fault. strchr () at ../sysdeps/arm/armv6/strchr.S:28 28 ../sysdeps/arm/armv6/strchr.S: No such file or directory. (gdb) bt #0 strchr () at ../sysdeps/arm/armv6/strchr.S:28 #1 0x76b121c8 in g_param_spec_pool_lookup () from ~/buildroot/output/staging/lib/libgobject-2.0.so.0 #2 0x76b0cf44 in g_object_new_valist () from ~/buildroot/output/staging/lib/libgobject-2.0.so.0 #3 0x76b0d39c in g_object_new () from ~/buildroot/output/staging/lib/libgobject-2.0.so.0 #4 0x75f75e40 in mm_plugin_create () at ublox/mm-plugin-ublox.c:99 #5 0x00031550 in load_plugin (path=0xe9b68 "/usr/lib/ModemManager/libmm-plugin-ublox.so") at mm-plugin-manager.c:1521 #6 load_plugins (error=0x7efffa68, self=0xdc4f0) at mm-plugin-manager.c:1574 #7 initable_init (initable=<optimized out>, cancellable=<optimized out>, error=0x7efffa68) at mm-plugin-manager.c:1679 #8 0x76b9b278 in g_initable_new_valist () from ~/buildroot/output/staging/lib/libgio-2.0.so.0 #9 0x76b9b2e0 in g_initable_new () from ~/buildroot/output/staging/lib/libgio-2.0.so.0 #10 0x000324d0 in mm_plugin_manager_new (plugin_dir=0xe9c40 "/usr/lib/ModemManager", error=error@entry=0x7efffa68) at mm-plugin-manager.c:1620 #11 0x0002da08 in initable_init (initable=0xddb40, cancellable=<optimized out>, error=0x7efffa68) at mm-base-manager.c:1113 #12 0x76b9b278 in g_initable_new_valist () from ~/buildroot/output/staging/lib/libgio-2.0.so.0 #13 0x76b9b2e0 in g_initable_new () from ~/buildroot/output/staging/lib/libgio-2.0.so.0 #14 0x0002e81c in mm_base_manager_new (connection=connection@entry=0xe1070, plugin_dir=plugin_dir@entry=0x9efb0 "/usr/lib/ModemManager", auto_scan=auto_scan@entry=1, initial_kernel_events=initial_kernel_events@entry=0x0, enable_test=0, error=0x7efffa68, error@entry=0x7efffa60) at mm-base-manager.c:957 #15 0x0002b6ec in bus_acquired_cb (connection=0xe1070, name=<optimized out>, user_data=<optimized out>) at main.c:87 #16 0x76c26864 in connection_get_cb () from ~/buildroot/output/staging/lib/libgio-2.0.so.0 #17 0x76bc76cc in g_task_return_now () from ~/buildroot/output/staging/lib/libgio-2.0.so.0 #18 0x76bc7d50 in g_task_return () from ~/buildroot/output/staging/lib/libgio-2.0.so.0 See similar bug in GStreamer: https://bugzilla.gnome.org/show_bug.cgi?id=740191
2017-07-17option,hso: fix async completion in 3gpp event handlers settingAleksander Morgado
2017-07-17option: fix async completion in 3gpp event handlers settingAleksander Morgado
2017-05-30plugins: use G_N_ELEMENTS when iterating ports arrayAleksander Morgado
2017-05-30altair,hso,samsung: setup send-delay=0 for probingAleksander Morgado
The Altair, Option HSO and Samsung plugins all use the send-delay=0 setting once the modem object has been created. For consistency, use the same setting during port probing.
2017-03-29plugins: remove explicit GDestroyNotify cast on g_free / g_object_unrefBen Chan
g_free and g_object_unref are in form of `void (*)(gpointer)`, which matches the GDestroyNotify signature. An explicit GDestroyNotify cast on g_free and g_object_unref is thus not needed.