Compare commits

...

345 Commits

Author SHA1 Message Date
Slava Monich
24fd7e863c [unit] Added one more slot-manager test case 2022-01-10 21:10:26 +02:00
Slava Monich
3bdcd55ad8 Merge pull request #21 from monich/imsi-change
Fix re-evaluation of data slot after SIM change
2022-01-10 19:54:55 +02:00
Slava Monich
fb76fa7be1 [ofono] Fixed re-evaluation of data slot after SIM change. JB#56789
The way it was done, slot driver wasn't always notified about the
role change after IMSI update (e.g. when SIM gets hot-swapped or
enabled/disabled) which could result in mobile data remaining
disabled.
2022-01-10 19:16:41 +02:00
Slava Monich
25c11d6697 Updated upstream hash to point to 1.27 2022-01-10 00:12:23 +02:00
Slava Monich
0f789ddf25 Merge pull request #19 from sailfish-on-dontbeevil/branch-1.27
[ofono] Update baseline to 1.27. JB#42254
2022-01-10 00:07:34 +02:00
Slava Monich
cfae9cd095 include: Housekeeping 2022-01-10 00:01:23 +02:00
Marcel Holtmann
dca2747d5f Release 1.27 2022-01-08 08:39:08 +00:00
Antara Borwankar
b6df026722 xmm7modem: modified ofono.conf for coex agent
Added coex agent interface to ofono.conf
2022-01-08 08:39:08 +00:00
Denis Kenzior
aa1e36040d xmm7xxx: Various style cleanups 2022-01-08 08:39:08 +00:00
Antara Borwankar
227af51e10 xmm7modem: implemnetation of coexistence functionality
Added coex implementation in xmm7modem plugin
2022-01-08 08:39:08 +00:00
Pau Espin Pedrol
cbab683ac2 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
2022-01-08 08:39:08 +00:00
Antara Borwankar
8a42f7cf48 doc: Adding documetation for intel LTE coex
Added intel-lte-coex-api.txt which defines LTE coexistence
interface for intel modems.
2022-01-08 08:39:08 +00:00
Nandini Rebello
45b8b675ac test: Fix number of arguments check in change-pin
Fix the number of arguments checked in second case of change-pin.
2022-01-08 08:39:08 +00:00
Nandini Rebello
b977415db8 xmm7xxx: Adding case for SIM PIN locked state
Handling the case when SIM PIN is enabled for xmm7xxx modem.
2022-01-08 08:39:08 +00:00
Clement Viel
011377b505 sim800: add sim800 support 2022-01-08 08:39:08 +00:00
Clement Viel
7653e2b293 sim800: merge sim800 and sim900 documentation. 2022-01-08 08:39:08 +00:00
Slava Monich
0012a3e4f0 Updated upstream hash to point to 1.26 2022-01-08 04:50:14 +02:00
Slava Monich
40ec15a394 [ofono] Handle OFONO_GPRS_AUTH_METHOD_ANY. JB#42254 2022-01-08 04:29:08 +02:00
Slava Monich
cb2fd2de41 [include] Updated enum ofono_gprs_auth_method. JB#42254
For backward compatibility.
2022-01-08 04:28:55 +02:00
Slava Monich
3221ab9512 Merge pull request #18 from sailfish-on-dontbeevil/branch-1.26
Update to Ofono 1.26
2022-01-08 04:27:59 +02:00
Marcel Holtmann
06b58a3650 Release 1.26 2022-01-05 12:55:41 +00:00
Marcel Holtmann
e834b8c1a8 mbimmodem: Convert back to using __builtin_bswap16 with proper indexing 2022-01-05 12:55:41 +00:00
Marcel Holtmann
c6eaa7f108 mbimmodem: Fix conversion of strings into UTF16-LE on big endian 2022-01-05 12:55:41 +00:00
Marcel Holtmann
ccf340a896 mbimmodem: Fix endian issue with UTF16-LE to UTF16-CPU conversion 2022-01-05 12:55:41 +00:00
Denis Kenzior
c8577e681b 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);
  ^
2022-01-05 12:55:41 +00:00
Nandini Rebello
64f833d351 udevng: enhance udev detection for intel 7xxx modems
Handle newer 7xxx modem enumeration based on ProductId.
Preserving the previous gen support too.
2022-01-05 12:55:41 +00:00
Marcel Holtmann
0bd5121144 mbim: Add the missing mbim-private.h header into packages 2022-01-05 12:55:22 +00:00
Denis Kenzior
f7cd4d229f gemalto: Use GEMALTO vendor for netreg 2022-01-05 12:45:12 +00:00
Giacinto Cifelli
b55593d9ef atmodem: remove vendor Cinterion 2022-01-05 12:44:29 +00:00
Giacinto Cifelli
ab9fdb8af1 cinterion: use Gemalto vendor in netreg 2022-01-05 12:44:15 +00:00
Giacinto Cifelli
1daf3f62c2 atmodem: Change cinterion prefix to gemalto 2022-01-05 12:43:59 +00:00
Giacinto Cifelli
20359b88d2 atmodem: change vendor cinterion to gemalto 2022-01-05 12:42:49 +00:00
Giacinto Cifelli
4e1f39638d gemalto: Use Gemalto vendor for LTE atom 2022-01-05 12:41:51 +00:00
Jonas Bonn
22c5c3ae98 modem: global data is pre-zeroed
Module-local and global data are BSS symbols and don't require
zero-initialization.
2022-01-05 12:41:30 +00:00
Jonas Bonn
f3f3d6819d stkutil: remove test for impossible condition
'string' is an array and therefore never NULL so this test always fails.
2022-01-05 12:41:16 +00:00
Jonas Bonn
8934c398bb 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.
2022-01-05 12:40:39 +00:00
Jonas Bonn
14759305fd mbim: remove unused modem data
Neither the Vendor nor Model strings are used by the mbim plugin.
2022-01-05 12:40:17 +00:00
Giacinto Cifelli
df160a28f7 doc/common-patterns.txt: initial version 2022-01-05 12:35:39 +00:00
Denis Kenzior
90cc6a3862 atmodem: Make sure to use none_prefix
Otherwise all unsolicited notifications would also be consumed when
invoking +CGAUTH/+CGDCONT
2022-01-05 12:35:16 +00:00
Giacinto Cifelli
9176411489 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>
2022-01-05 12:35:03 +00:00
Giacinto Cifelli
c470ab5043 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.
2022-01-05 12:34:51 +00:00
Giacinto Cifelli
9c092bbe72 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.
2022-01-05 12:34:35 +00:00
Giacinto Cifelli
2c41120b78 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.
2022-01-05 12:34:07 +00:00
Giacinto Cifelli
88342a037c atmodem: added Gemalto vendor quirk for +CNMI 2022-01-05 12:32:25 +00:00
Giacinto Cifelli
75ff3e7bbf 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
2022-01-05 12:32:09 +00:00
Giacinto Cifelli
6abd0106b9 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.
2022-01-05 12:31:51 +00:00
Denis Kenzior
85f9307c71 lte: Add additional sanity checks for username/password 2022-01-05 12:31:35 +00:00
Giacinto Cifelli
c5f48019ff 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>
2022-01-05 12:31:18 +00:00
Giacinto Cifelli
efa0627332 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>
2022-01-05 12:31:02 +00:00
Denis Kenzior
35e8201e96 doc: Mark new properties experimental
Just in case we need to redesign these in the near future
2022-01-05 12:30:32 +00:00
Giacinto Cifelli
b465782a10 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>
2022-01-05 12:30:07 +00:00
Denis Kenzior
557f907b27 AUTHORS: Mention Giacinto's contributions 2022-01-05 12:29:54 +00:00
Giacinto Cifelli
9a354879d3 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.
2022-01-05 12:29:38 +00:00
Giacinto Cifelli
e6799aacc9 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.
2022-01-05 12:26:56 +00:00
Jonas Bonn
f5d78b7e2f 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...
2022-01-05 12:26:25 +00:00
Jonas Bonn
8fde6264c8 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.
2022-01-05 12:26:09 +00:00
Nandini Rebello
eb8371b02d test: add support for new languages
Adding new language support to set "alphabet" parameter.
2022-01-05 12:25:47 +00:00
Nandini Rebello
3b2bfa8943 sms: support 8 national lang in Alphabet property
Adding support for 8 additional languages for GSM 7 bit.
2022-01-05 12:15:23 +00:00
Nandini Rebello
d2e46f9a5f util: adding 8 national sms alphabets
Adding national language tables for hindi,kannada,malayalam,
oriya,punjabi,tamil,telugu and urdu.
2022-01-05 12:13:44 +00:00
Nandini Rebello
9b3ba1a2f0 doc: add support for 8 additional sms alphabets
Adding support for hindi,kannada,malayalam,oriya,punjabi,tamil,
telugu and urdu for GSM 7 bit.
2022-01-05 12:13:31 +00:00
Denis Kenzior
b36b0d86f6 xmm7modem: Fix memory leak in netmon 2022-01-05 12:13:17 +00:00
Denis Kenzior
655dd9ab5a phonesim: Fix memory leak 2022-01-05 12:13:00 +00:00
Nandini Rebello
74017fe30f 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.
2022-01-05 12:12:43 +00:00
Giacinto Cifelli
022b31b075 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
2022-01-05 12:09:50 +00:00
Giacinto Cifelli
6674cc3340 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
2022-01-05 11:45:38 +00:00
Antara
a850fd8978 netmon: Enabled netmon atom for xmm7modem plugin
enabling netmon atom to report current serving cell measurements
for xmm7modem
2022-01-05 11:45:38 +00:00
Antara
c006d8b5ce netmon: Added netmon driver for xmm7modem
adding netmon driver for xmm7modem which uses intel proprietary
AT command +XMCI
2022-01-05 11:45:38 +00:00
Giacinto Cifelli
bf8e09da98 file-provision: support for auth type of NONE 2022-01-05 11:45:38 +00:00
Giacinto Cifelli
e60c6b16ff 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.
2022-01-05 11:36:53 +00:00
Giacinto Cifelli
c2dd50232f connman-api: added "none" auth_method 2022-01-05 11:36:53 +00:00
Giacinto Cifelli
fff50b8670 gatchat: support for auth NONE
Added authentication method G_AT_PPP_AUTH_METHOD_NONE and its handling.
2022-01-05 11:36:53 +00:00
Anirudh Gargi
0dd2d4874a xmm7xxx: enable sms and phonebook support 2022-01-05 11:36:53 +00:00
Denis Kenzior
b0e79b7564 AUTHORS: Mention Nandini's contributions 2022-01-05 11:36:53 +00:00
Nandini Rebello
e7f7197e5f test: Add test script to set sms alphabet 2022-01-05 11:36:53 +00:00
Nandini Rebello
fea0b49834 util: add bengali and gujrati sms alphabets 2022-01-05 11:36:53 +00:00
Nandini Rebello
e67bf1c41c doc: add support for 2 additional sms alphabets
Adding support for bengali and gujrati for GSM 7 bit.
2022-01-05 11:36:53 +00:00
Anirudh Gargi
3a5feec41d 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]: +++++++++++++++++++++++++++
2022-01-05 11:36:53 +00:00
Anirudh Gargi
8457376df4 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.
2022-01-05 11:36:53 +00:00
Adam Pigg
2aed406a96 network: add support eutran sms only states
EUTRAN SMS states mapped to registered and roaming respectively.
2022-01-05 11:36:49 +00:00
Anirudh Gargi
9ec0f966ef doc: Clarify LTE registration status documentation 2022-01-05 10:18:59 +00:00
Slava Monich
81b1bf3943 [packaging] Detect rpm version at build time. JB#55991 2021-12-17 13:56:07 +02:00
Slava Monich
c1bdd87f22 [unit] Avoid using g_key_file_save_to_file
Its use in a unit test is not significant enough to introduce
glib >= 2.40 requirement
2021-12-17 13:55:22 +02:00
Slava Monich
a796f670e1 [ofono] Fixed a few compilation warnings
plugins/cellinfo-netmon.c: In function 'cellinfo_netmon_notify':
plugins/cellinfo-netmon.c:85:44: warning: '%0*d' directive output may be truncated writing between 1 and 2147483647 bytes into a region of size 3 [-Wformat-truncation=]
     snprintf(s_mnc, OFONO_MAX_MNC_LENGTH, "%0*d",
                                            ^~~~
plugins/cellinfo-netmon.c:85:43: note: directive argument in the range [0, 999]
     snprintf(s_mnc, OFONO_MAX_MNC_LENGTH, "%0*d",
                                           ^~~~~~

src/gprs-provision.c: In function 'ofono_gprs_provision_get_settings':
src/gprs-provision.c:60:2: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
  if (mcc == NULL || strlen(mcc) == 0 || mnc == NULL || strlen(mnc) == 0)
  ^

plugins/generic-phonebook.c: In function 'export_entries':
plugins/generic-phonebook.c:942:2: warning: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
  if (strcmp(storage, "SM") != 0) {
  ^
2021-12-17 13:54:19 +02:00
Slava Monich
122998372d Merge pull request #16 from monich/cellinfo-netmon
Add ofono_cell_info based NetMon driver
2021-12-09 14:27:52 +02:00
Slava Monich
29a9190dce [plugins] Add ofono_cell_info based NetMon driver. JB#56038
Instantiate with ofono_netmon_create(modem, 0, "cellinfo", modem)
Requires slot driver to provide ofono_cell_info interface.
2021-12-09 14:21:39 +02:00
Slava Monich
3eba9c2518 Merge pull request #15 from monich/phonebook
Add generic phonebook plugin
2021-12-01 13:06:44 +02:00
Slava Monich
8bd27690bf [plugins] Add generic phonebook plugin. JB#55524
Instantiate with ofono_phonebook_create(modem, 0, "generic", modem)
2021-12-01 02:33:46 +02:00
Slava Monich
09074dc026 [include] Added ofono_slot_remove_all_handlers macro. JB#55524 2021-11-13 02:08:07 +02:00
Slava Monich
b6c5a7e33f [include] Define struct modem in types.h
Not having it defined prior to use may result in weird compilation
errors about pointer type being incompatible with iself, e.g.

expected struct ofono_modem * but argument is of type struct ofono_modem *
2021-11-05 15:11:30 +02:00
Slava Monich
9de9417ef1 [include] Defined enum ofono_call_mode. JB#55524
Just 'int type' gives no clue, which value means what.
2021-11-05 15:10:19 +02:00
Slava Monich
d5599452b4 Merge pull request #14 from monich/jb55900
[ofono] Pulled in a bug fix from upstream. JB#55900
2021-10-28 13:25:46 +03:00
Jimmy Gysens
b1f3d44524 gprs: clean context properly
After a context is detached, the context is not properly cleared. In
addition to releasing the context:

- Reset the context settings (IP, DNS, interface, ...).
- Signal the Active flag as false.
2021-10-28 02:58:52 +03:00
Slava Monich
14e0f4555b Merge pull request #12 from sailfishos/jb55010
BuildRequire systemd via pkgconfig
2021-10-12 18:28:34 +03:00
Björn Bidar
949878c201 [packaging] BuildRequire systemd via pkgconfig. JB#55010
This allows to pick systemd-mini inside the builder instead of full
systemd.
2021-10-12 17:57:01 +03:00
Slava Monich
2a21299b3d [radio-settings] Removed unreachable code 2021-10-12 00:38:16 +03:00
Slava Monich
76e2c4388c [ofono] Bump libglibutil requirement 2021-10-10 05:11:39 +03:00
Slava Monich
dfafcfc190 Merge pull request #11 from monich/modemwatch
Expose modem watch API to plugins
2021-10-08 13:07:45 +03:00
Slava Monich
c38df7dbf0 [ofono] Expose modem watch API to plugins. JB#54540 2021-10-08 03:39:47 +03:00
Slava Monich
a008c72abd Update upstream hash 2021-10-07 19:52:37 +03:00
Slava Monich
7794754b6a Merge pull request #9 from PsychoGame/ofono-new
[ofono] Update baseline to 1.25. JB#54354
2021-10-07 19:50:03 +03:00
Slava Monich
9c2ab0e1d8 [plugin] Disabled OFONO_API_SUBJECT_TO_CHANGE check in plugin.h
Sailfish OS APIs must remain backward compatible. That's not subject
to change.
2021-10-01 13:53:18 +03:00
Slava Monich
d87e925d57 Merge pull request #10 from monich/config
Do not require non-critical packages
2021-09-29 12:34:40 +03:00
Slava Monich
33744c5106 [ofono] Do not require non-critical packages. JB#55701
Recommend them instead (requires rpm 4.12)
2021-09-28 19:13:18 +03:00
Jan Jasper de Kroon
a68123c74b Merge branch 'sailfishos:master' into ofono-new 2021-09-20 17:38:41 +01:00
Slava Monich
1d35a2dc2d Merge pull request #8 from monich/signals
Fix a problem with D-Bus signal not being emitted
2021-09-17 12:42:08 +03:00
Jan Jasper de Kroon
fcd5ce0bdd Merge branch 'sailfishos:master' into ofono-new 2021-09-17 06:57:45 +01:00
Slava Monich
352bdf5a39 [unit] Test DefaultDataModemChanged signal. JB#55575 2021-09-17 02:25:57 +03:00
Slava Monich
d73d3e2e7f [ofono] Fixed a problem with D-Bus signal not being emitted. JB#55575
Whenever slot_manager_update_modem_paths() returns something non-zero,
corresponding D-Bus signals must be emitted.
2021-09-17 02:25:43 +03:00
Slava Monich
38a83d3c18 [ofono] Added debug trace 2021-09-16 20:28:42 +03:00
Slava Monich
5b175c2877 [unit] Fixed coverage script
It was broken by removal of ril plugin.
2021-09-16 19:59:06 +03:00
Slava Monich
52bb7b3295 [unit] Added back test-conf
It was accidentally removed earlier.
2021-09-16 19:57:18 +03:00
Marcel Holtmann
024cce6145 Release 1.25 2021-09-15 19:26:53 +02:00
Pavel Machek
4d537b3234 udevng: Move debug print to more useful place
in setup_gobi()
2021-09-15 19:24:56 +02:00
Pavel Machek
a96228731f doc: Fix typo in location-reporting-api.txt 2021-09-15 19:24:21 +02:00
Pavel Machek
5023d59bc5 test: Better help for delivery reports
Explain "delivery report" parameter in send-sms.
2021-09-15 19:23:37 +02:00
Anirudh Gargi
51c83a9837 atmodem: add EUTRAN tech for creg read status
Add handling for CREG's status to get the technology type. CREG
notify URC does not need additional handling as 'AcT' is mapped
one-on-one to tech.
2021-09-15 19:22:54 +02:00
Giacinto Cifelli
d4599af851 atmodem/sms: no mms support for Gemalto 2021-09-15 19:21:58 +02:00
Giacinto Cifelli
67d401d1f8 gemalto: Use GEMALTO vendor for sms 2021-09-15 19:21:17 +02:00
Giacinto Cifelli
af7ba36e78 atmodem: change vendor CINTERION in GEMALTO in sms 2021-09-15 19:20:00 +02:00
Giacinto Cifelli
27ebe48759 gemalto: Use GEMALTO vendor instead of CINTERION
The sim atom is now created with the GEMALTO vendor instead of
CINTERION.  This is because GEMALTO has superceeded CINTERION and the
gemalto plugin will be updated to handle (legacy) modems from cinterion
as well as current gemalto devices.
2021-09-15 19:19:21 +02:00
Giacinto Cifelli
bafb4c2c31 atmodem: change vendor CINTERION to GEMALTO in sim 2021-09-15 19:17:54 +02:00
Giacinto Cifelli
7a12dd7ac7 atmodem: added Gemalto vendor to CBS CSCB logic 2021-09-15 19:17:15 +02:00
Giacinto Cifelli
61ea242ce6 lte: add implementation for ofono_lte_get_modem 2021-09-15 19:16:32 +02:00
Giacinto Cifelli
d4a0dd4efc include: add ofono_lte_get_modem global function
this function can be used in the drivers to query the functions
ofono_modem_get_* to retrieve modem-specific properties
2021-09-15 19:14:02 +02:00
Giacinto Cifelli
d6d0ee296d lte: clarify failed registration message 2021-09-15 19:13:01 +02:00
Marcel Holtmann
3575ce6a2d build: Remove setup of thread support 2021-09-15 19:10:42 +02:00
Giacinto Cifelli
f8bdf3cd4e gprs: make sure that the context is properly released 2021-09-15 19:00:01 +02:00
Giacinto Cifelli
b4f200efc7 atmodem/sms: Do not print an error message incorrectly
add missing return in at_cmt_notify.  Without it an error message was
generated in all cases, even successful ones.
2021-09-15 18:58:18 +02:00
Giacinto Cifelli
758210a774 mbim: fix calling mbim_sms_exit instead of _init 2021-09-15 18:57:26 +02:00
Giacinto Cifelli
75c85ee49a tools: remove calls to g_thread_init 2021-09-15 18:56:44 +02:00
Giacinto Cifelli
b7a3fce633 main: Remove call to g_thread_init
according to g_thread documentation, this call is no longer needed,
and starting from g_thread version 2.32 it must not be used
2021-09-15 18:56:00 +02:00
Giacinto Cifelli
3b2945f3ff gprs: Fix use of invalid operator for bitwise flags 2021-09-15 18:54:57 +02:00
Giacinto Cifelli
fa3875693b atmodem: added vendor Gemalto 2021-09-15 18:54:15 +02:00
Giacinto Cifelli
92e8e6604c doc: fix typo in doc/emergency-call-handling.txt 2021-09-15 18:53:15 +02:00
Anirudh Gargi
9ca9dc545e udev:fix seg fault in case of vid and pid is NULL
In some case linux report 'driver' as valid yet vid and pid as NULL.
Adding NULL check to prevent seg fault.

Log:
ofonod[23829]: plugins/udevng.c:udev_start()
ofonod[23829]: plugins/udevng.c:enumerate_devices()
ofonod[23829]: plugins/udevng.c:check_usb_device() hub [1d6b:0002]
ofonod[23829]: plugins/udevng.c:check_usb_device() usb [1d6b:0002]
ofonod[23829]: plugins/udevng.c:check_usb_device() usbhid [03f0:034a]
ofonod[23829]: plugins/udevng.c:check_usb_device() usbhid [03f0:034a]
ofonod[23829]: plugins/udevng.c:check_usb_device() usb [1d6b:0002]
ofonod[23829]: plugins/udevng.c:check_usb_device() cdc_acm [(null):(null)]
ofonod[23829]: Aborting (signal 11) [./src/ofonod]
2021-09-15 18:52:34 +02:00
Christophe Ronco
69b6338baa qmimodem: fix roaming status report
Problem seen with a MC7304 modem and a roaming SIM card.
Status in org.ofono.NetworkRegistration properties ends up in "registered"
instead of roaming. Both AT command and qmicli indicates we are roaming.

What's happening is the following:

1) first QMI_NAS_SS_INFO_IND indicating we are registered contains a
QMI_NAS_RESULT_ROAMING_STATUS parameter.
Parameter inside says we are roaming and qmimidem driver correctly reports
status NETWORK_REGISTRATION_STATUS_ROAMING.
2) other QMI_NAS_SS_INFO_IND arrive, saying we are registered without
QMI_NAS_RESULT_ROAMING_STATUS parameter.
Driver reports NETWORK_REGISTRATION_STATUS_REGISTERED.

Extract of traces with QMI binary debug interpreted (as far as I can...):
a) first "searching" indication
ofonod[855]: QMI: < 01 3b 00 80 03 01 04 00 00 24 00 2f 00
29 05 00 d0 00 14 00 00 MCC:208 MNC:20
22 05 00 01 02 00 01 00 Detailed Service Status:
                        QMI_NAS_SERVICE_STATUS_LIMITED,
                        QMI_NAS_NETWORK_SERVICE_DOMAIN_PS, ...
