Commit Graph
3363 Commits
Author SHA1 Message Date
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
Dan Williams fdad4d636d broadband-modem: guess CDMA access technologies from registration state
Setting access technologies from registration state as part of the
registration checking in the CDMA Interface code fights with
custom implementations in each modem subclass, which causes the
access technologies to ping-pong between more specific (custom
implementation) and less specific (generated from registration state
during registration checking).  If the modem class has more
specific access technology knowledge, we should use that and not
override it on the next registration state poll.

So instead, implement the generic access technology update from
registration state in the broadband modem base class'
load_access_technologies() hook.  Thus, modem classes with more
specific checking (which override MMBroadbandModem's implementation)
will never fight with generic checking, while modems that don't
(and thus actually need the generic checking) still get some basic
access technology handling.
2013-01-14 13:50:27 -06:00
Dan Williams edeb75b028 broadband-modem: implement generic QCDM access technology checks
For modems that don't implement vendor-specific access technology
checks, try to get the access technology via QCDM if the modem has
a QCDM port.
2013-01-14 13:50:27 -06:00
Dan Williams f71852c5b9 iface-modem-cdma: get CDMA1x Serving System during QCDM registration
We want the SID/NID even when AT Serving System checks are disabled,
otherwise the SID/NID don't get filled at all.  QCDM doesn't need the
SID/NID to determine registration, so the values are informational
only and don't affect registration state.  But we still want to
export them via the API.
2013-01-14 13:50:27 -06:00
Dan Williams fe7438973a trivial: fix comment 2013-01-14 13:50:27 -06:00
Dan Williams 7489951f88 qcdm: various LTE-related NV mode pref and sysmode updates 2013-01-14 13:50:27 -06:00
Dan Williams fc4034a72f broadband-modem-sierra: implement access technology reporting for CDMA devices
Use AT!STATUS to grab current access technology.
2013-01-14 13:50:26 -06:00
Dan Williams 56bdf4a37b broadband-modem-sierra: make CDMA AT!STATUS parsing code generic
We'll use it for access technology reporting too.
2013-01-14 13:50:26 -06:00
Dan Williams b68a487e15 broadband-modem-sierra: don't check +CAD and +CSS for CDMA devices
We have !STATUS for that, which is much more detailed.  Use it.
2013-01-14 13:50:26 -06:00
Dan Williams 01e8e0574f broadband-modem: more compatible CSQ parsing
Some devices (usually CDMA modems like the Sierra MC5725 and others)
don't prefix their +CSQ replies with +CSQ.  So don't require that.
The scanf() should ensure the reply is valid even without the +CSQ.
2013-01-14 13:50:26 -06:00
Dan Williams 48b36b1afa broadband-modem-sierra: load own numbers via ~NAMVAL?0 for CDMA
Sierra CDMA devices don't always have QCDM ports, or if they do,
they aren't always usable.  Try Sierra-proprietary commands for
loading the modem's MDN and fall back to QCDM if that fails.
2013-01-14 13:50:26 -06:00
Dan Williams f7d55a688a broadband-modem-novatel: fix signal strength processing for older devices
mm_get_int_from_str() does not allow anything in the string after the
number, eg "-91  asdfasdf" returns an error.  So we have to chop off
anything after the number we're interested in.
2013-01-14 13:50:26 -06:00
Dan Williams f95274e735 broadband-modem: load own numbers with QCDM too
Not many CDMA/EVDO-only modems support CNUM since it's not a
standard IS707/856 AT command, so for those that don't
support it and have a QCDM port, try grabbing the number from
NV memory.
2013-01-14 13:50:26 -06:00
Aleksander Morgado 2bd4c63716 hso: remove duplicated code 2013-01-14 20:09:47 +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
Aleksander Morgado 8403a48b31 plugin-manager: new debug logs to help track probing issues 2013-01-11 12:20:57 +01:00
Aleksander Morgado 0f9873c23a sierra: load power state with !pcstate? in cdma-only modems 2013-01-11 11:21:08 +01:00
Aleksander Morgado 695680b2ff cli: show current power state in the modem status information 2013-01-11 10:05:46 +01:00
Aleksander Morgado 669f0928f3 cli: new '--set-power-state-on' and '--set-power-state-low' commands 2013-01-11 10:05:46 +01:00
Aleksander Morgado 091c47d695 libmm-glib,modem: new methods to handle the power state 2013-01-11 10:05:46 +01:00
Aleksander Morgado eec5d00a97 core,plugins: remove initial power down sequence
We no longer power down the modem during initialization, so remove that
implementation.
2013-01-11 10:05:46 +01:00
Aleksander Morgado 7c87555bf8 mbm: force initial power-up during first enabling
When both load_power_state() and modem_power_down() are not implemented, the
logic will launch the power-up command during (only the first) enabling of the
modem.

In this kind of modems, CFUN is directly related to allowed/preferred modes, so
during the initial power-up we'll just assume we want ANY mode.
2013-01-11 10:05:46 +01:00
Aleksander Morgado 5d02361501 iridium: ignore initial power state loading
No need to initially power-up the modem.
2013-01-11 10:05:45 +01:00
Aleksander Morgado 923d4dd8bd motorola: ignore initial power state loading
No need to initially power-up the modem.
2013-01-11 10:05:45 +01:00
Aleksander Morgado f79f3b8770 nokia: ignore initial power state loading
No need to initially power-up the modem.
2013-01-11 10:05:45 +01:00
Aleksander Morgado 9f5cfefb00 sierra: in 3GPP, no need to check if already powered up before powering up
This logic is now implemented by the parent broadband modem object.

Also, implement a custom initial power state loading, so that CDMA-only modems
get marked as 'offline', in order to launch !pcstate=1 to power them up during
the first enabling. The custom initial power state loading will run the parent's
implementation in non-CDMA-only modems.
2013-01-11 10:05:45 +01:00
Aleksander Morgado e3db373be4 wavecom: no need to check if already powered up before powering up
This logic is now implemented by the parent broadband modem object.
2013-01-11 10:05:45 +01:00
Aleksander Morgado 952d96234b broadband-modem: implement custom power state loading 2013-01-11 10:05:45 +01:00
Aleksander Morgado 696b879b6d broadband-modem-qmi: implement custom power state loading 2013-01-11 10:05:45 +01:00
Aleksander Morgado e55b543d38 iface-modem: implement power mode loading and setting 2013-01-11 10:05:45 +01:00
Aleksander Morgado 49aecb57dc api,modem: new 'SetPowerState()' method and 'PowerState' property
Going into/outof low-power state is now a user-requested action.
2013-01-11 10:05:45 +01:00
Dan Williams f50aa47fb2 sim-qmi: fix trivial GError literal issues/format string warnings 2013-01-10 10:09:35 -06:00
Aleksander Morgado 763e207e9c blacklist: ignore all devices from VID 0x0617
No modems from the Swiss Federal Institute of Technology.

https://bugzilla.gnome.org/show_bug.cgi?id=691384
2013-01-09 10:05:15 +01:00
Aleksander Morgado dc7aa25f0a sim-qmi: translate common SIM-related QMI errors into ME errors
Upper layers expect Mobile Equipment errors, so try to translate known QMI
protocol errors.
2013-01-08 18:40:48 +01:00
Aleksander Morgado 1372933345 iface-modem,sim: improve lock info update logic
The logic to handle the lock information (current lock and unlock retry count)
wasn't handling all possible cases properly, e.g.:

 * When PIN is incorrectly entered too many times, a SIM-PUK error may happen.
   In this case we need to directly assume SIM-PUK is the current lock (some
   modems, like Option HSO ones, would incorrectly reply SIM-PIN if CPIN? asked
   just after the SIM-PUK error).

 * After every operation acting in SIM locks, we need to update the current
   unlock retry count.

This change tries to cover those cases, by:

 * The logic to check current lock is extended to also load the unlock retry
   count when needed.

 * Whenever a SIM-PUK error happens in the SIM operations, we directly assume
   that SIM-PUK is required, without re-asking CPIN?.

 * The overall logic of lock checking is now handled by a state machine, which
   is much easier to understand.
2013-01-08 18:40:47 +01:00
Aleksander Morgado 959bb9d2ff broadband-modem: launch the Firmware interface even on fatal errors
Even when there is a fatal error during initialization (e.g. missing PIN in a
3GPP modem), we should allow operations on the Firmware interface.
2013-01-07 22:25:46 +01:00
Ben Chan e939221975 iface-modem, novatel-lte: disable network scan in LTE mode 2013-01-04 12:10:51 +01:00
Ben Chan bc399d9cf8 iface-modem-3gpp,iface-modem-cdma: check for deallocated RegistrationCheckContext
This patch fixes a crash in periodic_registration_checks_ready() due to
access of an already deallocated RegistrationCheckContext.

Thread 0 *CRASHED* ( SIGSEGV @ 0x00000000 )

0x7fc344d355cd   [ModemManager]             - mm-iface-modem-cdma.c:1112   periodic_registration_checks_ready
0x7fc3449ea266   [libgio-2.0.so.0.3200.4]   - gsimpleasyncresult.c:767     g_simple_async_result_complete
0x7fc3449ea368   [libgio-2.0.so.0.3200.4]   - gsimpleasyncresult.c:779     complete_in_idle_cb
0x7fc344851dc4   [libglib-2.0.so.0.3200.4]  - gmain.c:2539                 g_main_context_dispatch
0x7fc344852147   [libglib-2.0.so.0.3200.4]  - gmain.c:3146                 g_main_context_iterate
0x7fc3448525a1   [libglib-2.0.so.0.3200.4]  - gmain.c:3340                 g_main_loop_run
0x7fc344d0f154   [ModemManager]             - main.c:158                   main
0x7fc34426a474   [libc-2.15.so]             - libc-start.c:234             __libc_start_main
0x7fc344d0eb68   [ModemManager]             + 0x0001bb68
2013-01-03 22:28:34 +01:00
Aleksander Morgado d40ef83898 sierra: implement modem reset 2012-12-28 11:47:32 +01:00
Aleksander Morgado eae28e9be4 sierra: wait up to 10s for the power up command reply
Specially the first time that CFUN=1,0 is issued after the initial power up, we
really need to wait more than 3s for the AT command reply. Otherwise, the modem
won't like it and it will reset itself :-/
2012-12-28 10:34:43 +01:00
Aleksander Morgado 35775e3634 sierra: ignore all +PACSP messages
Not only +PACSP0, but also +PACSP1.
2012-12-28 08:49:35 +01:00
Aleksander Morgado b5257491b0 sierra: fix 3GPP dialling sequence
There was a missing step++ when falling down to the next step in the switch(),
which was preventing a proper connection.
2012-12-28 08:13:40 +01:00
Aleksander Morgado 95598e2e37 sierra: pass data port to parent's 3GPP dialling sequence 2012-12-28 08:01:05 +01:00
Aleksander Morgado 1b0ab2ea60 broadband-bearer: dial port may be different to the primary port 2012-12-28 08:00:04 +01:00
Aleksander Morgado 731812fe34 plugin: avoid QMI-managed net ports when compiling without QMI support 2012-12-27 13:51:28 +01:00
Aleksander Morgado 80b68ac0ae plugin-manager: initially never start with the Generic plugin suggested
The generic plugin should be a fallback, so when starting to probe the port,
never start with the Generic plugin first.
2012-12-27 12:44:50 +01:00
Aleksander Morgado ef31ff7535 broadband-bearer: PDP context deactivation may take longer
Update the default timeout from 3s to 10s.
2012-12-27 08:58:39 +01:00
Aleksander Morgado c8fcf7a91d plugin: re-run subsystems filter before grabbing the ports
Every port probing will have the Generic plugin as fallback, and due to some
other issues in other plugins (see ee099fcd), we need to allow overwriting the
suggested plugin from the Generic to a more specific one.

One of the drawbacks of this is that we're actually allowing the Generic plugin
to probe and accept the port, which means that the generic plugin may accept a
specific port type (e.g. QMI) while the specific plugin wouldn't. So, we will
now also run the subsystems filter before grabbing the specific port, in order
to really filter out those cases. We still keep the subsystems filter in
pre-probing, so that we build a better initial plugin list to probe.
2012-12-27 08:53:45 +01:00
Aleksander Morgado 7da2a65b43 plugins: fix generic GObject related macros 2012-12-27 08:48:11 +01:00
Aleksander Morgado f923e95861 base-modem: don't set the modem valid if we didn't export the Modem interface
If an error occurs early during the initialization (e.g. during port setup), we
would be aborting without even having exported the modem interface. So detect
that case and skip setting the modem as valid.
2012-12-27 08:48:11 +01:00