This can be used by a connection manager to decide to respond in a different way
to certain kinds of disconnects (e.g. intentional versus unintentional versus
suspension).
TEST=None
This change introduces no additional code, so testing it in isolation is not
possible.
BUG=chromium-os:6744
Change-Id: Ie371e20ec7a003333eba013af3ad61c0e494a4ad
Signed-Off-By: Elly Jones <ellyjones@chromium.org>
Review URL: http://codereview.chromium.org/3413011
(cherry picked from commit 29a9674b818fd64c19bad84f526f6fa68edec174)
BUG=6885
TEST=inspect mm-modem.h, build cromo et al against new mm-modem.h
Change-Id: Id8c849b6cffbadb9d5d2aa4109257eb747cf9bb5
Review URL: http://codereview.chromium.org/3616004
(cherry picked from commit 3a50b8c28d155060ce035a1c6d5eadf3d91297a5)
Also, include the interface name in the method and signal names, to avoid name collisions. I have corresponding changes in the flimflam modemmgr plugin to accomodate the new names.
For a sample of the output, see ~ers/mm-modem.h
Review URL: http://codereview.chromium.org/2852010
(cherry picked from commit f9dbea25b8ba4414c77d6dfc94545bf7b5c26e68)
The kernel appears to add the device first without any parents,
then to move it to the correct place in the hierarchy, with its
immediate parent being the device's HCI controller. So we need
to capture the 'move' event too since that's when the rfcomm
device is finally usable.
Which requires that we turn it into a GInterface that MMModemBase
can implement, because dbus-glib does not allow attaching more
than one introspection glue structure to an object at a time.
Also implement the standard D-Bus properties changed signal.
Ignore devices that aren't completely configured by udev yet. If
ModemManager is started in parallel with udev, explicitly requesting
devices may return devices for which not all udev rules have yet been
applied (a bug in udev/gudev). Since we often need those rules to match
the device to a specific ModemManager driver, we need to ensure that all
rules have been processed before handling a device.
Do this by adding an item to the environment of each device that MM
might possibly be interested in, and ignoring devices that don't
have that. When the device is fully processed by udev, MM will get
an 'add' event and the device will have all rules applied.
-1 = no APN set, so use modem default. We'll have to fix a few
more things up for modems like hso/mbm that don't use ATDT and
require CIDs, but this gets us halfway there for other devices.
If the base class advertises that it implements an interface, it
really does need to implement all that interface's properties too.
Otherwise dbus-glib gets mad and can't look up the property information
for D-Bus Introspection.
We currently convert to and from the modem's set charset and always pass
'15' as the data coding scheme. Passing the correct data coding scheme
as third argument to CUSD only upsets the network. This contradicts 3GPP
TS 23.038. Other tools like gsm-ussd handle it the same way.
Network responses that require further actions are not yet implemented.
(some fixes and cleanups by Dan Williams)
Some devices (8775 specifically) get angry if you don't check for
a PS attach before dialing. The next time they try to connect,
they'll continuously report "searching" as the registration status
and return CME ERROR 30 (No Network Service) for lots of requests.
So initiate a PS attach (which should return OK if the modem is
already attached) before dialing, and if that fails cancel the
dial attempt.
See http://mail.gnome.org/archives/networkmanager-list/2010-October/msg00072.html
"I talked about this problem with a contact at SierraWireless. He said that
a firmware upgrade will not help in this case. But what can help is checking
for PS attach and dial only if PS attach status is attached. Dialing without
PS attach can bring modem into unwanted condition that sometimes restart is
needed to recover."
Checking PIN status makes sure the SIM is initialized, and
that has to happen before we try to read the SIM for the
ICCID. So move PIN checking before getting the ICCID, and
retry the ICCID at least once for odd cards like Gobi 1K
that seems to need one more try right after it's done
booting up.
Depending on when the core requested the ICCID, the port may or may
not be open. Stuff that needs an open serial port needs to make sure
that the port gets opened itself.