15 03 00 01 08 01 LTE, no roaming
12 05 00 d0 00 14 00 00 Current PLMN: MCC:208 MNC:20, no desc
11 01 00 00
10 01 00 01 No roaming
01 06 00 02 02 02 02 01 08 NAS_REGISTRATION_STATE_NOT_REGISTERED_SEARCHING,
                           CS detached, PS detached, NETWORK_TYPE_3GPP,
                           QMI_NAS_RADIO_INTERFACE_LTE
ofonod[855]: QMI: NAS_ind msg=36 len=47 [client=1,type=4,tid=0,len=59]
ofonod[855]: QMI: {type=41,len=5} {type=34,len=5} {type=21,len=3}
             {type=18,len=5}
ofonod[855]: QMI: {type=17,len=1} {type=16,len=1} {type=1,len=6}
ofonod[855]: ofono_netreg_status_notify modem /sierra_0 status 2 lac -1
             cellid -1 tech 7

b) second "searching" indication
ofonod[855]: QMI: < 01 21 00 80 03 01 04 00 00 24 00 15 00
22 05 00 03 03 00 01 00 Detailed Service Status:
                        QMI_NAS_SERVICE_STATUS_LIMITED_REGIONAL, CS_PS, ...
11 01 00 00
01 06 00 02 02 02 02 01 08 NAS_REGISTRATION_STATE_NOT_REGISTERED_SEARCHING,
                           CS detached, PS detached, NETWORK_TYPE_3GPP,
                           QMI_NAS_RADIO_INTERFACE_LTE

ofonod[855]: QMI: NAS_ind msg=36 len=21 [client=1,type=4,tid=0,len=33]
ofonod[855]: QMI: {type=34,len=5} {type=17,len=1} {type=1,len=6}

c) First indication while "registered"
ofonod[855]: QMI: < 01 5e 00 80 03 01 04 00 00 24 00 52 00
2a 01 00 00
29 05 00 d0 00 14 00 00 MCC:208 MNC:20
28 02 00 15 01 UMTS Primary Scrambling Code
26 08 00 03 00 00 00 03 00 00 00 CS: all calls allowed,
                                 PS: all calls allowed
22 05 00 02 03 00 01 00 Detailed Service Status:
                        QMI_NAS_SERVICE_STATUS_AVAILABLE, CS_PS, ...
1e 04 00 f7 00 95 04 CID 3GPP
1d 02 00 fb 50 LAC 3GPP
15 03 00 01 05 00 UMTS: roaming
12 05 00 d0 00 14 00 00 Current PLMN: MCC:208 MNC:20, no desc
11 04 00 03 03 04 05
10 01 00 00 ROAMING ON
01 06 00 01 01 01 02 01 05 NAS_REGISTRATION_STATE_REGISTERED, CS attached,
                           PS attached, NETWORK_TYPE_3GPP,
                           QMI_NAS_RADIO_INTERFACE_UMTS
ofonod[855]: QMI: NAS_ind msg=36 len=82 [client=1,type=4,tid=0,len=94]
ofonod[855]: QMI: {type=42,len=1} {type=41,len=5} {type=40,len=2}
             {type=38,len=8}
ofonod[855]: QMI: {type=34,len=5} {type=30,len=4} {type=29,len=2}
             {type=21,len=3}
ofonod[855]: QMI: {type=18,len=5} {type=17,len=4} {type=16,len=1}
             {type=1,len=6}
ofonod[855]: ofono_gprs_status_notify modem /sierra_0 status 1

==================> ROAMING status reported <==========================
ofonod[855]: ofono_netreg_status_notify modem /sierra_0 status 5 lac 20731
             cellid 76873975 tech 2

d) second indication while "registered"
ofonod[855]: QMI: < 01 31 00 80 03 01 04 00 00 24 00 25 00
29 05 00 d0 00 14 00 00 MCC:208 MNC:20
28 02 00 15 01 UMTS Primary Scrambling Code
12 05 00 d0 00 14 00 00 Current PLMN: MCC:208 MNC:20, no desc
11 04 00 03 03 04 05
01 06 00 01 01 01 02 01 05 NAS_REGISTRATION_STATE_REGISTERED, CS attached,
                           PS attached, NETWORK_TYPE_3GPP,
                           QMI_NAS_RADIO_INTERFACE_UMTS
ofonod[855]: QMI: NAS_ind msg=36 len=37 [client=1,type=4,tid=0,len=49]
ofonod[855]: QMI: {type=41,len=5} {type=40,len=2} {type=18,len=5}
                  {type=17,len=4}
ofonod[855]: QMI: {type=1,len=6}
==================> ROAMING information lost <==========================
ofonod[855]: ofono_netreg_status_notify modem /sierra_0 status 1 lac -1
             cellid -1 tech 2

I can't tell if not having the ROAMING_STATUS parameter in all indication
is something happening only on MC7304 or if it happens on all "QMI" modems.

I have also seen (on MC7430, with a roaming SIM card):
 - first notification indicating status
QMI_NAS_REGISTRATION_STATE_SEARCHING and roaming ON
 - following notifications indicating status
QMI_NAS_REGISTRATION_STATE_REGISTERED and no roaming notification

So we must handle roaming information even when not registered.
2021-09-15 18:51:39 +02:00
Denis Kenzior
bef7e690b5 AUTHORS: Mention Julien's contributions 2021-09-15 18:50:45 +02:00
Julien Tournier
5a4923261a atmodem: Handle cinterion modems compliant with 27.005 2021-09-15 18:45:17 +02:00
Martin Hundebøll
05c2185163 atmodem: add Quectel M95 special case for PIN query
The AT command reference for Quectel M95 specifies that remaining SIM
pin retires can be queried using AT+QTRPIN, which responds with one
count for each pin-type:

+QTRPIN: 3,3,10,10

After entering the PIN code, enable an extra AT+CPIN? for the M95
vendor.
2021-09-15 18:40:51 +02:00
Denis Kenzior
2da2e87b76 AUTHORS: Mention Martin's contributions 2021-09-15 18:39:12 +02:00
Martin Hundebøll
8ca429b2c1 udevng: fix removal of serial devices
Since the merge of udev.c into udevng.c all cleanup function must handle
both usb devices and serial devices. Add this distinction to
check_remove(), so that is doesn't try to iterate the .serial member as
if it were a .devices list.
2021-09-15 18:38:24 +02:00
Giacinto Cifelli
dbcf6e269d ublox: Add voicecall support 2021-09-15 18:37:30 +02:00
Christophe Ronco
061c743837 huawei: use VENDOR_HUAWEI quirk on gprs context creation 2021-09-15 18:35:47 +02:00
Christophe Ronco
b908289e32 atmodem: Add gprs-context quirk for HUAWEI vendor
When ofono dies while connected using PPP, modem AT channel is not put
back to command mode (tested with HUAWEI modems E3372 and MS2372).
If ofono is restarted, it won't be able to connect as it gets no answer
to AT commands on this AT channel.
This patch adds a quirk to immediately send escape sequence on modem
channel when gprs-context atom is removed.
2021-09-15 18:33:58 +02:00
Denis Kenzior
d4220f7223 udevng: Fix SIM900 detection 2021-09-15 18:22:41 +02:00
Denis Kenzior
4ddff7658f mbim: Remove useless debug 2021-09-15 18:21:46 +02:00
Slava Monich
09e6f35a23 [ofono] Replace built-in ril plugin with the external one. JB#55027 2021-09-15 03:02:16 +03:00
Slava Monich
6dddf527d5 Merge pull request #7 from monich/double-free
Fix double-free
2021-09-14 17:01:57 +03:00
Slava Monich
a9de07c2bb [ril] Fix double-free. JB#55547 2021-09-14 16:43:36 +03:00
Slava Monich
ecf14f5165 Merge pull request #4 from monich/ril-split
Make more APIs available to external plugins
2021-09-13 17:51:42 +03:00
Slava Monich
bc4c860a86 [ofono] Make more APIs available to external plugins. JB#55027
This allows to build Jolla ril driver as an external dynamically
loadable plugin.
2021-09-13 16:32:33 +03:00
Slava Monich
7684dd4295 Housekeeping 2021-09-13 14:32:44 +03:00
Slava Monich
f24a5be4ec Update upstream hash 2021-09-13 14:32:23 +03:00
Slava Monich
c45e207f12 Merge pull request #6 from PsychoGame/ofono-new
[ofono] Update baseline to 1.24. JB#54354
2021-09-13 14:26:53 +03:00
Marcel Holtmann
005f36bb89 Release 1.24 2021-09-07 21:48:50 +02:00
Marcel Holtmann
3d01485a05 gatchat: Use pragma to mask unknown pragma diagnostic options
gatchat/gatmux.c:33:32: error: unknown option after ‘#pragma GCC diagnostic’ kind [-Werror=pragmas]
 #pragma GCC diagnostic ignored "-Wcast-function-type"
                                ^~~~~~~~~~~~~~~~~~~~~~
2021-09-07 21:43:31 +02:00
Marcel Holtmann
cc7b30414f rilmodem: Use pragma to mask restrict buffer warnings
In file included from drivers/rilmodem/network-registration.c:40:
drivers/rilmodem/network-registration.c: In function ‘ril_cops_list_cb’:
./gril/gril.h:98:11: error: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Werror=restrict]
   sprintf(print_buf, x);  \
           ^~~~~~~~~
drivers/rilmodem/network-registration.c:583:3: note: in expansion of macro ‘g_ril_append_print_buf’
   g_ril_append_print_buf(nd->ril, "%s [lalpha=%s, salpha=%s, "
   ^~~~~~~~~~~~~~~~~~~~~~
./gril/gril.h:98:11: error: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Werror=restrict]
   sprintf(print_buf, x);  \
           ^~~~~~~~~
drivers/rilmodem/network-registration.c:593:2: note: in expansion of macro ‘g_ril_append_print_buf’
  g_ril_append_print_buf(nd->ril, "%s}", print_buf);
  ^~~~~~~~~~~~~~~~~~~~~~

In file included from drivers/rilmodem/call-forwarding.c:41:
drivers/rilmodem/call-forwarding.c: In function ‘ril_query_call_fwd_cb’:
./gril/gril.h:98:11: error: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Werror=restrict]
   sprintf(print_buf, x);  \
           ^~~~~~~~~
drivers/rilmodem/call-forwarding.c:114:3: note: in expansion of macro ‘g_ril_append_print_buf’
   g_ril_append_print_buf(fd->ril, "%s [%d,%d,%d,%s,%d]",
   ^~~~~~~~~~~~~~~~~~~~~~
./gril/gril.h:98:11: error: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Werror=restrict]
   sprintf(print_buf, x);  \
           ^~~~~~~~~
drivers/rilmodem/call-forwarding.c:124:2: note: in expansion of macro ‘g_ril_append_print_buf’
  g_ril_append_print_buf(fd->ril, "%s}", print_buf);
  ^~~~~~~~~~~~~~~~~~~~~~
2021-09-07 21:42:45 +02:00
Marcel Holtmann
1617b325de gatchat: Use pragma to mask GFunc casting warning
gatchat/gatmux.c: In function ‘watch_dispatch’:
gatchat/gatmux.c:454:17: error: cast between incompatible function types from ‘GSourceFunc’ {aka ‘int (*)(void *)’} to ‘gboolean (*)(GIOChannel *, GIOCondition,  void *)’ {aka ‘int (*)(struct _GIOChannel *, enum <anonymous>,  void *)’} [-Werror=cast-function-type]
  GIOFunc func = (GIOFunc) callback;
                 ^
2021-09-07 21:42:01 +02:00
Antara Borwankar
a8838c2287 atmodem: Support ETWS & CMAS on XMM series modems 2021-09-07 21:40:49 +02:00
Denis Kenzior
c8cd552851 sim: Fix not updating sim pin state
In case we try to enter the PIN/PUK and fail to enter a correct code,
the PIN/PUK retries are not rechecked as they should be.

Reported by: Florent Beillonnet <florent.beillonnet@gmail.com>
2021-09-07 21:39:55 +02:00
Denis Kenzior
6995d8c42c AUTHORS: Mention Florent's contributions 2021-09-07 21:38:21 +02:00
Florent Beillonnet
17052d41de atmodem: Fix at_pin_send_puk userdata use
It seems that the function at_pin_send_puk should have been changed
along with at_pin_send, because it's also refering to the
at_pin_send_cb callback

See this commit : ba9f126716db3ae0bf6a3139088d9657cfb8b851
2021-09-07 21:37:38 +02:00
Denis Kenzior
70a93dcc5b gemalto: Whitespace fixes 2021-09-07 21:36:40 +02:00
Denis Kenzior
e3ea3abaa0 AUTHORS: Mention Varun's contributions 2021-09-07 21:36:00 +02:00
Varun Gargi
f60c44b034 udevng: remove vendor ID to make it generic for intel modem 2021-09-07 21:35:00 +02:00
James Prestwood
a679258b4a plugins: fixed crash in udevng
The return value from ofono_modem_register was not being checked. If this fails
the modem object is not setup and causes a crash. This was specifically seen
when using the mbim driver without having configured with mbim support.

Now the modem object gets destroyed properly if the modem registration fails.
2021-09-07 21:33:59 +02:00
Bob Ham
0ed72bcffa sim7100: Specify vendor ID while creating voicecall driver
This enables the atmodem voicecall driver to handle SIMCom quirks like
not setting AT+COLP=1.
2021-09-07 21:30:55 +02:00
Bob Ham
7d5a660604 atmodem: Don't set AT+COLP=1 on SIMCom modems
On the SIMCom SIM7100E, setting AT+COLP=1 causes there to be no
response at all from "ATD...;" commands until the call is answered.
The results in oFono stalling rather than creating a new VoiceCall
object.

We fix this by adding SIMCOM to the list of vendors for whom we set
AT+COLP=0 rather than AT+COLP=1.
2021-09-07 21:30:08 +02:00
Denis Kenzior
d67240c717 AUTHORS: Mention Bob's contributions 2021-09-07 21:26:39 +02:00
Bob Ham
b12016eb45 plugins: Add support for SIM7100E by SIMCom
Add support for the SIM7100E modem.  We add a new "sim7100" plugin
because there's no other AT-based modem that has support for both GPRS
and voice calls.
2021-09-07 21:25:40 +02:00
Denis Kenzior
bfec98afdf unit: Fix gcc warning
In file included from unit/test-mbim.c:28:0:
unit/test-mbim.c: In function ‘parse_device_caps’:
unit/test-mbim.c:332:9: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
  assert(cellular_class = 1);
2021-09-07 21:14:10 +02:00
Mark van der Putten
7376781211 gemalto: signal sim initialized
Modem type PLS8-E, firmware 03.017
2021-09-07 21:11:23 +02:00
Christophe Ronco
732160519a qmi: report SIM not inserted when unable to get PIN type 2021-09-07 21:08:55 +02:00
Christophe Ronco
f71d2a2b70 qmi: report failure or retry in case of invalid pin type
QMI_UIM_GET_CARD_STATUS is retried in more error cases
when trying to get password type.
In case of failure, driver report an error instead of
OFONO_SIM_PASSWORD_INVALID. This avoids a crash.
2021-09-07 21:08:08 +02:00
Christophe Ronco
793e9fcae4 qmi: use right slot and application during SIM detection
Use right slot and application to get card status, PIN status and PIN
retries. Without this patch, SIMs where selected application and slot
numbers are different are not detected.
2021-09-07 21:07:08 +02:00
Jonas Bonn
ae204ebf82 qmi: make services always shared 2021-09-07 21:05:05 +02:00
Jonas Bonn
30b09b35af gobi: Update to the new version_list changes 2021-09-07 21:03:54 +02:00
Jonas Bonn
1495f222b0 qmi: make version_list private 2021-09-07 21:02:38 +02:00
Jonas Bonn
b9b2765b21 qmi: assume version_list is up to date
The way things are currently coded, the gobi plugin calls
qmi_device_discover and does nothing else until it succeeds.  As such,
we can safely assume that the version_list is set up when we go to
create a service.
2021-09-07 20:59:42 +02:00
Jonas Bonn
29ecf1a59a qmi: drop header output parameter from request_alloc
The only thing this output parameter is being used for now is for
getting the transaction ID.  Return the TID directly from
__submit_requesta and drop the 'head' parameter altogether.
2021-09-07 20:58:52 +02:00
Jonas Bonn
f1d3367e0a qmi: request_alloc has no meaningful failure path
The only way request_alloc can fail is if one of the memory allocation
routines fail to allocate memory.  However, Linux memory allocation
doesn't really fail in this manner; memory can be overcommited and the
out-of-memory reaper will take care of re-establishing the balance when
excess memory is actually accessed.

Given this, request_alloc will never return anything other than success
and the failure paths will never be exercised.
2021-09-07 20:58:07 +02:00
Jonas Bonn
7131403177 qmi: unify common request header setup
The service and control requests differ slightly in their headers, but
this difference is minor enough that we can handle it directly in the
request submission routine.  This patch unifies the header setup for the
two request types.
2021-09-07 20:54:58 +02:00
Jonas Bonn
ff99f16ccb qmi: remove headroom parameter from req_alloc
The headroom can be established from the service type, so it's redundant
to pass it as a parameter.
2021-09-07 20:54:12 +02:00
Jonas Bonn
ccec9504a5 qmi: remove unused fields of service_send_data
After setting up the request structure, qmi_service_send makes no
further use of the 'param' and 'service' fields of the service_send_data
structure.  This patch removes those fields and frees 'param'
immediately after the request has been allocated and the parameter data
thereby copied into the send buffer.
2021-09-07 20:52:21 +02:00
Bassem Boubaker
e37ca6d384 gemalto: Clarify supported modem family name
Some gemalto modem family share almost the same base except some very
specific AT command and some hardware changes like ALSx and PXSx family
2021-09-07 20:49:34 +02:00
Mariem Cherif
ab5b76d6cf gemalto: handle sim is inserted or removed URCs 2021-09-07 20:48:14 +02:00
Denis Kenzior
35ef8fb8a1 qmi: Fix uninitialized value use
==2870== Conditional jump or move depends on uninitialised value(s)
==2870==    at 0x4C2ED31: __memcmp_sse4_1 (vg_replace_strmem.c:972)
==2870==    by 0x4F451A: sim_pin_retries_query_cb (sim.c:462)
==2870==    by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870==    by 0x45544A: service_send_callback (qmi.c:2143)
==2870==    by 0x452D00: handle_packet (qmi.c:815)
==2870==    by 0x452E85: received_data (qmi.c:863)
==2870==    by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x4C680B: main (main.c:256)
==2870==  Uninitialised value was created by a stack allocation
==2870==    at 0x459B1A: query_pin_retries_cb (sim.c:531)
==2870==
==2870== Conditional jump or move depends on uninitialised value(s)
==2870==    at 0x4F451D: sim_pin_retries_query_cb (sim.c:462)
==2870==    by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870==    by 0x45544A: service_send_callback (qmi.c:2143)
==2870==    by 0x452D00: handle_packet (qmi.c:815)
==2870==    by 0x452E85: received_data (qmi.c:863)
==2870==    by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x4C680B: main (main.c:256)
==2870==  Uninitialised value was created by a stack allocation
==2870==    at 0x459B1A: query_pin_retries_cb (sim.c:531)
==2870==
==2870== Conditional jump or move depends on uninitialised value(s)
==2870==    at 0x4F3DFB: get_pin_retries (sim.c:278)
==2870==    by 0x4F4553: sim_pin_retries_query_cb (sim.c:467)
==2870==    by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870==    by 0x45544A: service_send_callback (qmi.c:2143)
==2870==    by 0x452D00: handle_packet (qmi.c:815)
==2870==    by 0x452E85: received_data (qmi.c:863)
==2870==    by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x4C680B: main (main.c:256)
==2870==  Uninitialised value was created by a stack allocation
==2870==    at 0x459B1A: query_pin_retries_cb (sim.c:531)
==2870==
==2870== Conditional jump or move depends on uninitialised value(s)
==2870==    at 0x4F3E65: get_pin_retries (sim.c:288)
==2870==    by 0x4F4553: sim_pin_retries_query_cb (sim.c:467)
==2870==    by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870==    by 0x45544A: service_send_callback (qmi.c:2143)
==2870==    by 0x452D00: handle_packet (qmi.c:815)
==2870==    by 0x452E85: received_data (qmi.c:863)
==2870==    by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x4C680B: main (main.c:256)
==2870==  Uninitialised value was created by a stack allocation
==2870==    at 0x459B1A: query_pin_retries_cb (sim.c:531)
2021-09-07 20:46:23 +02:00
Denis Kenzior
d0a617d469 qmi: Fix memory leak
==14399== 28 bytes in 4 blocks are definitely lost in loss record 151 of 390
==14399==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==14399==    by 0x209065: convert_gsm_to_utf8_with_lang (util.c:651)
==14399==    by 0x2091D1: convert_gsm_to_utf8 (util.c:690)
==14399==    by 0x22DDA7: ussd_decode (smsutil.c:4738)
==14399==    by 0x18BF71: qmi_ussd_request (ussd.c:233)
==14399==    by 0x2183EA: ussd_initiate (ussd.c:614)
==14399==    by 0x27B6C8: process_message (object.c:259)
==14399==    by 0x27D1CD: generic_message (object.c:1070)
==14399==    by 0x5170732: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.14)
==14399==    by 0x5161D83: dbus_connection_dispatch (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.14)
==14399==    by 0x27907C: message_dispatch (mainloop.c:72)
==14399==    by 0x4E826A9: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
2021-09-07 20:06:26 +02:00
Denis Kenzior
1ba3b32273 qmi: Fix memory leak
==14399== 16 bytes in 8 blocks are definitely lost in loss record 132 of 390
==14399==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==14399==    by 0x59E03D9: strndup (strndup.c:43)
==14399==    by 0x18277E: qmi_result_get_string (qmi.c:1794)
==14399==    by 0x184221: get_ids_cb (devinfo.c:129)
==14399==    by 0x18353B: service_send_callback (qmi.c:2286)
==14399==    by 0x18093C: handle_packet (qmi.c:831)
==14399==    by 0x180ADD: received_data (qmi.c:880)
==14399==    by 0x4E826A9: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399==    by 0x4E82A5F: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399==    by 0x4E82D81: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399==    by 0x201900: main (main.c:306)
2021-09-07 20:05:00 +02:00
Gabriel Lucas
14b764ac64 gemalto: support ALS3 in gemalto's plugin
Force serial port opening options
Wait for modem to be ready to start
initializing it
Handle LTE
2021-09-07 20:03:52 +02:00
Bassem Boubaker
b808bfad17 gemalto: Add more details in setup_gemalto comment
ALS3, PLS8-E and PLS8-X have same vid/pid with same enumeration process
2021-09-07 19:53:46 +02:00
Denis Kenzior
82d62a8f50 AUTHORS: Mention Bassem's contributions 2021-09-07 19:52:07 +02:00
Bassem Boubaker
23d6263e3c cdma-netreg: Fix emission of PropertyChanged 2021-09-07 19:51:01 +02:00
Denis Kenzior
ac3192204c AUTHORS: Mention Mariem's contributions 2021-09-07 19:49:54 +02:00
Mariem Cherif
5ad2617ecd gemalto: acquire the network technology 2021-09-07 19:48:21 +02:00
Gabriel Lucas
890842b3af gemalto: add detection of ALS3 modem
The product ID is added to the list of
modems to be detected by Ofono.
The gemalto plugin is used to handle the
ALS3 modem.
2021-09-07 19:47:25 +02:00
Denis Kenzior
06de44299a plugins: Update to the new LTE API 2021-09-07 19:39:51 +02:00
Denis Kenzior
77b2eec613 ubloxmodem: Update to the new LTE API 2021-09-07 19:37:07 +02:00
Denis Kenzior
12ccd7cd46 rilmodem: Update to the new LTE API 2021-09-07 19:35:59 +02:00
Denis Kenzior
8f09880d52 qmimodem: Update to the new LTE API 2021-09-07 19:31:48 +02:00
Denis Kenzior
ee5f91221b atmodem: Update to the new lte API 2021-09-07 19:29:08 +02:00
Denis Kenzior
c03c6f4215 lte: update to the new API 2021-09-07 19:25:27 +02:00
Denis Kenzior
c49e2d8723 include: Add missing vendor parameter to lte atom 2021-09-07 19:13:37 +02:00
Slava Monich
deecd829a6 Merge pull request #5 from sailfishos/jb55388
Remove incorrect hardcoded tech value.
2021-09-07 16:49:39 +03:00
Matti Lehtimäki
3acf91c6a9 [ril] Remove incorrect hardcoded tech value. JB#55388 2021-09-06 20:44:26 +03:00
Marcel Holtmann
85b61c8964 call-forwarding: Increase string buffer to avoid overflow 2021-08-26 03:03:55 +03:00
Jonas Bonn
8986749585 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);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-08-26 03:03:55 +03:00
Juho Hämäläinen
1c0f5094a6 Merge pull request #3 from jusa/jb55276
Be less pedantic about ordering of speech codecs.
2021-08-25 17:00:06 +03:00
Juho Hämäläinen
4208b6d9ea [bluetooth] Be less pedantic about ordering of speech codecs. Fixes JB#55276
HFP spec 1.7.1 (4.34.1) says:

