Commit Graph

81 Commits

Author SHA1 Message Date
Dan Williams
78c232c2d1 core: actually ignore blacklisted devices 2010-04-09 19:32:47 -07:00
Dan Williams
41ca10e92d core: get correct PCMCIA master device
The master device of PCMCIA-provided ports is typically the
last device in the PCMCIA subsystem, because the PCMCIA
controller is usually a PCI device or some other subsystem.
2010-04-09 17:33:22 -07:00
Dan Williams
49c363d83a core: fix handling of deferred ports during probe
The next plugin logic was wrong when a previous plugin had already
claimed support for the port and the Generic plugin was next.  In
that case, the code failed to call the functions to actually grab
the port.
2010-04-05 12:26:12 -07:00
Dan Williams
bac945a8e4 core: fix supports check for last plugin (rh #579247)
Since Generic is always last, it was getting ignored by this
off-by-one bug caused by a previous patch.
2010-04-05 11:15:09 -07:00
Dan Williams
4d89b519b4 core: don't advance to next plugin until needed
Otherwise info->cur_plugin is wrong (and therefore we left uncleared
supports tasks in MMPluginBase) when the port isn't supported by
the plugin, but it's parent modem device was supported by the plugin.
Like when all probing of the port fails but one of it's siblings has
already been claimed by a modem; in this case we just drop the port
(so that no other plugin could try to claim it, because only one
plugin is allowed to handle all a modem's ports) but we still need
to tell the parent modem's plugin to clean up the supports task.
2010-03-31 03:05:22 -07:00
Dan Williams
40a713be6f core: pass try_supports_port() the existing modem 2010-03-30 23:36:08 -07:00
Dan Williams
4753f7360b core: don't re-export modems after db413acc4e
If a port is found by the kernel after the modem is already exported,
make sure we don't re-export the modem after the tardy port is handled.
2010-03-30 23:28:26 -07:00
Dan Williams
db413acc4e core: only export modems when all ports are handled
A modem is now only exported to D-Bus when both of the following are true:

1) the modem is valid
2) all ports the modem provides have been handled by appropriate plugins

This ensures that all the modem's ports are completely ready before
any clients can do anything with it.  In the case of CDMA modems with
QCDM ports, this allows the QCDM ports to be detected before exporting
the modem.  Since the QCDM detection comes after AT probing, previously
this resulted in a CDMA modem getting exported to clients before we had
a QCDM port to query for registration status.
2010-03-30 16:06:55 -07:00
Dan Williams
df08f6a43f core: find the existing modem for a port in the manager 2010-03-30 15:03:35 -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
76130862ed core: cleanly disable modems on shutdown 2010-03-22 15:41:14 -07:00
Dan Williams
a431455059 core: fix memory leak on startup 2010-02-20 14:53:43 -08:00
Martin Pitt
a9918d5942 core: ignore VTs
Even just walking sysfs for driver and parent devices takes
time for ports we know we'll never use, so take a short-cut
and save some startup time.  This reduces the startup
overhead to some 15%.
2010-02-02 10:02:53 -08:00
Dan Williams
1157b59a18 core: pretty-print state changes 2009-12-02 14:59:26 -08:00
Dan Williams
aa78b5f5e5 bluetooth: handle rfcomm device moves
rfcomm devices seem to be created as 'virtual' devices first, without
any parents, then moved to the right place in the device tree.  So
handle moves too; if the modem was already found in the 'add' phase
it'll be ignored in the move phase.
2009-10-02 23:33:18 -07:00
Noel J. Bergman
53af144f49 udev: handle removal of parent usb devices
fix device removal event handling to remove modems
if the associated parent usb device is removed
2009-09-09 01:17:20 +02:00
Alexander Sack
12ac98e9f6 license: add license header to all files and set copyright based on git log 2009-08-06 12:43:51 +02:00
Dan Williams
7b7df91eb8 manager: do modem creation from an idle handler
It helps make the supports/grab callchain less crappy to look at
in gdb by ensuring that the supports chain unwinds before the grab
happens, and also ensures that we use the right subsys/name variables
rather than depending on ones the plugin provided to supports_callback,
that may go be freed by the plugin somewhere in grab_port().
2009-06-29 16:51:25 -04:00
Dan Williams
6077763d90 asynchronous and deferred port detection
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.
2009-06-28 14:05:05 -04:00
Dan Williams
983e3c9947 core: gracefully handle SIGTERM and SIGINT by shutting down cleanly 2009-06-18 23:22:07 -04:00
Dan Williams
924814c101 udev: move device probing and detection to udev
Get rid of dependency on HAL, using libgudev instead.  Fix up the plugin API
to no longer use either HAL or udev defines, but let plugins use whatever
mechanism they want for getting more information out of the device given the
subsystem and device node name.

Modems are now defined as "master" devices which "own" a one or more ports.
A port could be a serial tty device or a network device or whatever.  The
plugin figures out whether it supports a given port or not and then assigns
it to a new or existing modem.  Modems now have a 'valid' property that
should be set to TRUE when the modem has enough ports to operate correctly.
For devices (ex. 'hso') that use a network device for data transfer, the
modem would need to grab at least one TTY and the network device associated
with that physical device to be 'valid'.

Also move the generic modem support code to a plugin like other modem plugins,
and change the I-support-this-device mechanism to return a number indicating
the level of support.  For example, the generic plugin would return a quite
low number if the device indicates via probing that it can do GSM or CDMA, but
a more specific plugin can indicate better support for the device, and thus
the more specific plugin would win control.
2009-06-18 14:25:30 -04:00
Tambet Ingo
8eb9fa50b4 Handle cases where HAL is not running/disappears/reappears. 2009-04-14 11:43:26 +03:00
Tambet Ingo
28fd7f7820 Implement the spec correctly for DeviceAdded and DeviceRemoved signals. 2009-02-10 15:26:51 +02:00
Tambet Ingo
c44079b312 Always print out which plugin created the modem. 2008-11-24 16:41:23 +02:00
Tambet Ingo
07f1b3cc3a Document DBus error codes and messages. 2008-09-16 14:00:10 +03:00
Tambet Ingo
e0c720e19c Fix the loadable module name checking. 2008-09-16 13:10:44 +03:00
Tambet Ingo
675964a6b2 Fix device added and removed signals.
The device argument was a MMModem object, which conflicted with the spec.
Changed it to the modem's udi.
2008-09-11 16:37:01 +03:00
Tambet Ingo
37b716de8a Fix error codes. 2008-09-11 15:12:07 +03:00
Tambet Ingo
ac4409e7ce Rewrite serial device communications.
Instead of vague "send something, wait something" the responses are now
analyzed by (overridable) parsers. Makes all the modem implementations much
easier since each caller knows without any code whether the call succeeded
or failed.

Another thing that makes modem code simpler (and the whole thing more robust),
is the queueing of sent commands. Each queued command has a command and a
callback which is quaranteed to get called, even if sending failed.

Define and implement error reporting.
2008-09-11 08:35:32 +03:00
Tambet Ingo
149b41f220 Implement per modem type DBus interfaces.
A major code reorganization.
2008-08-21 09:11:17 +03:00
Tambet Ingo
cc31458b18 Initial commit. 2008-07-31 09:43:00 +03:00