Commit Graph

50 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
15d34d56fd bearer: new helper 'MMBearerConnectResult' type
Instead of returning 3 variables in connect_finish(), return a single reference
counted struct. This simplifies how the result is built and passed within a
GSimpleAsyncResult to each _finish() method.

This also simplifies the dialling step in the 3GPP connection sequence, as we
can use the same new type.
2013-02-18 15:41:26 +01:00
Aleksander Morgado
2550cb20a9 huawei: only retry DHCP? check on specific errors
We don't want to retry DHCP? on every possible GError reported; specially if the
error is about the port being forced to get closed when the modem gets
unplugged or the like. So just retry on very specific errors reported.

The main cause for retry is really when the modem replies the following:
-->  AT^DHCP?
<--  ERROR

Which in our case gets translated to a 'unknown' mobile equipment error. We'll
also consider any kind of mobile equipment error, as the modems may reply a
CME ERROR instead.
2013-01-16 10:56:53 +01:00
Aleksander Morgado
2b3f353770 huawei: check NDISDUP support only once 2013-01-16 10:56:53 +01:00
Aleksander Morgado
f2a9ea3779 huawei: use NDISDUP only if net port from cdc_ncm or cdc_ether 2013-01-16 10:56:53 +01:00
Aleksander Morgado
8c5bd6375f huawei: refactor the connection and disconnection sequences in the bearer
We will now use a step-based state machine to handle the connection and
disconnection sequences. All the previous behaviour is kept, except for these
new things:

 * Instead of just subclassing the 'dialling' step in the 3GPP connection
   sequence, completely subclass the whole 3GPP connection sequence. We do this
   because we don't need to preconfigure PDP contexts with AT+CGDCONT before
   issuing ^NDISDUP.

 * Don't allow IP types other than IPv4. These modems work only with IPv4
   bearers.

 * Remove cancellation signal handler; not needed as we can check the status of
   the cancellation in every 1s timeout.

 * Removed the event source id handling for timeouts; timeouts are never
   cancelled here.
2013-01-16 10:56:53 +01:00
Aleksander Morgado
2499f5760b huawei: explicitly check for the ^NDISDUP command support
Don't assume that all modems exporting a 'net' port will support ^NDISDUP.
2013-01-16 10:56:53 +01:00
Franko Fang
696403e50a huawei: handle modems exposing 'net' ports with AT^NDISDUP
Modems with ECM (e.g. usb0) ports should use AT^NDISDUP in the control port to
request the connection and afterwards just fire up the DHCP client in the net
port.

This patch is originally developed by:
  Franko Fang <fangxiaozhi@huawei.com>

And afterwareds reviewed and updated by:
  Aleksander Morgado <aleksander@gnu.org>
2013-01-16 10:56:53 +01:00
Aleksander Morgado
9a07688524 huawei: check with next port if the first one is not AT 2013-01-11 16:13:55 +01:00
Dan Williams
8c1f80a9a4 huawei: implement Time interface for CDMA modems 2012-12-05 13:49:21 -06:00
Dan Williams
e3a71711bf huawei: handle CDMA allowed modes 2012-12-05 11:27:54 -06:00
Dan Williams
c3984d3982 huawei: fix crash disabling CDMA unsolicited response handlers
Parent MMBroadbandModem may not implement these functions so we
shouldn't call them unless it does.
2012-12-05 11:27:54 -06:00
Dan Williams
f0ba40f3a1 huawei: implement Huawei-specific CDMA signal quality checks
Many Huawei CDMA modems implement vendor commands for 1x and EVDO
signal quality, so use them since they are more accurate than the
generic signal checking.

(port of a similar patch for MM_06 by heiher <admin@heiher.info>)
2012-12-05 11:27:54 -06:00
Dan Williams
8fdcfd5b97 huawei: consolidate MODE parsing
Both CDMA and 3GPP modems emit this, but using slightly different
formats.
2012-12-05 10:49:21 -06:00
Dan Williams
56e5ecdc1b huawei: consolidate SYSINFO parsing
Both CDMA and 3GPP modems use SYSINFO, so consolidate the parsing of
its response.
2012-12-05 10:49:21 -06:00
Aleksander Morgado
b0746c591f huawei: don't assume g_regex_match_full() sets error when not matching 2012-11-27 22:04:04 +01:00
Dan Williams
2f28193cd4 broadband-modem-huawei: don't call non-existent MMBroadbandModem CDMA functions 2012-11-27 14:50:14 -06:00
Aleksander Morgado
c2db8abe52 huawei: better detection of data port on some modems
Some devices (e173) appear to lie about NDIS support; GETPORTMODE reports NDIS
is enabled, but that port is actually the MDM port and responds to AT commands.
So, if we get a port reported as NDIS and none reported as MDM, use the one
reported as NDIS for PPP.