The Codec ID for the mandatory narrow band codec (CVSD) shall
always be included.

If wide band speech is supported, then the mandatory codec (mSBC)
shall be included unless it is temporarily unavailable.

Any other optional wide band speech codecs may also be included
in this list as long as the mandatory codec is included first.

---

The wording in spec is slightly vague on what the ordering of
mandatory narrow band codec (CVSD) and - IF wide band speech
is supported - mandatory wide band coded (mSBC) should be.
oFono's take is that the mandatory narrow band codec should
be listed first, and when mSBC is there oFono will abort the
connection.

To fix this we can be less pedantic about the ordering of
codecs - as long as the mandatory ones are there.
2021-08-25 16:32:55 +03:00
Frajo
59e304d474 Merge pull request #2 from krnlyng/jb55233
[packaging] Use transfiletriggerin to restart ofono when a plugin is installed. JB#55233
2021-08-25 16:02:24 +03:00
Frajo Haider
30a2424507 [packaging] Use transfiletriggerin to restart ofono when a plugin is installed. JB#55233 2021-08-24 13:29:18 +03:00
Slava Monich
e4f3ec6322 Merge pull request #1 from monich/start_block
Fix SIM I/O mess
2021-07-30 15:12:59 +03:00
Slava Monich
95fd4efc37 [simfs] Fix SIM I/O mess. JB#54380
Apparently all simfs reads from any blocks other than the very first one
were badly broken and could even cause a crash :|
2021-07-30 01:50:07 +03:00
Slava Monich
ef5ee98508 [ofono] Set destination for Unsubscribed signal. JB#50816 2021-06-10 18:00:39 +03:00
Slava Monich
4220e7d5e8 Merge branch 'dbus-clients-fixes' into 'master'
Resolve a few issues with cell info notifications

See merge request mer-core/ofono!286
2021-06-10 13:54:42 +00:00
Slava Monich
33c067a75f [ofono] Resolved a few issues with cell info notifications. JB#50816
1. Disable notifications from modem on unsibscribe
2. Made all signals unicast
3. Fixed a memory leak
2021-06-10 16:23:52 +03:00
Slava Monich
29616c04d0 [ofono] Fixed signal emission, reworked D-Bus client list. JB#50816
1. Exposed D-Bus clients list to plugin as ofono_dbus_clients
2. Signal has to be properly declared, otherwise it's not emitted
3. Added missing unit tests
2021-06-10 05:10:16 +03:00
Slava Monich
beb997d914 Merge branch 'jb50608-ondemand' into 'master'
Disable cell info updates when no one listens for them

See merge request mer-core/ofono!274
2021-06-10 01:58:05 +00:00
Slava Monich
cefc03e5ed Merge branch 'pcscf' into 'master'
Expose P-CSCF address(es) over D-Bus

See merge request mer-core/ofono!285
2021-06-03 21:29:06 +00:00
Slava Monich
85d99536ee Merge branch 'mtu' into 'master'
Don't limit MTU for non-MMS contexts

See merge request mer-core/ofono!284
2021-06-03 21:28:08 +00:00
Slava Monich
ea36baa4c1 [ril] Don't limit MTU for non-MMS contexts
Larger MTU means better throughput, and the original problem for which
this workaround was implemented was specific to MMS. There's no reason
to limit MTU for other data connections.
2021-06-03 19:49:38 +03:00
Slava Monich
b95a089c00 [ril] Provide P-CSCF address to the core. JB#48905
Also optimized reporting of DNS addresses by not setting empty lists.
If nothing else, that slightly reduces the amount of D-Bus traffic.
2021-06-03 19:36:52 +03:00
Slava Monich
c8dbf5494b [ofono] Expose P-CSCF address(es) via D-Bus. JB#48905 2021-06-03 19:01:01 +03:00
Slava Monich
cfb75f473d [sim] Fixed AID comparison. JB#54048
It worked only because aid was the first field in the struct.
2021-06-03 04:24:46 +03:00
Slava Monich
edd91c94eb Merge branch 'auth' into 'master'
Implement org.ofono.SimAuthentication interface

See merge request mer-core/ofono!283
2021-06-02 14:15:27 +00:00
Slava Monich
af0ab142e1 [ril] Implement org.ofono.SimAuthentication interface. JB#54048 2021-06-01 02:12:35 +03:00
Slava Monich
dffc04d404 [sim-auth] Support short AIDs. JB#54048
They can be shorter than 16 bytes.
2021-06-01 02:11:36 +03:00
Slava Monich
97b5fcbd87 [sim-auth] Parse auth response according to TS 31.102 2021-05-30 14:09:32 +03:00
Slava Monich
d7e740347f [sim-auth] Fill unused part of AID with FFs 2021-05-30 14:09:32 +03:00
Slava Monich
1116ca2481 [ril] Append ROOTMF path by default
Empty path never works and some RILs/modems don't like it so much
that it causes a reset.
2021-05-30 14:01:02 +03:00
Denis Grigorev
3d147843c4 [ril] Make cell info updates unicast. JB#50608 2021-05-28 16:25:42 +03:00
Denis Grigorev
c01dc63cbc [ril] Cell info consumer can unsubscribe from updates. JB#50608
Add a new org.nemomobile.ofono.CellInfo.Unsubscribe method. If it is called
ofono excludes the client from cell info consumers. The updates will be
disabled if no one client left.
2021-05-28 16:25:42 +03:00
Denis Grigorev
297926ed24 [ril] Enable cell info updates only when requested. JB#50608 2021-05-28 16:25:42 +03:00
Denis Grigorev
6ef1174ea8 [ril] Cell info updates can be disabled. JB#50608 2021-05-28 16:25:42 +03:00
Slava Monich
4ad02792db Merge branch 'omp-jb54420' into 'master'
[ril] Use ofono_sim_read_path() in case of reading EFpbr from USIM. Fixes JB#54420

See merge request mer-core/ofono!282
2021-05-25 23:50:07 +00:00
Bogdan Migunov
eddcb88af4 [ril] Use ofono_sim_read_path() in case of reading EFpbr from USIM. Fixes JB#54420
There is an issue when some of the Mediatek modems do not accept empty
path to the EFpbr file on the USIM and do reset themselves.
This fix appends usim_path to the GET DATA command when it comes to
exporting phonebook from SIM card and prevents crashes like described
one.
2021-05-25 19:18:57 +03:00
Denis Kenzior
f91df7f0fd simutil: Fix EF structure bit processing
The intent here was to find the contents of the 3 low order bits
according to Table 11-5 in ETSI 102.221.  However, the mask ended up
only grabbing the contents of the 2 low order bits.
2021-05-03 16:59:02 +03:00
Slava Monich
9d220ff9be [sim-auth] Only close open sessions
Session has to be open in order to have a valid session_id
2021-04-26 02:51:15 +03:00
Slava Monich
deefa2c454 [sim-auth] Remove watch if open_channel fails
Otherwise open_channel won't be called again after a failure.
2021-04-26 02:51:15 +03:00
Slava Monich
80224b283d Merge branch 'pcscf' into 'master'
Keep track of P-CSCF address

See merge request mer-core/ofono!281
2021-04-23 12:53:54 +00:00
Slava Monich
07e07b6ddc [ril] Keep track of P-CSCF address. JB#48905
And use IMS data profile for IMS data calls.
2021-04-23 15:14:36 +03:00
Slava Monich
bd836b4499 Merge branch 'misc' into 'master'
Miscellaneous mobile data issues

See merge request mer-core/ofono!280
2021-04-23 12:12:42 +00:00
Slava Monich
6c289b1432 [ril] Do not submit RIL_REQUEST_ALLOW_DATA if it's disabled 2021-04-16 03:13:16 +03:00
Slava Monich
296e46487f [ril] Cancel RIL_REQUEST_ALLOW_DATA when SIM is removed 2021-04-15 20:19:21 +03:00
Slava Monich
09e98234aa [ril] Tweaked network state polling logic
grilio_channel_retry_request() returns FALSE if the request is pending,
i.e. has been submitted but there was no reply yet. In that case, in
order to retry right away, we need to cancel the already submitted
request (and ignore the reply when it arrives) and resubmit a fresh
new one.
2021-04-15 19:40:32 +03:00
Slava Monich
0f4cdba932 [ril] Documented umtsNetworkMode parameter 2021-04-02 20:59:52 +03:00
Slava Monich
870bac93e9 Merge branch 'jb53576' into 'master'
Sumbit a pending request from the DBus queue

See merge request mer-core/ofono!279
2021-03-17 14:58:19 +00:00
Denis Grigorev
246cd4e1d2 [unit] Fix the test for __ofono_dbus_queue_reply_all_error. JB#53576 2021-03-17 16:09:19 +03:00
Denis Grigorev
ca20b65098 [ofono] Sumbit a pending request from the DBus queue. JB#53576
Currently, the DBus queue stops working after an asynchronous request
has been completed while another request is pending. This commit adds
__ofono_dbus_queue_submit_next(), which fires a pending request after
the previous one completes.
2021-03-17 15:51:21 +03:00
Slava Monich
8e35a047da Merge branch 'omp-jb53535' into 'master'
Get rid of unwanted retries on manual network connection

See merge request mer-core/ofono!278
2021-03-12 15:57:59 +00:00
Bogdan Migunov
2b4b5a224d [ril] Get rid of unwanted retries on manual network connection. Fixes JB#53535
There is an issue when network operators return "allowed" flag no matter
which SIM card you are using currently. In that case, when user tries to
manually connect to such networks, it takes too long to have 2 (by
default) retries until device will get back to its home network.
So the solution is not to set additional retries to the
RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL request, as it has been done
in RILJ.
2021-03-12 18:10:50 +03:00
Slava Monich
50a5f2547e Merge branch 'hfp' into 'master'
Register HandsfreeAudioManager straight away at startup

See merge request mer-core/ofono!277
2020-11-19 22:36:22 +00:00
Slava Monich
d682fcd5fe [ofono] Request D-Bus name after initializing all plugins. JB#52107
To ensure that all D-Bus objects which should be available straight
after startup are there when the first incoming D-Bus call arrives.
2020-11-19 20:18:23 +02:00
Slava Monich
5799320480 [ril] Took out erroneous assert 2020-11-19 20:09:35 +02:00
Slava Monich
3eea7c868e [hfp_hf_bluez5] Removed __ofono_handsfree_audio_manager_ calls
Those functions are called by ofono_handsfree_audio_ref/unref which
ensure that initialization is only done once.
2020-11-19 19:20:50 +02:00
Slava Monich
4844fc6cf9 [hfp_ag_bluez5] Register HandsfreeAudioManager straight away at startup. JB#52107
Otherwise it's not clear how the client is supposed to wait for
org.ofono.HandsfreeAudioManager to appear and how to figure out
whether it's ever going to appear.
2020-11-19 17:06:05 +02:00
Juho Hamalainen
6976366051 Merge branch 'jb48911' into 'master'
Don't try to connect HFP AG if bluetooth service is not available.

See merge request mer-core/ofono!276
2020-11-12 08:15:36 +00:00
Juho Hämäläinen
d3d776837b [hfp_ag_bluez5] Don't try to connect if bluetooth service is not available. JB#48911
Trying to connect too soon will result in profile interface registration
failure with timeout error, effectively blocking for dbus timeout (25s
by default).
2020-11-12 10:13:44 +02:00
Slava Monich
f56c8a33b0 Merge branch 'jb50995' into 'master'
[ril] Calculate signal strength based on rsrp value correctly. JB#50995.

See merge request mer-core/ofono!275
2020-09-15 10:46:22 +00:00
Aleksei Berman
ed2f625b8b [ril] Calculate signal strength based on rsrp value correctly. JB#50995.
All the dBm values are converted to qdbm (multiply by 4) but rsrp which
results in incorrect signal strength representation on some devices.
2020-08-28 15:57:33 +03:00
Slava Monich
ed62d38632 Merge branch 'jb50608' into 'master'
[ril] Add config options for cell info update interval. JB#50608

See merge request mer-core/ofono!273
2020-07-27 22:12:17 +00:00
Denis Grigorev
3f433c97c5 [ril] Add config options for cell info update interval. JB#50608 2020-07-28 00:18:52 +03:00
Denis Grigorev
86d8149c79 [ril] Allow setting cell info update period to 0. JB#50608
According to ril.h, a value of 0 means invoke RIL_UNSOL_CELL_INFO_LIST when
any of the reported information changes.
2020-07-27 21:33:03 +03:00
Slava Monich
f3eb9b868b [aarch64] Print PLUGINDIR when compiling. JB#49681
It's not obvious where it actualy comes from, let's have it in the build log.
2020-07-22 14:46:21 +03:00
chriadam
4e067fa827 Merge branch 'jb50214' into 'master'
[ofono] Don't support '.' as a DTMF pause character. Contributes to JB#50214

See merge request mer-core/ofono!271
2020-07-13 00:36:38 +00:00
Chris Adams
2ee5e4c827 [ofono] Don't support '.' as a DTMF pause character. Contributes to JB#50214 2020-07-13 10:35:30 +10:00
Niels Breet
1366e426be Merge branch 'jb49681' into 'master'
[aarch64] Use macros for unitdir. Contributes to JB#49681

See merge request mer-core/ofono!272
2020-07-08 13:19:30 +00:00
Niels Breet
586c9b9262 [aarch64] Use macros for unitdir. Contributes to JB#49681 2020-07-08 13:19:30 +00:00
Slava Monich
83554e071a Merge branch 'cbs_retry' into 'master'
Tweak CBS request retry logic

See merge request mer-core/ofono!270
2020-06-25 21:12:01 +00:00
Slava Monich
dc41c2d003 [ril] Allow CBS PDU arrive from RIL as a plain blob. JB#5761
I swear I've seen such cases!
2020-06-25 20:21:09 +03:00
Slava Monich
550d41ae37 [ril] Tweaked CBS request retry logic. JB#5761
There's no need for RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG, since we
are not using its result anyway. Better just register for notifications
which would simply never arrive if CBS doesn't work at all.

Important requests, however, better be retried on RIL_E_INVALID_STATE.
2020-06-25 20:05:31 +03:00
Slava Monich
60e4246d93 Merge branch 'cbs' into 'master'
Allow the last CBS fragment to be truncated.

See merge request mer-core/ofono!269
2020-06-19 13:18:21 +00:00
Slava Monich
50619607b0 [cbs] Allow the last CBS fragment to be truncated. JB#5761
That does happen in real life.
2020-06-18 11:59:06 +03:00
Slava Monich
98b357f365 Merge branch 'recap' into 'master'
Refactring radio caps code

See merge request mer-core/ofono!261
2020-06-17 16:00:13 +00:00
Denis Grigorev
56c488d10c [ril] Select the best network for LTE. JB#49391
The radio caps manager will not do anything until the roles are assigned
to modems, so data manager must select the modem with highest capabilities
for LTE instead of the first one.
2020-06-17 18:03:40 +03:00
Denis Grigorev
944cd603e8 [ril] Fix typo. JB#49391 2020-06-17 17:52:41 +03:00
Denis Grigorev
77be0d5e98 [ril] Assert the network mode at startup. JB#49391
At startup, the device may have an inconsistency between data and voice
network modes, so it needs to be asserted.
2020-06-17 17:52:15 +03:00
Denis Grigorev
d8dd20092c [ril] Fix a memory leak in ril_plugin_shutdown_slot(). JB#49391 2020-06-17 17:49:11 +03:00
Slava Monich
c7faa21172 [ril] Refactored radio caps code. JB#49391 2020-06-13 13:29:24 +03:00
Slava Monich
98ffc61a03 Merge branch 'oemraw-access' into 'master'
OemRaw access control

See merge request mer-core/ofono!265
2020-06-11 22:08:55 +00:00
Slava Monich
f2b1625872 Merge branch 'scan' into 'master'
Workaround for bogus operator names in network scan

See merge request mer-core/ofono!152
2020-06-11 22:06:17 +00:00
Slava Monich
2d5a22284e Merge branch 'cbs' into 'master'
Fix parsing of NEW_BROADCAST_SMS packet

See merge request mer-core/ofono!268
2020-06-10 21:09:47 +00:00
Slava Monich
9d742180ab [ril] Fixed parsing of NEW_BROADCAST_SMS packet. JB#5761
It's 4-byte length followed by the specified number of bytes
zero-padded to 4-byte boundary. Kind of like a string.
2020-06-10 15:01:59 +03:00
Slava Monich
f8b0ccc1b4 [ril] Workaround for bogus operator names in network scan. JB#49900
Some RILs (e.g. Sony Xperia X, MediaTek) report bogus operator names
in response to QUERY_AVAILABLE_NETWORKS request. We can make user's
life easier by looking up possible operator name in MBPI database
based on MCC and MNC (assuming those are reported correctly) in case
if weirdness is detected.

To turn this feature on, add this to /etc/ofono/ril_subscription.conf
config file:

replaceStrangeOperatorNames=true
2020-06-05 20:15:35 +03:00
Slava Monich
7a54bb8cbe Merge branch 'jb49955' into 'master'
Provide SmsHistory interface for all modems.

See merge request mer-core/ofono!266
2020-05-20 11:04:49 +00:00
Denis Grigorev
56e0923dc3 [ril] Provide SmsHistory interface for all modems. JB#49955
The SmsHistory plugin uses a global variable to determine if it is already
registered. Because of that, Ofono provides org.ofono.SmsHistory only for
the first modem, and SMS delivery notifications do not work on the others.
After this commit is applied, the plugin will be registered for each modem.
2020-05-19 18:30:44 +03:00
Slava Monich
6dfce4b5e9 [ril] Housekeeping 2020-05-15 15:24:03 +03:00
Slava Monich
4ec3568d71 [ril] Added access control for OemRaw interface. JB#49309 2020-05-15 15:22:09 +03:00
Slava Monich
9b2b7127ef [unit] Added test for OemRaw access control. JB#49309 2020-05-15 15:20:35 +03:00
Slava Monich
1053577376 [ofono] Add OemRaw to D-Bus access control framework. JB#49309
Even though it's RIL specific, it makes sense to reuse the
existing access control mechanism.
2020-05-15 15:19:51 +03:00
Slava Monich
22197b5e04 Merge branch 'jb49798' into 'master'
Fix a memory leak on switching an active SIM card

See merge request mer-core/ofono!263
2020-05-05 14:59:51 +00:00
Denis Grigorev
3a358ddc9d [ril] Fix GRilIoTransportSocket object leak. JB#49798 2020-05-05 16:44:37 +03:00
Denis Grigorev
53929f9f1a [ril] Fix RilCellInfo object leak. JB#49798
On some devices RIL requires to reset the modem while switching radio
capabilities. During this procedure all associated objects should be
disposed and replaced by new instances. This patch fixes a memory
leak through RilCellInfo object.
2020-05-05 16:44:24 +03:00
Slava Monich
08bae57a2b Merge branch 'jb49714' into 'master'
Register settings atom as soon as we have IMSI

See merge request mer-core/ofono!262
2020-04-23 09:08:23 +00:00
Slava Monich
1915aeda76 [ril] Register settings atom as soon as we have IMSI. Fixes JB#49714
There's no need to wait for modem to get powered on. This is just a user
setting - if it can't be applied right away, it will be applied later at
appropriate time.
2020-04-23 04:20:28 +03:00
Slava Monich
51bfb17cbc Merge branch 'modem_offline' into 'master'
Take modem offline when ril_modem is deleted

