summaryrefslogtreecommitdiff
path: root/drivers/atmodem
Commit message (Collapse)AuthorAgeFilesLines
* lte: switch auth to NONE if other options cannot be usedSergei Golubtsov2022-09-061-1/+2
| | | | | If the user name or user name together with the password for an AP are not provided the NONE auth method should be used
* droid 4: special handling for SMSesPavel Machek2020-09-151-3/+13
| | | | | Droid 4 modem is "special" (aka broken) so and getting incoming SMSes to work is quite tricky. This should get it right.
* droid 4: add special handling required for voice calls and SIMPavel Machek2020-09-153-0/+7
| | | | | Droid 4 modem is "special" (aka broken) so it seems to need a bit of error handling.
* atmodem: Detect usage of AT+CGEREPLars Poeschel2020-09-011-2/+62
| | | | | | | | 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.
* atmodem: Signal quality on quectel serial modemsLars Poeschel2020-08-251-3/+21
| | | | | | | | | | | As the default way of getting the signal quality with +CIND is also unstable on quectel serial modems (the same as on quectel EC21). In fact the signal quality is only updated on cell changes. Those trigger a manual AT+CSQ in ofono and get an update this way, but the URCs do not work. So we implement a quectelish way here as well. The quectelish way is very similar to the way ifx modems work. We can reuse their csq_notify function.
* atmodem: Deactivate AT+CPSB for quectel serial modemsLars Poeschel2020-08-191-0/+1
| | | | | | | | | 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.
* gprs: Quectel EC21 does not understand AT+CPSBLars Poeschel2020-08-171-0/+2
| | | | | | | 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.
* atmodem: Get strength and tech the quectel way on EC21Lars Poeschel2020-08-111-0/+71
| | | | | | | | | | I had some trouble getting network strengh and access technology the standard way on Quectel EC21. It does work - but only kind of. I did not get URCs when I am sure I should. This way through CIEV, CIND and CMER is also not documented in Quectel documentation, so I suspect this to be unsupported. This is now changed to the "quectelish" way of gettings those values and this does work more fine-grained and reliable on the Quectel EC21.
* Add a vendor OFONO_VENDOR_QUECTEL_EC2XLars Poeschel2020-08-114-1/+6
| | | | | | | The distinction between OFONO_VENDOR_QUECTEL and OFONO_VENDOR_QUECTEL_SERIAL does not suffice for EC21/EC25 in some places, so introduce and use a new vendor: OFONO_VENDOR_QUECTEL_EC2X
* voicecall: Quectel modem do not understand AT+CNAPLars Poeschel2020-05-211-1/+3
|
* atutil: Add missing va_endDenis Kenzior2019-11-131-0/+1
|
* atmodem: CGDCONT handling for cid 0Antara Borwankar2019-09-301-1/+1
| | | | Added handling for cid 0 in +CGDCONT callback.
* atmodem: sim: remove quectel serial vendor quirkMartin Hundebøll2019-09-261-1/+0
| | | | | | The sim inserted/initialized state is handled properly in the quectel plugin now, so remove the "auto-initialized" quirk from the atmodem sim driver.
* atmodem: sms: don't request URC buffering for Quectel UC15 modemsMartin Hundebøll2019-09-041-0/+1
| | | | | Add a vendor quirk to avoid an error being returned when setting up sms notification for Quectel UC15 modems.
* atmodem: introduce send_clcc() to reduce code duplicationPavel Machek2019-08-191-13/+11
| | | | Reduce code duplication by introducing send_clcc function.
* atmodem: Implement the list_activated_contexts callbackRichard Röjfors2019-08-131-33/+134
| | | | | The callback calls cgact and cgdcont to get information regarding any activate context.
* atmodem: Remove the pointless #pragma onceMarcel Holtmann2019-08-131-1/+0
|
* atmodem: Check for auto activated contexts during initRichard Röjfors2019-07-241-0/+47
| | | | | | 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.
* atmodem: gprs-context: parse list-less CGDATA responseMartin Hundebøll2019-07-191-3/+5
| | | | | | | | | The Quectel M95 and MC60 modems respond to AT+CGDATA=? with a single +CGDATA="PPP", but the callback in gprs-context expects a list of protocols. Avoid falling back to the old-style ATD*99 by not expecting a list of protocols for serial quectel modems.
* atmodem: export struct netregJonas Bonn2019-07-192-54/+54
| | | | In order to do inheritance by composition.
* atmodem: export generic netreg funcsJonas Bonn2019-07-192-7/+26
| | | | | | | | | | | | | | | | An upcoming netreg driver for uBlox modems will need to override the probe method in order to set itself up, but for further functionality the "generic" AT implementations are sufficient. The easiest way to do this is to just set up a vtable with a custom probe implementation and defer all other methods to the common/generic methods. The problem is that the AT methods are not actually exported. This generic AT functionality was not intended to be hooked directly into other drivers. This patch exports all the methods of the atmodem network-registration driver implementation so that they can be used as generic/common implementations for other drivers.
* atmodem: rename OFONO_VENDOR_QUECTEL_M95Martin Hundebøll2019-07-173-5/+5
| | | | | Other serial connected modems (i.e the MC60 model) from is AT-compatible with the M95 model, so rename the M95 vendor id to be common for both.
* atmodem: sms: add quectel m95 quirksMartin Hundebøll2019-07-121-5/+19
| | | | | | | | | | | | CNMA isn't mentioned in the m95 documentation, but trial'n'error has revealed some details: * the CSMS query returns the list (0,128) instead of a range * CNMA is enabled by setting 128 as CSMS service * once enabled, SMS deliveries are acked by sending AT+CNMA without a value setting Add m95 quirks to the atmodem driver, so that CNMA is correctly detected, configured, and used.
* atutil: guard call to g_hash_table_destroy()Martin Hundebøll2019-07-051-1/+3
| | | | | | | | | Glib emits a warning when g_hash_table_destroy() is called on a NULL pointer: GLib-CRITICAL **: 13:27:40.269: g_hash_table_destroy: assertion 'hash_table != NULL' failed Add a check to avoid this warning.
* atmodem: fix to activate context with cid zeroAntara Borwankar2019-06-141-4/+5
| | | | | | | 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.
* atutil: Introduce at_util_open_deviceDenis Kenzior2019-05-312-2/+61
|
* xmm7modem: enabling simtoolkit in modem driverAntara Borwankar2019-05-161-0/+13
| | | | | handled enabling of stk for xmm7modem vendor in atmodem driver.
* atmodem: Fix a race if a context get deactivated while readRichard Röjfors2019-05-081-0/+11
| | | | | | | 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.
* drivers: Silence strncpy use warningsDenis Kenzior2019-04-301-1/+2
|
* atmodem: Remove unneeded if statementDenis Kenzior2019-04-291-28/+26
| | | | if (ctx->apn) is always true since apn is an array variable
* xmm7modem: handling of IPv6 address for activated contextAntara Borwankar2019-04-292-0/+42
| | | | | | | Handled IPv6 address after activating PDP context. Received IPv6 address is of format addr + netmask in the same string in the form of "a1.a2.a3.a4.a5.a6.a7.a8.a9.a10.a11.a12.a13.a14.a15.a16. m1.m2.m3.m4.m5.m6.m7.m8.m9.m10.m11.m12.m13.m14.m15.m16"
* xmm7modem: handling of dual sim single active featureAntara Borwankar2019-04-021-1/+125
| | | | | | | | | | | | Handled DSSA use case for xmm7modem. Added driver function to switch between available card slots for SIM. Only one SIM will be active at a given time. On calling this function the active SIM will be removed and the card slot made inactive and SIM in the other card slot will be made active. Use case is similar to a SIM swap/change where one SIM is replaced another SIM in the same slot.
* atmodem: Remove TOBY_L2 vendorJonas Bonn2019-03-131-1/+0
|
* atmodem: drop vendor type for Toby L2 modelJonas Bonn2019-03-133-4/+5
| | | | | | | | | | 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.
* Fix whitespace weirdnessJonas Bonn2019-03-131-6/+6
|
* atmodem: Use l_util_hexstring instead of encode_hexDenis Kenzior2018-12-271-2/+3
|
* drivers: switch g_convert usage to ellDenis Kenzior2018-12-271-16/+13
|
* drivers: Update to new convert_ucs2_to_gsm APIDenis Kenzior2018-12-271-2/+3
| | | | Use l_free instead of g_free since the above API was changed to use ell
* drivers: Update to the new util apiDenis Kenzior2018-12-271-3/+3
|
* atmodem: remove vendor CinterionGiacinto Cifelli2018-10-291-1/+0
|
* atmodem: Change cinterion prefix to gemaltoGiacinto Cifelli2018-10-291-8/+8
|
* atmodem: change vendor cinterion to gemaltoGiacinto Cifelli2018-10-291-2/+2
|
* atmodem: enlarge command bufferJonas Bonn2018-10-291-1/+1
| | | | | | | | | | | | | | The ofono phone number max length is 80 so a buffer size of 64 is obviously insufficient. Expanding the buffer to 128 prevents a potential failure and suppresses the folowing compiler warning: ../drivers/atmodem/sms.c: In function ‘at_csca_set’: ../drivers/atmodem/sms.c:108:40: warning: ‘%s’ directive output may be truncated writing up to 80 bytes into a region of size 55 [-Wformat-truncation=] snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type); ^~ ../drivers/atmodem/sms.c:108:2: note: ‘snprintf’ output between 13 and 103 bytes into a destination of size 64 snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* atmodem: Make sure to use none_prefixDenis Kenzior2018-10-251-2/+4
| | | | | Otherwise all unsolicited notifications would also be consumed when invoking +CGAUTH/+CGDCONT
* atmodem: Add proto and authentication handling to lteGiacinto Cifelli2018-10-251-14/+56
| | | | | | | The ofono_lte_default_attach_info now handles also the protocol and the authentication method, username and password. Co-authored-by: Martin Baschin <martin.baschin@googlemail.com>
* atmodem: Add reference counting to cb_dataGiacinto Cifelli2018-10-251-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the cb_data can be used by creating the structure with cb_data_new, and then there are two possibilities: - use it in a single callback function, and destroy it with a call to g_free. Example: - calling function: struct cb_data *cbd = cb_data_new(cb, data); if (g_at_chat_send(chat, buf, NULL, at_cgatt_cb, cbd, g_free) > 0) return; g_free(cbd); - called function (here at_cgatt_cb): static void at_cgatt_cb(gboolean ok, GAtResult *result, gpointer user_data) { struct cb_data *cbd = user_data; ofono_gprs_cb_t cb = cbd->cb; struct ofono_error error; decode_at_error(&error, g_at_result_final_response(result)); cb(&error, cbd->data); } note the absence of explicit g_free(cbd); - pass it through a train of callback functions, adding a reference at each pass cb_data_ref, and removing it with cb_data_unref. the use of cb_data_ref would replace a new object creation, while the use of cb_data_unref the use of g_free. Example: - calling function: struct cb_data *cbd = cb_data_new(cb, data); // no cb_ref at the creation if (g_at_chat_send(chat, buf, NULL, at_lte_set_default_attach_info_cb, cbd, cb_data_unref) > 0) goto end; cb_data_unref(cbd); - called function 1 (at_lte_set_default_attach_info_cb): static void at_lte_set_default_attach_info_cb(gboolean ok, GAtResult *result, gpointer user_data) { struct cb_data *cbd = user_data; cbd = cb_data_ref(cbd); if (g_at_chat_send(chat, buf, NULL, at_cgatt_cb, cbd, cb_data_unref) > 0) return; cb_data_unref(cbd); } - called function 2 (at_cgatt_cb): like above. no call to g_free or cb_data_unref. The terminal function doesn't need to know about the reference scheme.
* atmodem: added Gemalto vendor quirk for +CNMIGiacinto Cifelli2018-10-231-1/+11
|
* atmodem: Add at_util_get_cgdcont_commandGiacinto Cifelli2018-10-222-0/+40
| | | | | | | The function at_util_get_cgdcont_command computes the AT+CGDCONT string, as per 3GPP 27.007. It uses a second function, at_util_gprs_proto_to_pdp_type, that returns the pdp_type string for the command
* atmodem: Add at_util_gprs_auth_method_to_auth_protoGiacinto Cifelli2018-10-222-0/+20
| | | | | | This function converts the ofono enum ofono_gprs_auth_method into the value of the 3GPP 27.007 'auth_proto' variable of +CGAUTH so that it can be passed directly to the AT command.
* treewide: Remove superfluous use of _GNU_SOURCEJonas Bonn2018-10-1717-17/+0
| | | | | | 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...