https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1057186
2012-11-12 09:49:48 +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
3c2bcb8d04 huawei: ignore '^STIN' unsolicited messages 2012-10-30 15:50:32 +01:00
Aleksander Morgado
6992e3b32d huawei: reset ignored unsolicited message handlers only once 2012-10-30 15:48:30 +01: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
6995300ecd huawei: if port replies to AT^GETPORTMODE, port is AT
Just skips the additional check for AT support in the port.
2012-09-19 10:37:31 +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
4804c37604 build: new `--without-qmi' configure option
For those who don't care about the QMI support through libqmi-glib, or if you're
stuck with glib 2.30 (libqmi-glib requires 2.32), this configure switch allows
disabling the QMI support completely.

The logic to detect cdc-wdm ports is still in place, but the QMI probing is
never launched at them. Also, all QMI-related objects won't be compiled.
2012-09-05 20:02:31 +02:00
Aleksander Morgado
369e14f1d3 huawei: additional unsolicited messages to ignore 2012-08-31 15:11:30 +02:00
Aleksander Morgado
35a69d6b8e huawei: enable QMI-powered Huawei modems 2012-08-30 14:18:03 +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
d9ea4a304c at-serial-port: allow sending 'raw' commands
Commands treated as 'raw' won't get the 'AT' prefix and will also not get the
trailing carriage return.
2012-08-24 12:32:28 +02:00
Aleksander Morgado
5b2c839dd9 huawei: cache port mode results in the parent `MMDevice'
This lets us skip the search for the `MMPortProbe' where we got the results.
2012-08-06 20:07:23 +02:00
Aleksander Morgado
dd71656106 huawei: implement custom detailed CDMA registration state checks 2012-08-06 20:07:23 +02:00
Aleksander Morgado
ad3f3fe6a6 huawei: do not run AT+CSS? in EV-DO capable devices 2012-08-06 20:07:23 +02:00
Aleksander Morgado
e6d7885d7f huawei: implement CDMA unsolicited signal change report handling 2012-08-06 20:07:23 +02:00
Aleksander Morgado
a7f0a313e5 huawei: setup/cleanup unsolicited message handlers in the CDMA interface 2012-08-06 20:07:23 +02:00
Aleksander Morgado
93cc9483bc huawei: allow grabbing QCDM ports 2012-08-06 20:07:23 +02:00
Aleksander Morgado
5d38983d66 huawei: ignore unsolicited ^CSNR notifications 2012-08-06 20:07:23 +02:00
Aleksander Morgado
8775702906 huawei: implement custom USSD encode/decode methods 2012-08-06 20:07:23 +02:00
Aleksander Morgado
5a5aa9b789 huawei: implement allowed mode getting/setting 2012-08-06 20:07:23 +02:00
Aleksander Morgado
c0126531c5 huawei: implement band loading/setting 2012-08-06 20:07:23 +02:00
Aleksander Morgado
325ece6fe3 huawei: implement unlock retries loading 2012-08-06 20:07:23 +02:00
Aleksander Morgado
8c5f13a657 huawei: implement unsolicited messages enabling/disabling 2012-08-06 20:07:22 +02:00
Aleksander Morgado
6f2fe89ef2 huawei: implement unsolicited 3GPP signal change report handling 2012-08-06 20:07:22 +02:00
Aleksander Morgado
02cf87b149 huawei: implement access technology loading and update handling 2012-08-06 20:07:22 +02:00
Aleksander Morgado
433c8fa85b huawei: report connection status statistics 2012-08-06 20:07:22 +02:00
Aleksander Morgado
b25b7f91cb huawei: setup/cleanup unsolicited message handlers in the 3GPP interface 2012-08-06 20:07:22 +02:00
Aleksander Morgado
98f28db6e3 huawei: setup handlers for unsolicited messages
Initially all disabled.
2012-08-06 20:07:22 +02:00
Aleksander Morgado
008beeedcc huawei: new `MMBroadbandModemHuawei' object 2012-08-06 20:07:22 +02:00
Aleksander Morgado
efe2228515 huawei: try to gather port layout while probing
We will try to use usbif0 to gather the port layout with AT^GETPORTMODE.
2012-08-06 20:07:22 +02:00
Aleksander Morgado
f9a0aba08c huawei: start porting the Huawei plugin 2012-08-06 20:07:22 +02:00