Commit Graph

55 Commits

Author SHA1 Message Date
Lars Poeschel 21f148afe9 atmodem: Detect usage of AT+CGEREP
Currently AT+CGEREP=2,1 is sent in case we don't know what the modem
needs. (default case) Not all modems understand this. So, we first query
what the modem supports with AT+CGEREP=? and then use this information
to be nice to the modem. This way modems, like the Quectel M95 that do
only understand AT+CGEREP=1 do also work nicely.
2020-09-01 11:10:14 -05:00
Lars Poeschel dbc1fb62ac atmodem: Deactivate AT+CPSB for quectel serial modems
There are at the moment two quectel modems in ofono vendored as
OFONO_VENDOR_QUECTEL_SERIAL: The M95 and the MC60.
Both modems are GSM only modems, and their official documentation does
not mention the AT+CPSB command.
I have a M95 here that gives an error on issuing the AT+CPSB=1 command.
So skip this command for these two modems.
2020-08-19 09:57:09 -05:00
Lars Poeschel 288f263ab6 gprs: Quectel EC21 does not understand AT+CPSB
The Quectel EC21 modem does not understand the AT+CPSB command, and we
did not find a suitable replacement in the
Quectel_EC25&EC21_AT_Commands_Manual_V1.3.pdf
AT+CPSB gives an error on this modem, so we just skip it.
2020-08-17 10:14:38 -05:00
Antara Borwankar b9da075d63 atmodem: CGDCONT handling for cid 0
Added handling for cid 0 in +CGDCONT callback.
2019-09-30 11:14:50 -05:00
Richard Röjfors e3d5ac1f16 atmodem: Implement the list_activated_contexts callback
The callback calls cgact and cgdcont to get information
regarding any activate context.
2019-08-13 01:56:53 -05:00
Richard Röjfors cfac75a332 atmodem: Check for auto activated contexts during init
To detect if a context gets activated before we register
for unsolicited events we need to check if any is
already activated, and flag it auto activated.
2019-07-24 02:11:25 -05:00
Antara Borwankar 999cf73282 atmodem: fix to activate context with cid zero
xmm7xxx based devices (among others) return 0 as cid for default
pdp context. Fix the atmodem gprs driver logic to work with such
devices by initializing last_auto_context_id to -1 instead of 0
to indicate a deactivated context.
2019-06-14 11:42:28 -05:00
Richard Röjfors 9b1dae2e62 atmodem: Fix a race if a context get deactivated while read
When a context gets activated we read its settings, but
if the context gets deactivated during this time we should
not indicate that the context is activated when the settings
are received.
2019-05-08 09:38:11 -05:00
Jonas Bonn a5adf39aa1 atmodem: drop vendor type for Toby L2 model
The 'Toby L2'-specific vendor type is used only to prevent the CMER
command from attempting to set mode '3'.  For all u-blox models, mode
'3' is just an alias for mode '1'.  As such, mode '1' can be used in
place of mode '3', removing the model-specific quirk in favour of a
vendor-specific quirk.

With this change, the L2-specific vendor type is no longer needed.
2019-03-13 13:19:15 -05:00
Jonas Bonn 3beeff758d treewide: Remove superfluous use of _GNU_SOURCE
There are a large number of files in the tree that define _GNU_SOURCE
despite not actually using features hidden behind this flag.  This patch
removes all these definitions in one fell swoop...
2018-10-17 10:01:57 -05:00
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
Christophe Ronco b3e4837641 atmodem: correctly report lte bearer for huawei modems 2017-09-07 11:41:01 -05:00
Marcel Holtmann 6c936db4ae atmodem: Fix missing break statement for ublox driver 2017-07-11 10:42:59 -07:00
Lukasz Nowak 81a54c5a47 atmodem: telit - re-attach gprs automatically
Telit AT modem firmware (tested with UE910-EUR) generates
+CGREG: 0\r\n\r\n+CGEV: NW DETACH
after a context is de-activated and ppp connection closed.
Then, after a random amount of time (observed from a few seconds
to a few hours), an unsolicited +CGREG: 1 arrives.
Attempt to fix the problem, by sending AT+CGATT=1 once.
This does not re-activate the context, but if a network connection
is still correct, will generate an immediate +CGREG: 1.
2017-03-29 10:01:50 -05:00
Piotr Haber c493491c1a atmodem: add LTE to Telit #PSNT status parser
Network type of 4 in Telit #PSNT command response
denotes LTE network
2017-01-25 10:00:07 -06:00
Vincent Cesson 4edc9fd57f atmodem: Fix CGDCONT result parsing.
CGDCONT result parsing fails if first list contains several ranges. For
example with modem Cinterion PHS8:

 AT+CGDCONT=?
 +CGDCONT: (1-17,101-116),"IP",,,(0),(0-4)

Solution: read first range and jump to second list instead of trying to
close the brackets.
2017-01-13 09:38:43 -06:00
Dragos Tatulea 52b698222c atmodem: gprs: handle automatic context activation
When the event comes, trigger CGCONT? to read the APN for the
activated cid and then call ogono_gprs_cid_activated to handle
the event.
2016-03-18 10:10:09 -05:00
Dragos Tatulea 6970a289c2 atmodem: add support for U-Blox TOBY L2 modems
Besides exceptions below, act like normal U-Blox devices.