See merge request mer-core/ofono!260
2020-04-01 16:33:23 +00:00
Slava Monich
a83b553032 [ril] Stop repeating requests on RADIO_NOT_AVAILABLE. JB#49471
If the modem is powered off, this error is repeated indefinitely,
causing unnecessary wakeups.
2020-03-30 21:19:40 +03:00
Slava Monich
ec00abd62d [ril] Tweaked power state confirmation logic. JB#49471
Changed ril_radio_confirm_power_on() to send RADIO_POWER request even if
we think that modem is powered on. Some RILs change power state without
letting us know and that's what this function is for - to make sure that
power is on when we think that it's on.
2020-03-29 01:38:58 +02:00
Slava Monich
80924d5787 [ril] Take modem offline when ril_modem is deleted. JB#49471
Also, mobile data need to be disallowed before deleting the modem
object, so that power keep-on request could be submitted before
bringing the modem offline, to keep power on while data call is
being deactivated (if there was one).
2020-03-29 01:34:39 +02:00
Slava Monich
2bdd05aa31 [ril] Fixed ref vs unref mixup.
RilRadioCapsManager was never freed :/

That was leaving 472 bytes in 8 blocks still reachable on exit.
2020-03-20 18:30:40 +02:00
Slava Monich
544f02e5a2 Merge branch 'jb49322' into 'master'
Improve network registration process

See merge request mer-core/ofono!256
2020-03-16 19:05:22 +00:00
Denis Grigorev
6d4638f9bf [ril] Do not trigger automatic PLMN selection if not needed. JB#49322
On some devices SET_NETWORK_SELECTION_AUTOMATIC takes significant time,
because it triggers a complete scan of available PLMNs. If applied, this
commit will make ofono to issue QUERY_NETWORK_SELECTION_MODE first and
check whether the mode actually needs to be changed.
2020-03-16 20:24:14 +03:00
Slava Monich
6584919e9d Merge branch 'configurable-netsel-timeout' into 'master'
Add networkSelectionTimeout config option

See merge request mer-core/ofono!257
2020-03-12 18:48:50 +00:00
Denis Grigorev
34fb44f4eb [ril] Add networkSelectionTimeout config option. JB#49322
On some devices (such as BQ Aquarius NS208) SET_NETWORK_SELECTION_AUTOMATIC
takes a long time and ofono fails with timeout. If applied, this commit
will make network selection timeout configurable.
2020-03-12 18:02:24 +03:00
Slava Monich
c98d2f41c5 Merge branch 'jb49175' into 'master'
Support combinations of device state tracking methods

See merge request mer-core/ofono!255
2020-03-10 13:28:27 +00:00
Slava Monich
b279be4528 [ril] Support combinations of device state tracking methods. JB#49175
In addition to specifying ss, ds or ur method, one can specify a
combination of methods, e.g. ds+ur
2020-03-06 22:02:23 +02:00
Slava Monich
a7912fea39 [ril] Added ril_config_get_mask. JB#49175 2020-03-06 19:25:19 +02:00
Slava Monich
f291cea905 Merge branch 'jb49175' into 'master'
Add a new device state management method

See merge request mer-core/ofono!253
2020-03-05 12:45:13 +00:00
Denis Grigorev
68f7d30b77 [ril] Add a new device state management method. JB#49175
If applied, this commit will add a new ril_devmon implementation which
controls network state updates by sending SET_UNSOLICITED_RESPONSE_FILTER.
This is useful for devices with RIL version >= 15 if they ignore
both SEND_DEVICE_STATE and SEND_SCREEN_STATE requests as some Qualcomm-
based devices do.
2020-03-04 12:19:55 +03:00
Slava Monich
890a2697fe Merge branch 'jb49163' into 'master'
Access control for SIM Toolkit agent

See merge request mer-core/ofono!254
2020-03-03 21:35:16 +00:00
Slava Monich
9568c8449b [ofono] Access control for SIM Toolkit agent. Fixes JB#49163
Non-privileged process will get org.ofono.Error.AccessDenied from
RegisterAgent. Other methods already check that D-Bus call is coming
from a registered agent.
2020-03-03 19:19:47 +02:00
Slava Monich
cf91be9742 Merge branch 'ims_ap' into 'master'
Support for provisioning and configuring IMS access point

See merge request mer-core/ofono!252
2020-02-21 09:24:25 +00:00
Slava Monich
087771dc0f [ril] Allocate context for IMS. JB#48905 2020-02-20 14:56:10 +02:00
Slava Monich
645dfe47e5 [ofono] Support for automatic creation of IMS context. JB#48905
The approach is quite generic, it's up to the driver to configure
contexts that it wants to be created automatically at startup.
2020-02-20 14:56:02 +02:00
Slava Monich
68e8b02d3b [ofono] Added support for provisioning IMS access points. JB#48905 2020-02-20 14:55:52 +02:00
Slava Monich
aa4309e8cb Merge branch 'once' into 'master'
Store one-time data SIM selection

See merge request mer-core/ofono!251
2020-02-13 17:05:02 +00:00
Slava Monich
cb6b24d950 [ofono] Store one-time data SIM selection. JB#48462
This way, automatic choice survives a reboot.
2020-02-13 18:53:32 +03:00
Slava Monich
6d1ab13c74 [ofono] Ignore known deprecation warnings
Apparently, the only way to get rid of "warning: G_ADD_PRIVATE" is to
completely disable all Glib deprecation warnings in the entire file.
G_GNUC_BEGIN/END_IGNORE_DEPRECATIONS macros don't help :/
2020-02-12 20:58:24 +03:00
Slava Monich
45424a3f96 Merge branch 'error55' into 'master'
Workaround for data call status 55

See merge request mer-core/ofono!250
2020-02-12 17:05:43 +00:00
Slava Monich
4f7398e39d [ril] Workaround for data call status 55. JB#40162
With some networks we sometimes start getting error 55 (Multiple
PDN connections for a given APN not allowed) when trying to setup
an LTE data call and this error doesn't go away until we successfully
establish a data call over 3G. Then we can switch back to LTE.
2020-02-11 17:08:01 +03:00
Slava Monich
cd118ce70b [qmimodem] Move lte.c to the right place 2020-02-11 12:51:15 +03:00
Slava Monich
99d4ce538e [ofono] Updated baseline to 1.23. Fixes JB#48840 2020-02-05 17:05:33 +02:00
Slava Monich
9b2c4bcf76 Merge branch 'v1.23' into 'master'
Update baseline to 1.23

See merge request mer-core/ofono!247
2020-02-05 14:59:54 +00:00
Slava Monich
0122db04a3 Revert "[unit] Fixed memory leak in test-simutil"
This reverts commit c04b14c49a.

It conflicts with commit f5971198 cherry-picked from upstream.
2020-02-05 16:10:42 +02:00
Marcel Holtmann
021db194cb Release 1.23 2020-02-05 15:49:23 +02:00
Jonas Bonn
e0a0896205 qmimodem: release DMS service on radio-settings atom removal 2020-02-05 15:49:23 +02:00
Jonas Bonn
49d0bbbb28 qmimodem: release WDS service on GPRS atom removal 2020-02-05 15:49:22 +02:00
Jonas Bonn
9193d06b77 qmimodem: get LTE default bearer APN from modem
When an LTE modem registers with the network, a default bearer is
automatically established.  The APN used for this bearer is taken from
whatever default settings the modem has.

The LTE atom takes cares of setting up the default context/profile with
the APN to use.  From there, a default bearer will be established when
the modem registers with the network.  This results in a call to 'Get
LTE Attach Parameters' which tells us what APN the gateway negotiated
with us.

If we can't get the APN, we do what the AT driver does:  pretend the
bearer wasn't established.  This is a reasonable fallback, currently,
because connman can't handle zero-length APN's anyway; the previous
approach of setting the APN to 'automatic' breaks connman badly when it
needs to switch between LTE and non-LTE networks.
2020-02-05 15:49:22 +02:00
Jonas Bonn
b0cd3e4544 gobi: add LTE atom
This atom needs to be created in post_sim so that the APN can be
written to the default profile before the modem attempts to use the
setting to connect to the network.
2020-02-05 15:49:22 +02:00
Jonas Bonn
29cce6969b qmi: add LTE atom driver
This patch adds an LTE atom for QMI modems.

This atom sets the APN that the LTE default bearer should use when
establishing its PDP context.  This APN needs to be set on the 'default'
profile so the atom queries which profile is the default and resets
it before allowing the APN to be set.

Once configured, the default profile settings are used when the
modem connects to the network; for this reason, the LTE atom needs
to be instantiated in post_sim, before the modem is set online.
2020-02-05 15:49:22 +02:00
Denis Kenzior
b87f666e4b sim-auth: Improve pending cleanup on sim_auth_remove 2020-02-05 15:49:21 +02:00
Denis Kenzior
1c1e4fa28b sim-auth: Do not leak nai
==31530== 88 bytes in 2 blocks are definitely lost in loss record 132 of 186
==31530==    at 0x4C2BF8F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==31530==    by 0x5847B97: vasprintf (in /lib64/libc-2.23.so)
==31530==    by 0x510AE38: g_vasprintf (gprintf.c:316)
==31530==    by 0x50D8BDF: g_strdup_vprintf (gstrfuncs.c:514)
==31530==    by 0x50D8CAA: g_strdup_printf (gstrfuncs.c:540)
==31530==    by 0x4F706B: build_nai (sim-auth.c:660)
==31530==    by 0x4F706B: sim_auth_register (sim-auth.c:738)
==31530==    by 0x4F706B: ofono_sim_auth_create (sim-auth.c:768)
==31530==    by 0x4ACBB4: modem_change_state (modem.c:525)
==31530==    by 0x4AD0CD: sim_state_watch.part.5 (modem.c:720)
==31530==    by 0x4CF6D0: call_state_watches (sim.c:366)
==31530==    by 0x4CF6D0: sim_set_ready (sim.c:1475)
==31530==    by 0x4CF6D0: sim_imsi_obtained (sim.c:1577)
==31530==    by 0x45D868: at_cimi_cb (sim.c:453)
==31530==    by 0x49CB5F: at_chat_finish_command (gatchat.c:459)
==31530==    by 0x49DAC7: at_chat_handle_command_response (gatchat.c:521)
==31530==    by 0x49DAC7: have_line (gatchat.c:600)
==31530==    by 0x49DAC7: new_bytes (gatchat.c:759)
2020-02-05 15:49:03 +02:00
Denis Kenzior
f597119845 unit: Use sim_app_record_free to avoid memleaks 2020-02-05 15:49:03 +02:00
Christophe Ronco
633888932d udevng: Add modem string SystemPath 2020-02-05 15:44:38 +02:00
Christophe Ronco
a37f325d4a modem: Add SystemPath dbus property 2020-02-05 15:44:38 +02:00
Christophe Ronco
0afceac554 doc: Add SystemPath to Modem interface 2020-02-05 15:44:38 +02:00
Philippe De Swert
109751bcc0 doc: add new DialMemory method to VoicecallManager 2020-02-05 15:44:38 +02:00
Denis Kenzior
30dfbf8fd7 hfpmodem: Don't use strcat 2020-02-05 15:44:37 +02:00
Philippe De Swert
c7aab2e790 hfpmodem: Add memory dialling support
Handle the request to dial from a memory index and send the
correct ATD> sequence to make it happen.
2020-02-05 15:44:37 +02:00
Philippe De Swert
412a2a0e7f voicecall: Add memory location dialing
Implement functionality to allow to  dial favourites/quick contacts over
bluetooth.
2020-02-05 15:44:37 +02:00
Philippe De Swert
f1aeedd113 voicecall: Add support for dialing number at a given memory location
Add a new function to be able to dial numbers from memory/favourites.

Conflicts:
	ofono/include/voicecall.h
2020-02-05 15:44:32 +02:00
Philippe De Swert
639fce8eca voicecall: Rename hfp dialing functions
Calling from memory index is very similar in functionality to dialing
the last called number. So we rename the functions so we can reuse them,
to deal with memory index calling. Function names now also reflect this
is for hfp.
2020-02-05 15:34:26 +02:00
Jonas Bonn
9cfd0a195e xmm7modem: drop executable bit from C source file 2020-02-05 15:34:25 +02:00
Slava Monich
cf2d8488cc Merge branch 'dbm' into 'master'
Add signalStrengthRange option

See merge request mer-core/ofono!246
2020-01-22 10:10:44 +00:00
Slava Monich
ab0ac10abd [ril] Added signalStrengthRange option. JB#46086
Allows to tweak conversion of dBm values returned by the modem
into signal strength percentage.
2020-01-21 19:15:52 +02:00
368 changed files with 17910 additions and 31565 deletions

16
ofono/.gitignore vendored
View File

@@ -9,7 +9,7 @@ Makefile.in
aclocal.m4
config.guess
config.h
config.h.in
config.h.in*
config.log
config.status
config.sub
@@ -42,9 +42,14 @@ unit/test-sms-root
unit/test-simutil
unit/test-mux
unit/test-caif
unit/test-cell-info
unit/test-cell-info-control
unit/test-cell-info-dbus
unit/test-stkutil
unit/test-cdmasms
unit/test-conf
unit/test-dbus-access
unit/test-dbus-clients
unit/test-dbus-queue
unit/test-gprs-filter
unit/test-ril_config
@@ -57,13 +62,10 @@ unit/test-rilmodem-cs
unit/test-rilmodem-gprs
unit/test-rilmodem-sms
unit/test-sailfish_access
unit/test-sailfish_cell_info
unit/test-sailfish_cell_info_dbus
unit/test-sailfish_manager
unit/test-sailfish_sim_info
unit/test-sailfish_sim_info_dbus
unit/test-config
unit/test-slot-manager
unit/test-watch
unit/test-sim-info
unit/test-sim-info-dbus
unit/test-sms-filter
unit/test-voicecall-filter
unit/test-*.log

View File

@@ -130,3 +130,12 @@ Joey Hewitt <joey@joeyhewitt.com>
Richard Röjfors <richard.rojfors@gmail.com>
Philippe De Swert <philippe.deswert@nomovok.com>
Gabriel Lucas <gabriel.lucas@smile.fr>
Mariem Cherif <mariem.cherif@ardia.com.tn>
Bassem Boubaker <bassem.boubaker@actia.fr>
Bob Ham <bob.ham@puri.sm>
Varun Gargi <varun.gargi@intel.com>
Florent Beillonnet <florent.beillonnet@gmail.com>
Martin Hundebøll <martin@geanix.com>
Julien Tournier <tournier.julien@gmail.com>
Nandini Rebello <nandini.rebello@intel.com>
Giacinto Cifelli <gciofono@gmail.com>

View File

@@ -1,3 +1,46 @@
ver 1.27:
Add support for handling SIMCom based SIM800 modems.
Add support for SIM lock state with xmm7xxx modems.
Add support for coexistence feature with xmm7xxx modems.
ver 1.26:
Fix issue with AT callback handler and GPRS.
Fix issue with handling EUTRAN SMS only states.
Fix issue with handling MBIM strings on big endian.
Fix issue with missing char and SMS national language.
Fix issue with unsolicited notifications of +CGAUTH/+CGDCONT.
Add support for setting "none" authentication method.
Add support for SMS and phonebook with xmm7xxx modems.
Add support for voice features and Gemalto modems.
Add support for Bengali and Gujrati SMS alphabets.
Add support for 8 additional languages for GSM 7 bit
Add support for using internal Embedded Linux library.
ver 1.25:
Fix issue with handling GPRS context release.
Fix issue with GPRS context shutdown and Huawei modems.
Fix issue with roaming status report and QMI devices.
Add support for voice call handling of U-Blox modems
Add support for EUTRAN technology reporting.
ver 1.24:
Fix issue with property changed signals and CDMA networks.
Fix issue with handling SIM filesystem and SIM removal.
Fix issue with handling PIN state and incorrect codes.
Fix issue with handling of parsing AID type.
Fix issue with SIM detection and QMI devices.
Fix issue with PIN handling and QMI devices.
Fix issue with USSD handling and QMI devices.
Fix issue with handling USSD TERMINATED response.
Fix issue with handling USSD reset and STK REFRESH.
Add support for detecting Gemalto ALS3 modems.
Add support for SIMCom based SIM7100E modems.
ver 1.23:
Fix issue with handling SIM AID sessions.
Add support for QMI LTE bearer handling.
Add support for memory location dialing.
ver 1.22:
Fix issue with GPIO handling and Nokia modems.
Fix issue with SIM state callback and AT modems.

View File

