Commit Graph

72 Commits

Author SHA1 Message Date
Aleksander Morgado
b6402a4e21 bearer,3gpp: dial operation specifies which data port to use
Instead of deciding in advance which data port to use, we let the dialling
operation gather it. For the generic dialling logic, ATD-based, always an
'AT' port will be used as data port, even if we grabbed a 'net' port. Those
plugins that can work with 'net' ports will grab the specific 'net' port
themselves.
2013-02-18 15:41:26 +01:00
Aleksander Morgado
2bd4c63716 hso: remove duplicated code 2013-01-14 20:09:47 +01:00
Aleksander Morgado
ded8bfe965 hso: new helper code to debug GPS related issues
Disabled in normal compilation, can be enabled to debug issues.
2012-12-24 19:06:26 +01:00
Aleksander Morgado
dc9bbefbc0 icera,hso: don't wait to get connected if the primary port is removed
If the primary port is gone (e.g. when going to sleep) and we are just in the
middle of a connection attempt, we won't be able to receive any unsolicited
message regarding the status of the attempt. So, if we detect that the port is
forced to get closed, we'll just treat it as a connection failure.

http://code.google.com/p/chromium-os/issues/detail?id=35391
2012-12-12 12:56:47 +01:00
Dan Williams
ef644fba84 hso: DIAG ports aren't always DIAG
The 'hso' driver tags Icera-based modems' proprietary protocol port
as a DIAG port, but since they aren't Qualcomm-based, it's not
a DIAG port.  Just turn off AT probing and let QCDM probing
fail the port instead of assuming it's a DIAG port.
2012-11-27 09:56:25 -06:00
Aleksander Morgado
e6052a4abf icera,hso: don't disconnect() cancellable in the cancellation callback
The logic gets completely stuck when this happens:

Stack trace below:
#0  0x77661424 in __kernel_vsyscall ()
#1  0x77337c3c in pthread_cond_wait ()
#2  0x773cebaa in g_cond_wait () from /usr/lib/libglib-2.0.so.0
#3  0x774c03cc in g_cancellable_disconnect () from /usr/lib/libgio-2.0.so.0
#4  0x76955d36 in connect_cancelled_cb (cancellable=0x78e055a0, self=0x78e0b590)
#5  0x77460982 in g_cclosure_marshal_VOID__VOIDv () from /usr/lib/libgobject-2.0.so.0
#6  0x7745ed8a in ?? () from /usr/lib/libgobject-2.0.so.0
#7  0x77478435 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#8  0x77478eb3 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#9  0x774c01eb in g_cancellable_cancel () from /usr/lib/libgio-2.0.so.0
#10 0x776a0eab in mm_bearer_disconnect (self=0x78e0b590, callback=0x776c5980 <disconnect_ready>,
#11 0x776c57de in disconnect_next_bearer (ctx=0x78e12870) at mm-iface-modem-simple.c:898
#12 0x776c58d2 in disconnect_auth_ready (self=0x78df3048, res=0x78e06210, ctx=0x78e12870)
#13 0x774fed25 in g_simple_async_result_complete () from /usr/lib/libgio-2.0.so.0
#14 0x776a8c4e in authorize_ready (authp=0x78db68d0, res=0x76801638, simple=0x78e06210)
#15 0x774fed25 in g_simple_async_result_complete () from /usr/lib/libgio-2.0.so.0
#16 0x774fee3e in ?? () from /usr/lib/libgio-2.0.so.0
#17 0x7738a7a2 in ?? () from /usr/lib/libglib-2.0.so.0
#18 0x7738ce83 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#19 0x7738d248 in ?? () from /usr/lib/libglib-2.0.so.0
#20 0x7738d6eb in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#21 0x77696a7d in main (argc=2, argv=0x7fbb1f04) at main.c:158

http://code.google.com/p/chromium-os/issues/detail?id=36448
2012-11-27 11:26:51 +01:00
Aleksander Morgado
8c4a836a2d option,hso: early check of port type hints to avoid probings
Instead of getting the port type hints while grabbing each probed port, we now
run a custom init operation in the probing which already gives us the port type,
and therefore allows us to completely skip port probings.