gprs-context: don't set auth for TOBY L2. U-Blox Toby L2
doesn't support PAP/CHAP APN auth method.

atmodem: TOBY L2 supports only CMER mode 1. Also chaged original
mode variable to ind, which is a more appropriate name.
mode is what is being set first.
2016-03-16 13:15:08 -05:00
Dragos Tatulea 1290fd1410 atmodem: ublox: EPS now supported by newer ublox
Based on UBX-13002752 R33
2016-03-10 08:26:34 -06:00
Philip Paeps 6df64cd1a9 gprs: add support for u-blox +UREG URCs 2014-06-30 14:03:08 -05:00
August Mayer 4293e4ea63 gprs: data bearer for telit with PSNT
Telit neither supports '+CPSB' nor reports the data bearer through
'+CGREG'. It has its own +PSNT command.
2012-08-16 01:10:56 -05:00
Marcel Holtmann 1f9f161e0b atmodem: Fix issue with AT+CREG=? and AT+CGREG=? handling
Some modems might see an interim +CREG: or +CGREG: notification when
querying the supported modes.

  Aux: > AT+CFUN=1\r
  Aux: < \r\nOK\r\n
  Aux: > AT+CREG=?\r
  Aux: < \r\n+CREG: 2\r\n
  Aux: < \r\n+CREG: (0-2)\r\nOK\r\n
  Unable to initialize Network Registration

To make this work, skip to the first line with an actual range value.
2012-05-24 03:28:50 +02:00
Marcel Holtmann 4e77afffb3 drivers: Update copyright information 2011-10-10 13:39:48 -07:00
Marcel Holtmann 7cabd1075c atmodem: Add Huawei specific GPRS bearer notifications 2011-07-29 13:11:17 +02:00
Jeevaka Badrappan 4258fb5915 atmodem: remove NULL check 2011-01-29 18:39:37 +01:00
Marcel Holtmann 62686f7719 atmodem: Add support for Gobi technology change handling 2011-01-22 13:12:15 +01:00
Marcel Holtmann 63fd483fc9 atmodem: Always listen for bearer notifications 2011-01-20 12:13:17 +01:00
Rémi Denis-Courmont e3f51d7507 atmodem: packet switch bearer support 2011-01-20 12:10:32 +01: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 080ff41db9 atmodem: Add support for IFX specific GPRS suspend notification
The Infineon modem informs about GPRS suspend cases. For example when
GPRS is active and a call is made. If the status changes, inform the
core about this change.

This uses GPRS_SUSPENDED_UNKNOWN_CAUSE reason since the modem does not
give a clear reason why GPRS was suspended. With this reason there is
a delay before the status change gets send out as D-Bus signal.
2010-10-29 13:39:27 +02:00
Marcel Holtmann 240e3878ae atmodem: Add Nokia specific quirk for AT+CGEREP handling 2010-08-20 20:57:30 +02:00
Marcel Holtmann 205b3b813a atmodem: Turn a STE GPRS quirk into a MBM and STE quirk 2010-08-20 14:05:18 +02:00
Marcel Holtmann a8d3e7433a atmodem: Remove useless NULL checks before g_free 2010-08-16 22:02:01 +02:00
Denis Kenzior ac524be99f atmodem: Use g_at_chat_clone 2010-08-12 16:40:40 -05:00
Marcel Holtmann 45bf4cf396 Add support for handling CNTI=0 request with Novatel devices 2010-06-06 13:12:37 -07:00
Denis Kenzior 36a8801115 Update atmodem gprs driver to the new API 2010-03-26 23:00:28 -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
Sjur Brændeland 040e799665 Add STE modem support for GPRS and network registration 2010-01-25 20:55:10 +01:00
Jussi Kukkonen ebe8904f39 Add quirk for cid and lac handling for Huawei 2010-01-20 10:09:54 -06:00
Marcel Holtmann 144080e749 Update copyright information 2010-01-01 17:00:10 -08:00
Denis Kenzior fe02d6bc45 Use new at_util_parse_reg in gprs driver 2009-12-09 12:50:22 -06:00
Denis Kenzior 2297bc926d Style: Fix some remaining style issues in atmodem 2009-12-09 02:46:33 -06:00
Denis Kenzior 07bdfc6bce Harden the CGREG parsing function
Sometimes the CGREG query and CGREG unsolicited notification get
intermixed.  Since they have the same prefix, GAtChat clumps them
together.  Make sure the parser skips the unsolicited notification.
2009-12-08 03:43:54 -06:00
Andrzej Zaborowski 3187db9352 Fix +CGEV: parsing 2009-11-10 12:48:08 -06:00
Andrzej Zaborowski 49c2f7b2e7 Fix: Don't bail if CREG/CGREG mode=2 is unsupported 2009-11-10 12:40:21 -06:00
Denis Kenzior bc72cca91b Fix: notify_attached was only used when detached
The standard only specifies that the context might have been detached by
the network / mobile equipment.  Not attached.
2009-10-26 16:55:03 -05:00
Denis Kenzior ffd7c1920a Fix: Some modems report PDP_type in a list 2009-10-23 17:05:57 -05:00
Denis Kenzior 14c116be36 Remove unused code and make compiler happy 2009-10-23 17:05:56 -05:00