Commit Graph

8483 Commits

Author SHA1 Message Date
Marcel Holtmann 443d571c45 README: Add information about ELL when building from sources 2018-11-08 21:26:52 +01:00
Marcel Holtmann 6f431e2d70 main: Remove leftover HAVE_ELL conditions 2018-11-01 20:54:37 +01:00
Marcel Holtmann ad8a8a90a2 Release 1.26 2018-10-31 23:42:40 +01:00
Marcel Holtmann 2a5c9cf0f2 mbimmodem: Convert back to using __builtin_bswap16 with proper indexing 2018-10-31 21:03:49 +01:00
Marcel Holtmann 2df69194ac mbimmodem: Fix conversion of strings into UTF16-LE on big endian 2018-10-31 21:00:38 +01:00
Marcel Holtmann 63ed2c2080 mbimmodem: Fix endian issue with UTF16-LE to UTF16-CPU conversion 2018-10-31 20:42:14 +01:00
Denis Kenzior 4029ef3a11 mbimmodem: Fix compilation on 32-bit
CC       drivers/mbimmodem/mbim.o
drivers/mbimmodem/mbim.c: In function ‘command_write_handler’:
drivers/mbimmodem/mbim.c:490:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
   l_info("n_iov: %lu, %lu", n_iov + 1, (size_t) written);
   ^
drivers/mbimmodem/mbim.c:490:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat=]
drivers/mbimmodem/mbim.c: In function ‘command_read_handler’:
drivers/mbimmodem/mbim.c:649:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
  l_info("header_offset: %lu", device->header_offset);
  ^
drivers/mbimmodem/mbim.c:650:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
  l_info("segment_bytes_remaining: %lu", device->segment_bytes_remaining);
  ^
2018-10-31 14:20:00 -05:00
Nandini Rebello 157258eb2d udevng: enhance udev detection for intel 7xxx modems
Handle newer 7xxx modem enumeration based on ProductId.
Preserving the previous gen support too.
2018-10-31 14:20:00 -05:00
Marcel Holtmann b56139e80b mbim: Add the missing mbim-private.h header into packages 2018-10-31 20:15:11 +01:00
Marcel Holtmann 8452a7f349 build: Add support for internal and external Embedded Linux library 2018-10-31 19:58:10 +01:00
Denis Kenzior 814f7fc744 gemalto: Use GEMALTO vendor for netreg 2018-10-29 15:03:03 -05:00
Giacinto Cifelli d7bb1d9254 atmodem: remove vendor Cinterion 2018-10-29 15:01:50 -05:00
Giacinto Cifelli edac159aa5 cinterion: use Gemalto vendor in netreg 2018-10-29 15:01:22 -05:00
Giacinto Cifelli 713585963f atmodem: Change cinterion prefix to gemalto 2018-10-29 15:00:44 -05:00
Giacinto Cifelli a429950f2f atmodem: change vendor cinterion to gemalto 2018-10-29 15:00:05 -05:00
Giacinto Cifelli 261a30f799 gemalto: Use Gemalto vendor for LTE atom 2018-10-29 14:59:23 -05:00
Jonas Bonn 652a717f3a modem: global data is pre-zeroed
Module-local and global data are BSS symbols and don't require
zero-initialization.
2018-10-29 14:04:50 -05:00
Jonas Bonn ec3c6c67af stkutil: remove test for impossible condition
'string' is an array and therefore never NULL so this test always fails.
2018-10-29 13:59:19 -05:00
Jonas Bonn a1141ae393 qmimodem: prevent use of unitialized variable
'index' may not be initialized in the error path so don't try to print a
message with it.
2018-10-29 13:35:01 -05:00
Jonas Bonn ab4460690d mbim: remove unused modem data
Neither the Vendor nor Model strings are used by the mbim plugin.
2018-10-29 13:34:07 -05:00
Jonas Bonn 1e176755af atmodem: enlarge command buffer
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);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2018-10-29 13:33:56 -05:00
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