Commit Graph

1618 Commits

Author SHA1 Message Date
Alexander Couzens 21d29419ed qmibridge: fixup memeory leaks commit
Wrong signature of the function was used
2017-11-07 16:27:46 +01:00
Alexander Couzens b0171fc03a qmi: fix off-by-one error in qmi_error_to_ofono_cme()
Also fixes the Gobi2000 when trying to register manual to a network
2017-11-07 16:22:04 +01:00
Alexander Couzens 08e27c2d5f qmibridge: fix memoryleaks 2017-10-17 14:09:30 +02:00
Alexander Couzens a9fd714e96 qmimodem: report the qmimodem bug 2017-10-10 14:56:20 +02:00
Alexander Couzens 64d75091fb qmimodem: ensure the modem is registered by check cs and ps state
The modem tells to early it's registered even it hasn't yet received a location
update complete.
2017-10-10 14:56:20 +02:00
Alexander Couzens 877b0afe8f qmimodem: convert register_net_cb errors into CMEs
Certain modems doesn't support manual registering (gobi 2000).
Translate the error code into ofono error to return the
correct dbus error message.
2017-10-10 14:56:20 +02:00
Alexander Couzens 4843d1432e qmimodem: add define CALLBACK_WITH_CME_ERROR(cb, err, args..) 2017-10-10 14:56:20 +02:00
Alexander Couzens bb5302a72b qmimodem: add translator qmi_error_to_ofono_cme()
Translates qmi error codes into ofono cme errors
2017-10-10 14:56:20 +02:00
Alexander Couzens 1056147002 Merge sysmocom/lynxis/master into sysmocom/osmo-gsm-tester
Conflicts: plugins/gobi.c
2017-10-02 08:51:51 +02:00
Alexander Couzens b4cf29adaf qmimodem: sync the modem on enable
The qmi sync call release all previous resources.
qmi/discovery: only do the sync call when ctl service version >= 1.5
2017-09-12 13:08:33 +02:00
Alexander Couzens 7f3704dea8 qmi/discovery: include control service into service list
There is no need to exclude it. It helps debugging because the service is now logged.
2017-09-12 13:08:33 +02:00
Alexander Couzens 8b23ce5d19 qmi/discovery: remove useless code 2017-09-12 13:08:33 +02:00
Alexander Couzens 1b26e1e8f8 [RFC] qmimodem: implement voice calls
The voice_generated.* files is an RFC how files should look like.
They aren't yet generated.
2017-09-12 13:08:33 +02:00
Alexander Couzens ca4ad7e6b0 atutil.h: remove doublicated ofono_call_compare_by_status() 2017-09-12 13:08:33 +02:00
Alexander Couzens 95693632ed NOT_FOR_MERGE: decode qmi messages with libqmi 2017-09-12 13:08:32 +02:00
Alexander Couzens 12983c0464 common,atmodem: rename & move at_util_call_compare_by_id to common.c
at_util_call_compare_by_id is used by several modem drivers.
2017-09-12 13:08:32 +02:00
Alexander Couzens a2e9a50db3 common,atmodem: rename & move at_util_call_compare_by_status to common.c
at_util_call_compare_by_status is used by several modem drivers.
2017-09-12 13:08:32 +02:00
Alexander Couzens 0982b4c4e8 common: create GList helper ofono_call_compare
replaces at_util_call_compare (atmodem) and
call_compare (rild).
2017-09-12 11:53:07 +02:00
Alexander Couzens a18c892c64 qmimodem: register callbacks after netreg_register
When registering callbacks before ofono_netreg_register(), callbacks
will use the netreg api which might lead into undefined behaviour,
because certain fields aren't yet initilized.
2017-09-11 10:41:14 -05:00
Nishanth V 4590c695e0 rilmodem: netmon fix missing notify for g_ril_send 2017-09-11 10:37:52 -05:00
Clayton Craft cbac15cdd9 isimodem: Use correct callback for pin status 2017-09-11 10:37:06 -05:00
Nishanth V 25347b9e83 rilmodem: driver changes for netmon agent
Rilmodem driver updated to handle enabling
and disabling periodic serving cell updates
2017-09-08 15:07:06 -05:00
Denis Kenzior 0f2d1278c4 qmimodem: Fix whitespace issue 2017-09-08 09:56:32 -05:00
Jonas Bonn 054323d4ba qmi: provide AvailableTechnologies in radio-settings
This provides the list of available technologies in the radio-settings
atom.  The list is queried by the DMS Get Capabilities method; ofono
takes care of caching the available technologies for us so we don't need
to worry about this method being called excessively.
2017-09-08 09:48:42 -05:00
Alexander Couzens b81bdfe456 qmimodem: extract network time from serving system 2017-09-07 16:50:14 -05:00
Alexander Couzens 8d74986d6e qmimodem: add strength (in %) to the debug output 2017-09-07 16:49:00 -05:00
Jonas Bonn 76689b81d4 qmi: add helper to get int16_t result 2017-09-07 11:57:31 -05:00
Jonas Bonn 4ac537394e qmi: implement RAT selection
The QMI radio-settings atom was just a skeleton and did not even implement
the mandtory property TechnologyPreference.  As such, it probably should
never even have been registered for the modem.  Nonetheless, this patch
puts this mandatory property into place.

