Commit Graph

8462 Commits

Author SHA1 Message Date
Jonas Bonn 85cf3c8aa9 test: use python3 for set-ddr 2018-10-29 13:32:56 -05:00
Giacinto Cifelli d093aa3960 doc/common-patterns.txt: initial version 2018-10-25 13:55:00 -05:00
Denis Kenzior dd6ae48d19 atmodem: Make sure to use none_prefix
Otherwise all unsolicited notifications would also be consumed when
invoking +CGAUTH/+CGDCONT
2018-10-25 13:51:57 -05:00
Giacinto Cifelli c1f7135261 atmodem: Add proto and authentication handling to lte
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>
2018-10-25 11:15:59 -05:00
Giacinto Cifelli eed785a4d7 atmodem: Add reference counting to cb_data
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.
2018-10-25 10:55:09 -05:00
Giacinto Cifelli f20da0e7f9 modem: Implement ofono_modem_set_timeout_hint
this patch provides the handling for the modem-depending powered timeout

It provides the trivial implementation for
ofono_modem_set_powered_timeout_hint, introducing the ofono_modem
variable timeout_hint, used together with the existing ofono_modem
variable timeout.

The default value, previously hardcoded as a magic number, is provided
by the DEFAULT_POWERED_TIMEOUT define and set as soon as the
ofono_modem struct is created, and then can be overwritten by the
aforementioned ofono_modem_set_powered_timeout_hint.
2018-10-24 14:32:02 -05:00
Giacinto Cifelli 13467d5dcb include: add ofono_modem_set_powered_timeout_hint
function to set the powered timeout for those cases where a device might
require longer time to boot (uncommon).

The function is effective if called before Powered=true,
so it is best called by modem detection logic and prior to calling
ofono_modem_register.
2018-10-24 14:26:59 -05:00
Giacinto Cifelli 92bf7fb867 atmodem: added Gemalto vendor quirk for +CNMI 2018-10-23 09:54:59 -05:00
Giacinto Cifelli 0d9a380ea0 atmodem: Add at_util_get_cgdcont_command
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
2018-10-22 15:05:38 -05:00
Giacinto Cifelli 0208c10e9b atmodem: Add at_util_gprs_auth_method_to_auth_proto
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.
2018-10-22 15:01:51 -05:00
Denis Kenzior 2637bfd4ec lte: Add additional sanity checks for username/password 2018-10-22 11:46:08 -05:00
Giacinto Cifelli 924edf03ce lte: protocol and authentication for default ctx
Many LTE networks require user authentication, even for the default
context. In particular, most of the private APNs use this facility
to add some control on top of the MNO providing the service, so that
another user of the same network cannot access the private one.
As such, we add these parameters to the default context
settings that will attempt to use when registering to the network.

The additional parameters added by this patch are:  protocol, user, and
password.  These are sufficient to allow to connect to networks
available to the patch author where ofono previously failed to register
to the network at all.

Co-authored-by: Martin Baschin <martin.baschin@googlemail.com>
Co-authored-by: Denis Kenzior <denis.kenzior@intel.com>
2018-10-22 11:44:29 -05:00
Giacinto Cifelli 37b913b7bf include: add proto and authentication parameters
The ofono_lte_default_attach_info is extended with protocol,
authentication method, username and password.

Co-authored-by: Martin Baschin <martin.baschin@googlemail.com>
2018-10-22 11:44:29 -05:00
Denis Kenzior 60ab4bdc1b doc: Mark new properties experimental
Just in case we need to redesign these in the near future
2018-10-22 11:44:05 -05:00
Giacinto Cifelli b8de6082ec doc: Add additional default attach parameters to LTE
Added 4 properties for handling the type of context and the
authentication method, exactly like in any gprs context handling.
The properties are named after the equivalent gprs-context one, for
compatibility and uniformity.

Co-authored-by: Martin Baschin <martin.baschin@googlemail.com>
2018-10-22 11:03:15 -05:00
Denis Kenzior 16a77f2497 AUTHORS: Mention Giacinto's contributions 2018-10-17 17:03:33 -05:00
Giacinto Cifelli c8c718a46e gemalto: added voice support
The plugin for Gemalto modems is enriched with all voice-related atoms,
as well as USSD.
All except the voicecall itself are from the atmodem, while the
voicecall is from gemaltomodem.
2018-10-17 17:03:18 -05:00
Giacinto Cifelli b18560441d gemalto: Add Gemalto specific voicecall atom
This atom uses the URC ^SLCC to monitor the call status, as well as
incoming calls.
Note the use in the atom of the variable GemaltoVtsQuotes: this is
needed to support future modules, as of today not yet available in the
plugin.
2018-10-17 17:03:03 -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
Nandini Rebello ef6c257a3e test: add support for new languages
Adding new language support to set "alphabet" parameter.
2018-10-15 14:09:53 -05:00
Nandini Rebello 4f0ba39cbe sms: support 8 national lang in Alphabet property
Adding support for 8 additional languages for GSM 7 bit.
2018-10-15 14:09:07 -05:00
Nandini Rebello d984a59f3d util: adding 8 national sms alphabets
Adding national language tables for hindi,kannada,malayalam,
oriya,punjabi,tamil,telugu and urdu.
2018-10-15 14:07:27 -05:00
Nandini Rebello 1f0ea2b882 doc: add support for 8 additional sms alphabets
Adding support for hindi,kannada,malayalam,oriya,punjabi,tamil,
telugu and urdu for GSM 7 bit.
2018-10-15 14:06:23 -05:00
Denis Kenzior 352a9f4b23 xmm7modem: Fix memory leak in netmon 2018-10-12 13:45:23 -05:00
Denis Kenzior 37d856c071 phonesim: Fix memory leak 2018-10-12 13:45:01 -05:00
Nandini Rebello 032aaef87d sms: fix a missing entry in single shift table
Fix a missing char in the nation language set in single shift table
for a special character. Character set again validated.
2018-10-11 10:15:49 -05:00
Giacinto Cifelli 597ab6683f common: Move proto and auth_method related helpers
the following functions:
	gprs_proto_to_string
	gprs_proto_from_string
	gprs_auth_method_to_string
	gprs_auth_method_from_string

