summaryrefslogtreecommitdiff
path: root/src/mm-plugin-manager.c
Commit message (Collapse)AuthorAgeFilesLines
* core: use G_SOURCE_REMOVE and G_SOURCE_CONTINUE in GSourceFuncsAleksander Morgado2015-12-021-2/+2
|
* plugin-manager: make sure there is some wait time before probing the first portAleksander Morgado2015-02-161-27/+68
| | | | | | | | We really do need a wait time to make sure most ports are exposed by the kernel, so that plugin filters based on "forbidden-drivers" work correctly. E.g. the "gobi" plugin now flags as forbidden the "qmi_wwan" driver, which means that modems exposing both TTYs and QMI/WWAN ports should never be handled by the Gobi plugin.
* plugin-manager: fix defer-until-suggested probing tasksAleksander Morgado2014-06-021-66/+99
| | | | | | | | | If a task is marked as defer-until-suggested (e.g. a wwan port) and there was already a 'best' plugin set in the parent device, use it to complete the deferred task. This may happen in e.g. MBIM devices if the WWAN port arrives later than the already probed /dev/cdc-wdm character device.
* core: minor coding style fixesBen Chan2014-05-201-3/+3
|
* context: new '--test-plugin-dir' to allow specifying where the plugins areAleksander Morgado2014-02-131-5/+67
|
* plugin-manager: allow looking plugins by nameAleksander Morgado2014-02-131-0/+22
|
* plugin-manager: handle modems where only some ports report being IceraAleksander Morgado2013-06-261-16/+69
| | | | | | | | | Icera-based Nokia modems may reply correctly to the Icera probing only in some AT ports, not in all. In order to handle this situation we override the final plugin selected to be the Icera-based one if we find that the mismatched plugins have the 'icera-allowed' and 'icera-forbidden' filters. https://bugzilla.gnome.org/show_bug.cgi?id=703022
* plugin-manager: handle race condition during probingAleksander Morgado2013-04-181-25/+34
| | | | | | | | | | | | | | | | The specific case: * Modem exposes cdc-wdm port, Generic plugin probes it successfully as QMI. * Modem exposes new ports, including the wwan one. All ttys fail probing because they're neither AT nor QCDM (CnS in this case). * The wwan port ends up without a port being suggested and is not grabbed. The root cause of this is that we do not propagate the suggested plugin to newly added ports when it's the Generic one. If it wasn't the Generic one, the newly added ports would start with the suggested one for probing. Now, handle this by looking for the device-specified plugin when the port probing ends without a specific port given. If there is such a device-specified plugin accept the port, and otherwise, reject it.
* plugin-manager: cancelled tasks are no longer deferred-until-suggestedAleksander Morgado2013-02-251-0/+4
| | | | | | | The deferred-until-suggested tasks specify tasks that are open/ongoing; cancelled tasks shouldn't have this flag set. https://bugzilla.gnome.org/show_bug.cgi?id=694603
* core: update logging levels of several messagesAleksander Morgado2013-02-191-9/+9
| | | | | 'info' log level, the default if none specified, included too many logs which aren't that useful, to try to minimize the noise we produce by default.
* plugin-manager: log time required for device probingAleksander Morgado2013-02-191-2/+14
|
* plugin-manager: if minimum time consumed and all deferred tasks, abort probingAleksander Morgado2013-02-191-1/+22
| | | | | | For the case where we just get a device with all net ports (i.e. all deferred until result suggested), just abort the probing if the minimum probing time is consumed.
* plugin-manager: new debug logs to help track probing issuesAleksander Morgado2013-01-111-9/+32
|
* plugin-manager: initially never start with the Generic plugin suggestedAleksander Morgado2012-12-271-5/+10
| | | | | The generic plugin should be a fallback, so when starting to probe the port, never start with the Generic plugin first.
* plugin-manager,plugin: run pre-probing filters earlyAleksander Morgado2012-10-301-33/+86
| | | | | | | | | | | | | | | | | | | | | For each port, we will construct the list of plugins to test with. In that list we will include those plugins which are likely to handle a given port, so we will skip all those which aren't. To see if a plugin is likely or not, we will run the pre-probing filters before adding them to the list, with the new `mm_plugin_discard_port_early()'. This method will return one of these hints: * UNSUPPORTED: The plugin will not be able to handle this port. * MAYBE: The plugin may handle this port. * LIKELY: The plugin may (very likely) handle this port. * SUPPORTED: If any plugin should support the port, this is it. Plugins reported to be 'likely' supporting the port will be probed before the ones reported just as 'maybe'. If a plugin reports 'supported' only that one and the fallback generic ones will be tried.
* plugin-manager: use dispose() as we're holding plugin objectsAleksander Morgado2012-10-301-4/+7
|
* plugin-manager,plugin: improve loggingAleksander Morgado2012-10-301-44/+17
| | | | | | Logging which are the reasons for a plugin to filter a given port really help when trying to debug user issues. Some other general logging improvements also done.
* plugin-manager: never suggest the Generic plugin to othersAleksander Morgado2012-09-191-25/+48
| | | | | | | | | | | | | | | Some modems, e.g. Huawei E367, will probe first the QMI port and for some reason it doesn't report a proper VID/PID so the Generic plugin is the one finally accepting that port. When we probe the AT ports afterwards we already got the Generic plugin as suggestion, and we end up not grabbing the proper primary and secondary ports as we skipped the AT^GETPORTMODE reply. So, from now on the Generic plugin is never suggested to other probes; except for the case where we need the suggestion to finish a probing task which was 'deferred until suggested'. Also, the device-level plugin can now be overwritten, if and only if, the previously set plugin was the Generic one.
* plugin-manager: never suggest result to the probe which generated the suggestionAleksander Morgado2012-08-301-3/+6
|
* device: keep all unsupported ports in a separate listAleksander Morgado2012-08-061-0/+3
| | | | | Ports being marked as unsupported should not be passed to the plugin specific create_modem() or grab_port() methods.
* plugin-manager: relaunch probing when suggestion comes to deferred tasksAleksander Morgado2012-08-061-11/+24
| | | | | | | | If a port support task was deferred until suggested, do not assume that the suggested plugin actually supports the port, instead re-launch support check. This covers the cases where a net port appears in a modem which only supports AT ports (e.g. Nokia case).
* device,plugin: let the `MMPlugin' API know about `MMDevice'Aleksander Morgado2012-08-061-5/+7
|
* plugin-manager: simplify by iterating the list ourselvesAleksander Morgado2012-08-061-7/+3
|
* plugin-manager: use a double-linked list for the plugin listAleksander Morgado2012-08-061-19/+18
|
* plugin: new method to compare pluginsAleksander Morgado2012-08-061-20/+1
| | | | | | Instead of providing a method to get if a plugin is requesting to get sorted last, we provide a way to comparing two plugins, compatible with the GCompareFunc required in g_list_sort().
* plugin: simplify interface by passing around the device and/or port objectsAleksander Morgado2012-08-061-4/+2
|
* plugin-manager: simplify device/port probing logicAleksander Morgado2012-08-061-471/+271
| | | | | | | | The plugin manager no longer needs to take care of keeping track of which probes are being run and to which physical device they correspond, as the upper layer's `MMDevice' already does this. This simplifies the internal logic quite a lot, as we can now easily suggest plugins to the remaining port probes of the same device directly.
* plugin-manager: find port support is now only an internal operationAleksander Morgado2012-08-061-18/+23
|
* plugin-manager: remove unneeded methodsAleksander Morgado2012-08-061-50/+0
| | | | | | | | | | | We no longer need to query the plugin manager whether we're checking support for a specific port, as the ports are now grabbed only once in the MMDevice, and therefore we ensure that supports check is launched only once in the PluginManager for that specific port. Also, we no longer need to query the plugin manager whether we're checking support for a given device, as the logic to check when all ports of the device are probed is now maintained internally.
* plugin-manager: define a minimum probing time of 2sAleksander Morgado2012-08-061-9/+41
| | | | | Effectively, we're now letting the kernel up to 2s to show all the ports of the device, starting from the time where the first port is exposed.
* plugin-manager: new method to check support for a given device and all its portsAleksander Morgado2012-08-061-0/+185
| | | | | | The new `mm_plugin_manager_find_device_support()' will be an async method which waits for ports to be added in the given `MMDevice'. As soon as all added ports are probed, the device support check is considered finished.
* plugin-manager: avoid race when port deferred until suggested and suggestion ↵Aleksander Morgado2012-03-161-6/+18
| | | | | | | already there It may happen that we launch the supports task in the port AFTER having received the suggestion.
* plugin-manager: fix loop of deferred tasks when no best plugin foundAleksander Morgado2012-03-151-32/+81
| | | | | | | If deferring tasks until result suggested, and we never got a suggestion, the tasks may have been left deferred in loop forever. We now remove the defer timeout in the case of waiting for suggestion, and ensure that we cancel tasks if the last valid probing ended without best plugin found.
* plugin-manager: new defer-until-suggested support check result handlingAleksander Morgado2012-03-151-1/+24
| | | | | 'net' ports will be supported as soon as there is another port reporting successful support.
* core: start using our newly defined errorsAleksander Morgado2012-03-151-1/+3
|
* core: start using MMBroadbandModem objectsAleksander Morgado2012-03-151-2/+2
| | | | | | We chain up the Generic plugin created MMBroadbandModem objects within the GDBusObjectManagerServer in MMManager, so that they get properly exported in DBus.
* plugin-base: remove `MM_PLUGIN_SUPPORTS_PORT_IN_PROGRESS' statusAleksander Morgado2012-03-151-5/+0
| | | | | | Support checks are fully asynchronous and result is always reported when the check is considered ready, so in-progress replies to `mm_plugin_supports_port_finish()' don't make any sense.
* plugin-base: don't report numeric support level in the [0-100] rangeAleksander Morgado2012-03-151-36/+13
| | | | | | There is no single case where more than one plugin may end up wanting to support a given port, and therefore there is no need to report the numeric support level when reporting SUPPORTED.
* plugin-manager: new methods to check for ongoing port support operationsAleksander Morgado2012-03-151-0/+50
| | | | | | | | The new mm_plugin_manager_is_finding_port_support() allows to check whether the Plugin Manager is looking for support in a specific port. The new mm_plugin_manager_is_checking_device_support() allows to check whether the Plugin Manager is looking for support in any port of a given device.
* plugin-manager: allow suggesting a plugin when launching support checksAleksander Morgado2012-03-151-0/+8
| | | | | The newly launched support check will start probing with the suggested plugin right away.
* plugin-manager: propagate support check results to tasks in the same deviceAleksander Morgado2012-03-151-21/+108
| | | | | | | | | | | | As soon as the first support check of a port in a given device finishes with a valid best plugin and level > 0, propagate the result to other support tasks corresponding to ports in the same physical device. Previously, this propagation of support check results was only done once the port was grabbed by a plugin, not just when the plugin reported that it supported it. This change in behaviour isn't probably a big deal, as there should not be any case where a plugin says it supports a port and then cannot grab it.
* plugin-manager: keep track of all launched support checksAleksander Morgado2012-03-151-0/+86
| | | | | | | | We will keep a reference to each of the support checks currently in progress, grouped by physical device path. The stored SupportsInfo structs as well as the support check operations, are guaranteed to be kept valid as long as the Plugin Manager exists. Or in other words, the Plugin Manager cannot be disposed if there is still an ongoing supports check operation.
* plugin-manager: new method to look for best plugin supporting a given portAleksander Morgado2012-03-151-0/+203
| | | | | | | | | The new `mm_plugin_manager_find_port_support()' method requests the Plugin Manager to iterate over the list of plugins internally handled, launching supports task for the given port in each of them. The method is fully asynchronous, and the result can be retrieved with `mm_plugin_manager_find_port_support_finish()' once the operation is ready.
* plugin-manager: ensure we always print paths in UTF-8Aleksander Morgado2012-03-151-22/+34
| | | | | There is little chance of having a PLUGINDIR which is not UTF-8, but it may happen, and g_log() won't like it.
* plugin-manager: find and load plugins when the manager object is createdAleksander Morgado2012-03-151-2/+177
| | | | Ported the plugin finding and loading code from the MMManager object.
* plugin-manager: let it be initableAleksander Morgado2012-03-151-3/+26
| | | | | Looking for plugins and loading them will be done during the object creation, so the operation may fail and we need to report it.
* plugin-manager: new MMPluginManager objectAleksander Morgado2012-03-151-0/+58