@@ -26,9 +26,11 @@ pkginclude_HEADERS = include/log.h include/plugin.h include/history.h \
include/sms-filter.h include/gprs-filter.h \
include/voicecall-filter.h include/dbus-access.h \
include/ril-constants.h include/ril-transport.h \
include/watch.h gdbus/gdbus.h \
include/watch.h gdbus/gdbus.h include/dbus-clients.h \
include/netmon.h include/lte.h include/ims.h \
include/storage.h
include/slot.h include/cell-info.h \
include/storage.h include/conf.h include/misc.h \
include/mtu-limit.h
nodist_pkginclude_HEADERS = include/version.h
@@ -111,6 +113,9 @@ gril_sources = gril/gril.h gril/gril.c \
btio_sources = btio/btio.h btio/btio.c
builtin_modules += cellinfo_netmon generic_phonebook
builtin_sources += plugins/cellinfo-netmon.c plugins/generic-phonebook.c
if UDEV
builtin_cflags += @UDEV_CFLAGS@
builtin_libadd += @UDEV_LIBS@
@@ -119,72 +124,12 @@ builtin_modules += udevng
builtin_sources += plugins/udevng.c
endif
if SAILFISH_MANAGER
builtin_modules += sailfish_manager
builtin_sources += plugins/sailfish_manager/sailfish_cell_info.c \
plugins/sailfish_manager/sailfish_cell_info_dbus.c \
plugins/sailfish_manager/sailfish_manager.c \
plugins/sailfish_manager/sailfish_manager_dbus.c \
plugins/sailfish_manager/sailfish_sim_info.c \
plugins/sailfish_manager/sailfish_sim_info_dbus.c
endif
if SAILFISH_ACCESS
builtin_modules += sailfish_access
builtin_sources += plugins/sailfish_access.c
endif
if RILMODEM
if SAILFISH_RILMODEM
builtin_modules += ril
builtin_sources += drivers/ril/ril_call_barring.c \
drivers/ril/ril_call_forward.c \
drivers/ril/ril_call_settings.c \
drivers/ril/ril_call_volume.c \
drivers/ril/ril_cell_info.c \
drivers/ril/ril_config.c \
drivers/ril/ril_connman.c \
drivers/ril/ril_cbs.c \
drivers/ril/ril_data.c \
drivers/ril/ril_devinfo.c \
drivers/ril/ril_devmon.c \
drivers/ril/ril_devmon_auto.c \
drivers/ril/ril_devmon_ds.c \
drivers/ril/ril_devmon_ss.c \
drivers/ril/ril_ecclist.c \
drivers/ril/ril_gprs.c \
drivers/ril/ril_gprs_context.c \
drivers/ril/ril_modem.c \
drivers/ril/ril_netmon.c \
drivers/ril/ril_netreg.c \
drivers/ril/ril_network.c \
drivers/ril/ril_oem_raw.c \
drivers/ril/ril_phonebook.c \
drivers/ril/ril_plugin.c \
drivers/ril/ril_radio.c \
drivers/ril/ril_radio_caps.c \
drivers/ril/ril_radio_settings.c \
drivers/ril/ril_sim.c \
drivers/ril/ril_sim_card.c \
drivers/ril/ril_sim_settings.c \
drivers/ril/ril_sms.c \
drivers/ril/ril_stk.c \
drivers/ril/ril_ussd.c \
drivers/ril/ril_util.c \
drivers/ril/ril_vendor.c \
drivers/ril/ril_voicecall.c
# Vendor specific extensions
builtin_sources += drivers/ril/ril_vendor_mtk.c
if DATAFILES
dist_conf_DATA += drivers/ril/ril_subscription.conf
endif
else
builtin_sources += $(gril_sources)
builtin_modules += rildev
@@ -225,7 +170,6 @@ builtin_sources += drivers/rilmodem/rilmodem.h \
drivers/infineonmodem/infineon_constants.h \
drivers/rilmodem/lte.c
endif
endif
if ISIMODEM
builtin_modules += isimodem
@@ -305,6 +249,7 @@ builtin_sources += $(qmi_sources) \
drivers/qmimodem/ussd.c \
drivers/qmimodem/gprs.c \
drivers/qmimodem/gprs-context.c \
drivers/qmimodem/lte.c \
drivers/qmimodem/radio-settings.c \
drivers/qmimodem/location-reporting.c \
drivers/qmimodem/netmon.c
@@ -467,14 +412,16 @@ builtin_modules += gemaltomodem
builtin_sources += drivers/atmodem/atutil.h \
drivers/gemaltomodem/gemaltomodem.h \
drivers/gemaltomodem/gemaltomodem.c \
drivers/gemaltomodem/location-reporting.c
drivers/gemaltomodem/location-reporting.c \
drivers/gemaltomodem/voicecall.c
builtin_modules += xmm7modem
builtin_sources += drivers/atmodem/atutil.h \
drivers/xmm7modem/xmm7modem.h \
drivers/xmm7modem/xmm7modem.c \
drivers/xmm7modem/radio-settings.c \
drivers/xmm7modem/ims.c
drivers/xmm7modem/ims.c \
drivers/xmm7modem/netmon.c
if PHONESIM
builtin_modules += phonesim
@@ -494,7 +441,7 @@ builtin_sources += drivers/cdmamodem/cdmamodem.h \
drivers/cdmamodem/connman.c
endif
if !RILMODEM
if EXTRA_MODEMS
builtin_modules += g1
builtin_sources += plugins/g1.c
@@ -570,6 +517,9 @@ builtin_sources += plugins/samsung.c
builtin_modules += sim900
builtin_sources += plugins/sim900.c
builtin_modules += sim7100
builtin_sources += plugins/sim7100.c
builtin_modules += telit
builtin_sources += plugins/telit.c
@@ -719,6 +669,7 @@ builtin_libadd += @ELL_LIBS@
if MBIMMODEM
mbim_sources = drivers/mbimmodem/mbim.h \
drivers/mbimmodem/mbim.c \
drivers/mbimmodem/mbim-private.h \
drivers/mbimmodem/mbim-desc.h \
drivers/mbimmodem/mbim-desc.c \
drivers/mbimmodem/mbim-message.h \
@@ -745,7 +696,6 @@ endif
sbin_PROGRAMS = src/ofonod
src_ofonod_SOURCES = $(builtin_sources) $(gatchat_sources) src/ofono.ver \
src/mtu-watch.c \
src/main.c src/ofono.h src/log.c src/plugin.c \
src/modem.c src/common.h src/common.c \
src/manager.c src/dbus.c src/util.h src/util.c \
@@ -772,11 +722,16 @@ src_ofonod_SOURCES = $(builtin_sources) $(gatchat_sources) src/ofono.ver \
src/handsfree-audio.c src/bluetooth.h \
src/sim-mnclength.c src/voicecallagent.c \
src/sms-filter.c src/gprs-filter.c \
src/dbus-queue.c src/dbus-access.c src/config.c \
src/dbus-clients.c src/dbus-queue.c src/dbus-access.c \
src/voicecall-filter.c src/ril-transport.c \
src/hfp.h src/siri.c src/watchlist.c \
src/netmon.c src/lte.c src/ims.c \
src/netmonagent.c src/netmonagent.h
src/netmonagent.c src/netmonagent.h \
src/slot-manager.c src/slot-manager-dbus.c \
src/cell-info.c src/cell-info-dbus.c \
src/cell-info-control.c \
src/sim-info.c src/sim-info-dbus.c \
src/conf.c src/mtu-limit.c
src_ofonod_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) \
@GLIB_LIBS@ @DBUS_LIBS@ -ldl
@@ -803,8 +758,7 @@ AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ $(builtin_cflags) \
AM_CPPFLAGS = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/src \
-I$(srcdir)/gdbus -I$(srcdir)/gisi -I$(srcdir)/gatchat \
-I$(srcdir)/btio -I$(srcdir)/gril \
-I$(srcdir)/plugins/sailfish_manager
-I$(srcdir)/btio -I$(srcdir)/gril
doc_files = doc/overview.txt doc/ofono-paper.txt doc/release-faq.txt \
doc/manager-api.txt doc/modem-api.txt doc/network-api.txt \
@@ -941,7 +895,8 @@ test_scripts = test/backtrace \
test/test-serving-cell-info \
test/ims-register \
test/ims-unregister \
test/list-applications
test/list-applications \
test/set-sms-alphabet
if TEST
@@ -964,63 +919,68 @@ unit_tests = unit/test-common unit/test-util unit/test-idmap \
unit/test-simutil unit/test-stkutil \
unit/test-sms unit/test-cdmasms
if SAILFISH_MANAGER
unit_test_conf_SOURCES = unit/test-conf.c src/conf.c src/log.c
unit_test_conf_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT)
unit_test_conf_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_conf_OBJECTS)
unit_tests += unit/test-conf
unit_test_sailfish_cell_info_SOURCES = unit/test-sailfish_cell_info.c \
plugins/sailfish_manager/sailfish_cell_info.c
unit_test_sailfish_cell_info_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT)
unit_test_sailfish_cell_info_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_sailfish_cell_info_OBJECTS)
unit_tests += unit/test-sailfish_cell_info
unit_test_cell_info_SOURCES = unit/test-cell-info.c src/cell-info.c src/log.c
unit_test_cell_info_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT)
unit_test_cell_info_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_cell_info_OBJECTS)
unit_tests += unit/test-cell-info
unit_test_sailfish_cell_info_dbus_SOURCES = unit/test-dbus.c \
unit/test-sailfish_cell_info_dbus.c \
unit/fake_sailfish_cell_info.c \
plugins/sailfish_manager/sailfish_cell_info.c \
plugins/sailfish_manager/sailfish_cell_info_dbus.c \
gdbus/object.c \
src/dbus.c src/log.c
unit_test_sailfish_cell_info_dbus_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT) \
unit_test_cell_info_control_SOURCES = unit/test-cell-info-control.c \
unit/fake_cell_info.c src/cell-info.c \
src/cell-info-control.c src/log.c
unit_test_cell_info_control_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT)
unit_test_cell_info_control_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_cell_info_control_OBJECTS)
unit_tests += unit/test-cell-info-control
unit_test_cell_info_dbus_SOURCES = unit/test-dbus.c \
unit/test-cell-info-dbus.c unit/fake_cell_info.c \
src/cell-info.c src/cell-info-dbus.c \
src/cell-info-control.c gdbus/object.c \
src/dbus-clients.c src/dbus.c src/log.c
unit_test_cell_info_dbus_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT) \
@DBUS_GLIB_CFLAGS@
unit_test_sailfish_cell_info_dbus_LDADD = @DBUS_GLIB_LIBS@ @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_sailfish_cell_info_dbus_OBJECTS)
unit_tests += unit/test-sailfish_cell_info_dbus
unit_test_cell_info_dbus_LDADD = @DBUS_GLIB_LIBS@ @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_cell_info_dbus_OBJECTS)
unit_tests += unit/test-cell-info-dbus
unit_test_sailfish_sim_info_SOURCES = unit/test-sailfish_sim_info.c \
unit/fake_watch.c \
plugins/sailfish_manager/sailfish_sim_info.c \
src/storage.c src/watchlist.c src/log.c
unit_test_sailfish_sim_info_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS) \
unit_test_sim_info_SOURCES = unit/test-sim-info.c unit/fake_watch.c \
src/sim-info.c src/storage.c src/watchlist.c src/log.c
unit_test_sim_info_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS) \
-DSTORAGEDIR='"/tmp/ofono"'
unit_test_sailfish_sim_info_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_sailfish_sim_info_OBJECTS)
unit_tests += unit/test-sailfish_sim_info
unit_test_sim_info_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_sim_info_OBJECTS)
unit_tests += unit/test-sim-info
unit_test_sailfish_sim_info_dbus_SOURCES = unit/test-sailfish_sim_info_dbus.c \
unit_test_sim_info_dbus_SOURCES = unit/test-sim-info-dbus.c \
unit/test-dbus.c unit/fake_watch.c \
plugins/sailfish_manager/sailfish_sim_info.c \
plugins/sailfish_manager/sailfish_sim_info_dbus.c \
src/sim-info.c src/sim-info-dbus.c \
gdbus/object.c \
src/dbus.c src/storage.c src/watchlist.c src/log.c
unit_test_sailfish_sim_info_dbus_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS) \
unit_test_sim_info_dbus_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS) \
@DBUS_GLIB_CFLAGS@ -DSTORAGEDIR='"/tmp/ofono"'
unit_test_sailfish_sim_info_dbus_LDADD = @DBUS_GLIB_LIBS@ @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_sailfish_sim_info_dbus_OBJECTS)
unit_tests += unit/test-sailfish_sim_info_dbus
unit_test_sim_info_dbus_LDADD = @DBUS_GLIB_LIBS@ @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_sim_info_dbus_OBJECTS)
unit_tests += unit/test-sim-info-dbus
unit_test_sailfish_manager_SOURCES = unit/test-sailfish_manager.c \
unit/fake_watch.c \
plugins/sailfish_manager/sailfish_manager.c \
plugins/sailfish_manager/sailfish_cell_info.c \
plugins/sailfish_manager/sailfish_sim_info.c \
src/storage.c src/log.c
unit_test_sailfish_manager_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT) \
unit_test_slot_manager_SOURCES = unit/test-slot-manager.c unit/fake_watch.c \
unit/fake_cell_info.c src/slot-manager.c \
src/cell-info.c src/cell-info-control.c \
src/sim-info.c src/storage.c src/log.c
unit_test_slot_manager_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT) \
-DSTORAGEDIR='"/tmp/ofono"'
unit_test_sailfish_manager_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_sailfish_manager_OBJECTS)
unit_tests += unit/test-sailfish_manager
unit_test_slot_manager_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_slot_manager_OBJECTS)
unit_tests += unit/test-slot-manager
unit_test_watch_SOURCES = unit/test-watch.c src/watch.c \
src/cell-info.c src/cell-info-control.c \
src/log.c src/watchlist.c
unit_test_watch_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT) \
-DSTORAGEDIR='"/tmp/ofono"'
@@ -1028,15 +988,6 @@ unit_test_watch_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_watch_OBJECTS)
unit_tests += unit/test-watch
endif
unit_test_config_SOURCES = unit/test-config.c drivers/ril/ril_util.c \
src/config.c src/log.c
unit_test_config_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_config_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_config_OBJECTS)
unit_tests += unit/test-config
if SAILFISH_ACCESS
unit_test_sailfish_access_SOURCES = unit/test-sailfish_access.c \
plugins/sailfish_access.c src/dbus-access.c src/log.c
@@ -1054,38 +1005,6 @@ unit_objects += $(unit_test_dbus_access_OBJECTS)
unit_tests += unit/test-dbus-access
if RILMODEM
if SAILFISH_RILMODEM
unit_test_ril_config_SOURCES = unit/test-ril_config.c drivers/ril/ril_util.c \
drivers/ril/ril_config.c src/log.c
unit_test_ril_config_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_ril_config_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_ril_config_OBJECTS)
unit_tests += unit/test-ril_config
unit_test_ril_ecclist_SOURCES = unit/test-ril_ecclist.c \
drivers/ril/ril_ecclist.c src/log.c
unit_test_ril_ecclist_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_ril_ecclist_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_ril_ecclist_OBJECTS)
unit_tests += unit/test-ril_ecclist
unit_test_ril_util_SOURCES = unit/test-ril_util.c drivers/ril/ril_util.c \
src/log.c
unit_test_ril_util_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_ril_util_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_ril_util_OBJECTS)
unit_tests += unit/test-ril_util
unit_test_ril_vendor_SOURCES = unit/test-ril_vendor.c unit/fake_watch.c \
drivers/ril/ril_vendor.c drivers/ril/ril_vendor_mtk.c \
drivers/ril/ril_util.c src/log.c
unit_test_ril_vendor_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_ril_vendor_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_ril_vendor_OBJECTS)
unit_tests += unit/test-ril_vendor
else
unit_tests += unit/test-rilmodem-cs \
unit/test-rilmodem-cs \
unit/test-rilmodem-sms \
@@ -1093,7 +1012,6 @@ unit_tests += unit/test-rilmodem-cs \
unit/test-rilmodem-gprs
endif
endif
if ELL
if MBIMMODEM
@@ -1161,6 +1079,14 @@ unit_test_caif_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_caif_LDADD = @GLIB_LIBS@
unit_objects += $(unit_test_caif_OBJECTS)
unit_test_dbus_clients_SOURCES = unit/test-dbus-clients.c unit/test-dbus.c \
src/dbus-clients.c gdbus/object.c \
src/dbus.c src/log.c
unit_test_dbus_clients_CFLAGS = @DBUS_GLIB_CFLAGS@ $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_dbus_clients_LDADD = @DBUS_GLIB_LIBS@ @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_dbus_clients_OBJECTS)
unit_tests += unit/test-dbus-clients
unit_test_dbus_queue_SOURCES = unit/test-dbus-queue.c unit/test-dbus.c \
src/dbus-queue.c gdbus/object.c \
src/dbus.c src/log.c

View File

@@ -1,5 +1,5 @@
AC_PREREQ(2.60)
AC_INIT(ofono, 1.22)
AC_INIT(ofono, 1.27)
AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
AC_CONFIG_HEADERS(config.h)
@@ -55,9 +55,6 @@ AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
fi
])
AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads],
[enable threading support]), [enable_threads=${enableval}])
AC_CHECK_FUNC(signalfd, dummy=yes,
AC_MSG_ERROR(signalfd support is required))
@@ -79,14 +76,6 @@ PKG_CHECK_MODULES(GIO, gio-2.0, dummy=yes,
GLIB_CFLAGS="$GLIB_CFLAGS $GIO_CFLAGS"
GLIB_LIBS="$GLIB_LIBS $GIO_LIBS"
if (test "${enable_threads}" = "yes"); then
AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
AC_MSG_ERROR(GThread >= 2.16 is required))
GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
fi
PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4, dummy=yes,
AC_MSG_ERROR(D-Bus >= 1.4 is required))
AC_SUBST(DBUS_CFLAGS)
@@ -177,33 +166,17 @@ AC_ARG_ENABLE(rilmodem, AC_HELP_STRING([--disable-rilmodem],
[enable_rilmodem=${enableval}])
AM_CONDITIONAL(RILMODEM, test "${enable_rilmodem}" != "no")
AC_ARG_ENABLE(sailfish-rilmodem, AC_HELP_STRING([--enable-sailfish-rilmodem],
[enable Sailfish RIL modem]),
[enable_sailfish_rilmodem=${enableval}],
[enable_sailfish_rilmodem="no"])
AM_CONDITIONAL(SAILFISH_RILMODEM, test "${enable_sailfish_rilmodem}" != "no")
AC_ARG_ENABLE(extra-modems,
AC_HELP_STRING([--enable-extra-modems],
[enable modems not used by Sailfish OS]),
[enable_extra_modems=${enableval}])
AM_CONDITIONAL(EXTRA_MODEMS, test "${enable_extra_modems}" = "yes")
PKG_CHECK_MODULES(GLIBUTIL, libglibutil >= 1.0.35, dummy=yes,
AC_MSG_ERROR(libglibutil >= 1.0.35 is required))
PKG_CHECK_MODULES(GLIBUTIL, libglibutil >= 1.0.51, dummy=yes,
AC_MSG_ERROR(libglibutil >= 1.0.51 is required))
CFLAGS="$CFLAGS $GLIBUTIL_CFLAGS"
LIBS="$LIBS $GLIBUTIL_LIBS"
if (test "${enable_sailfish_rilmodem}" = "yes"); then
PKG_CHECK_MODULES(GRILIO, libgrilio >= 1.0.35, dummy=yes,
AC_MSG_ERROR(libgrilio >= 1.0.35 is required))
PKG_CHECK_MODULES(LIBMCE, libmce-glib >= 1.0.6, dummy=yes,
AC_MSG_ERROR(libmce-glib >= 1.0.6 is required))
CFLAGS="$CFLAGS $GRILIO_CFLAGS $LIBMCE_CFLAGS"
LIBS="$LIBS $GRILIO_LIBS $LIBMCE_LIBS"
enable_sailfish_manager=yes
fi
AC_ARG_ENABLE(sailfish-manager,
AC_HELP_STRING([--enable-sailfish-manager],
[enable Sailfish OS modem manager plugin]),
[enable_sailfish_manager=${enableval}])
AM_CONDITIONAL(SAILFISH_MANAGER, test "${enable_sailfish_manager}" = "yes")
PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1, dummy=yes,
AC_MSG_ERROR(dbus-glib is required by unit tests))
AC_SUBST(DBUS_GLIB_CFLAGS)

View File

@@ -0,0 +1,164 @@
Every project has its own recursive patterns, and oFono is not an exception.
This document describes the most common ones found in the code.
Typical flow for atom <-> atom driver operations
================================================
Most of the time, the core atom for a given request calls a function in
the atom driver, which generally executes some commands against the modem,
and can then return the results to the core.
For example:
dbus call: lte/SetProperty(DefaultAPN)
|
v
core: check APN validity, call the modem atom for execution in the modem
|
v
atom driver: schedules 'AT+CGDCONT=0,"IP","MyNiceAPN"' for execution
|
[ break in the flow: the functions return back to the core, the dbus request ]
[ is not answered at this time ]
...
[GLibMain event loop schedules the command, it is sent to the modem and the ]
[ modem's reply is obtained ]
|
v
atom driver: a callback function, optionally provided when AT command was
scheduled is now called
|
v
core: atom driver core callback function is now called. This was passed from
the core as an argument, earlier, when the atom driver operation was invoked,
along with some context data (opaque info for the atom driver containing core
atom owned data)
|
v
the core can now answer the dbus message
In the code, it looks like this:
//core call:
static DBusMessage *lte_set_property(DBusConnection *conn,
DBusMessage *msg, void *data)
{
struct ofono_lte *lte = data;
/*
* a block of code here processes the msg and fills the
* lte->pending_info structure
*/
lte->driver->set_default_attach_info(lte, &lte->pending_info,
lte_set_default_attach_info_cb, lte);
return NULL;
}
// lte_set_default_attach_info_cb is the core callback function,
// the lte structure is the parameter that it takes
//atom:
static void at_lte_set_default_attach_info(const struct ofono_lte *lte,
const struct ofono_lte_default_attach_info *info,
ofono_lte_cb_t cb, void *data)
{
struct lte_driver_data *ldd = ofono_lte_get_data(lte);
// next line creates a structure for the in-atom callback
struct cb_data *cbd = cb_data_new(cb, data);
if (g_at_chat_send(ldd->chat, "AT", NULL,
at_lte_set_default_attach_info_cb,
cbd, g_free) > 0)
return;
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, data);
}
// here the structure is allocate dynamically, and since it is quite common,
// the function g_at_chat_send accepts the last 3 parameters:
// - in-atom callback function
// - in-atom callback data
// - destroy function for dynamically-allocated callback data
// NOTE: if g_at_chat_send fails, it does not free the memory, so it must be
// done after the call.
// Note also the callback to the core directly here if the g_at_chat_send fails.
//atom callback:
static void at_lte_set_default_attach_info_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
if (result == NULL) {
CALLBACK_WITH_FAILURE(cbd->cb, cbd->data);
return;
}
decode_at_error(&error, g_at_result_final_response(result));
cbd->cb(&error, cbd->data);
}
// note that here cbd must not be released, it will be done by the GAtChat
// after invoking the callback (at_lte_set_default_attach_info_cb)
// note also that the core function will be executed before cbd is released,
// so the last line of the code is ok.
Use of the cb_data in AT command based atom drivers
===================================================
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.

View File

@@ -201,7 +201,8 @@ Properties boolean Active [readwrite]
string AuthenticationMethod [readwrite]
Holds the PPP authentication method to use. Valid
values are "pap" and "chap". Defaults to "chap".
values are "pap", "chap" and "none".
Defaults to "chap".
string Username [readwrite]
@@ -278,6 +279,13 @@ Properties boolean Active [readwrite]
via this proxy. All other values are left
out in this case.
array{string} ProxyCSCF [readonly, optional]
Holds the list of P-CSCF (SIP proxy) for this
context. Only used by IMS connections.
This is a Sailfish OS specific extension.
dict IPv6.Settings [readonly, optional]
Holds all the IPv6 network settings
@@ -304,6 +312,13 @@ Properties boolean Active [readwrite]
Holds the gateway IP for this connection.
array{string} ProxyCSCF [readonly, optional]
Holds the list of P-CSCF (SIP proxy) for this
context. Only used by IMS connections.
This is a Sailfish OS specific extension.
string MessageProxy [readwrite, MMS only]
Holds the MMS Proxy setting.

View File

@@ -14,7 +14,7 @@ What oFono will do:
- Post online atoms will be created.
- Upon reception of Dial request, Emergency mode is activated.
- Once the call is ended, Emergency mode is deactivated.
- Modem remains in online mode with full funcationality.
- Modem remains in online mode with full functionality.
Case 2: Call in SIM Present and PIN required state

View File

@@ -0,0 +1,137 @@
LTE Coexistence hierarchy
=========================
Service org.ofono
Interface org.ofono.intel.LteCoexistence
Object path [variable prefix]/{modem0,modem1,...}
Methods dict GetProperties()
Returns all coexistence configuration properties.
void SetProperty(string property, variant value)
Changes the value of the specified property. Only
properties that are listed as Read-write are changeable.
On success a PropertyChanged signal will be emitted.
Possible Errors: [service].Error.InProgress
[service].Error.InvalidArguments
[service].Error.Failed
void RegisterAgent(object path)
Registers an agent which will be called whenever the
modem initiates LTE Coexistence information.
Possible Errors: [service].Error.InProgress
[service].Error.InvalidArguments
[service].Error.InvalidFormat
[service].Error.Failed
void UnregisterAgent(object path)
Unregisters an agent.
Possible Errors: [service].Error.InvalidArguments
[service].Error.Failed
a(a{sv}) GetPlmnHistory()
Requests for LTE Plmn history list stored in NVM to
retrieve geo location history like MobileNetworkCode,
MobileCountryCode, LteBandsFDD, LteBandsTDD,
ChannelBandwidth.
Refer to the sections below for which property types
are available, their valid value ranges and
applicability to different cell types.
Signals PropertyChanged(string property, variant value)
This signal indicates a changed value of the given
property.
Properties string Band [readwrite]
Frequency band in which the modem is operating when
using "lte" mode.
boolean BTActive [readwrite]
Contains whether BT Coex is activated or not.
boolean WLANActive [readwrite]
Contains whether WLAN Coex is activated or not.
string WLANBandwidth [readwrite]
Contains the frequency WLAN Coex is activated on, when
"CoexWLANActive" is active.
The possible values are:
- "20MHz"
- "40MHz"
- "80MHz"
LTECoexistenceAgent Hierarchy [experimental]
=============================
Service unique name
Interface org.ofono.intel.LteCoexistenceAgent
Object path freely definable
Methods void ReceiveBluetoothNotification(array{byte} notification,
dict info) [noreply]
Requests the agent to process Bluetooth related LTE
Coexistence information. The dictionary info contains
vector table with modem recommended Safe Tx/Rx band and
range information.The properties involved are
'SafeTxMin', 'SafeRxMin', 'SafeTxMax', 'SafeRxMax' and
'SafeVector'.
Possible Errors: None
void ReceiveWiFiNotification(array{byte} notification,
dict info) [noreply]
Requests the agent to process WiFi related LTE
Coexistence information. The dictionary info contains
vector table with modem recommended SafeTx/Rx band and
range information. The properties involved are
'SafeTxMin', 'SafeRxMin', 'SafeTxMax', 'SafeRxMax' and
'SafeVector'.
Possible Errors: None
void Release() [noreply]
Agent is being released, possibly because of oFono
terminating, Coex interface is being torn down or modem
off. No UnregisterAgent call is needed.
LTE Plmn history params
=======================
uint16 MobileNetworkCode [readonly, optional]
Contains the MNC of the cell.
uint16 MobileCountryCode [readonly, optional]
Contains the MCC of the cell.
uint32 LteBandsFDD [readonly, optional]
Contains the Lte FDD band. Valid range of values is 1 to 32 as per
3GPP 36.101 Section 5.5.
uint32 LteBandsTDD [readonly, optional]
Contains the Lte TDD band. Valid range of values is 33 to 64 as per
3GPP 36.101 Section 5.5.
byte ChannelBandwidth [readonly, optional]
Contains the Channel bandwidth. Valid range of values is 0 to 6 as per
3GPP 36.101 Section 5.6.

View File

@@ -13,7 +13,7 @@ Methods dict GetProperties()
filedescriptor Request()
Asks to turn ON the NMEA stream and supplies the
gps device file descriptor. The external cliend should
gps device file descriptor. The external client should
use the file descriptor to receive the NMEA data.
Possible Errors: [service].Error.InProgress

View File

@@ -33,3 +33,39 @@ Properties string DefaultAccessPointName [readwrite]
Setting this property to an empty string clears the
default APN from the modem.
string Protocol [readwrite, experimental]
Holds the protocol for this context. Valid values
are: "ip", "ipv6" and "dual". Default value is "ip".
string AuthenticationMethod [readwrite, experimental]
Sets the Method used for the authentication
for the default APN.
Available values are "none", "pap" and "chap".
Default is "none".
If the AuthenticationMethod is set to 'none',
no authentication is performed for the default attach
APN. Username and Password properties are ignored,
even if containing a valid value. If Username or
Password are empty, AuthenticationMethod is implicitly
assumed to be set to 'none'.
If the default APN supports authentication and it
fails, then it is up to the network how to proceed.
In general LTE access is denied and the modem can
fallback to a legacy technology if capable and another
radio technology is available.
string Username [readwrite, experimental]
Holds the username to be used for authentication
purposes.
string Password [readwrite, experimental]
Holds the password to be used for authentication
purposes.

