Commit Graph

7 Commits

Author SHA1 Message Date
Dan Williams
4dad94d500 core: rework port grabbing and organization
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-02-28 10:06:04 -06:00
Dan Williams
2af1a612e9 core: don't crash on error if response is NULL
Various bits of the code didn't check if response was valid
or not during error conditions, and when an error occurs
sometimes it'll be NULL (since not all errors are translated
errors from the modem, some are serial or general ones).  We
have to make sure we don't try to use response->str when
response doesn't exist.

Found in the generic CDMA code likely as a result of
d5d9eec2b5 but was a bug long
before that commit happened anyway.
2011-12-07 17:07:46 -06:00
Aleksander Morgado
f9f6d1dfdb plugins: propagate cached probing result to supports task
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.
2011-06-06 17:21:47 +02:00
Dan Williams
c45df27ca0 x22x: add support for the Alcatel X200
Same USB IDs as the X060s which is driven by Longcheer, but uses the
X22X command set so we have to do a little dance and make sure we
don't claim the X060s here.
2011-06-05 20:58:23 -05:00
Dan Williams
ed5aefb3cb serial: allow plugins to specify probe-time send_delay
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.
2011-04-08 16:19:36 -05:00
Dan Williams
7ae8ffe21b core: use hardware IDs as part of DeviceIdentifier
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.
2010-10-22 11:06:48 -05:00
Dan Williams
79f05cbcec x22x: add simple plugin for Alcatel X220D
And possibly the X225 as well.  Can't tell much about the modem and
what commands it supports other than AT+SYSSEL for mode selection.
The driver software and connection manager for Windows/Mac OS X are
written by JRD Communication in China, which is a subsidiary of
TCT, which makes Alcatel-branded phones and data sticks.  But it
doesn't appear to be the same firmware as other Alcatel/T&A modems
like X060S and such which are supported by the Longcheer plugin.
2010-09-22 16:04:25 -05:00