Commit Graph

13 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
1936979f11 longcheer: ensure the Alcatel X200 is not claimed
The X200 shares the same USB VID and PID as the X060s but the X200
does not use the same AT command set; it uses the X22X plugin
instead.  Since both modems also report the same +GMM and +GMI
responses, we have to fall back to using +GMR even though that's
a pretty sketchy way to tell them apart if the firmware ever changes.
2011-06-05 20:58:18 -05:00
Dan Williams
00e00bf9e7 longcheer: ensure the plugin on handles devices it's supposed to
Other devices from the same vendor (x220) need to be handled by
the x22x plugin, so Longcheer can't just rely on the vendor ID
match to know whether it should handle the modem.
2011-05-04 15:11:37 -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
425c28dfc1 longcheer: handle TAMobile/Alcatel X060s vendor ID too
These are Longcheer-based devices, but the vendor ID is different.
We had tagged the X060s' ports in the rules but never updated the
plugin to handle the different vendor ID.
2010-05-06 15:28:43 -07:00
Dan Williams
f0e0861aa4 longcheer: add support for access technology and allowed modes 2010-05-01 22:44:00 -07:00
Dan Williams
720e38aec0 core: move physical device checking into the manager
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.
2010-03-30 14:50:40 -07:00
Dan Williams
bcfb75d88d core: grab probed QCDM ports for plugins where they are useful 2010-03-23 01:36:00 -07:00
Dan Williams
621d9e8751 longcheer: don't try to use untagged ports on known devices 2010-01-15 11:45:43 -08:00
Dan Williams
471d8a70a9 longcheer: new plugin for Longcheer (Alcatel etc) devices (bgo #606550)
Anything with vendor ID 0x1c9e really; like Alcatel X020, X030,
X060s, etc.  Longcheer appears to make the actual hardware that all
the devices with vendor ID 0x1c9e use.  You'll see it in .INF files
with "CMLONG" as part of the USB interface definition.

If the ports are not correctly detected, we need to get the driver's
.INF files to determine what the ports should be, and add them to
the udev rules file.
2010-01-15 01:37:26 -08:00