View File

@@ -104,6 +104,16 @@ Properties string ServiceCenterAddress
"turkish" - Turkish alphabet
"spanish" - Spanish alphabet
"portuguese" - Portuguese alphabet
"bengali" - Bengali alphabet
"gujarati" - Gujarati alphabet
"hindi" - Hindi alphabet
"kannada" - Kannada alphabet
"malayalam" - Malayalam alphabet
"oriya" - Oriya alphabet
"punjabi"- Punjabi alphabet
"tamil" - Tamil alphabet
"telugu" - Telugu alphabet
"urdu" - Urdu alphabet
The standard, language-specific alphabets are defined
in 3GPP TS23.038, Annex A. By default, oFono uses

View File

@@ -95,6 +95,13 @@ Properties boolean Powered [readwrite]
String representing the software version number of the
modem device.
string SystemPath [readonly, optional]
String representing the system path for the modem
device.
For modems detected by udev events, this corresponds to
the modem sysfs path.
array{string} Features [readonly]
List of currently enabled features. It uses simple

View File

@@ -82,7 +82,9 @@ Properties string Mode [readonly]
string Status [readonly]
The current registration status of a modem.
The current registration status of a modem. In case
technology is 'lte', 'registered' and 'roaming' may
not necessarily mean voice calling available.
The possible values are:
"unregistered" Not registered to any network

View File

@@ -10,3 +10,13 @@ On the i-Tetra tracking device, the SIM900 is accessed
via N_GSM mux device. We use ofono as SMS message
service and incoming voice calls service, so we
use /dev/gsmtty1 provided by N_GSM mux.
SIM800 modem usage
==================
When using sim800 modem, the udev rule is the same as the
sim900 rule :
KERNEL=="ttyS3", ENV{OFONO_DRIVER}="sim900"
Because the SIM800 and SIM900 code are the merged into one driver.

View File