This is implemented via the 'Set System Selection' method by way of the
'mode' parameter.  This seems to best reflect the intention of the Ofono
API and works as expected when tested with a Quectel EC21.

Some notes:
i)  There is an alternative function called 'Set Technology Preference'
    which provides similar functionality.  This 'technology preference'
    is updated automatically when the 'system selection mode' is modified
    so everything seems to be in order.
ii) For the EC21, switching the underlying technology works seamlessly.
    There are indications, however, that some modems _might_ require a
    reset before changes take effect; that bridge will need to be crossed
    if reached.
2017-09-07 11:54:25 -05:00
Christophe Ronco b3e4837641 atmodem: correctly report lte bearer for huawei modems 2017-09-07 11:41:01 -05:00
Ankit Navik 2640e0a882 Add support for Intel xmm7xxx series modem driver
This adds driver as xmm7modem for radio-settings
2017-09-05 10:48:00 -05:00
Ankit Navik 7df48a5107 atmodem: Add lte atom driver
Adds atmodem driver for setting the default APN command.
The default APN is manage by config storage.
2017-09-05 10:44:22 -05:00
Matthijs Kooijman 8d690efa83 at/cdma/ifxmodem: Use /dev/net/tun to check for TUN support
Previously, these drivers would check /sys/devices/virtual/misc/tun to
see if TUN is supported, and bail out otherwise. However, the tun module
can sometimes be autoloaded by opening the /dev/net/tun file. In this
case the /dev file already exists, but the /sys file only gets created
after the modul is loaded.

Additionally, the ppp code does not use the /sys file, but only the
/dev file, so checking for the existence of the latter seems a better
indicator of expected success.
2017-08-22 23:24:59 -05:00
Alexander Couzens fb17995721 qmi/sms: require WMS version >= 1.2 for bearer calls
I've never seen a major 0 service. The gobi2000 comes with
WMS 1.0 and doesn't support the bearer command. Guessing
it's 1.2 required.
2017-08-22 10:38:14 -05:00
Alexander Couzens 49a7d0aa1b qmimodem: use a default RAT when registering
When registering to an operator ofono uses the old RAT.
In the case the modem is not connected to any network, this would use
QMI_NAS_NETWORK_RAT_NONE which results in the error OP_DEVICE_UNSUPPORTED.

