aboutsummaryrefslogtreecommitdiff
path: root/src/mm-base-modem.c
AgeCommit message (Collapse)Author
2013-11-20base-modem: fix port validity checksAleksander 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-04-17base-modem: allow grabbing MBIM portsAleksander Morgado
2013-04-09base-modem: keep AT port as possible data port if flagged as PPPFranko Fang
2013-04-06base-modem: don't assume primary AT port is availableAleksander Morgado
QMI modems may not have it.
2013-04-01base-modem: don't assume all cdc-wdm ports are QMIAleksander Morgado
2013-02-18bearer,3gpp: dial operation specifies which data port to useAleksander Morgado
Instead of deciding in advance which data port to use, we let the dialling operation gather it. For the generic dialling logic, ATD-based, always an 'AT' port will be used as data port, even if we grabbed a 'net' port. Those plugins that can work with 'net' ports will grab the specific 'net' port themselves.
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-12-27base-modem: don't set the modem valid if we didn't export the Modem interfaceAleksander Morgado
If an error occurs early during the initialization (e.g. during port setup), we would be aborting without even having exported the modem interface. So detect that case and skip setting the modem as valid.
2012-10-31core: allow QMI modems without AT portsAleksander Morgado
2012-10-09base-modem: new fallback when matching QMI vs data portsAleksander Morgado
If no matching found, but there is only one QMI port and only one data port, assume that is already a valid match.
2012-10-08base-modem: cleanly close the QMI port to get the CIDs releasedAleksander Morgado
If we end up allocating too many CIDs without releasing them new allocations will fail with client-ids-exhausted errors. This usually happens specially when debugging/developing as you're all the time Ctrl+C-ing the daemon without rebooting the system.
2012-09-05build: new `--without-qmi' configure optionAleksander Morgado
For those who don't care about the QMI support through libqmi-glib, or if you're stuck with glib 2.30 (libqmi-glib requires 2.32), this configure switch allows disabling the QMI support completely. The logic to detect cdc-wdm ports is still in place, but the QMI probing is never launched at them. Also, all QMI-related objects won't be compiled.
2012-08-30base-modem: allow looking for the QMI port associated to a given data portAleksander Morgado
QMI and wwan ports come in pairs. Each wwan port has an associated control QMI port, which is the only port allowed to send the Start|Stop Network QMI requests to start|stop the connection in the given wwan interface. Paired QMI and wwan interfaces (should) share the same parent udev device, quoting Bjørn: "If we ignore the unfortunate 3.4 and 3.5 kernels, then a matching wwanX and cdc-wdmY set will always share the same parent USB interface on QMI devices. Having the same parent USB device is *not* sufficient. You cannot control wwan0 using cdc-wdm1 in the above example."
2012-08-29base-modem: allow getting/peeking all data portsAleksander Morgado
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-29base-modem: allow grabbing multiple 'net' and 'qmi' portsAleksander Morgado
All grabbed 'net' ports are added to the new list of data ports. It is a task for the specific plugin to decide how each of the data ports should be connected. In the case of not having 'net' ports, the list of data ports will only contain a single AT port. All grabbed 'qmi' ports are added to the new list of QMI ports. The first port in the list is to be considered the 'primary' one, and will be the one used for all services. The remaining QMI ports, if any, will only be used to for WDS, to manage the associated 'net' ports.
2012-08-29base-modem: use the new `MMQmiPort' objectAleksander Morgado
2012-08-29base-modem: allow getting/peeking the QMI portAleksander Morgado
2012-08-29core: allow grabbing QMI portsAleksander Morgado
2012-08-24api,introspection: report list of drivers, not just oneAleksander Morgado
Different ports of the same modem may get handled by different drivers. We therefore need to provide a list of drivers (new `Modem.Drivers' property with signature 'as') instead of just one (removed `Modem.Driver' property with signature 's'). $ sudo mmcli -m 0 | grep drivers | drivers: 'qcserial, qmi_wwan'
2012-03-30base-modem: disconnect internal cancellable handler while disposingAleksander Morgado
2012-03-30base-modem: plug small leaksAleksander Morgado
2012-03-30core: fatal errors in iface initializations force the modem into a FAILED stateAleksander Morgado
Modems which end up being found unusable (e.g. no SIM, fatal SIM error, no capabilities) will be exposed in DBus, but just with the Modem interface and in a FAILED state which allows no actions.
2012-03-29base-modem: use new `MMGpsSerialPort' type for the raw GPS portAleksander Morgado
2012-03-28base-modem: handle GPS control and data portsAleksander Morgado
Plugin may specify GPS-specific port tyeps when requesting to grab the port. These could either be an AT-based GPS control port, or the raw GPS serial port which emits the NMEA traces.
2012-03-28port: new `MM_PORT_TYPE_NET' for pure net devicesAleksander Morgado
Net devices will be MMPorts of type MM_PORT_TYPE_NET.
2012-03-28base-modem: no need for `port_grabbed()'Aleksander Morgado
Subclasses can configure additional stuff in the ports just after all have been organized, in the SETUP_PORTS initialization step in MMBroadbandModem.
2012-03-16base-modem: new method to check if the modem got any AT portAleksander Morgado
Required for the single-at logic in the plugins.
2012-03-16base-modem: ensure we cancel any ongoing operation when we're disposingAleksander Morgado
2012-03-16base-modem: implement new modem-wide cancellable, and rework AT commandsAleksander Morgado
Instead of the `_in_port()' variants, we'll provide more generic `_full()' methods. These should be used either if we want to send commands to a specific port, or if we want to use a specific user-provided GCancellable. In addition to this user-provided GCancellable, we keep the internal modem-wide one.
2012-03-16base-modem: new modem-wide cancellable, passed to every state machineAleksander Morgado
2012-03-16base-modem: new port getters and peekersAleksander Morgado
* mm_base_modem_peek_port_* () will return either a port object (no new reference), or NULL if none available. You would usually peek() a port if you're going to use it just in the current method, as there is no way to that reference to get invalid (we're single threaded). * mm_base_modem_get_port_* () will return either NEW references to valid port objects, or NULL if none available. And, you would usually get() a port, whenever you want the port object to be valid even out of the current method, for example when keeping it in the context of an async operation. Also, we need to consider that the primary AT port MAY BE NULL when you peek() or get() it. This is due to the fact that we may be releasing ports (due to device disconnection) in the middle of async operations.
2012-03-16base-modem: when getting best AT port, assume we may have lost specific portsAleksander Morgado
Don't assume that primary port is always set.
2012-03-16base-modem: use new simplified authentication setupAleksander Morgado
2012-03-15core: don't pass primary port to interface initializationsAleksander Morgado
They will all get it themselves.
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-15at-serial-port: no need to pass port type when creating the objectAleksander Morgado
We'll just specify the port is AT, not primary or secondary
2012-03-15qcdm-serial-port: no need to pass port type when creating the objectAleksander Morgado
2012-03-15base-modem: also signal validity when reporting invalidAleksander Morgado
Otherwise the manager won't catch invalid modems failing at initialization.
2012-03-15base-modem: use new autogenerated port-enum-string gettersAleksander Morgado
2012-03-15base-modem: ignore every unsolicited CMTI until we set up messagingAleksander Morgado
2012-03-15broadband-modem: if locked, don't try to initialize remaining interfacesAleksander Morgado
Whenever we get unlocked, the modem initialization sequence will be run again.
2012-03-15base-modem: initially set the unsolicited CUSD handler with NULL callbackAleksander Morgado
2012-03-15base-modem: log when fully disposing the objectAleksander Morgado
2012-03-15base-modem: use g_clear_object() before setting new objectsAleksander Morgado
2012-03-15base-modem: make public the method to get best AT portAleksander Morgado
Sometimes, we want to check whether a given port is available to send commands, and fallback to some other method if so (e.g. using a QCDM port).
2012-03-15base-modem: fully ignore CIEV messages on startupAleksander Morgado
2012-03-15modem-helpers: renamed 3GPP registration related helpers with `mm_3gpp' prefixAleksander Morgado
2012-03-15base-modem: allow retrieving non-connected data portsAleksander Morgado
Bearers will ask for data ports that can be used for connections. Right now, only one data port is expected to be handled, but we don't impose any restriction in the API.