@@ -69,6 +69,17 @@ Methods dict GetProperties()
[service].Error.NotImplemented
[service].Error.Failed
object DialMemory(string memory position, string hide_callerid)
Initiates a new outgoing call to the number in the given memory
position/favourite. For callerid see the Dial method.
Possible Errors: [service].Error.InProgress
[service].Error.InvalidArguments
[service].Error.InvalidFormat
[service].Error.NotImplemented
[service].Error.Failed
void Transfer()
Joins the currently Active (or Outgoing, depending

View File

@@ -3,6 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
* Copyright (C) 2018 Gemalto M2M
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -654,3 +655,46 @@ int at_util_get_ipv4_address_and_netmask(const char *addrnetmask,
return ret;
}
int at_util_gprs_auth_method_to_auth_prot(
enum ofono_gprs_auth_method auth_method)
{
switch (auth_method) {
case OFONO_GPRS_AUTH_METHOD_ANY:
case OFONO_GPRS_AUTH_METHOD_PAP:
return 1;
case OFONO_GPRS_AUTH_METHOD_CHAP:
return 2;
case OFONO_GPRS_AUTH_METHOD_NONE:
return 0;
}
return 0;
}
const char *at_util_gprs_proto_to_pdp_type(enum ofono_gprs_proto proto)
{
switch (proto) {
case OFONO_GPRS_PROTO_IPV6:
return "IPV6";
case OFONO_GPRS_PROTO_IPV4V6:
return "IPV4V6";
break;
case OFONO_GPRS_PROTO_IP:
return "IP";
}
return NULL;
}
char *at_util_get_cgdcont_command(guint cid, enum ofono_gprs_proto proto,
const char *apn)
{
const char *pdp_type = at_util_gprs_proto_to_pdp_type(proto);
if (!apn)
return g_strdup_printf("AT+CGDCONT=%u", cid);
return g_strdup_printf("AT+CGDCONT=%u,\"%s\",\"%s\"", cid, pdp_type,
apn);
}

View File

@@ -3,6 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
* Copyright (C) 2018 Gemalto M2M
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -86,7 +87,24 @@ void at_util_sim_state_query_free(struct at_util_sim_state_query *req);
int at_util_get_ipv4_address_and_netmask(const char *addrnetmask,
char *address, char *netmask);
int at_util_gprs_auth_method_to_auth_prot(
enum ofono_gprs_auth_method auth_method);
const char *at_util_gprs_proto_to_pdp_type(enum ofono_gprs_proto proto);
/*
* at_util_get_cgdcont_command
* if the apn pointer is NULL, the context will be removed: the resulting
* string will be like: AT+CGDCONT=7
* but if apn pointer is not NULL and the string is empty, then
* this function will create a normal context with empty apn, like:
* AT+CGDCONT=4,"IPV6",""
*/
char *at_util_get_cgdcont_command(guint cid, enum ofono_gprs_proto proto,
const char *apn);
struct cb_data {
gint ref_count;
void *cb;
void *data;
void *user;
@@ -97,12 +115,29 @@ static inline struct cb_data *cb_data_new(void *cb, void *data)
struct cb_data *ret;
ret = g_new0(struct cb_data, 1);
ret->ref_count = 1;
ret->cb = cb;
ret->data = data;
return ret;
}
static inline struct cb_data *cb_data_ref(struct cb_data *cbd)
{
cbd->ref_count++;
return cbd;
}
static inline void cb_data_unref(gpointer user_data)
{
struct cb_data *cbd = user_data;
if (--cbd->ref_count)
return;
g_free(cbd);
}
static inline int at_util_convert_signal_strength(int strength)
{
int result;

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -212,7 +211,7 @@ static void at_call_barring_remove(struct ofono_call_barring *cb)
ofono_call_barring_set_data(cb, NULL);
}
static struct ofono_call_barring_driver driver = {
static const struct ofono_call_barring_driver driver = {
.name = "atmodem",
.probe = at_call_barring_probe,
.remove = at_call_barring_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -264,7 +263,7 @@ static void at_ccfc_remove(struct ofono_call_forwarding *cf)
ofono_call_forwarding_set_data(cf, NULL);
}
static struct ofono_call_forwarding_driver driver = {
static const struct ofono_call_forwarding_driver driver = {
.name = "atmodem",
.probe = at_ccfc_probe,
.remove = at_ccfc_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -331,7 +330,7 @@ static void at_caoc_remove(struct ofono_call_meter *cm)
ofono_call_meter_set_data(cm, NULL);
}
static struct ofono_call_meter_driver driver = {
static const struct ofono_call_meter_driver driver = {
.name = "atmodem",
.probe = at_caoc_probe,
.remove = at_caoc_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -398,7 +397,7 @@ static void at_call_settings_remove(struct ofono_call_settings *cs)
ofono_call_settings_set_data(cs, NULL);
}
static struct ofono_call_settings_driver driver = {
static const struct ofono_call_settings_driver driver = {
.name = "atmodem",
.probe = at_call_settings_probe,
.remove = at_call_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
@@ -207,7 +206,7 @@ static void at_call_volume_remove(struct ofono_call_volume *cv)
g_free(cvd);
}
static struct ofono_call_volume_driver driver = {
static const struct ofono_call_volume_driver driver = {
.name = "atmodem",
.probe = at_call_volume_probe,
.remove = at_call_volume_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
@@ -48,6 +47,51 @@ struct cbs_data {
unsigned int vendor;
};
static void at_xmm_etw_sec_notify(GAtResult *result, gpointer user_data)
{
struct ofono_cbs *cbs = user_data;
const char *hexpdu;
int pdulen;
GAtResultIter iter;
unsigned char pdu[88];
long hexpdulen;
DBG("");
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "+XETWSECWARN:"))
return;
if (!g_at_result_iter_next_number(&iter, &pdulen))
return;
if (pdulen != 88) {
ofono_error("Got a CBM message with invalid PDU size!");
return;
}
hexpdu = g_at_result_pdu(result);
if (hexpdu == NULL) {
ofono_error("Got a CBM, but no PDU. Are we in text mode?");
return;
}
DBG("Got new Cell Broadcast via XETWSECWARN: %s, %d", hexpdu, pdulen);
if (decode_hex_own_buf(hexpdu, -1, &hexpdulen, 0, pdu) == NULL) {
ofono_error("Unable to hex-decode the PDU");
return;
}
if (hexpdulen != pdulen) {
ofono_error("hexpdu length not equal to reported pdu length");
return;
}
ofono_cbs_notify(cbs, pdu, pdulen);
}
static void at_cbm_notify(GAtResult *result, gpointer user_data)
{
struct ofono_cbs *cbs = user_data;
@@ -121,9 +165,14 @@ static void at_cbs_set_topics(struct ofono_cbs *cbs, const char *topics,
switch (data->vendor) {
case OFONO_VENDOR_GOBI:
case OFONO_VENDOR_QUALCOMM_MSM:
case OFONO_VENDOR_GEMALTO:
g_at_chat_send(data->chat, "AT+CSCB=0", none_prefix,
NULL, NULL, NULL);
break;
case OFONO_VENDOR_XMM:
g_at_chat_send(data->chat, "AT+XETWNTFYSTART=2", none_prefix,
NULL, NULL, NULL);
break;
default:
break;
}
@@ -151,6 +200,10 @@ static void at_cbs_clear_topics(struct ofono_cbs *cbs,
DBG("");
if (data->vendor == OFONO_VENDOR_XMM)
g_at_chat_send(data->chat, "AT+XETWNTFYSTOP=2", none_prefix,
NULL, NULL, NULL);
if (g_at_chat_send(data->chat, "AT+CSCB=0", none_prefix,
at_cscb_set_cb, cbd, g_free) > 0)
return;
@@ -175,6 +228,10 @@ static void at_cbs_register(gboolean ok, GAtResult *result, gpointer user)
*/
g_at_chat_register(data->chat, "+CBM:", at_cbm_notify, TRUE, cbs, NULL);
if (data->vendor == OFONO_VENDOR_XMM)
g_at_chat_register(data->chat, "+XETWSECWARN:",
at_xmm_etw_sec_notify, TRUE, cbs, NULL);
ofono_cbs_register(cbs);
}
@@ -223,6 +280,13 @@ static int at_cbs_probe(struct ofono_cbs *cbs, unsigned int vendor,
ofono_cbs_set_data(cbs, data);
if (vendor == OFONO_VENDOR_XMM) {
g_at_chat_send(data->chat, "AT+XCMAS=1", cscb_prefix,
NULL, NULL, NULL);
g_at_chat_send(data->chat, "AT+XETWCFG=1,1,0,0; ", none_prefix,
NULL, NULL, NULL);
}
g_at_chat_send(data->chat, "AT+CSCB=?", cscb_prefix,
at_cscb_support_cb, cbs, NULL);
@@ -239,7 +303,7 @@ static void at_cbs_remove(struct ofono_cbs *cbs)
g_free(data);
}
static struct ofono_cbs_driver driver = {
static const struct ofono_cbs_driver driver = {
.name = "atmodem",
.probe = at_cbs_probe,
.remove = at_cbs_remove,

View File

@@ -153,7 +153,7 @@ static void at_devinfo_remove(struct ofono_devinfo *info)
g_at_chat_unref(chat);
}
static struct ofono_devinfo_driver driver = {
static const struct ofono_devinfo_driver driver = {
.name = "atmodem",
.probe = at_devinfo_probe,
.remove = at_devinfo_remove,

View File

@@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -263,7 +262,7 @@ static void at_gnss_remove(struct ofono_gnss *gnss)
g_free(gd);
}
static struct ofono_gnss_driver driver = {
static const struct ofono_gnss_driver driver = {
.name = "atmodem",
.probe = at_gnss_probe,
.remove = at_gnss_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -465,10 +464,19 @@ static int at_gprs_context_probe(struct ofono_gprs_context *gc,
static void at_gprs_context_remove(struct ofono_gprs_context *gc)
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
GAtIO *io;
DBG("");
if (gcd->state != STATE_IDLE && gcd->ppp) {
if ((gcd->vendor == OFONO_VENDOR_HUAWEI) && gcd->chat) {
/* immediately send escape sequence */
io = g_at_chat_get_io(gcd->chat);
if (io)
g_at_io_write(io, "+++", 3);
}
g_at_ppp_unref(gcd->ppp);
g_at_chat_resume(gcd->chat);
}
@@ -479,7 +487,7 @@ static void at_gprs_context_remove(struct ofono_gprs_context *gc)
g_free(gcd);
}
static struct ofono_gprs_context_driver driver = {
static const struct ofono_gprs_context_driver driver = {
.name = "atmodem",
.probe = at_gprs_context_probe,
.remove = at_gprs_context_remove,

View File

@@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -642,7 +641,7 @@ static void at_gprs_remove(struct ofono_gprs *gprs)
g_free(gd);
}
static struct ofono_gprs_driver driver = {
static const struct ofono_gprs_driver driver = {
.name = "atmodem",
.probe = at_gprs_probe,
.remove = at_gprs_remove,

View File

@@ -3,6 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2017 Intel Corporation. All rights reserved.
* Copyright (C) 2018 Gemalto M2M
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -23,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -41,45 +41,88 @@
#include "atmodem.h"
static const char *none_prefix[] = { NULL };
struct lte_driver_data {
GAtChat *chat;
struct ofono_lte_default_attach_info pending_info;
};
static void at_lte_set_default_attach_info_cb(gboolean ok, GAtResult *result,
static void at_lte_set_auth_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_lte_cb_t cb = cbd->cb;
struct ofono_error error;
DBG("ok %d", ok);
decode_at_error(&error, g_at_result_final_response(result));
cb(&error, cbd->data);
}
static void at_lte_set_default_attach_info_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_lte_cb_t cb = cbd->cb;
void *data = cbd->data;
struct lte_driver_data *ldd = cbd->user;
struct ofono_error error;
char buf[32 + OFONO_GPRS_MAX_USERNAME_LENGTH +
OFONO_GPRS_MAX_PASSWORD_LENGTH + 1];
size_t buflen = sizeof(buf);
size_t len;
enum ofono_gprs_auth_method auth_method;
if (!ok) {
decode_at_error(&error, g_at_result_final_response(result));
cb(&error, data);
return;
}
auth_method = ldd->pending_info.auth_method;
/* change the authentication method if the parameters are invalid */
if (!*ldd->pending_info.username || !*ldd->pending_info.password)
auth_method = OFONO_GPRS_AUTH_METHOD_NONE;
len = snprintf(buf, buflen, "AT+CGAUTH=0,%d",
at_util_gprs_auth_method_to_auth_prot(auth_method));
buflen -= len;
if (auth_method != OFONO_GPRS_AUTH_METHOD_NONE)
snprintf(buf + len, buflen, ",\"%s\",\"%s\"",
ldd->pending_info.username,
ldd->pending_info.password);
cbd = cb_data_ref(cbd);
if (g_at_chat_send(ldd->chat, buf, none_prefix,
at_lte_set_auth_cb, cbd, cb_data_unref) > 0)
return;
cb_data_unref(cbd);
CALLBACK_WITH_FAILURE(cb, data);
}
static void at_lte_set_default_attach_info(const struct ofono_lte *lte,
const struct ofono_lte_default_attach_info *info,
ofono_lte_cb_t cb, void *data)
{
struct lte_driver_data *ldd = ofono_lte_get_data(lte);
char buf[32 + OFONO_GPRS_MAX_APN_LENGTH + 1];
struct cb_data *cbd = cb_data_new(cb, data);
char *buf = at_util_get_cgdcont_command(0, info->proto, info->apn);
DBG("LTE config with APN: %s", info->apn);
cbd->user = ldd;
memcpy(&ldd->pending_info, info, sizeof(ldd->pending_info));
if (strlen(info->apn) > 0)
snprintf(buf, sizeof(buf), "AT+CGDCONT=0,\"IP\",\"%s\"",
info->apn);
else
snprintf(buf, sizeof(buf), "AT+CGDCONT=0,\"IP\"");
/* We can't do much in case of failure so don't check response. */
if (g_at_chat_send(ldd->chat, buf, NULL,
at_lte_set_default_attach_info_cb, cbd, g_free) > 0)
return;
if (g_at_chat_send(ldd->chat, buf, none_prefix,
at_lte_set_default_attach_info_cb,
cbd, cb_data_unref) > 0)
goto end;
cb_data_unref(cbd);
CALLBACK_WITH_FAILURE(cb, data);
end:
g_free(buf);
}
static gboolean lte_delayed_register(gpointer user_data)
@@ -91,7 +134,7 @@ static gboolean lte_delayed_register(gpointer user_data)
return FALSE;
}
static int at_lte_probe(struct ofono_lte *lte, void *data)
static int at_lte_probe(struct ofono_lte *lte, unsigned int vendor, void *data)
{
GAtChat *chat = data;
struct lte_driver_data *ldd;
@@ -124,7 +167,7 @@ static void at_lte_remove(struct ofono_lte *lte)
g_free(ldd);
}
static struct ofono_lte_driver driver = {
static const struct ofono_lte_driver driver = {
.name = "atmodem",
.probe = at_lte_probe,
.remove = at_lte_remove,

View File

@@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -48,6 +47,7 @@ static const char *cops_prefix[] = { "+COPS:", NULL };
static const char *csq_prefix[] = { "+CSQ:", NULL };
static const char *cind_prefix[] = { "+CIND:", NULL };
static const char *cmer_prefix[] = { "+CMER:", NULL };
static const char *smoni_prefix[] = { "^SMONI:", NULL };
static const char *zpas_prefix[] = { "+ZPAS:", NULL };
static const char *option_tech_prefix[] = { "_OCTI:", "_OUWCTI:", NULL };
@@ -178,6 +178,31 @@ static int option_parse_tech(GAtResult *result)
return tech;
}
static int gemalto_parse_tech(GAtResult *result)
{
int tech = -1;
GAtResultIter iter;
const char *technology;
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "^SMONI: "))
return tech;
if (!g_at_result_iter_next_unquoted_string(&iter, &technology))
return tech;
if (strcmp(technology, "2G") == 0) {
tech = ACCESS_TECHNOLOGY_GSM_EGPRS;
} else if (strcmp(technology, "3G") == 0) {
tech = ACCESS_TECHNOLOGY_UTRAN;
} else if (strcmp(technology, "4G") == 0) {
tech = ACCESS_TECHNOLOGY_EUTRAN;
}
return tech;
}
static void at_creg_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
@@ -202,9 +227,25 @@ static void at_creg_cb(gboolean ok, GAtResult *result, gpointer user_data)
if ((status == 1 || status == 5) && (tech == -1))
tech = nd->tech;
/* 6-10 is EUTRAN, with 8 being emergency bearer case */
if (status > 5 && tech == -1)
tech = ACCESS_TECHNOLOGY_EUTRAN;
cb(&error, status, lac, ci, tech, cbd->data);
}
static void gemalto_query_tech_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct tech_query *tq = user_data;
int tech;
tech = gemalto_parse_tech(result);
ofono_netreg_status_notify(tq->netreg,
tq->status, tq->lac, tq->ci, tech);
}
static void zte_tech_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
@@ -838,7 +879,7 @@ static void telit_ciev_notify(GAtResult *result, gpointer user_data)
ofono_netreg_strength_notify(netreg, strength);
}
static void cinterion_ciev_notify(GAtResult *result, gpointer user_data)
static void gemalto_ciev_notify(GAtResult *result, gpointer user_data)
{
struct ofono_netreg *netreg = user_data;
struct netreg_data *nd = ofono_netreg_get_data(netreg);
@@ -1518,6 +1559,12 @@ static void creg_notify(GAtResult *result, gpointer user_data)
option_query_tech_cb, tq, g_free) > 0)
return;
break;
case OFONO_VENDOR_GEMALTO:
if (g_at_chat_send(nd->chat, "AT^SMONI",
smoni_prefix,
gemalto_query_tech_cb, tq, g_free) > 0)
return;
break;
}
g_free(tq);
@@ -1984,12 +2031,12 @@ static void at_creg_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
g_at_chat_send(nd->chat, "AT*TLTS=1", none_prefix,
NULL, NULL, NULL);
break;
case OFONO_VENDOR_CINTERION:
case OFONO_VENDOR_GEMALTO:
/*
* We can't set rssi bounds from Cinterion responses
* We can't set rssi bounds from Gemalto responses
* so set them up to specified values here
*
* Cinterion rssi signal strength specified as:
* Gemalto rssi signal strength specified as:
* 0 <= -112dBm
* 1 - 4 signal strengh in 15 dB steps
* 5 >= -51 dBm
@@ -2003,7 +2050,7 @@ static void at_creg_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
g_at_chat_send(nd->chat, "AT^SIND=\"rssi\",1", none_prefix,
NULL, NULL, NULL);
g_at_chat_register(nd->chat, "+CIEV:",
cinterion_ciev_notify, FALSE, netreg, NULL);
gemalto_ciev_notify, FALSE, netreg, NULL);
break;
case OFONO_VENDOR_NOKIA:
case OFONO_VENDOR_SAMSUNG:
@@ -2107,7 +2154,7 @@ static void at_netreg_remove(struct ofono_netreg *netreg)
g_free(nd);
}
static struct ofono_netreg_driver driver = {
static const struct ofono_netreg_driver driver = {
.name = "atmodem",
.probe = at_netreg_probe,
.remove = at_netreg_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -593,7 +592,7 @@ static void at_phonebook_remove(struct ofono_phonebook *pb)
g_free(pbd);
}
static struct ofono_phonebook_driver driver = {
static const struct ofono_phonebook_driver driver = {
.name = "atmodem",
.probe = at_phonebook_probe,
.remove = at_phonebook_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -66,10 +65,11 @@ static const char *oercn_prefix[] = { "_OERCN:", NULL };
static const char *cpinr_prefixes[] = { "+CPINR:", "+CPINRE:", NULL };
static const char *epin_prefix[] = { "*EPIN:", NULL };
static const char *simcom_spic_prefix[] = { "+SPIC:", NULL };
static const char *cinterion_spic_prefix[] = { "^SPIC:", NULL };
static const char *gemalto_spic_prefix[] = { "^SPIC:", NULL };
static const char *pct_prefix[] = { "#PCT:", NULL };
static const char *pnnm_prefix[] = { "+PNNM:", NULL };
static const char *qpinc_prefix[] = { "+QPINC:", NULL };
static const char *qtrpin_prefix[] = { "+QTRPIN:", NULL };
static const char *upincnt_prefix[] = { "+UPINCNT:", NULL };
static const char *cuad_prefix[] = { "+CUAD:", NULL };
static const char *ccho_prefix[] = { "+CCHO:", NULL };
@@ -982,6 +982,49 @@ error:
CALLBACK_WITH_FAILURE(cb, NULL, cbd->data);
}
static void at_qtrpin_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_sim_pin_retries_cb_t cb = cbd->cb;
const char *final = g_at_result_final_response(result);
GAtResultIter iter;
struct ofono_error error;
int retries[OFONO_SIM_PASSWORD_INVALID];
size_t i;
decode_at_error(&error, final);
if (!ok) {
cb(&error, NULL, cbd->data);
return;
}
for (i = 0; i < OFONO_SIM_PASSWORD_INVALID; i++)
retries[i] = -1;
g_at_result_iter_init(&iter, result);
while (g_at_result_iter_next(&iter, "+QTRPIN:")) {
int pin, pin2, puk, puk2;
if (!g_at_result_iter_next_number(&iter, &pin))
continue;
if (!g_at_result_iter_next_number(&iter, &pin2))
continue;
if (!g_at_result_iter_next_number(&iter, &puk))
continue;
if (!g_at_result_iter_next_number(&iter, &puk2))
continue;
retries[OFONO_SIM_PASSWORD_SIM_PIN] = pin;
retries[OFONO_SIM_PASSWORD_SIM_PUK] = puk;
retries[OFONO_SIM_PASSWORD_SIM_PIN2] = pin2;
retries[OFONO_SIM_PASSWORD_SIM_PUK2] = puk2;
}
cb(&error, retries, cbd->data);
}
static void at_qpinc_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
@@ -1066,7 +1109,7 @@ error:
CALLBACK_WITH_FAILURE(cb, NULL, cbd->data);
}
static void cinterion_spic_cb(gboolean ok, GAtResult *result,
static void gemalto_spic_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
@@ -1172,15 +1215,20 @@ static void at_pin_retries_query(struct ofono_sim *sim,
at_qpinc_cb, cbd, g_free) > 0)
return;
break;
case OFONO_VENDOR_QUECTEL_M95:
if (g_at_chat_send(sd->chat, "AT+QTRPIN", qtrpin_prefix,
at_qtrpin_cb, cbd, g_free) > 0)
return;
break;
case OFONO_VENDOR_UBLOX:
case OFONO_VENDOR_UBLOX_TOBY_L2:
if (g_at_chat_send(sd->chat, "AT+UPINCNT", upincnt_prefix,
upincnt_cb, cbd, g_free) > 0)
return;
break;
case OFONO_VENDOR_CINTERION:
if (g_at_chat_send(sd->chat, "AT^SPIC", cinterion_spic_prefix,
cinterion_spic_cb, cbd, g_free) > 0)
case OFONO_VENDOR_GEMALTO:
if (g_at_chat_send(sd->chat, "AT^SPIC", gemalto_spic_prefix,
gemalto_spic_cb, cbd, g_free) > 0)
return;
break;
default:
@@ -1305,6 +1353,7 @@ static void at_pin_send_cb(gboolean ok, GAtResult *result,
case OFONO_VENDOR_HUAWEI:
case OFONO_VENDOR_SIMCOM:
case OFONO_VENDOR_SIERRA:
case OFONO_VENDOR_QUECTEL_M95:
/*
* On ZTE modems, after pin is entered, SIM state is checked
* by polling CPIN as their modem doesn't provide unsolicited
@@ -1359,12 +1408,12 @@ static void at_pin_send_puk(struct ofono_sim *sim, const char *puk,
char buf[64];
int ret;
cbd->user = sd;
cbd->user = sim;
snprintf(buf, sizeof(buf), "AT+CPIN=\"%s\",\"%s\"", puk, passwd);
ret = g_at_chat_send(sd->chat, buf, none_prefix,
at_pin_send_cb, cbd, NULL);
at_pin_send_cb, cbd, g_free);
memset(buf, 0, sizeof(buf));
@@ -1909,7 +1958,7 @@ static void at_sim_remove(struct ofono_sim *sim)
g_free(sd);
}
static struct ofono_sim_driver driver = {
static const struct ofono_sim_driver driver = {
.name = "atmodem",
.probe = at_sim_probe,
.remove = at_sim_remove,
@@ -1937,7 +1986,7 @@ static struct ofono_sim_driver driver = {
.logical_access = at_logical_access
};
static struct ofono_sim_driver driver_noef = {
static const struct ofono_sim_driver driver_noef = {
.name = "atmodem-noef",
.probe = at_sim_probe,
.remove = at_sim_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -104,7 +103,7 @@ static void at_csca_set(struct ofono_sms *sms,
{
struct sms_data *data = ofono_sms_get_data(sms);
struct cb_data *cbd = cb_data_new(cb, user_data);
char buf[64];
char buf[128];
snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type);
@@ -220,9 +219,16 @@ static void at_cmgs(struct ofono_sms *sms, const unsigned char *pdu,
int len;
if (mms) {
snprintf(buf, sizeof(buf), "AT+CMMS=%d", mms);
g_at_chat_send(data->chat, buf, none_prefix,
NULL, NULL, NULL);
switch (data->vendor) {
case OFONO_VENDOR_GEMALTO:
/* no mms support */
break;
default:
snprintf(buf, sizeof(buf), "AT+CMMS=%d", mms);
g_at_chat_send(data->chat, buf, none_prefix,
NULL, NULL, NULL);
break;
}
}
len = snprintf(buf, sizeof(buf), "AT+CMGS=%d\r", tpdu_len);
@@ -329,7 +335,7 @@ static inline void at_ack_delivery(struct ofono_sms *sms)
/* We must acknowledge the PDU using CNMA */
if (data->cnma_ack_pdu) {
switch (data->vendor) {
case OFONO_VENDOR_CINTERION:
case OFONO_VENDOR_GEMALTO:
snprintf(buf, sizeof(buf), "AT+CNMA=1");
break;
default:
@@ -411,9 +417,25 @@ static void at_cmt_notify(GAtResult *result, gpointer user_data)
goto err;
switch (data->vendor) {
case OFONO_VENDOR_CINTERION:
if (!g_at_result_iter_next_number(&iter, &tpdu_len))
goto err;
case OFONO_VENDOR_GEMALTO:
if (!g_at_result_iter_next_number(&iter, &tpdu_len)) {
/*
* Some Gemalto modems (ALS3,PLS8...), act in
* accordance with 3GPP 27.005. So we need to skip
* the first (<alpha>) field
* \r\n+CMT: ,23\r\nCAFECAFECAFE... ...\r\n
* ^------- PDU length
*/
DBG("Retrying to find the PDU length");
if (!g_at_result_iter_skip_next(&iter))
goto err;
/* Next attempt at finding the PDU length. */
if (!g_at_result_iter_next_number(&iter, &tpdu_len))
goto err;
}
break;
default:
if (!g_at_result_iter_skip_next(&iter))
@@ -439,6 +461,7 @@ static void at_cmt_notify(GAtResult *result, gpointer user_data)
if (data->vendor != OFONO_VENDOR_SIMCOM)
at_ack_delivery(sms);
return;
err:
ofono_error("Unable to parse CMT notification");
@@ -835,8 +858,18 @@ static gboolean build_cnmi_string(char *buf, int *cnmi_opts,
data->cnma_enabled ? "21" : "1", FALSE))
return FALSE;
switch (data->vendor) {
case OFONO_VENDOR_GEMALTO:
mode = "0";
break;
default:
/* Sounds like 2 is the sanest mode */
mode = "20";
break;
}
/* Always deliver CB via +CBM, otherwise don't deliver at all */
if (!append_cnmi_element(buf, &len, cnmi_opts[2], "20", FALSE))
if (!append_cnmi_element(buf, &len, cnmi_opts[2], mode, FALSE))
return FALSE;
/*
@@ -1296,7 +1329,7 @@ static void at_sms_remove(struct ofono_sms *sms)
ofono_sms_set_data(sms, NULL);
}
static struct ofono_sms_driver driver = {
static const struct ofono_sms_driver driver = {
.name = "atmodem",
.probe = at_sms_probe,
.remove = at_sms_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -223,7 +222,7 @@ static void at_stk_remove(struct ofono_stk *stk)
g_free(sd);
}
static struct ofono_stk_driver driver = {
static const struct ofono_stk_driver driver = {
.name = "atmodem",
.probe = at_stk_probe,
.remove = at_stk_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -327,7 +326,7 @@ static void at_ussd_remove(struct ofono_ussd *ussd)
g_free(data);
}
static struct ofono_ussd_driver driver = {
static const struct ofono_ussd_driver driver = {
.name = "atmodem",
.probe = at_ussd_probe,
.remove = at_ussd_remove,

View File

@@ -44,8 +44,9 @@ enum ofono_vendor {
OFONO_VENDOR_WAVECOM_Q2XXX,
OFONO_VENDOR_ALCATEL,
OFONO_VENDOR_QUECTEL,
OFONO_VENDOR_QUECTEL_M95,
OFONO_VENDOR_UBLOX,
OFONO_VENDOR_UBLOX_TOBY_L2,
OFONO_VENDOR_CINTERION,
OFONO_VENDOR_XMM,
OFONO_VENDOR_GEMALTO,
};

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -1120,6 +1119,7 @@ static int at_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,
switch (vd->vendor) {
case OFONO_VENDOR_QUALCOMM_MSM:
case OFONO_VENDOR_SIMCOM:
g_at_chat_send(vd->chat, "AT+COLP=0", NULL, NULL, NULL, NULL);
break;
default:
@@ -1154,7 +1154,7 @@ static void at_voicecall_remove(struct ofono_voicecall *vc)
g_free(vd);
}
static struct ofono_voicecall_driver driver = {
static const struct ofono_voicecall_driver driver = {
.name = "atmodem",
.probe = at_voicecall_probe,
.remove = at_voicecall_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -292,7 +291,7 @@ static void calypso_stk_remove(struct ofono_stk *stk)
g_free(sd);
}
static struct ofono_stk_driver driver = {
static const struct ofono_stk_driver driver = {
.name = "calypsomodem",
.probe = calypso_stk_probe,
.remove = calypso_stk_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -402,7 +401,7 @@ static void calypso_voicecall_remove(struct ofono_voicecall *vc)
g_free(vd);
}
static struct ofono_voicecall_driver driver = {
static const struct ofono_voicecall_driver driver = {
.name = "calypsomodem",
.probe = calypso_voicecall_probe,
.remove = calypso_voicecall_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -323,7 +322,7 @@ static void cdma_connman_remove(struct ofono_cdma_connman *cm)
g_free(cd);
}
static struct ofono_cdma_connman_driver driver = {
static const struct ofono_cdma_connman_driver driver = {
.name = "cdmamodem",
.probe = cdma_connman_probe,
.remove = cdma_connman_remove,

View File

@@ -153,7 +153,7 @@ static void cdma_devinfo_remove(struct ofono_devinfo *info)
ofono_devinfo_set_data(info, NULL);
}
static struct ofono_devinfo_driver driver = {
static const struct ofono_devinfo_driver driver = {
.name = "cdmamodem",
.probe = cdma_devinfo_probe,
.remove = cdma_devinfo_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -143,7 +142,7 @@ static void cdma_voicecall_remove(struct ofono_cdma_voicecall *vc)
g_free(vd);
}
static struct ofono_cdma_voicecall_driver driver = {
static const struct ofono_cdma_voicecall_driver driver = {
.name = "cdmamodem",
.probe = cdma_voicecall_probe,
.remove = cdma_voicecall_remove,

View File

@@ -73,7 +73,7 @@ static void dun_gprs_attached_status(struct ofono_gprs *gprs,
CALLBACK_WITH_SUCCESS(cb, 1, data);
}
static struct ofono_gprs_driver driver = {
static const struct ofono_gprs_driver driver = {
.name = "dunmodem",
.probe = dun_gprs_probe,
.remove = dun_gprs_remove,

View File

@@ -107,7 +107,7 @@ static void dun_netreg_remove(struct ofono_netreg *netreg)
g_free(nd);
}
static struct ofono_netreg_driver driver = {
static const struct ofono_netreg_driver driver = {
.name = "dunmodem",
.probe = dun_netreg_probe,
.remove = dun_netreg_remove,

View File

@@ -3,6 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2017 Vincent Cesson. All rights reserved.
* Copyright (C) 2018 Gemalto M2M
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -35,12 +36,14 @@
static int gemaltomodem_init(void)
{
gemalto_location_reporting_init();
gemalto_voicecall_init();
return 0;
}
static void gemaltomodem_exit(void)
{
gemalto_voicecall_exit();
gemalto_location_reporting_exit();
}

View File

@@ -3,6 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2017 Vincent Cesson. All rights reserved.
* Copyright (C) 2018 Gemalto M2M
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -23,3 +24,6 @@
extern void gemalto_location_reporting_init();
extern void gemalto_location_reporting_exit();
extern void gemalto_voicecall_init();
extern void gemalto_voicecall_exit();

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -217,7 +216,7 @@ static void gemalto_location_reporting_remove(struct ofono_location_reporting *l
g_free(gd);
}
static struct ofono_location_reporting_driver driver = {
static const struct ofono_location_reporting_driver driver = {
.name = "gemaltomodem",
.type = OFONO_LOCATION_REPORTING_TYPE_NMEA,
.probe = gemalto_location_reporting_probe,

View File

@@ -0,0 +1,576 @@
/*
*
* oFono - Open Source Telephony
*
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
* Copyright (C) 2018 Gemalto M2M
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <glib.h>
#include <ofono/log.h>
#include <ofono/modem.h>
#include <ofono/voicecall.h>
#include "gatchat.h"
#include "gatresult.h"
#include "common.h"
#include "gemaltomodem.h"
static const char *clcc_prefix[] = { "+CLCC:", NULL };
static const char *none_prefix[] = { NULL };
struct voicecall_data {
GAtChat *chat;
GSList *calls;
unsigned int local_release;
GSList *new_calls;
};
struct release_id_req {
struct ofono_voicecall *vc;
ofono_voicecall_cb_t cb;
void *data;
int id;
};
struct change_state_req {
struct ofono_voicecall *vc;
ofono_voicecall_cb_t cb;
void *data;
int affected_types;
};
static void generic_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct change_state_req *req = user_data;
struct voicecall_data *vd = ofono_voicecall_get_data(req->vc);
struct ofono_error error;
decode_at_error(&error, g_at_result_final_response(result));
if (ok && req->affected_types) {
GSList *l;
struct ofono_call *call;
for (l = vd->calls; l; l = l->next) {
call = l->data;
if (req->affected_types & (1 << call->status))
vd->local_release |= (1 << call->id);
}
}
req->cb(&error, req->data);
}
static void gemalto_call_common(const char *cmd, struct ofono_voicecall *vc,
GAtResultFunc result_cb,
unsigned int affected_types,
ofono_voicecall_cb_t cb, void *data)
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
struct change_state_req *req = g_new0(struct change_state_req, 1);
req->vc = vc;
req->cb = cb;
req->data = data;
req->affected_types = affected_types;
if (g_at_chat_send(vd->chat, cmd, none_prefix,
result_cb, req, g_free) > 0)
return;
g_free(req);
CALLBACK_WITH_FAILURE(cb, data);
}
static void gemalto_answer(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
gemalto_call_common("ATA", vc, generic_cb, 0, cb, data);
}
static void gemalto_hangup_all(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
unsigned int affected = (1 << CALL_STATUS_INCOMING) |
(1 << CALL_STATUS_DIALING) |
(1 << CALL_STATUS_ALERTING) |
(1 << CALL_STATUS_WAITING) |
(1 << CALL_STATUS_HELD) |
(1 << CALL_STATUS_ACTIVE);
/* Hangup all calls */
gemalto_call_common("AT+CHUP", vc, generic_cb, affected, cb, data);
}
static void gemalto_hangup(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
unsigned int affected = (1 << CALL_STATUS_ACTIVE);
/* Hangup current active call */
gemalto_call_common("AT+CHLD=1", vc, generic_cb, affected, cb, data);
}
static void gemalto_hold_all_active(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
unsigned int affected = (1 << CALL_STATUS_ACTIVE);
gemalto_call_common("AT+CHLD=2", vc, generic_cb, affected, cb, data);
}
static void gemalto_release_all_held(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
unsigned int affected = (1 << CALL_STATUS_INCOMING) |
(1 << CALL_STATUS_WAITING);
gemalto_call_common("AT+CHLD=0", vc, generic_cb, affected, cb, data);
}
static void gemalto_set_udub(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
unsigned int affected = (1 << CALL_STATUS_INCOMING) |
(1 << CALL_STATUS_WAITING);
gemalto_call_common("AT+CHLD=0", vc, generic_cb, affected, cb, data);
}
static void gemalto_release_all_active(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
unsigned int affected = (1 << CALL_STATUS_ACTIVE);
gemalto_call_common("AT+CHLD=1", vc, generic_cb, affected, cb, data);
}
static void release_id_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct release_id_req *req = user_data;
struct voicecall_data *vd = ofono_voicecall_get_data(req->vc);
struct ofono_error error;
decode_at_error(&error, g_at_result_final_response(result));
if (ok)
vd->local_release = 1 << req->id;
req->cb(&error, req->data);
}
static void gemalto_release_specific(struct ofono_voicecall *vc, int id,
ofono_voicecall_cb_t cb, void *data)
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
struct release_id_req *req = g_new0(struct release_id_req, 1);
char buf[32];
req->vc = vc;
req->cb = cb;
req->data = data;
req->id = id;
snprintf(buf, sizeof(buf), "AT+CHLD=1%d", id);
if (g_at_chat_send(vd->chat, buf, none_prefix,
release_id_cb, req, g_free) > 0)
return;
g_free(req);
CALLBACK_WITH_FAILURE(cb, data);
}
static void gemalto_private_chat(struct ofono_voicecall *vc, int id,
ofono_voicecall_cb_t cb, void *data)
{
char buf[32];
snprintf(buf, sizeof(buf), "AT+CHLD=2%d", id);
gemalto_call_common(buf, vc, generic_cb, 0, cb, data);
}
static void gemalto_create_multiparty(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
gemalto_call_common("AT+CHLD=3", vc, generic_cb, 0, cb, data);
}
static void gemalto_transfer(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
/* Held & Active */
unsigned int affected = (1 << CALL_STATUS_ACTIVE) |
(1 << CALL_STATUS_HELD);
/* Transfer can puts held & active calls together and disconnects
* from both. However, some networks support transferring of
* dialing/ringing calls as well.
*/
affected |= (1 << CALL_STATUS_DIALING) |
(1 << CALL_STATUS_ALERTING);
gemalto_call_common("AT+CHLD=4", vc, generic_cb, affected, cb, data);
}
static void gemalto_send_dtmf(struct ofono_voicecall *vc, const char *dtmf,
ofono_voicecall_cb_t cb, void *data)
{
struct ofono_modem *modem = ofono_voicecall_get_modem(vc);
int use_quotes = ofono_modem_get_integer(modem, "GemaltoVtsQuotes");
int len = strlen(dtmf);
int s;
int i;
char *buf;
/* strlen("+VTS=\"T\";") = 9 + initial AT + null */
buf = (char *)alloca(len * 9 + 3);
if (use_quotes)
s = sprintf(buf, "AT+VTS=\"%c\"", dtmf[0]);
else
s = sprintf(buf, "AT+VTS=%c", dtmf[0]);
for (i = 1; i < len; i++) {
if (use_quotes)
s += sprintf(buf + s, ";+VTS=\"%c\"", dtmf[i]);
else
s += sprintf(buf + s, ";+VTS=%c", dtmf[i]);
}
gemalto_call_common(buf, vc, generic_cb, 0, cb, data);
}
static void gemalto_dial(struct ofono_voicecall *vc,
const struct ofono_phone_number *ph,
enum ofono_clir_option clir,
ofono_voicecall_cb_t cb, void *data)
{
struct cb_data *cbd = cb_data_new(cb, data);
char buf[256];
size_t len;
cbd->user = vc;
if (ph->type == 145)
len = snprintf(buf, sizeof(buf), "ATD+%s", ph->number);
else
len = snprintf(buf, sizeof(buf), "ATD%s", ph->number);
switch (clir) {
case OFONO_CLIR_OPTION_INVOCATION:
len += snprintf(buf+len, sizeof(buf)-len, "I");
break;
case OFONO_CLIR_OPTION_SUPPRESSION:
len += snprintf(buf+len, sizeof(buf)-len, "i");
break;
default:
break;
}
snprintf(buf + len, sizeof(buf) - len, ";");
gemalto_call_common(buf, vc, generic_cb, 0, cb, data);
}
static void gemalto_parse_slcc(GAtResult *result, GSList **l,
ofono_bool_t *ret_mpty, gboolean *last)
{
GAtResultIter iter;
int id, dir, status, type;
ofono_bool_t mpty;
struct ofono_call *call;
const char *str = "";
int number_type = 129;
if (last)
*last = TRUE;
g_at_result_iter_init(&iter, result);
g_at_result_iter_next(&iter, "^SLCC:");
if (!g_at_result_iter_next_number(&iter, &id))
return;
if (last)
*last = FALSE;
if (id == 0)
return;
if (!g_at_result_iter_next_number(&iter, &dir))
return;
if (!g_at_result_iter_next_number(&iter, &status))
return;
if (status > 5)
return;
if (!g_at_result_iter_next_number(&iter, &type))
return;
if (!g_at_result_iter_next_number(&iter, &mpty))
return;
/* skip 'Reserved=0' parameter, only difference from CLCC */
if (!g_at_result_iter_skip_next(&iter))
return;
if (g_at_result_iter_next_string(&iter, &str))
g_at_result_iter_next_number(&iter, &number_type);
call = g_new0(struct ofono_call, 1);
ofono_call_init(call);
call->id = id;
call->direction = dir;
call->status = status;
call->type = type;
strncpy(call->phone_number.number, str,
OFONO_MAX_PHONE_NUMBER_LENGTH);
call->phone_number.type = number_type;
if (strlen(str) > 0)
call->clip_validity = 2;
else
call->clip_validity = 0;
*l = g_slist_insert_sorted(*l, call, at_util_call_compare);
if (ret_mpty)
*ret_mpty = mpty;
}
static void clcc_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_voicecall *vc = user_data;
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
GSList *l;
if (!ok)
return;
vd->calls = at_util_parse_clcc(result, NULL);
for (l = vd->calls; l; l = l->next)
ofono_voicecall_notify(vc, l->data);
}
/*
* ^SLCC, except for one RFU parameter (see above in the parsing), is identical
* to +CLCC, but as URC it is parsed line by line, and the last line is
* indicated by an empty "^SLCC:" (equivalent to the "OK" for CLCC).
*/
static void slcc_notify(GAtResult *result, gpointer user_data)
{
struct ofono_voicecall *vc = user_data;
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
GSList *n, *o;
struct ofono_call *nc, *oc;
gboolean last;
gemalto_parse_slcc(result, &vd->new_calls, NULL, &last);
if (!last)
return;
n = vd->new_calls;
o = vd->calls;
while (n || o) {
nc = n ? n->data : NULL;
oc = o ? o->data : NULL;
if (oc && (nc == NULL || (nc->id > oc->id))) {
enum ofono_disconnect_reason reason;
if (vd->local_release & (1 << oc->id))
reason = OFONO_DISCONNECT_REASON_LOCAL_HANGUP;
else
reason = OFONO_DISCONNECT_REASON_REMOTE_HANGUP;
if (!oc->type)
ofono_voicecall_disconnected(vc, oc->id,
reason, NULL);
o = o->next;
} else if (nc && (oc == NULL || (nc->id < oc->id))) {
if (nc->type == 0) /* new call, signal it */
ofono_voicecall_notify(vc, nc);
n = n->next;
} else {
DBG("modify call part");
/* notify in case of changes */
if (memcmp(nc, oc, sizeof(*nc)))
ofono_voicecall_notify(vc, nc);
n = n->next;
o = o->next;
}
}
g_slist_free_full(vd->calls, g_free);
vd->calls = vd->new_calls;
vd->new_calls = NULL;
vd->local_release = 0;
}
static void cssi_notify(GAtResult *result, gpointer user_data)
{
struct ofono_voicecall *vc = user_data;
GAtResultIter iter;
int code, index;
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "+CSSI:"))
return;
if (!g_at_result_iter_next_number(&iter, &code))
return;
if (!g_at_result_iter_next_number(&iter, &index))
index = 0;
ofono_voicecall_ssn_mo_notify(vc, 0, code, index);
}
static void cssu_notify(GAtResult *result, gpointer user_data)
{
struct ofono_voicecall *vc = user_data;
GAtResultIter iter;
int code;
int index;
const char *num;
struct ofono_phone_number ph;
ph.number[0] = '\0';
ph.type = 129;
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "+CSSU:"))
return;
if (!g_at_result_iter_next_number(&iter, &code))
return;
if (!g_at_result_iter_next_number_default(&iter, -1, &index))
goto out;
if (!g_at_result_iter_next_string(&iter, &num))
goto out;
strncpy(ph.number, num, OFONO_MAX_PHONE_NUMBER_LENGTH);
if (!g_at_result_iter_next_number(&iter, &ph.type))
return;
out:
ofono_voicecall_ssn_mt_notify(vc, 0, code, index, &ph);
}
static void gemalto_voicecall_initialized(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct ofono_voicecall *vc = user_data;
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
DBG("voicecall_init: registering to notifications");
/* NO CARRIER, NO ANSWER, BUSY, NO DIALTONE are handled through SLCC */
g_at_chat_register(vd->chat, "^SLCC:", slcc_notify, FALSE, vc, NULL);
g_at_chat_register(vd->chat, "+CSSI:", cssi_notify, FALSE, vc, NULL);
g_at_chat_register(vd->chat, "+CSSU:", cssu_notify, FALSE, vc, NULL);
ofono_voicecall_register(vc);
/* Populate the call list */
g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix, clcc_cb, vc, NULL);
}
static int gemalto_voicecall_probe(struct ofono_voicecall *vc,
unsigned int vendor, void *data)
{
GAtChat *chat = data;
struct voicecall_data *vd;
vd = g_new0(struct voicecall_data, 1);
vd->chat = g_at_chat_clone(chat);
ofono_voicecall_set_data(vc, vd);
g_at_chat_send(vd->chat, "AT+CSSN=1,1", NULL, NULL, NULL, NULL);
g_at_chat_send(vd->chat, "AT^SLCC=1", NULL,
gemalto_voicecall_initialized, vc, NULL);
return 0;
}
static void gemalto_voicecall_remove(struct ofono_voicecall *vc)
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
ofono_voicecall_set_data(vc, NULL);
g_at_chat_unref(vd->chat);
g_free(vd);
}
static const struct ofono_voicecall_driver driver = {
.name = "gemaltomodem",
.probe = gemalto_voicecall_probe,
.remove = gemalto_voicecall_remove,
.dial = gemalto_dial,
.answer = gemalto_answer,
.hangup_all = gemalto_hangup_all,
.hangup_active = gemalto_hangup,
.hold_all_active = gemalto_hold_all_active,
.release_all_held = gemalto_release_all_held,
.set_udub = gemalto_set_udub,
.release_all_active = gemalto_release_all_active,
.release_specific = gemalto_release_specific,
.private_chat = gemalto_private_chat,
.create_multiparty = gemalto_create_multiparty,
.transfer = gemalto_transfer,
.send_tones = gemalto_send_dtmf
};
void gemalto_voicecall_init(void)
{
ofono_voicecall_driver_register(&driver);
}
void gemalto_voicecall_exit(void)
{
ofono_voicecall_driver_unregister(&driver);
}

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -218,7 +217,7 @@ static void hfp_call_volume_remove(struct ofono_call_volume *cv)
g_free(vd);
}
static struct ofono_call_volume_driver driver = {
static const struct ofono_call_volume_driver driver = {
.name = "hfpmodem",
.probe = hfp_call_volume_probe,
.remove = hfp_call_volume_remove,

View File

@@ -91,7 +91,7 @@ static void hfp_devinfo_remove(struct ofono_devinfo *info)
g_free(dd);
}
static struct ofono_devinfo_driver driver = {
static const struct ofono_devinfo_driver driver = {
.name = "hfpmodem",
.probe = hfp_devinfo_probe,
.remove = hfp_devinfo_remove,

View File

@@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -411,7 +410,7 @@ static void hfp_hf_indicator(struct ofono_handsfree *hf,
CALLBACK_WITH_FAILURE(cb, data);
}
static struct ofono_handsfree_driver driver = {
static const struct ofono_handsfree_driver driver = {
.name = "hfpmodem",
.probe = hfp_handsfree_probe,
.remove = hfp_handsfree_remove,

View File

@@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -343,7 +342,7 @@ static void hfp_netreg_remove(struct ofono_netreg *netreg)
g_free(nd);
}
static struct ofono_netreg_driver driver = {
static const struct ofono_netreg_driver driver = {
.name = "hfpmodem",
.probe = hfp_netreg_probe,
.remove = hfp_netreg_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -196,7 +195,7 @@ static void hfp_siri_set_eyes_free_mode(struct ofono_siri *siri,
CALLBACK_WITH_FAILURE(cb, NULL);
}
static struct ofono_siri_driver driver = {
static const struct ofono_siri_driver driver = {
.name = "hfpmodem",
.probe = hfp_siri_probe,
.remove = hfp_siri_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <errno.h>

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -422,6 +421,28 @@ static void hfp_dial_last(struct ofono_voicecall *vc, ofono_voicecall_cb_t cb,
CALLBACK_WITH_FAILURE(cb, data);
}
static void hfp_dial_memory(struct ofono_voicecall *vc,
unsigned int memory_location,
ofono_voicecall_cb_t cb, void *data)
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[256];
cbd->user = vc;
DBG("Calling memory location %d\n", memory_location);
snprintf(buf, sizeof(buf), "ATD>%d;", memory_location);
if (g_at_chat_send(vd->chat, buf, none_prefix,
atd_cb, cbd, g_free) > 0)
return;
g_free(cbd);
DBG("at_chat_failed");
CALLBACK_WITH_FAILURE(cb, data);
}
static void hfp_template(const char *cmd, struct ofono_voicecall *vc,
GAtResultFunc result_cb, unsigned int affected_types,
ofono_voicecall_cb_t cb, void *data)
@@ -1281,12 +1302,13 @@ static void hfp_voicecall_remove(struct ofono_voicecall *vc)
g_free(vd);
}
static struct ofono_voicecall_driver driver = {
static const struct ofono_voicecall_driver driver = {
.name = "hfpmodem",
.probe = hfp_voicecall_probe,
.remove = hfp_voicecall_remove,
.dial = hfp_dial,
.dial_last = hfp_dial_last,
.dial_memory = hfp_dial_memory,
.answer = hfp_answer,
.hangup_active = hfp_hangup,
.hold_all_active = hfp_hold_all_active,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -379,7 +378,7 @@ static void hso_gprs_context_remove(struct ofono_gprs_context *gc)
g_free(gcd);
}
static struct ofono_gprs_context_driver driver = {
static const struct ofono_gprs_context_driver driver = {
.name = "hsomodem",
.probe = hso_gprs_context_probe,
.remove = hso_gprs_context_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -199,7 +198,7 @@ static void hso_radio_settings_remove(struct ofono_radio_settings *rs)
g_free(rsd);
}
static struct ofono_radio_settings_driver driver = {
static const struct ofono_radio_settings_driver driver = {
.name = "hsomodem",
.probe = hso_radio_settings_probe,
.remove = hso_radio_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -113,7 +112,7 @@ static void huawei_audio_settings_remove(struct ofono_audio_settings *as)
g_free(asd);
}
static struct ofono_audio_settings_driver driver = {
static const struct ofono_audio_settings_driver driver = {
.name = "huaweimodem",
.probe = huawei_audio_settings_probe,
.remove = huawei_audio_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <glib.h>
#include <errno.h>
@@ -210,7 +209,7 @@ static void huawei_cdma_netreg_remove(struct ofono_cdma_netreg *netreg)
g_at_chat_unref(chat);
}
static struct ofono_cdma_netreg_driver driver = {
static const struct ofono_cdma_netreg_driver driver = {
.name = "huaweimodem",
.probe = huawei_cdma_netreg_probe,
.remove = huawei_cdma_netreg_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -339,7 +338,7 @@ static void huawei_gprs_context_remove(struct ofono_gprs_context *gc)
g_free(gcd);
}
static struct ofono_gprs_context_driver driver = {
static const struct ofono_gprs_context_driver driver = {
.name = "huaweimodem",
.probe = huawei_gprs_context_probe,
.remove = huawei_gprs_context_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -569,7 +568,7 @@ static void huawei_radio_settings_remove(struct ofono_radio_settings *rs)
g_free(rsd);
}
static struct ofono_radio_settings_driver driver = {
static const struct ofono_radio_settings_driver driver = {
.name = "huaweimodem",
.probe = huawei_radio_settings_probe,
.remove = huawei_radio_settings_remove,

View File

@@ -204,7 +204,7 @@ static void huawei_ussd_remove(struct ofono_ussd *ussd)
g_free(data);
}
static struct ofono_ussd_driver driver = {
static const struct ofono_ussd_driver driver = {
.name = "huaweimodem",
.probe = huawei_ussd_probe,
.remove = huawei_ussd_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -497,7 +496,7 @@ static void huawei_voicecall_remove(struct ofono_voicecall *vc)
g_free(vd);
}
static struct ofono_voicecall_driver driver = {
static const struct ofono_voicecall_driver driver = {
.name = "huaweimodem",
.probe = huawei_voicecall_probe,
.remove = huawei_voicecall_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -403,7 +402,7 @@ static void icera_gprs_context_remove(struct ofono_gprs_context *gc)
g_free(gcd);
}
static struct ofono_gprs_context_driver driver = {
static const struct ofono_gprs_context_driver driver = {
.name = "iceramodem",
.probe = icera_gprs_context_probe,
.remove = icera_gprs_context_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -212,7 +211,7 @@ static void icera_radio_settings_remove(struct ofono_radio_settings *rs)
g_free(rsd);
}
static struct ofono_radio_settings_driver driver = {
static const struct ofono_radio_settings_driver driver = {
.name = "iceramodem",
.probe = icera_radio_settings_probe,
.remove = icera_radio_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -382,7 +381,7 @@ static void ifx_audio_settings_remove(struct ofono_audio_settings *as)
g_free(asd);
}
static struct ofono_audio_settings_driver driver = {
static const struct ofono_audio_settings_driver driver = {
.name = "ifxmodem",
.probe = ifx_audio_settings_probe,
.remove = ifx_audio_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -167,7 +166,7 @@ static void ifx_ctm_remove(struct ofono_ctm *ctm)
g_free(ctmd);
}
static struct ofono_ctm_driver driver = {
static const struct ofono_ctm_driver driver = {
.name = "ifxmodem",
.probe = ifx_ctm_probe,
.remove = ifx_ctm_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -514,6 +513,9 @@ static void deactivate_cb(gboolean ok, GAtResult *result, gpointer user_data)
if (gcd->vendor != OFONO_VENDOR_XMM)
g_at_chat_resume(gcd->chat);
if (!gcd->cb)
return;
CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
}
@@ -652,7 +654,7 @@ static void ifx_gprs_context_remove(struct ofono_gprs_context *gc)
g_free(gcd);
}
static struct ofono_gprs_context_driver driver = {
static const struct ofono_gprs_context_driver driver = {
.name = "ifxmodem",
.probe = ifx_gprs_context_probe,
.remove = ifx_gprs_context_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -201,7 +200,7 @@ static void ifx_radio_settings_remove(struct ofono_radio_settings *rs)
g_free(rsd);
}
static struct ofono_radio_settings_driver driver = {
static const struct ofono_radio_settings_driver driver = {
.name = "ifxmodem",
.probe = ifx_radio_settings_probe,
.remove = ifx_radio_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -307,7 +306,7 @@ static void ifx_stk_remove(struct ofono_stk *stk)
g_free(sd);
}
static struct ofono_stk_driver driver = {
static const struct ofono_stk_driver driver = {
.name = "ifxmodem",
.probe = ifx_stk_probe,
.remove = ifx_stk_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -1019,7 +1018,7 @@ static void ifx_voicecall_remove(struct ofono_voicecall *vc)
g_free(vd);
}
static struct ofono_voicecall_driver driver = {
static const struct ofono_voicecall_driver driver = {
.name = "ifxmodem",
.probe = ifx_voicecall_probe,
.remove = ifx_voicecall_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -117,7 +116,7 @@ static void isi_audio_settings_remove(struct ofono_audio_settings *as)
g_free(asd);
}
static struct ofono_audio_settings_driver driver = {
static const struct ofono_audio_settings_driver driver = {
.name = "isimodem",
.probe = isi_audio_settings_probe,
.remove = isi_audio_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -429,7 +428,7 @@ static void isi_call_barring_remove(struct ofono_call_barring *barr)
g_free(data);
}
static struct ofono_call_barring_driver driver = {
static const struct ofono_call_barring_driver driver = {
.name = "isimodem",
.probe = isi_call_barring_probe,
.remove = isi_call_barring_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -457,7 +456,7 @@ static void isi_call_forwarding_remove(struct ofono_call_forwarding *cf)
g_free(data);
}
static struct ofono_call_forwarding_driver driver = {
static const struct ofono_call_forwarding_driver driver = {
.name = "isimodem",
.probe = isi_call_forwarding_probe,
.remove = isi_call_forwarding_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -118,7 +117,7 @@ static void isi_call_meter_remove(struct ofono_call_meter *cm)
g_free(data);
}
static struct ofono_call_meter_driver driver = {
static const struct ofono_call_meter_driver driver = {
.name = "isimodem",
.probe = isi_call_meter_probe,
.remove = isi_call_meter_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -405,7 +404,7 @@ static void isi_call_settings_remove(struct ofono_call_settings *cs)
g_free(data);
}
static struct ofono_call_settings_driver driver = {
static const struct ofono_call_settings_driver driver = {
.name = "isimodem",
.probe = isi_call_settings_probe,
.remove = isi_call_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -229,7 +228,7 @@ static void isi_cbs_remove(struct ofono_cbs *cbs)
g_free(cd);
}
static struct ofono_cbs_driver driver = {
static const struct ofono_cbs_driver driver = {
.name = "isimodem",
.probe = isi_cbs_probe,
.remove = isi_cbs_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -252,7 +251,7 @@ static void isi_devinfo_remove(struct ofono_devinfo *info)
g_free(data);
}
static struct ofono_devinfo_driver driver = {
static const struct ofono_devinfo_driver driver = {
.name = "isimodem",
.probe = isi_devinfo_probe,
.remove = isi_devinfo_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -659,7 +658,7 @@ static void isi_gprs_context_remove(struct ofono_gprs_context *gc)
g_free(cd);
}
static struct ofono_gprs_context_driver driver = {
static const struct ofono_gprs_context_driver driver = {
.name = "isimodem",
.probe = isi_gprs_context_probe,
.remove = isi_gprs_context_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -490,7 +489,7 @@ error:
g_free(cbd);
}
static struct ofono_gprs_driver driver = {
static const struct ofono_gprs_driver driver = {
.name = "isimodem",
.probe = isi_gprs_probe,
.remove = isi_gprs_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1165,7 +1164,7 @@ static void isi_netreg_remove(struct ofono_netreg *netreg)
g_free(data);
}
static struct ofono_netreg_driver isimodem = {
static const struct ofono_netreg_driver isimodem = {
.name = "isimodem",
.probe = isi_netreg_probe,
.remove = isi_netreg_remove,

View File

@@ -340,7 +340,7 @@ static void isi_phonebook_remove(struct ofono_phonebook *pb)
g_free(data);
}
static struct ofono_phonebook_driver driver = {
static const struct ofono_phonebook_driver driver = {
.name = "isimodem",
.probe = isi_phonebook_probe,
.remove = isi_phonebook_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -365,7 +364,7 @@ static void isi_radio_settings_remove(struct ofono_radio_settings *rs)
g_free(rd);
}
static struct ofono_radio_settings_driver driver = {
static const struct ofono_radio_settings_driver driver = {
.name = "isimodem",
.probe = isi_radio_settings_probe,
.remove = isi_radio_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -969,7 +968,7 @@ static void isi_sim_remove(struct ofono_sim *sim)
g_free(data);
}
static struct ofono_sim_driver driver = {
static const struct ofono_sim_driver driver = {
.name = "isimodem",
.probe = isi_sim_probe,
.remove = isi_sim_remove,

View File

@@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1121,7 +1120,7 @@ static void isi_sms_remove(struct ofono_sms *sms)
g_free(sd);
}
static struct ofono_sms_driver driver = {
static const struct ofono_sms_driver driver = {
.name = "isimodem",
.probe = isi_sms_probe,
.remove = isi_sms_remove,

View File

@@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1651,7 +1650,7 @@ static void uicc_sim_remove(struct ofono_sim *sim)
g_free(data);
}
static struct ofono_sim_driver driver = {
static const struct ofono_sim_driver driver = {
.name = "wgmodem2.5",
.probe = uicc_sim_probe,
.remove = uicc_sim_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -276,7 +275,7 @@ static void isi_ussd_remove(struct ofono_ussd *ussd)
g_free(data);
}
static struct ofono_ussd_driver driver = {
static const struct ofono_ussd_driver driver = {
.name = "isimodem",
.probe = isi_ussd_probe,
.remove = isi_ussd_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1935,7 +1934,7 @@ static void isi_remove(struct ofono_voicecall *call)
g_free(data);
}
static struct ofono_voicecall_driver driver = {
static const struct ofono_voicecall_driver driver = {
.name = "isimodem",
.probe = isi_probe,
.remove = isi_remove,

View File

@@ -88,7 +88,7 @@ static void mbim_devinfo_remove(struct ofono_devinfo *info)
l_free(dd);
}
static struct ofono_devinfo_driver driver = {
static const struct ofono_devinfo_driver driver = {
.name = "mbim",
.probe = mbim_devinfo_probe,
.remove = mbim_devinfo_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdint.h>
#include <stdbool.h>
#include <errno.h>
@@ -444,7 +443,7 @@ static void mbim_gprs_context_remove(struct ofono_gprs_context *gc)
l_free(gcd);
}
static struct ofono_gprs_context_driver driver = {
static const struct ofono_gprs_context_driver driver = {
.name = "mbim",
.probe = mbim_gprs_context_probe,
.remove = mbim_gprs_context_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdint.h>
#include <stdbool.h>
#include <inttypes.h>
@@ -280,7 +279,7 @@ static void mbim_gprs_remove(struct ofono_gprs *gprs)
l_free(gd);
}
static struct ofono_gprs_driver driver = {
static const struct ofono_gprs_driver driver = {
.name = "mbim",
.probe = mbim_gprs_probe,
.remove = mbim_gprs_remove,

View File

@@ -197,7 +197,7 @@ static bool _iter_copy_string(struct mbim_message_iter *iter,
if (L_CPU_TO_LE16(0x8000) != 0x8000) {
uint16_t *le = (uint16_t *) buf;
for (i = 0; i < len; i+= 2)
for (i = 0; i < len / 2; i++)
le[i] = __builtin_bswap16(le[i]);
}
@@ -1131,7 +1131,7 @@ bool mbim_message_builder_append_basic(struct mbim_message_builder *builder,
if (L_CPU_TO_LE16(0x8000) != 0x8000) {
size_t i;
for (i = 0; i < len - 2; i += 2)
for (i = 0; i < len / 2; i++)
utf16[i] = __builtin_bswap16(utf16[i]);
}

View File

@@ -487,7 +487,7 @@ static bool command_write_handler(struct l_io *io, void *user_data)
written = TEMP_FAILURE_RETRY(write(fd, buf, pos));
l_info("n_iov: %lu, %lu", n_iov + 1, (size_t) written);
l_info("n_iov: %zu, %zu", n_iov + 1, (size_t) written);
if (written < 0)
return false;
@@ -646,8 +646,8 @@ static bool command_read_handler(struct l_io *io, void *user_data)
l_info("hdr->len: %u", L_LE32_TO_CPU(hdr->len));
l_info("header_size: %u", header_size);
l_info("header_offset: %lu", device->header_offset);
l_info("segment_bytes_remaining: %lu", device->segment_bytes_remaining);
l_info("header_offset: %zu", device->header_offset);
l_info("segment_bytes_remaining: %zu", device->segment_bytes_remaining);
iov[n_iov].iov_base = device->segment + L_LE32_TO_CPU(hdr->len) -
device->header_offset -

View File

@@ -33,7 +33,7 @@ static int mbimmodem_init(void)
mbim_devinfo_init();
mbim_sim_init();
mbim_netreg_init();
mbim_sms_exit();
mbim_sms_init();
mbim_gprs_init();
mbim_gprs_context_init();
return 0;

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
@@ -395,7 +394,7 @@ static void mbim_netreg_remove(struct ofono_netreg *netreg)
l_free(nd);
}
static struct ofono_netreg_driver driver = {
static const struct ofono_netreg_driver driver = {
.name = "mbim",
.probe = mbim_netreg_probe,
.remove = mbim_netreg_remove,

View File

@@ -509,7 +509,7 @@ static void mbim_sim_remove(struct ofono_sim *sim)
l_free(sd);
}
static struct ofono_sim_driver driver = {
static const struct ofono_sim_driver driver = {
.name = "mbim",
.probe = mbim_sim_probe,
.remove = mbim_sim_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <errno.h>
#include <stdint.h>
@@ -496,7 +495,7 @@ static void mbim_sms_remove(struct ofono_sms *sms)
l_free(sd);
}
static struct ofono_sms_driver driver = {
static const struct ofono_sms_driver driver = {
.name = "mbim",
.probe = mbim_sms_probe,
.remove = mbim_sms_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -511,7 +510,7 @@ static void mbm_gprs_context_remove(struct ofono_gprs_context *gc)
g_free(gcd);
}
static struct ofono_gprs_context_driver driver = {
static const struct ofono_gprs_context_driver driver = {
.name = "mbmmodem",
.probe = mbm_gprs_context_probe,
.remove = mbm_gprs_context_remove,

Some files were not shown because too many files have changed in this diff Show More