Also now added hints for 'Diag' (QCDM) ports and AT/'Modem' ports (I guess it's
the one for PPP if we don't have a net port, which is unlikely anyway in HSO).

This makes the probing of an Option/HSO modem almost instant.
2012-11-09 12:05:03 +01:00
Aleksander Morgado
9ec90d9a11 core,plugins: don't assume 'CS' supported when '2G' supported
We will not report 'CS' as a supported mode every time '2G' is supported. This
actually was forcing all plugins to handle a 'CS' fallback when they didn't have
CS-specific mode setup. So, to simplify things, we will only report 'CS' as
supported for those plugins which actually allow to select 'CS' mode (e.g. the
'wavecom' plugin).
2012-11-02 09:52:31 +01:00
Aleksander Morgado
96986117b3 option,hso: don't reset connection if cancelled, wait to get connected before
If we are requested to cancel the connection, we first need to wait for the
connection attempt to finish before issuing the disconnect command, as otherwise
the modem just returns an error saying that it cannot perform the operation and
at the end we end up with the modem connected but ModemManager thinking that it
isn't.
2012-10-30 15:35:33 +01:00
Aleksander Morgado
8ddee24cc9 hso: use user-specified allowed authentication methods
If none of the specified methods is supported, an error is returned.

Also quote user and password using `mm_at_serial_port_quote_string()'.
2012-10-07 21:12:00 +02:00
Aleksander Morgado
c250fa3797 libmm-glib: remove the `libmm-common.h' header
Both the ModemManager daemon and the mmcli will now include `libmm-glib.h' only.

We also handle two new special `_LIBMM_INSIDE_MM' and `LIBMM_INSIDE_MMCLI'
symbols, which if included before the `libmm-glib.h' library allow us to:

 * Don't include the libmm-glib high level API in the ModemManager daemon, as
   the object names would clash with those in the core.

 * Define some of the methods of helper objects to be included only if compiling
   ModemManager daemon or the mmcli.
2012-10-04 10:17:12 +02:00
Aleksander Morgado
a66f971a7c libmm-common: added common utils from core
Moved the utils to play with binary to hex strings into libmm-common.
2012-09-14 07:05:26 +02:00
Aleksander Morgado
4f7534452d option,hso: properly parse returned IMEI 2012-09-14 07:05:23 +02:00
Aleksander Morgado
6c1e005b54 hso: fix error handling in PIN retry counts 2012-08-30 23:47:30 +02:00
Aleksander Morgado
0436b3e457 api,introspection: report list of drivers, not just one
Different ports of the same modem may get handled by different drivers. We
therefore need to provide a list of drivers (new `Modem.Drivers' property with
signature 'as') instead of just one (removed `Modem.Driver' property with
signature 's').

$ sudo mmcli -m 0 | grep drivers
           |        drivers: 'qcserial, qmi_wwan'
2012-08-24 13:34:51 +02:00
Aleksander Morgado
d18dbb869a base-modem-at: add 'raw' handling to `mm_base_modem_at_command_full()' 2012-08-24 12:32:29 +02:00
Aleksander Morgado
d091344da2 broadband-bearer: pass down the data port to the 3GPP dialling step
Plugins may require specific dialling commands depending on the port type.
2012-08-23 18:56:22 +02:00
Aleksander Morgado
40730b115e hso: avoid highly unlikely use of already unref-ed bearer
In the connection sequence, we make sure that the Bearer object is valid by
keeping a reference in the Dial3gppContext (actually, another one kept by the
GSimpleAsyncResult as well). But we are considering here the case where the
connection context is completed and freed by an unsolicited message handler
before we get the reply to the AT command, so to properly ensure that the bearer
object is still valid when we try to check if the context is in the priv struct,
we need to keep an extra ref around.
2012-08-06 20:07:26 +02:00
Aleksander Morgado
63a45f8082 hso: avoid trying to use an already freed context
In the connection sequence, we keep the context in the private info of the
Bearer object, so that we can complete and free it when we receive OWANCALL
unsolicited messages. Now, the reply of the OWANCALL itself may get processed
as an unsolicited message, so effectively we're processing and finishing the
connection/disconnection context *before* we process the reply of the AT
command.

This patch ensures that we do not try to re-use the connection context after it
has been processed by the unsolicited messages handler.
2012-08-06 20:07:26 +02:00
Dan Williams
4e92b849af hso: fix small error in unlock retries checking
_OERCN only reports PIN and PUK, so we only check for two values.
2012-08-06 20:07:26 +02:00
Dan Williams
32bc031ae6 hso: implement unlock retries checking 2012-08-06 20:07:26 +02:00
Aleksander Morgado
a9075b0c09 port-probe: rename _get_port() to _peek_port() as there is no ownership transfer 2012-08-06 20:06:45 +02:00
Aleksander Morgado
e5e46f489e core: merge MMPluginBase' and MMPlugin'
There's no real point in maintaining a separate `MMPlugin' interface, as all the
plugins will inherit from `MMPluginBase', so just merge them and simplify
everything.
2012-08-06 20:06:45 +02:00
Aleksander Morgado
815693661c core: compile all ports before creating the modem object
Before this, we only exported the modem to DBus when all ports were organized,
in order to make sure that we select as primary port the one we really want and
not the first AT port grabbed. Given that to get all the ports organized we also
needed to wait to get all the ports grabbed, we can now also defer the creation
of the modem object until all the ports get grabbed. This allows us to create
different types of objects based on the ports available (e.g. we can now create
QMI-supported modem objects if we see a QMI port around).
2012-08-06 20:06:44 +02:00
Aleksander Morgado
b300110055 hso: use common integer string parsers 2012-07-19 16:22:45 +02:00
Aleksander Morgado
487cd29d8b hso: unsolicited %IPDPACT may come before the AT command reply 2012-07-19 16:22:40 +02:00
Aleksander Morgado
c63f42a20c hso: plug memleak when finishing dialling with error 2012-07-19 16:22:32 +02:00
Aleksander Morgado
b43ee56d06 hso: fix cid to report to 2012-07-19 16:22:27 +02:00
Aleksander Morgado
caeeae2721 bearer: simplify handling of the bearer configuration
The base MMBearer object will receive the MMBearerProperties configuration,
which contains every generic and plugin-specific set up. Not every configuration
parameter will be used by every implementation (e.g. not every bearer needs
user/password).

The Bearer object will expose every configuration parameter received in its
`Properties' property in the interface, even if it's not really used.
2012-05-06 17:12:36 +02:00
Aleksander Morgado
d379b9ea2a bearer: allow subclasses to report disconnection
The new `mm_bearer_report_disconnection()' allows subclasses to notify about
being disconnected, so that every layer of inheritance can chain its own code
to reset the connection status.

This commit partially disables the logic included in commit 981222. Now
subclasses (actually, no one) are not allowed to g_object_set() the
MM_BEARER_STATUS property.
2012-04-10 23:27:25 +02:00
Aleksander Morgado
0d8cf160e5 broadband: ensure 3GPP location info gets updated when enabling the source
Whenever 3GPP location source gets enabled, we'll launch new registration status
checks (to get updated LAC/CI) and new operator code/name checks (to get updated
MCC/MNC).

Additional changes were needed in the HSO plugin, so that the specific location
gathering enabling implemented by the HSO modem chains up parent's one first.
2012-03-29 17:20:37 +02:00
Aleksander Morgado
71e108fd64 hso: include support for the raw GPS location source 2012-03-29 09:18:04 +02:00
Aleksander Morgado
614a547316 hso: report received NMEA traces 2012-03-29 09:18:03 +02:00
Aleksander Morgado
2072190691 hso: open/close the raw GPS port when we enable/disable GPS gathering 2012-03-29 09:17:53 +02:00
Aleksander Morgado
97f779df1e hso: ensure GPS is disabled when we initialize the modem 2012-03-29 09:17:53 +02:00
Aleksander Morgado
ab9363011a hso: enable/disable GPS location gathering 2012-03-29 09:17:53 +02:00
Aleksander Morgado
335ba97f48 hso: include custom location capabilities loading
Will check for GPS location sources.
2012-03-29 09:17:53 +02:00
Aleksander Morgado
090e349209 hso: grab GPS-specific ports 2012-03-28 15:50:51 +02:00
Aleksander Morgado
f0b02ce321 hso: plug small memleak when building devfile
Why do we need the devfile anyway?
2012-03-28 15:50:43 +02:00
Aleksander Morgado
e07786ebb1 option: fix loading current allowed modes
The proper command to check the current allowed modes is `AT_OPSYS?'.
2012-03-26 15:23:28 +02:00
Aleksander Morgado
2d02279ba7 Revert "option: fix allowed modes response parsing"
This reverts commit 0bc824b452.

The fix is NOT to change the expected result, but to change the command itself.
2012-03-26 15:20:55 +02:00
Aleksander Morgado
063c4f9bf8 option: fix disabling sequence handling
This provides the proper fix for the disabling sequence, also amending the
erroneous checks introduced in commit 5b10af0f.
2012-03-26 13:46:30 +02:00
Aleksander Morgado
b581d6765f hso: skip the 10s timeout in High-Speed Option devices
Will only be applied to non-HSO Option modems.
2012-03-26 13:39:21 +02:00
Aleksander Morgado
e387100eb5 hso: update connection status only in the bearer matching the specific CID 2012-03-26 12:57:44 +02:00
Aleksander Morgado
770511f449 hso: fix segfault in bearer status update handling 2012-03-26 12:57:00 +02:00
Aleksander Morgado
5191dd3d9e option: fix reading port-specific setup file
The `physdev' stored in the probe is the sysfs path of the parent device, that
owning all ports. We need to build the setup file path using the port's sysfs
path instead.
2012-03-26 12:56:18 +02:00
Aleksander Morgado
ae50d291cd hso: probe for QCDM ports 2012-03-24 20:29:26 +01:00
Aleksander Morgado
6b678bd8cf hso: fix bearer private data handling 2012-03-24 19:50:10 +01:00
Aleksander Morgado
bd90ee8094 option: handle special 'auto' mode when setting allowed/preferred modes 2012-03-24 19:17:25 +01:00
Aleksander Morgado
43cdb25eb1 option: handle response specifying automatic mode
Option modems may reply '_OPSYS: 5,2' to report automatic mode being used.
2012-03-24 19:17:19 +01:00