Commit Graph

1788 Commits

Author SHA1 Message Date
Alexander Couzens db0e15dea8 NOT_FOR_MERGE: decode qmi messages with libqmi 2019-03-25 14:38:04 +01:00
Alexander Couzens b81b25d27c qmimodem: report the qmimodem bug 2019-03-25 14:38:04 +01:00
Alexander Couzens e11eca4d19 qmimodem: ensure the modem is registered by check cs and ps state
The modem tells to early it's registered even it hasn't yet received a location
update complete.
2019-03-25 14:38:04 +01:00
Alexander Couzens a826ee1134 atutil.h: remove doublicated ofono_call_compare_by_status() 2019-03-25 14:38:04 +01:00
Alexander Couzens f133a463bb [RFC] qmimodem: implement voice calls
The voice_generated.* files is an RFC how files should look like.
They aren't yet generated.
2019-03-25 14:38:04 +01:00
Alexander Couzens ff5dd1f6a1 common,atmodem: rename & move at_util_call_compare_by_id to common.c
at_util_call_compare_by_id is used by several modem drivers.
2019-03-25 14:38:04 +01:00
Alexander Couzens dc8ee604db common,atmodem: rename & move at_util_call_compare_by_status to common.c
at_util_call_compare_by_status is used by several modem drivers.
2019-03-25 14:38:04 +01:00
Alexander Couzens 4cd5716ba5 common: create GList helper ofono_call_compare
replaces at_util_call_compare (atmodem) and
call_compare (rild).
2019-03-25 13:11:33 +01:00
Jonas Bonn a55e797ba2 ublox: gprs-context: query networking mode for TOBY L2
The TOBY L2 may run in either "bridge" mode or "router" mode.  For this
model, query the configured mode so that the appropriate settings are
communicated when the context is activated.
2019-03-14 20:34:32 -05:00
Jonas Bonn efe1306ec2 ublox: TOBY L4 supports only router mode
The TOBY L4 supports only "router mode" where the modem presents a
network interface that one can run a DHCP client against.  Behind this
interface, the modem takes care of routing packets via NAT by:

i)  selecting the relevant context based on destination IP
ii) using the first activated context as the default route

In order to have the connection manager, thus, do the right thing, the
context only needs to report itself as being active and with the IP
settings set to method "dhcp".  There's no need for the connection manager
to know details like what IP address the context was assigned.

Tested with connman that does the right thing when it finds an active
"dhcp" context.
2019-03-14 20:34:32 -05:00
Jonas Bonn d393863486 ublox: gprs-context: take model parameter 2019-03-14 20:34:32 -05:00
Jonas Bonn 0c2afdd3f0 ublox: extend LTE driver
There are a couple of semi-independent changes here:

* use the 'vendor' parameter to pass the modem 'model'
* support TOBY L4 modem which uses a fixed CID for configuring the EPS
default bearer
* add the setup of authentication parameters that was recently added to
the atmodem LTE driver
2019-03-13 16:39:42 -05:00
Jonas Bonn 83834419e5 ublox: add TOBY L4 models 2019-03-13 16:38:55 -05:00
Jonas Bonn cfab42825d ublox: add model flag HAVE_USBCONF
This flag should be set on devices that support multiple USB profiles
and will be used to determine whether or not querying USB profiles is
appropriate/necessary.
2019-03-13 16:26:42 -05:00
Jonas Bonn d7844183c0 ublox: create model data structures
This sets up some device model data structures and adds some helpers for
manipulating them.  These data structures are a first step to trying to
support the large number of devices that ublox produces with a common
driver structure.
2019-03-13 13:48:54 -05:00
Jonas Bonn e70789534e atmodem: Remove TOBY_L2 vendor 2019-03-13 13:20:43 -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 a88ebf4913 Fix whitespace weirdness 2019-03-13 13:13:27 -05:00
Denis Kenzior 54b8639c0e ifxmodem: Clean up the previous commit slightly
The if statements were over 80 characters and breaking them up made the
code look a bit uglier.  So refactor the if statements to just figure
out the data path 'n' parameter or return an error.  On success, form
the datapath string and return it.

Also bump the buffer size and use snprintf to be safe(r).
2019-03-04 13:34:13 -06:00
Antara Borwankar b51c1a23c0 xmm7modem: data channel setup for xmm7modem
Added the implementation required to setup data channel
in ifxmodem gprs-context driver for xmm7modem vendor
2019-03-04 13:21:34 -06:00
Christophe Ronco 34225d2681 qmi: support sim hotplug
Use card status indication to detect SIM removal and insertions
2019-02-17 20:48:54 -06:00
Nicolas Serafini 5e173b28d0 qmimodem: Notify when SIM is initialized
Since the commit that introduced the notification API of a SIM inserted
and initialized I can not unlock the SIM card on a WP7607 modem.

The previously mentioned commit: 54d56d763e
2019-02-08 14:02:02 -06:00
Pavel Machek cc3375e2dd rilmodem: fix compilation on gcc-6.3
gcc-6 fails to compile ofono due to #pragma directives. Limit them to
gcc versions where they are needed.
2019-01-22 11:02:30 -06:00
Antara Borwankar 80470869e5 ifxmodem: removing TAP/TUN support check for XMM vendor
skipping TAP/TUN support check from gprs-context probe for
xmm vendor. xmm modem does not require TAP/TUN support. Also
it is not enabled by default in enbedded yocto bsp.
2019-01-15 14:54:52 -06:00
Denis Kenzior 270d19495c rilmodem: Fix compiler error 2018-12-29 14:19:16 -06:00
Denis Kenzior 50077ee352 rilmodem: Use l_util_hexstring instead of encode_hex 2018-12-27 18:18:51 -06:00
Denis Kenzior 305ae9ba84 atmodem: Use l_util_hexstring instead of encode_hex 2018-12-27 18:18:51 -06:00
Denis Kenzior b2ebd60bcd rilmodem: Convert decode_hex to l_util_from_hexstring 2018-12-27 18:18:51 -06:00
Denis Kenzior a65bf69f38 drivers: update to use l_free
Previous commit changes character conversion functions to use ell memory
allocation routines.  Update all uses to free memory using the same.
2018-12-27 18:18:51 -06:00
Denis Kenzior 77271f33d2 drivers: switch g_convert usage to ell 2018-12-27 18:18:51 -06:00
Denis Kenzior 88ff5d36dd drivers: Update to new convert_ucs2_to_gsm API
Use l_free instead of g_free since the above API was changed to use ell
2018-12-27 18:18:51 -06:00
Denis Kenzior c2b68f20b3 drivers: Update to the new util api 2018-12-27 18:18:51 -06:00
Pau Espin 1749018577 qmi: Fix Secondary DNS overwriting Primary DNS
inet_ntoa was called twice in a row and as a result both primay and
secondary DNS were pointing to same static buffer containing last
value (secondary DNS).

As a result, ofono always advertised the secondary DNS twice through
DBus ConnectionContext.GetProperties 'DomainNameServers'.

Related: https://osmocom.org/issues/3031
2018-12-11 14:14:40 -06: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
Marcel Holtmann 8452a7f349 build: Add support for internal and external Embedded Linux library 2018-10-31 19:58:10 +01:00
Giacinto Cifelli d7bb1d9254 atmodem: remove vendor Cinterion 2018-10-29 15:01:50 -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
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 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
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 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
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