are moved from gprs.c to common.c, with related declaration in common.h
so that they can also be accessed from lte core functions
2018-10-09 15:10:25 -05:00
Giacinto Cifelli 93caa4ceef include: move auth_method and proto enumerations
ofono_gprs_proto and ofono_gprs_auth_method, and related length consts,
moved to types.h from gprs-context.h,
so that they can be shared also with lte core functions
2018-10-09 15:06:36 -05:00
Antara d9e3329f55 netmon: Enabled netmon atom for xmm7modem plugin
enabling netmon atom to report current serving cell measurements
for xmm7modem
2018-10-09 12:54:27 -05:00
Antara a4a7e553dc netmon: Added netmon driver for xmm7modem
adding netmon driver for xmm7modem which uses intel proprietary
AT command +XMCI
2018-10-09 12:54:24 -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
Giacinto Cifelli a5bdf48ca7 mbpi: support for auth NONE
support of 'none' in mbpi:
the default method remains CHAP, but it is overridden by NONE after
parsing the entire key for the apn and detecting no username/password
2018-10-09 10:44:17 -05:00
Giacinto Cifelli a5aa268747 file-provision: support for auth type of NONE 2018-10-09 10:43:31 -05:00
Giacinto Cifelli cc79162470 gprs: support for NONE auth type 2018-10-09 10:43:01 -05:00
Giacinto Cifelli 6cf24fe1f9 gprs-context: added OFONO_GPRS_AUTH_METHOD_NONE
This method makes explicit the lack of authentication.

When selected, the username and password are ignored, but they are not
changed in the user-defined properties for the context.
This treatment is necessary to allow setting independently auth_method,
username and password.

This method is also selected implicitly when username is set to
an empty string. Also this selection is done without changing the
user-defined auth_method for the context, so that the behavior is
consistent.
2018-10-09 10:40:15 -05:00
Giacinto Cifelli f2fa45b830 connman-api: added "none" auth_method 2018-10-09 10:40:12 -05:00
Giacinto Cifelli 6fc119d9ea gatchat: support for auth NONE
Added authentication method G_AT_PPP_AUTH_METHOD_NONE and its handling.
2018-10-03 11:44:03 -05:00
Anirudh Gargi 3317cc6f45 xmm7xxx: enable sms and phonebook support 2018-10-03 11:42:51 -05:00
Denis Kenzior cfbb202435 AUTHORS: Mention Nandini's contributions 2018-10-01 14:55:31 -05:00
Nandini Rebello 638583522e test: Add test script to set sms alphabet 2018-10-01 14:54:29 -05:00
Nandini Rebello a2168cd136 sms: support bengali and gujrati in Alphabet property 2018-10-01 14:53:11 -05:00
Nandini Rebello 7e82a2d940 util: add bengali and gujrati sms alphabets 2018-10-01 14:52:03 -05:00
Nandini Rebello 5d316b1dea doc: add support for 2 additional sms alphabets
Adding support for bengali and gujrati for GSM 7 bit.
2018-10-01 14:50:54 -05:00
Anirudh Gargi 4b44fb3910 gprs: fix seg fault in case of NULL callback
In case of AT callback if callback handler is NULL, check for null
before calling the success macro.

Logs:
ofonod[32496]: src/network.c:current_operator_callback() 0x157ad60, (nil)
ofonod[32496]: src/gprs.c:netreg_status_changed() 0
ofonod[32496]: src/gprs.c:gprs_netreg_update() attach: 0, driver_attached: 1
ofonod[32496]: src/gprs.c:ofono_gprs_detached_notify() /xmm7xxx_0
ofonod[32496]: drivers/ifxmodem/gprs-context.c:ifx_gprs_detach_shutdown()
ofonod[32496]: drivers/ifxmodem/gprs-context.c:ifx_gprs_deactivate_primary() cid 0
ofonod[32496]: src/gprs.c:ofono_gprs_detached_notify() /xmm7xxx_0
ofonod[32496]: src/gprs.c:gprs_attach_callback() /xmm7xxx_0 error = 0
ofonod[32496]: drivers/ifxmodem/gprs-context.c:deactivate_cb() ok 0
ofonod[32496]: Aborting (signal 11) [./../src/ofonod]
ofonod[32496]: ++++++++ backtrace ++++++++
ofonod[32496]: +++++++++++++++++++++++++++
2018-10-01 14:46:35 -05:00
Anirudh Gargi 40f5916316 sms: allow sms send for EUTRAN sms only state
Patch to be considered, if support for EUTRAN SMS states accepted.

SMS registered flag while sending sms to consider the new EUTRAN
registered status also.
2018-10-01 14:43:23 -05:00
Anirudh Gargi 88358047c8 network: add support eutran sms only states
EUTRAN SMS states mapped to registered and roaming respectively.
2018-10-01 14:42:57 -05:00
Anirudh Gargi eb70ba464a doc: Clarify LTE registration status documentation 2018-10-01 14:42:57 -05:00
Marcel Holtmann 7dd0597ac1 Release 1.25 2018-09-29 10:31:40 +02:00
Pavel Machek 33be5732f1 udevng: Move debug print to more useful place
in setup_gobi()
2018-09-27 17:26:49 -05:00