Use QMI_NAS_NETWORK_RAT_NO_CHANGE instead to not define any preference.
2017-08-07 13:50:03 -05:00
Alexander Couzens a9dbc1a62e [RFC] qmimodem: implement voice calls
The voice_generated.* files is an RFC how files should look like.
They aren't yet generated.
2017-08-01 12:29:00 +02:00
Alexander Couzens 9fd345accc qmi/ussd: implement MO USSD 2017-08-01 12:20:10 +02:00
Alexander Couzens f3a2e65049 qmimodem: extract network time from serving system 2017-08-01 12:18:51 +02:00
Alexander Couzens 7980fb610f qmimodem: sync the modem on enable
The qmi sync call release all previous resources.
2017-08-01 12:18:51 +02:00
Alexander Couzens b5f179b40a common,atmodem: rename & move at_util_call_compare_by_id to common.c
at_util_call_compare_by_id is used by several modem drivers.
2017-07-25 15:40:43 +02:00
Alexander Couzens e84ccdf99d common,atmodem: rename & move at_util_call_compare_by_status to common.c
at_util_call_compare_by_status is used by several modem drivers.
2017-07-25 15:40:37 +02:00
Alexander Couzens c97a48fd4b common: create GList helper ofono_call_compare
replaces at_util_call_compare (atmodem) and
call_compare (rild).
2017-07-25 15:28:28 +02:00
Alexander Couzens 1fafaee37e drivers/qmimodem: don't change the RAT when registering to an operator
When registering to an operator ofono uses the old RAT.
In the case the modem is not connected to any network, this would use
QMI_NAS_NETWORK_RAT_NONE which results in the error OP_DEVICE_UNSUPPORTED.

Use QMI_NAS_NETWORK_RAT_NO_CHANGE instead to not define any preference.
2017-07-25 15:28:23 +02:00
Marcel Holtmann 9cdcf72994 ifxmodem: Fix GPRS activation command string buffer size 2017-07-11 10:43:59 -07:00
Marcel Holtmann 339e874212 telitmodem: Fix GPRS activation command string buffer size 2017-07-11 10:43:23 -07:00
Marcel Holtmann 6c936db4ae atmodem: Fix missing break statement for ublox driver 2017-07-11 10:42:59 -07:00
Alexander Couzens 417af0eaf2 qmimodem/sms: don't check for free ME space on receive
If the ME storage is full, the modem will reject new messages
with a SMPP RP-Error 'Protocol error, unspecific'.
It seems the qmimodem is first checking the ME storage for
free space, then deliver the SMS via QMI and not saving it
to the ME anyway.
Using QMI_WMS_STORAGE_TYPE_NONE it doesn't check for free space.

Tested-on: Quectel EC20
2017-05-30 17:31:25 -05:00
Alexander Couzens b5cc57775f qmimodem: add debug helper qmi_result_print_tlvs
qmi_result_print_tlvs prints the type and length field
of a result to DBG()
2017-05-30 17:29:13 -05:00
Denis Kenzior 2d6c4f9d02 qmi: Fix invalid memory access
When qmi_device_shutdown is used and the callback provided utilizes
qmi_device_unref, an access into already freed memory is triggered.

Sequence of events is:

1. timeout fires
2. glib calls timeout callback (e.g. shutdown_callback) which in turn
calls shutdown_func (gobi shutdown_cb) which in turn calls
qmi_device_unref()
3. qmi_device_unref calls g_source_remove, which doesn't call the
destroy callback (it is blocked)
4. qmi_device_unref then frees the memory used by device
5. glib then calls the source destroy callback (e.g. shutdown_destroy)
which results in just freed memory being used.

glib appears to always call the destroy callback, even if the source has
been removed previously.  So to work around the issue, delay the actual
g_free until the destroy callback is invoked.
2017-05-11 14:41:43 -05:00
Jonas Bonn f23ea6b45f qmimodem: set APN for LTE default bearer
Apparently, an empty APN in an ofono context means that that the context
cannot be activated.  connman definitely interprets it this way.

This patch sets a default name of "automatic" for the default bearer if
no other LTE APN is supplied (which is currently the case as the LTE
atom is not in place yet).  Without this, connman happily ignores the
context, even though it has been activated by ofono.
2017-05-04 11:00:24 -05:00
Jonas Bonn 4651a70285 qmi: activate default bearer context for LTE networks
When the modem attaches to an LTE network, a default bearer is
automatically negotiated using the "defalt profile" settings.  The
QMI modem, however, does not given any explicit indication that
the bearer exists; instead, we must assume its existence based on
the network registration state.

This patch extends the GPRS atom to signal the presence of a
default bearer when it detects network connectivity on an LTE
network.
2017-05-01 12:12:08 -05:00