aboutsummaryrefslogtreecommitdiff
path: root/src/mm-manager.c
AgeCommit message (Collapse)Author
2013-03-05core: don't automatically probe ports of USB<->serial adaptersAleksander Morgado
We should not automatically probe ports marked as coming from USB to serial adapters, as we're not sure that a modem is behind the adapter. Still, let the user request a manual scan and have these devices probed in that case. https://bugzilla.gnome.org/show_bug.cgi?id=647556 https://bugzilla.gnome.org/show_bug.cgi?id=691076
2013-02-20manager: during initial scan, add new ports in idlesAleksander Morgado
Treat each port independently in its own idle, as if we're receiving independent udev events, otherwise, GSources may not be properly scheduled in the main loop.
2013-01-18core: add 'hotplugged' flag to indicate if modem is newly plugged inBen Chan
This patch adds a 'hotplugged' flag to MMBaseModem to indicate if a modem is newly plugged in. A plugin can use this information to determine if, for example, the modem needs to be soft reset using the ATZ command. Dan Williams <dcbw@redhat.com> contributed the idea of implementation.
2012-08-29core: handle the 'usb'->'usbmisc' subsystem rename in the kernelAleksander Morgado
We'll try to cope with getting devices being reported in either 'usb' or 'usbmisc', trying to avoid the need of checking kernel version during runtime.
2012-08-29core: allow grabbing QMI portsAleksander Morgado
2012-08-06manager: remove the MMDevice object when the last port of the device is releasedAleksander Morgado
2012-08-06manager: fix removal of device from our HT of devicesAleksander Morgado
2012-08-06port-probe-cache: removed, no longer neededAleksander Morgado
The `MMDevice' acts as port probe cache for us now, directly storing all port probes of the same device.
2012-08-06manager: use the new method to check support of a given full deviceAleksander Morgado
2012-08-06device: split `MMDevice' creation and plugin settingAleksander Morgado
We want to be able to create the MMDevice way before we have decided which plugin to use.
2012-08-06core: compile all ports before creating the modem objectAleksander Morgado
Before this, we only exported the modem to DBus when all ports were organized, in order to make sure that we select as primary port the one we really want and not the first AT port grabbed. Given that to get all the ports organized we also needed to wait to get all the ports grabbed, we can now also defer the creation of the modem object until all the ports get grabbed. This allows us to create different types of objects based on the ports available (e.g. we can now create QMI-supported modem objects if we see a QMI port around).
2012-03-30manager: no need to remove modems in idleAleksander Morgado
There is no problem in getting the modem removed just after finishing the disabling sequence.
2012-03-30manager: try to get all modems disabled before while shutting downAleksander Morgado
2012-03-30port-probe-cache: ensure we cleanup every possible leftoverAleksander Morgado
2012-03-16build: require gudev >= 147Aleksander Morgado
Since udev 147 the gudev API is no longer marked as experimental, and therefore `G_UDEV_API_IS_SUBJECT_TO_CHANGE' is no longer needed.
2012-03-16manager: use new simplified authentication setupAleksander Morgado
2012-03-15manager: print modem debug info as soon as it gets exportedAleksander Morgado
2012-03-15core: rework port grabbing and organizationAleksander Morgado
Make port roles more flexible. We have modems that do PPP on interfaces other than the primary interface, and that wasn't possible with the old code. So clean up all that logic and move the port organization code into the core so we can reduce code in the plugins. In the new world order, the plugins say whether the port is a QCDM port, an AT port, or ignored. If it's an AT port the plugins get to tag it as primary, secondary, or PPP, or any combination of the 3. This allows for modems where PPP should really be done on the secondary port (Huawei E220, Sierra devices) so that the primary port stays open for command and status. After all ports are grabbed by the generic classes, they get "organized", which assigns various ports to the roles of PRIMARY, SECONDARY, DATA, and QCDM based on specific rules and hints that the plugin provided (which are expressed as MMAtPortFlags). The plugin code is responsible for determining the port hints (ie MMAtPortFlags) at probe time, instead of having a combination of the plugin and the modem class do the job. This simplifies things greatly for the plugins at the expense of more complicated logic in the core. This is the port of commit 96505d42ed62327101dcee7c2bf31177b0bb1c9f to the 06-api branch.
2012-03-15api,header: define common object prefixes in the daemon headerAleksander Morgado
2012-03-15manager: make sure modems get exported when all their ports are finishedDan Williams
My LG Rumor2 phone (ttyACM0 - AT, ttyUSB0 - QCDM) was never getting exported after the QCDM port finished probing. Not entirely sure why, but we should check whether we need to export a modem or not any time a port gets grabbed.
2012-03-15manager: plug small leakAleksander Morgado
2012-03-15manager: don't try to export already exported modemsAleksander Morgado
2012-03-15core: start using our newly defined errorsAleksander Morgado
2012-03-15core: start using MMBroadbandModem objectsAleksander Morgado
We chain up the Generic plugin created MMBroadbandModem objects within the GDBusObjectManagerServer in MMManager, so that they get properly exported in DBus.
2012-03-15manager: make it export the Object Manager interfaceAleksander Morgado
2012-03-15manager: let it be initableAleksander Morgado
The MMManager object creation may fail due to environment reasons (i.e. no plugins found, or problems exporting DBus interfaces), so we can use the initable interface to properly handle those situations.
2012-03-15manager: keep the GDBus connection reference in a 'connection' propertyAleksander Morgado
2012-03-15manager: use G_TYPE_INSTANCE_GET_PRIVATE() just to create the private structAleksander Morgado
A new 'priv' pointer is added in the MMManager struct, which will contain the address of the private structure.
2012-03-15core: implement the Manager1 DBus interface, based on GDBusAleksander Morgado
The MMManager object now derives from the gdbus-codegen-generated MmGdbusOrgFreedesktopModemManager1Skeleton object, and implements the handlers for the SetLogging() and ScanDevices() DBus methods. The main program is also modified to be based on GDBus.
2012-03-15manager: clear cached port probe when device is removedAleksander Morgado
2012-03-15manager: integrate the Plugin ManagerAleksander Morgado
All plugin handling and port support checks now done by the Plugin Manager.
2012-03-15plugin-base: rename 'cancel_supports_port' to 'supports_port_cancel'Aleksander Morgado
We now have 'supports_port' (async method) and 'supports_port_finish' (to get the result of the async method), so it makes sense to rename the method to 'supports_port_cancel'.
2012-03-15plugin-base: rewrite port supports check as fully asynchronousAleksander Morgado
Before this change, supports check was either synchronous (e.g. in some UNSUPPORTED cases) or asynchronous (when IN_PROGRESS was returned). With this fix, the supports check requested to the plugin will always be completed asynchronously; either directly in an idle before launching any real probing operation, or once the probing operation is finished. Therefore, it is not expected to get a IN_PROGRESS reply in mm_plugin_supports_port_finish(), only UNSUPPORTED|SUPPORTED|DEFERRED.
2012-03-15core: avoid using DBusGMethodInvocation in auth APIAleksander Morgado
While porting to GDBus, use opaque pointers. This allows us to include either a DBusGMethodInvocation or a GDBusMethodInvocation in the 'context' pointer. Once fully ported to GDBus, we can safely change it back to make the context be a GDBusMethodInvocation.
2012-02-28core: rework port grabbing and organizationDan Williams
Make port roles more flexible. We have modems that do PPP on interfaces other than the primary interface, and that wasn't possible with the old code. So clean up all that logic and move the port organization code into the core so we can reduce code in the plugins. In the new world order, the plugins say whether the port is a QCDM port, an AT port, or ignored. If it's an AT port the plugins get to tag it as primary, secondary, or PPP, or any combination of the 3. This allows for modems where PPP should really be done on the secondary port (Huawei E220, Sierra devices) so that the primary port stays open for command and status. Modem subclasses no longer get asked to handle port grabbing themselves. Instead, that's now done by the generic classes (MMGenericCdma and MMGenericGsm) and the plugins are notified when a port is grabbed so they can add unsolicited response handlers for it. After all ports are grabbed by the generic classes, they get "organized", which assigns various ports to the roles of PRIMARY, SECONDARY, DATA, and QCDM based on specific rules and hints that the plugin provided (which are expressed as MMAtPortFlags). The plugins then have a chance to perform fixups on the primary port if they choose. The plugin code is responsible for determining the port hints (ie MMAtPortFlags) at probe time, instead of having a combination of the plugin and the modem class do the job. This simplifies things greatly for the plugins at the expense of more complicated logic in the core.
2012-01-16core: register SMS errors with dbus-glibDan Williams
2011-06-30Add a DBus interface for setting the log level.Nathan Williams
Lifted almost entirely from similar code in NetworkManager. BUG=chromium-os:15197 TEST='dbus-send --print-reply --system --dest=org.freedesktop.ModemManager /org/freedesktop/ModemManager org.freedesktop.ModemManager.SetLogging string:DEBUG' Also try valid log levels 'ERR', 'WARN', 'INFO', and an invalid log level, such as 'ABCDE'. Change-Id: I2bddcd0319f4966dd293b119f68e7cc1697949b7 Reviewed-on: http://gerrit.chromium.org/gerrit/3134 Tested-by: Nathan J. Williams <njw@chromium.org> Reviewed-by: Eric Shienbrood <ers@chromium.org>
2011-06-09core: trivial whitespace cleanupDan Williams
Tabs -> spaces
2011-06-09core: handle udev 'change' eventsNathan Williams
That's what the udev replay gives us these days (as of udev-152).
2011-06-06manager: protect ScanDevices() d-bus method with manager control policy ruleAleksander Morgado
2011-06-06manager: new ScanDevices() d-bus method to request a new device scan loopAleksander Morgado
2011-06-06plugin base: let plugins decide if they should be sorted lastAleksander Morgado
Note that even if a plugin says it wants to be sorted last, the generic plugin will always be the last one. Also, there is no order guaranteed between two plugins that request to be sorted last.
2011-05-09manager: avoid assertion warning when enumerating devicesAleksander Morgado
2011-01-24core: add logging when ports get removedDan Williams
2011-01-23core: rework loggingDan Williams
Make it more flexible, add logging to a file, and absolute and relative timestamps.
2010-12-08core: work around udev parallel startup raceDan Williams
Ignore devices that aren't completely configured by udev yet. If ModemManager is started in parallel with udev, explicitly requesting devices may return devices for which not all udev rules have yet been applied (a bug in udev/gudev). Since we often need those rules to match the device to a specific ModemManager driver, we need to ensure that all rules have been processed before handling a device. Do this by adding an item to the environment of each device that MM might possibly be interested in, and ignoring devices that don't have that. When the device is fully processed by udev, MM will get an 'add' event and the device will have all rules applied.
2010-10-22core: print out modem hardware VID/PID and subsystemDan Williams
2010-06-24trivial: print out useful debugging info before assertingDan Williams
2010-06-22core: ensure claimed ports don't fall back to Generic (rh #597296)Dan Williams
Found by jklimes. If some plugin already supports this port, it's pointless to let Generic figure out if it supports the port since we're just going to hand it to the other plugin anyway.
2010-05-07core: fix memory leaksDan Williams
Since MMModem is an interface and doesn't store stuff like the modem's physdev internally (since it's an interface) these things are handled via GObject properties. And since g_object_get() returns allocated values, we need to free the returned value from mm_modem_get_device() after we're done with it.