Commit Graph

42 Commits

Author SHA1 Message Date
Jonas Bonn 67701b1c40 drivers: constify vtables
The driver vtables are read-only structures.  This patch declares them as
'const' allowing the compiler to (optionally) put them in the RELRO
section.  RELRO pages may be marked as read-only by the linker after
the relocations have been done ensuring that they aren't inadvertently
or maliciously altered at runtime.
2018-10-17 09:56:27 -05:00
Giacinto Cifelli bd6f807849 drivers: support for auth NONE
Added the explicit support for auth NONE.
It needs to be added in all drivers/*/gprs-context.c atoms.

This method is already supported by all atoms that support
authentication (ie, all but Sierra' swmodem driver).

The behavior is left unchanged in case of inconsistent parameters:
if username is empty, then fallback to auth NONE.
2018-10-09 12:35:44 -05:00
Christophe Ronco 527e6b1f86 atmodem: Add gprs-context quirk for HUAWEI vendor
When ofono dies while connected using PPP, modem AT channel is not put
back to command mode (tested with HUAWEI modems E3372 and MS2372).
If ofono is restarted, it won't be able to connect as it gets no answer
to AT commands on this AT channel.
This patch adds a quirk to immediately send escape sequence on modem
channel when gprs-context atom is removed.
2018-07-25 14:11:45 -05:00
Matthijs Kooijman 8d690efa83 at/cdma/ifxmodem: Use /dev/net/tun to check for TUN support
Previously, these drivers would check /sys/devices/virtual/misc/tun to
see if TUN is supported, and bail out otherwise. However, the tun module
can sometimes be autoloaded by opening the /dev/net/tun file. In this
case the /dev file already exists, but the /sys file only gets created
after the modul is loaded.

Additionally, the ppp code does not use the /sys file, but only the
/dev file, so checking for the existence of the latter seems a better
indicator of expected success.
2017-08-22 23:24:59 -05:00
Christophe Ronco 8e929df4f5 atmodem: use ATD99 to enter data state when needed
Some modems do not support AT+CGDATA="PPP",X to enter data state.
Use AT+CGDATA=? to detect these modems and for them use ATD*99***X#
to enter data state.
2017-02-16 11:52:49 -06:00
Philip Paeps 293c701e25 atmodem: set the auth method for u-blox modems 2014-07-08 08:52:25 -05:00
Philip Paeps 8cbe061c3b atmodem: set the PPP authentication method to use 2014-06-21 12:02:51 -05:00
Jesper Larsen ff2051053c atmodem: Add gprs-context quirk for SIM900
The SIM900 module from SIMCOM does have a AT+CGDATA command.
However, it is not possible to make a ppp connection when CGDATA
has been used to bring up the gprs context.

This patch adds a quirk that uses the alternative ATD*99***<cid>#
command instead.
2013-07-18 14:10:38 -05:00
Christopher Vogl 76ccb73063 gprs-context: print reason for ppp disconnect 2012-08-13 08:38:30 -05:00
Guillaume Zajac 79b6fd4b24 gprs-context: Add new driver entry definition 2012-07-15 20:05:23 -05:00
Marcel Holtmann 4e77afffb3 drivers: Update copyright information 2011-10-10 13:39:48 -07:00
Marcel Holtmann 63e8118eee atmodem: Add funny ZTE quirk for GPRS context support 2011-08-05 22:50:21 +02:00
Marcel Holtmann caaff33422 atmodem: Add support for handling GPRS context vendor quirks 2011-08-05 17:59:55 +02:00
Marcel Holtmann 476fab4ea1 atmodem: Add support for NW DEACT notifications on slave channel 2011-07-24 14:48:39 +02:00
Denis Kenzior 17deacbfff atmodem: Update to new GAtPPP api 2011-05-24 12:25:08 -05:00
Mika Liljeberg a8731aabb0 atmodem: update to new gprs context interface 2011-03-15 17:11:58 -05:00
Jeevaka Badrappan b97676acc3 atmodem: M15 coding style fix 2011-01-12 08:06:58 -08:00
Lucas De Marchi b82a7f8511 drivers: explicitly compare pointers to NULL
This patch was generated by the following semantic patch
(http://coccinelle.lip6.fr/)

// <smpl>
@fix disable is_null,isnt_null1@
expression *E;
@@

- !E
+ E == NULL
// </smpl>
2010-11-29 11:37:09 -06:00
Marcel Holtmann 65f1ad4ce2 atmodem: Print IP details after GPRS context setup 2010-10-27 14:54:46 +02:00
Marcel Holtmann 9b316185c6 atmodem: Add some more GPRS context debug statements 2010-10-27 01:29:55 +02:00
Marcel Holtmann 94d67b9c66 atmodem: Use g_try_new0 when checking for the result 2010-10-21 20:00:07 +02:00
Marcel Holtmann 49544d43d8 atmodem: Check for TUN/TAP support before enabling PPP 2010-10-21 18:23:20 +02:00
Marcel Holtmann 9f906504a5 atmodem: Allow setting PPP debug via environment variable 2010-09-20 08:28:13 +09:00
Denis Kenzior ac524be99f atmodem: Use g_at_chat_clone 2010-08-12 16:40:40 -05:00
Zhenhua Zhang 26efde3d7b Fix busylooped in ppp_disconnect for huawei modem
Huawei modem closes the modem port after PPP disconnect. So the channel
of gatchat is NULL in ppp_disconnect. In such case, we resume the chat
and it causes huawei_disconnect() get called and the gprs context is
removed later.

Before removing this gprs context, we should reply the pending DBus
message to the client.
2010-08-02 14:10:37 -05:00
Zhenhua Zhang 8246463ef3 atmodem: Update to the new PPP API 2010-06-28 10:19:32 -05:00
Denis Kenzior 76dc7e4acd atmodem: Shutdown ppp cleanly on remove
There is a race condition from udev / kernel when a USB dongle is
removed.  Sometimes all ports are removed first (and the io channels for
those ports are signaled as hupped) while other times the udev remove
event fires first.

If the latter happens, then gprs_context remove is called with a
potentially live ppp object.  This patch shuts it down cleanly.
2010-06-11 09:20:05 -05:00
Denis Kenzior c3dddcb5b3 atmodem: Always unref ppp when context is down 2010-06-11 09:20:05 -05:00
Marcel Holtmann 24fd3e2f15 The default PPP netmask should be 255.255.255.255 2010-06-03 00:00:42 -07:00
Kalle Valo 125c7c392f atmodem: fix crash during context deactivation
Ofono either crashed or busy looped with my Huawei E1552 3G modem when I
tried to deactivate GPRS context. The reason was that gcd->chat was
unreferenced already in setup_ppp() but the chat was still accessed
later in at_gprs_deactivate_primary().

To fix the problem, change the logic instead to suspend chat session
for PPP and resume when PPP has disconnected. Now it doesn't crash
anymore.

Deactivation still doesn't work properly with Huawei E1552, and most
probably with other Huawei modems, because the modem hangs up the chat
line after PPP deactivation. This needs to be fixed separately. The
workaround is to reboot the modem, for example physically unplug and plug
it in again.
2010-05-26 12:34:07 -05:00
Kalle Valo bf7243eda4 atmodem: refactor context deactivation
The old way of using CGACT is no longer needed.  It is enough
that we shutdown PPP. Recommended by Denis.
2010-05-26 12:32:03 -05:00
Denis Kenzior 5343272bc1 atmodem: Port gprs-context to new PPP api 2010-04-30 15:32:54 -05:00
Denis Kenzior b5f81f4012 Fix: For now calling g_at_chat_unref is fine
Same as g_at_chat_shutdown in this case
2010-04-28 17:27:33 -05:00
Denis Kenzior 389eb70dc8 Initial implementation of the PPP gprs context 2010-03-31 18:49:39 -05:00
Denis Kenzior c98b951fe6 Refactor: Remove atutil dump_response
No longer needed now that we have nice AT command tracing using
OFONO_AT_DEBUG=1
2010-02-08 12:28:23 -06:00
Denis Kenzior 1721f81fe9 Fix: Use snprintf instead of sprintf in atmodem 2010-02-05 11:59:24 -06:00
Marcel Holtmann 144080e749 Update copyright information 2010-01-01 17:00:10 -08:00
Denis Kenzior 55572b6e69 Style: Use unsigned int instead of unsigned 2009-12-01 12:42:23 -06:00
Denis Kenzior 38ae7bd9aa Update the AT modem driver to the new API 2009-11-17 18:54:46 -06:00
Denis Kenzior 3408fc5094 Register for CGEV indications in gprs context 2009-10-23 17:05:56 -05:00
Denis Kenzior 14c116be36 Remove unused code and make compiler happy 2009-10-23 17:05:56 -05:00
Denis Kenzior d6161ddb61 Add basic atmodem gprs context implementation 2009-10-23 17:05:56 -05:00