aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem.c
AgeCommit message (Collapse)Author
2017-06-30iface-modem: use g_new0 instead of g_slice_new0 to allocate contextBen Chan
By using g_new0 instead of g_slice_new0 to allocate certain context structs, we can simply use g_free as GDestroyNotify in g_task_set_task_data and get rid of those functions that solely wrap the g_slice_free call.
2017-06-30iface-modem: port mm_iface_modem_wait_for_final_state to use GTaskBen Chan
2017-06-30iface-modem: port internal_load_unlock_required to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_update_lock_info to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_set_power_state to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_set_current_modes to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_set_current_bands to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_create_bearer to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_disable to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_enable to use GTaskBen Chan
2017-06-30iface-modem: port mm_iface_modem_initialize to use GTaskBen Chan
2017-06-06iface-modem: if bands, capabilities or modes change, refresh signalAleksander Morgado
We also remove the explicit refresh request from the Cinterion plugin, as this is a generic action applicable to all modems that require polling for signal quality and/or access technology.
2017-06-06iface-modem: consolidate signal quality and access tech pollingAleksander Morgado
Plugins have two ways to update signal quality and access technology values: via unsolicited messages or via polling periodically. Instead of keeping separate contexts for polling signal quality and access technology values, we setup a common timeout to trigger both. This allows us to simplify in which case the explicit update is required, whenever one is needed to be explicitly updated, the other one should also be. The logic now also allows plugins to return an UNSUPPORTED error in either load_signal_quality() and/or load_access_technologies() to tell the interface logic that the polling of the specific item shouldn't be performed (e.g. if the updates are expected via unsolicited messages). If both signal quality and access technology polling is flagged as disabled, we totally disable the polling logic internally. The new SignalCheckContext is bound to the lifetime of the object so that we can keep the value of the supported flags until the object is destroyed.
2017-05-20iface-modem: always complete async context with a valueAleksander Morgado
Just for consistency, this is not a bug per se.
2017-05-15iface-modem: fix setting up signal quality retrieval logicAleksander Morgado
If going directly e.g. from "Searching" to "Connecting", just setup the signal quality retrieval logic right away, don't assume we always go through "Registered" state before starting a connection. Reported-by: <colin.helliwell@ln-systems.com>
2017-03-16iface-modem: improve network registration checks for LTE devicesAleksander Morgado
If a device reports "LTE" in the list of current capabilities, we'll set EPS network supported by default. This will enable CEREG registration checks for AT based devices. If a device reports only "LTE" in the list of current capabilities, we disable all the other network support flags (e.g. will disable CREG and CGREG checks among others). https://bugs.freedesktop.org/show_bug.cgi?id=100170
2016-10-12iface-modem: always sort supported and current bands before exposing themAleksander Morgado
2016-08-15core: use MM-specific logging methods always instead of the generic GLib onesAleksander Morgado
2016-08-10core: minor coding style changesAleksander Morgado
2016-08-10modem: support SIM hot swapCarlo Lobrano
BaseModem added reprobe property. MMDevice added logic to recreate the modem if it is set invalid and "to reprobe" MMBroadbandModem * added initialization step for SIM hot swap: 1. keep dedicated ports open to listen to modem's unsolicited 2. dedicated error management in case of initialization failure due to SIM missing * added function to be called in order to act upon SIM insertion/removal: 1. close dedicated ports 2. set the modem to be reprobed 3. disable modem * added SIM HOT SWAP boolean property MMIfaceModem * added initialization step for SIM hot swap, if supported by the plugin * dedicated error management in case of initialization failure due to SIM missing
2016-07-26iface-modem: inverted steps in update_lock_info_context_stepCarlo Lobrano
Inverted steps UPDATE_LOCK_INFO_CONTEXT_STEP_RETRIES and UPDATE_LOCK_INFO_CONTEXT_STEP_AFTER_UNLOCK. Soon after the unlock, the SIM can be busy and loading unlock retries might fail. When implemented, let run "after unlock" logic before any other step in update lock info, when SIM is not locked this change does not have any effect since "after unlock" is not executed.
2016-07-20iface-modem: fix checking for single capabilitiesAleksander Morgado
The mm_iface_modem_is_*_only() checks were validating that all the other capabilities except for the ones being queried were unset, but the check wasn't explicitly checking that the actual capabilities being queried were set. This was making the check fail when capabilities == MM_MODEM_CAPABILITY_NONE. Reported-by: Matthew Stanger <stangerm2@gmail.com>
2015-12-03iface-modem: explicitly disconnect bearer before removing itAleksander Morgado
https://bugs.freedesktop.org/show_bug.cgi?id=90408
2015-12-02core: use G_SOURCE_REMOVE and G_SOURCE_CONTINUE in GSourceFuncsAleksander Morgado
2015-07-20iface-modem: don't check the cache when asking for required unlocksDan Williams
When passing known_lock=UNKNOWN to mm_iface_modem_update_lock_info() we actually do want to ask the modem itself for locks instead of checking the cache. For example, when an unknown error is returned after performing PIN/PUK operations, the cache value may well be NONE if that was the prior lock state, and that bypasses the modem which might now be locked. Thus the state gets messed up. Reproducer is to send 'ChangePin' with the wrong "old" PIN 3 times, then send a wrong PUK. No error was returned from mmcli and the modem's lock state was shown as 'none'.
2015-03-02iface-modem: don't artificially forbid power updates when in OFF stateAleksander Morgado
If for any reason the modem is in OFF state and still can talk to the modem, allow running the remaining transition requests to LOW or ON. This can happen for example for modems that use CFUN:0, i.e. which can still go online with CFUN=1. https://bugs.freedesktop.org/show_bug.cgi?id=89368
2014-08-11iface-mode: downgrade "access technology changed" message to debugDan Williams
We have a report of a modem that switches access technologies frequently, in this case almost every 10 seconds. While that's unusual, it's not unexpected depending on the RF environment. We shouldn't spam syslog with that info; if we need it we can get it with mmcli.
2014-07-06sim: rename 'MMSim' to 'MMBaseSim'Aleksander Morgado
Just so that we don't have same header names in src/ and /libmm-glib.
2014-07-06bearer: rename 'MMBearer' to 'MMBaseBearer'Aleksander Morgado
Just so that we don't have same header names in src/ and /libmm-glib.
2014-06-04iface-modem: make "signal quality updated" log message debug not infoDan Williams
Otherwise your logs fill up if the signal quality changes, which is pretty frequently for many devices.
2014-03-03iface-modem: allow setting power state to OFF when modem is in FAILED stateBen Chan
2014-02-28iface-modem: allow requesting the refresh of the access techAleksander Morgado
For periodic updates, we may want to request an explicit re-check at some point, instead of waiting for the next scheduled update.
2014-02-20iface-modem: allow transitioning to the OFF power stateAleksander Morgado
There are systems in which the modem power source can be controlled externally, e.g. to switch it on or off. In these cases, it is sometimes advisable to be able to tell the modem to cleanly shut off completely before the power is cut. So, allow transitioning to the OFF power state if the modem supports it, even if afterwards the modem could be completely unreachable.
2014-01-11iface-modem,sim: make SIM interface initialization cancellableBen Chan
2013-12-17iface-modem: fix crash in wait_for_final_state_context_complete_and_freeBen Chan
When wait_for_final_state_context_complete_and_free is invoked, if the callback associated with the GSimpleAsyncResult object of the WaitForFinalStateContext object updates the modem state via mm_iface_modem_update_state, state_changed is invoked, which causes wait_for_final_state_context_complete_and_free to be invoked again on the same WaitForFinalStateContext object. That leads to the following crash, which is observed sometimes when a modem is being disabled. Thread 0 *CRASHED* ( SIGSEGV @ 0x00000000 ) 0x7fcb7728f202 [libgobject-2.0.so.0.3400.3] - gobject.c:2916 g_object_unref 0x7fcb7743205c [ModemManager] - mm-broadband-modem.c:8034 disabling_context_complete_and_free 0x7fcb77434d64 [ModemManager] - mm-broadband-modem.c:8130 disabling_wait_for_final_state_ready 0x7fcb770c0b86 [libgio-2.0.so.0.3400.3] - gsimpleasyncresult.c:775 g_simple_async_result_complete 0x7fcb7740cdbc [ModemManager] - mm-iface-modem.c:101] wait_for_final_state_context_complete_and_free 0x7fcb7740ce19 [ModemManager] - mm-iface-modem.c:128] state_changed_wait_expired 0x7fcb76f78c33 [libglib-2.0.so.0.3400.3] - gmain.c:4026] g_timeout_dispatch 0x7fcb76f78087 [libglib-2.0.so.0.3400.3] - gmain.c:2715] g_main_context_dispatch 0x7fcb76f78437 [libglib-2.0.so.0.3400.3] - gmain.c:3290] g_main_context_iterate 0x7fcb76f78891 [libglib-2.0.so.0.3400.3] - gmain.c:3484] g_main_loop_run 0x7fcb773f4d55 [ModemManager] - main.c:142] main 0x7fcb7698a9c6 [libc-2.15.so] - libc-start.c:234] __libc_start_main 0x7fcb773f48b8 [ModemManager] + 0x000218b8]
2013-12-05core: fix some typos in commentsBen Chan
2013-11-21introspection,api: new 'Bearers' property in the Modem interfaceAleksander Morgado
https://bugzilla.gnome.org/show_bug.cgi?id=712276
2013-11-21altair-lte: add SIMREFRESH supportThieu Le
Register for SIMREFRESH event and reload own numbers and reregister modem with network when this happens.
2013-10-24iface-modem: remove unnecessary G_SIMPLE_ASYNC_RESULT() castBen Chan
This patch removes an unnecessary G_SIMPLE_ASYNC_RESULT() cast of the 'result' field, which is already of type GSimpleAsyncResult, of InternalLoadUnlockRequiredContext.
2013-09-19iface-modem: consolidate new unlock required check with retriesAleksander Morgado
The new internal_load_unlock_required() method will take care of running the subclassed load_unlock_required(), if available, and also retry the check up to 6 times. This method will be used both by the standard unlock required check and by the check within the current capabilities loading for multimode devices.
2013-09-18iface-modem: fix MODEM_STATE_IS_INTERMEDIATE macroBen Chan
2013-09-16iface-modem: free GError when interface initialization is cancelledBen Chan
This patch fixes an assertion failure 'ctx->fatal_error == NULL' in initialization_context_complete_and_free(), which happens if 'fatal_error' of the initialization context is set during the modem interface initialization and the initialization is later cancelled.
2013-09-02iface-modem: allow reset and factory reset operation in every stateBen Chan
2013-08-14iface-modem: add mm_iface_modem_get_model helper to query modelBen Chan
2013-06-25iface-modem: plug memleakAleksander Morgado
2013-06-24api,introspection: new 'Ports' property in the Modem interfaceAleksander Morgado
We will expose a new 'Ports' property listing all ports currently known by a given modem. Ports which are not used but are detected as being part of the modem will be listed with an 'unknown' port type. This change uses the new 'MMModemPortType' enum and the new 'MMModemPortInfo' helper struct to handle these values in libmm-glib. The already available 'MMPortType' enum hasn't been re-used for the interface because it contains values that we don't need (e.g. IGNORED). The port list is now also included in the modem information command of mmcli: $ sudo mmcli -m 0 /org/freedesktop/ModemManager1/Modem/0 (device id '97b7b99e3e2bea103880545b619fb05a3cc81b26') ------------------------- System | device: '/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4' | drivers: 'qcserial, qmi_wwan' | plugin: 'Gobi' | primary port: 'cdc-wdm0' | ports: 'ttyUSB0 (qcdm), ttyUSB1 (at), cdc-wdm0 (qmi), wwp0s29u1u4 (net)' https://bugzilla.gnome.org/show_bug.cgi?id=702678
2013-06-24iface-modem: don't rely on the cached current power state valueAleksander Morgado
The real power state value of the modem may be changed by other means, e.g. rfkill. So when changing power state of the modem in MM, we better recheck which the current power status is. A better full approach would be to follow rfkill changes, but this fix should help until that is done. https://bugzilla.gnome.org/show_bug.cgi?id=702838
2013-06-05iface-modem: allow changing capabilities in every stateAleksander Morgado
Same as done with the firmware switching, we allow capabilities changing even if the modem is in FAILED state, e.g. to switch from 3GPP to 3GPP2 mode.
2013-06-05iface-modem: load current modes and bands during initializationAleksander Morgado
We now load current modes and bands before enabling the modem, and we also allow mode and bands changes while the modem is disabled.
2013-06-05api,introspection: new 'SetCurrentCapabilities' methodAleksander Morgado
For those modems which expose a valid 'SupportedCapabilities' property with more than one item in the list, we'll allow switching between them.