Age | Commit message (Collapse) | Author |
|
|
|
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.
|
|
|
|
We need to ensure that the supports task always has the results of the probing,
no matter if the probing was just launched by the plugin grabbing the port, or
by a previous plugin. We do this during supports_port(), by propagating to the
supports task any possible previously cached probing results.
|
|
Previously plugins could only stop probing, *or* stop probing and
indicate support for a device. For the Alcatel X200/X060s debacle
we need to stop probing and indicate that the plugin does not
support the device at all.
|
|
Long ago there were problems where certain Huawei devices would
stop responding on various ports, and sometimes would crash
randomly. The theory at the time was that touching the secondary
ports made the device angry, thus the plugin simply opened the
ports and listened for unsolicited messages. But if the device
didn't send any during that 7 second period, MM would not detect
and secondary ports at all. Plus, it was always a hack.
Instead, the new theory is that the device crashes if unsolicited
messages are enabled (^CURC=1), the secondary port gets touched,
*and* then closed and left for a while. Fix that by turning
unsolicited messages off at probe time, on when the device is
enabled, and off again when the device is disabled like happens
for other modems. Thus when MM first detects the modem, it turns
off unsolicited messages and the serial buffer on the secondary
port doesn't fill up and crash the modem.
Second, this allows us to simplify the probing logic quite a bit
so that we can probe all ports we find, but we still wait to probe
the first port so we can turn off unsolicited messages and get
hints about what port is the secondary.
|
|
Let modems we know don't suck use a zero send-delay at probe time,
which greatly reduces time required to probe AT-compatible ports.
|
|
Make it more flexible, add logging to a file, and absolute and
relative timestamps.
|
|
Pass the device's hardware IDs through modem creation and use them
when calculating the device's identifier. Add a bunch of testcases
for real hardware to ensure we don't break the device ID in the
future unless we really want to.
|
|
|
|
|
|
It turns out that the manager needs to know about the physical
device so we can prevent multiple plugins from claiming ports on
the same modem.
|
|
Previously there was an issue where if the probe failed, because
we can't really probe huawei secondary ports for various reasons,
the Generic plugin would eventually come around and try actively
probing the secondary port after the Huawei plugin said "I don't
support this port". Which resulted (potentially) in two MMModem
objects for the same device (one driven by Huawei, the other by
Generic).
|
|
|
|
|
|
Using the USB product ID to direct certain modems to the generic
driver is wrong since even new modems like the E1550 are 0x1001
after the modeswitch. Instead, lets assume that most current modes
use the Huawei-specific AT command set.
|
|
For QCDM devices we want most of what MMSerialPort does, but not
the AT command handling stuff since the commands and responses
aren't AT commands nor are they even strings. So convert everything
that MMSerialPort does into a GByteArray, and let MMAtSerialPort
handle the conversion to strings when necessary.
|
|
|
|
Like UMTS vs. GSM, EVDO and 1x are separate networks and technologies
and have separate registration state. You can even be roaming on
EVDO while in your home 1x network. Handle that.
|
|
|
|
|
|
ZTE modems need to use udev rules to assign port type hints,
so generalize that and port all the plugins over to suggested
port types in the MMModem interface's grab_port() function.
|
|
Allow plugins to perform asynchronous port detection, and to defer port detection
until later. This moves the prober bits into MMPluginBase so that all plugins
can take adavantage of it only when needed; the probing is not done at udev time.
Furthermore, plugins like Novatel can flip the secondary ports over the AT mode
through deferred detection, by deferring the secondary ports until the main port
has been detected and AT$NWDMAT has been sent.
This commit also finishes the port of the rest of the plugins (except mbm) over
to the new port detection methods and plugin API.
|
|
We'll need it in more than one place, so make it generic.
|
|
Create a base MMPort class to handle both tty and net ports generically,
and move plugins over to that. Also port the 'hso' plugin to udev.
|
|
|
|
Find the monitoring device for Huawei modems by usb interface number.
|
|
Turn DCD detection off for certain Huawei modems that don't report it
correctly.
|
|
|
|
|