Commit Graph

1788 Commits

Author SHA1 Message Date
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
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
Jonas Bonn 10854cb459 qmi: use named status values 2017-05-01 12:08:02 -05:00
Jonas Bonn ea7691f04b qmi: use shared services
Apparently it's not legal to create a QMI service multiple times for
a device.  I've been testing with a Quectel EC21 and here it works fine
to do so, but the general case would require "shared" services across
atoms.

This patch switches the users of the NAS and WDS services over to using
a "shared" service instead of each instatiating their own instance.
2017-05-01 12:07:41 -05:00
Jonas Bonn 81cb808daf qmi: watch packet status for spontaneous disconnection only
There are three principal ways for a context to become disconnected:

i)  deactivate_primary() is called
ii)  the network registration is lost and the context is cleaned up
via _detach_shutdown() (via release_all_contexts())
iii) the network decides to disconnect the context

We need to watch the packet status in order to detect case iii).  For
case i) and ii), stop_net will be called, the pkt_handle will be
cleared, and subsequent packet status notifications be ignored.

This patch makes it so that the packet status "disconnected" event
is only propagated when the pkt_handle has not been cleared, indicating
an unrequested disconnection.

This should fix a race reported by Christophe Ronco whereby the packet
status disconnect notification is called between activate_primary
(start_net) and it's callback (start_net_cb).
2017-05-01 12:05:54 -05:00
Vincent Cesson 0e7add9447 atmodem: Fix SMS reception for Gemalto modems
SMS reception is not working for Gemalto modems because of +CMT parsing.
PDU length is the first argument of +CMT URCs in Gemalto modems.

Add a switch case on vendor info to handle Gemalto case.
Also handle acknowledgment, +CNMA takes only one parameter.

CMT parsing is moved from at_parse_cmt() to at_cmt_notify(). This
function is modified to match the style of at_cmgr_notify() and it
includes a switch case for CINTERION modems.
2017-04-21 11:02:05 -05:00
Jonas Bonn d6704223d8 qmi: move rat_to_tech() into own module
We want to use this function from multiple atoms so this patch moves
it out to its own module for NAS-related helper functions.
2017-04-18 09:48:04 -05:00
Jonas Bonn c0273f9d85 qmi: add missing header inclusion 2017-04-18 09:47:39 -05:00
Jonas Bonn 27b527c4f9 qim: use named status value 2017-04-17 12:11:40 -05:00
Jonas Bonn 949f968676 qmi: implement detach_shutdown method
The detach_shutdown method is invoked to unconditionally release
an active context.  For QMI, this is equivalent to a call to
deactivate_primary.

This patch makes the callback to deactivate_primary optional and
implements detach_shutdown to simply call it.  When there is no
callback, the stop_net callback notifies ofono about the context
release via an asynchronous ofono_gprs_context_deactivated() call.
2017-04-17 12:09:48 -05:00
Jonas Bonn f0f5a19af5 qmi: free cb_data on error
...and move allocation of structure up to variable declarations to
match the pattern used elsewhere in the code.
2017-04-17 12:07:43 -05:00
Jonas Bonn 91b89f472f qmi: read_settings needs to call start network
For LTE networks, a default bearer is automatically activated when
the modem registers to the network.  QMI modems, however, do not
automatically enable the network interface just because the bearer
exists; a call to "start network" needs to be made in order to
get the packet handle before get_settings will return any data and
the network interface can be configured.

This patch makes read_settings call "start network" in order to
enable the interface for the default bearer.  No new bearer will
be created with this call and the settings for the bearer will come
from the default profile, irregardless of what parameters are passed
to the "start network" method.
2017-04-14 17:54:29 -05:00
Jonas Bonn ad39b9003b qmi: fix typo 2017-04-14 16:49:31 -05:00
Jonas Bonn 71372ba0b3 qmi: duplicate callback data correctly 2017-04-14 16:44:05 -05:00
Denis Kenzior 7a2e198fd7 qmi: Use destroy callback for context activate 2017-04-11 12:01:15 -05:00
Denis Kenzior f29a316c91 qmi: Use destroy callback for context deactivate
This ensures that cbd will be freed even if the device is hot-unplugged.
Also, this fixes a memory leak on the failure path inside stop_net_cb
2017-04-11 12:01:06 -05:00
Jonas Bonn ef9af151ee qmi: implement read_settings for automatic contexts
For LTE, a context is created automatically when the modem registers
to the network.  The read_settings function is called for these
automatic contexts to get their configuration.
2017-04-11 11:45:41 -05:00
Jonas Bonn 475b789f3d qmi: retrieve GPRS context parameters
The GPRS context needs to be configured with connection parameters when
the bearer has been established.  This was only partially implemented, so
this patch adds additional parameters to those passed to the context.
2017-04-11 11:43:16 -05:00
Jonas Bonn 55bd639ae1 qmi: add WDS parameter definition 2017-04-11 11:22:29 -05:00
Jonas Bonn a0b3a8e0b8 qmi: NAS definitions adjustment
Calling the ps_state/cs_state alternatives *ATTACH_STATUS* was confusing
because there is also a status field in the *serving_system structure.
This patch does a minor rename and adds the appropriate definitions for
the status field.
2017-04-11 10:22:57 -05:00
Denis Kenzior 829fc23137 qmi: Fix qmi_device_shutdown
qmi_device_shutdown allocated a new orphaned data structure and kicked
off a timeout to wait for the shutdown to complete.  The logic was quite
racy, but the main issue was that the timeouts could not be canceled
when the underlying qmi_device object was destroyed.  This resulted in
crashes.

This patch switches to first-past-the-gate mechanism.  Since only the
modem driver should be issuing a qmi_device_shutdown call, this should
not be a limitation.  The shutdown source is then tracked on the
qmi_device object itself and is canceled when the qmi_device object is
freed.

As an added bonus, the shutdown_destroy callback should now actually
function.  Before it was simply never called.
2017-04-04 10:24:13 -05:00
Denis Kenzior 2701dd8919 qmi: Optimize structure allocations
struct discovery was allocated for every discovery procedure that was
kicked off, which itself allocated a structure.  This patch uses a
class/subclass concept to only allocate a single structure per discovery
procedure.
2017-04-03 12:56:26 -05:00
Jonas Bonn 1e39a9d26d qmi: fix bad lookup and double free
This function was never removing discovery instances because it was looking
them up in the wrong list.  This led to some strangeness with the discovery
callbacks being invoked after the "failure" timeout of 5 seconds and
consequent failures with everything getting out of sync.

With this patch we fix the lookup to use the correct queue.  There's also
a double-free in the function that was never being hit before because the
lookups never succeeded; fix that as well.

With this, service discovery and creation work as expected when testing with
an EC21.
2017-04-03 09:23:53 -05:00
Jonas Bonn 529afeb67f qmi: add service ID's 2017-04-03 09:23:53 -05:00
Lukasz Nowak 81a54c5a47 atmodem: telit - re-attach gprs automatically
Telit AT modem firmware (tested with UE910-EUR) generates
+CGREG: 0\r\n\r\n+CGEV: NW DETACH
after a context is de-activated and ppp connection closed.
Then, after a random amount of time (observed from a few seconds
to a few hours), an unsolicited +CGREG: 1 arrives.
Attempt to fix the problem, by sending AT+CGATT=1 once.
This does not re-activate the context, but if a network connection
is still correct, will generate an immediate +CGREG: 1.
2017-03-29 10:01:50 -05:00
Denis Kenzior 4c46605f6b qmi: track discovery tasks so clean up is possible
There are various device & service discovery tasks that are initiated
based on a qmi_device object.  qmi_device object does not currently
keep track of these tasks.  Unfortunately the qmi_device object can
go away at any time, and these tasks can become orphaned.

The result of this can lead to crashes.  E.g. a discovery task timeout fires
after the qmi_device object has been destroyed.  Since the object is no
longer valid, any accesses to it will likely result in a SEGFAULT.

This patch attempts to track all discovery tasks on the qmi_device
object itself, so that they can be cleaned up properly.  This patch does
not handle the qmi_device_shutdown functionality.
2017-03-28 14:21:07 -05:00
Jonas Bonn f3911b1669 qmimodem: add WDA service string 2017-03-25 16:01:21 -05:00
Jonas Bonn c548fe2eb5 qmimodem: fix typo 2017-03-25 16:01:06 -05:00
Lukasz Nowak 078582d567 qmimodem: detect utf-8 string as operator name
Telit QMI modems can return non-utf-8 characters in plmn-desc.
Observed with LE910-SVG and Verizon. When that happens, libdbus
will abort ofono.
If non-utf-8 characters are detected, use mccmnc string.
2017-03-23 10:26:30 -05:00
Lukasz Nowak 4219fcf7bc qmimodem: read ss_info at probe time
LTE modems (observed with Telit LE910 V1) can power on
already registered to a network. In that case, the SS_INFO
change notification will never arrive, and the gprs driver
will never be marked as attached.

To avoid this situation, read SS_INFO at probe time, and if
registered, mark the gprs driver as attached.
2017-03-23 10:25:23 -05:00
Denis Kenzior 8559a29d77 qmimodem: Fix warning
This was introduced by the previous patch:
drivers/qmimodem/devinfo.c: In function ‘get_ids_cb’:
drivers/qmimodem/devinfo.c:129:14: error: implicit declaration of function ‘strcmp’ [-Werror=implicit-function-declaration]
  if (!str || strcmp(str, "0") == 0) {
2017-03-23 10:24:34 -05:00
Lukasz Nowak a2a8e71db2 qmimodem: telit LE910 V1 - fix ESN string
Telit QMI modems report "0", rather than a NULL string,
if ESN is not available.
2017-03-23 10:23:50 -05:00
Christophe Ronco 89c92e7277 qmimodem: fix sim file reading on MC7304
Command read_file_info on MC7304 always fails.
Using qmicli or AT command, I am able to read file info.
Qmicli command is:
qmicli -d /dev/cdc-wdm0 --uim-get-file-attributes=0x3f00,0x7fff,0x6fad
[(null)] Successfully got file '/dev/cdc-wdm0' attributes from the UIM:
Card result:
        SW1: '0x90'
        SW2: '0x00'
File attributes:
        File size: 4
        File ID: 28589
        File type: transparent
        Record size: 0
        Record count: 0
        Read security attributes: (always) (null)
        Write security attributes: (single) adm
        Increase security attributes: (always) (null)
        Deactivate security attributes: (single) adm
        Activate security attributes: (single) adm
        Raw:    62:17:82:02:41:21:83:02:6F:AD:8A:01:05:8B:...

After a check of parameters sent by qmimodem driver and qmicli,
the only difference is on parameter "Session Information".
Session type sent by qmimodem driver is 'Card on slot 1'.
Session type sent by qmicli command is 'primary-gw-provisioning'.
Changing session type in qmimodem driver fixed problem (on this modem).

Comparing with what is done by qmili command
2017-02-17 11:16:54 -06:00
Christophe Ronco 8e929df4f5 atmodem: use ATD99 to enter data state when needed
Some modems do not support AT+CGDATA="PPP",X to enter data state.
Use AT+CGDATA=? to detect these modems and for them use ATD*99***X#
to enter data state.
2017-02-16 11:52:49 -06:00
Denis Kenzior 149002c110 rilmodem: Fix warning
drivers/rilmodem/stk.c: In function ‘ril_stk_probe’:
drivers/rilmodem/stk.c:210:18: error: ‘data’ is used uninitialized in
this function [-Werror=uninitialized]
  struct cb_data *cbd = cb_data_new(stk, NULL, data);
2017-02-07 11:05:09 -06:00
Antara Borwankar 058a293de6 rilmodem: Send needed RIL request for stk init
sending RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING after
stk atom is created so that modem will inititialize
sim toolkit by sending terminal profile to sim.
2017-02-07 10:56:46 -06:00
Christophe Ronco cf3835f0f3 qmimodem: change kernel driver data format if needed
During gprs-context driver probe function, check kernel device driver
data format and modem low level data format.
If they are different, align kernel device driver data format on
modem low level data format.
If an error occurs during this process, continue probing without error.
This is inspired by what is done in qmicli and qmi-network (package
libqmi).
2017-02-02 11:48:38 -06:00
Denis Kenzior 0fbc802845 qmi: Fix typo 2017-02-02 11:41:36 -06:00
Christophe Ronco 8dffd365a2 qmimodem: get/set kernel device driver data format
Add a way to get and set data format expected by kernel device driver.
This is inspired by what is done in qmicli (package libqmi).
It does not use QMI protocol but a sysfs exported by kernel driver.
To use this feature, kernel version must be equal or more than 4.5.
2017-02-02 11:41:27 -06:00
Piotr Haber bf3890a445 telitmodem: support for CDC-NCM network adapter
Network Control Model is a new Communication Device Class
protocol for exchanging Ethernet frames over USB.
NCM is intended to be used with high-speed network
attachments such as HSDPA and LTE data services.
2017-01-27 20:35:50 -06:00
Piotr Haber 50f1dfcb24 qmimodem: send authentication credentials
Pass authentication method, user and password
to QMI WDS service.
2017-01-26 09:21:07 -06:00
Piotr Haber c493491c1a atmodem: add LTE to Telit #PSNT status parser
Network type of 4 in Telit #PSNT command response
denotes LTE network
2017-01-25 10:00:07 -06:00
Vincent Cesson c0c7c92a82 drivers: Add gemaltomodem driver to handle GNSS
Add a new location-reporting driver for Gemalto Cinterion modems based
on telit implementation + use it in gemalto plugin. It supports
activation of GNSS engine (Request) with command AT^SGPSC. This driver
is tested on PHS8. NMEA frames are accessible on /dev/ttyUSB1.
2017-01-19 13:34:36 -06:00
Christophe Ronco d6866f2f90 qmimodem: query_passwd_state can be retried
Retry command QMI_UIM_GET_CARD_STATUS during query_passwd_state if a
temporary error status has been detected.
This happens with a MC7430 modem when query_passwd_state is called just
after PIN is entered.
2017-01-16 22:25:23 -06:00
Vincent Cesson 4edc9fd57f atmodem: Fix CGDCONT result parsing.
CGDCONT result parsing fails if first list contains several ranges. For
example with modem Cinterion PHS8:

 AT+CGDCONT=?
 +CGDCONT: (1-17,101-116),"IP",,,(0),(0-4)

Solution: read first range and jump to second list instead of trying to
close the brackets.
2017-01-13 09:38:43 -06:00
Christophe Ronco b4cbe8d41a qmimodem: add pin_send feature
Add ability to send PIN to a QMI modem using QMI_UIM_VERIFY_PIN command.
This has been tested on MC7304 and MC7430 modems.
2017-01-11 09:57:53 -06:00
Christophe Ronco 6a1d111e21 qmimodem: get password state from modem
Password state and number of retries asked to modem using
QMI_UIM_GET_CARD_STATUS command rather than remembered after initial
QMI_UIM_GET_CARD_STATUS command.
2017-01-11 09:57:06 -06:00
Christophe Ronco 2505d96544 qmimodem: Add read_imsi to qmimodem sim driver
Add read_imsi feature to qmimodem sim driver.
This is based on DMS service.
On MC7430, this is mandatory to be able to use this driver for GPRS
connection because reading IMSI via EF reads fails.
2017-01-09 12:31:35 -06:00
Christophe Ronco 567e5ec9fc qmimodem: fix QMI notification messages handling
QMI notification messages handlers are never called on MC7430 without this fix.

- Do not test transaction id before calling notification handler.  On MC7430,
notification messages contain a not null transaction id (starts with 1,
increased at each message for a particular client).
- On MC7304 transaction id in notification messages is always 0.
2016-12-30 18:38:29 -06:00
Christophe Ronco f15c33ed20 qmimodem: fix get signal strength
Get current signal strength (type: 0x01), not list of other signals strength
(0x10)

Without this fix:
- I can't get a signal strength on MC7430 because list does not exist
	(only one signal strength).
- On MC7304, result is wrong
2016-12-30 18:37:30 -06:00
Marko Šulejić a9a477e469 atmodem: fix typo 2016-12-14 11:19:56 -06:00
Ankit Navik 6aa1f1b3be rilmodem: set LTE preferred in rat mode 2016-12-07 10:20:01 -06:00
Ankit Navik 94789031bb rilmodem: Add lte atom driver
Adds rilmodem driver for setting the default APN command.
The default APN is manage by config storage.
2016-12-07 10:20:01 -06:00
Denis Kenzior 3c473979c7 ubloxmodem: Fixup minor style issues
- useless return at the end of a function
- mixed tabs & spaces for indentation
- over 80 characters for the comment
- line > 80 characters due to access technology conversion.  Replaced
  with a direct assignment.
2016-12-01 11:27:21 -06:00
Denis Kenzior 83783a71d8 ubloxmodem: Fix warning
drivers/ubloxmodem/netmon.c: In function ‘req_cb_data_unref’:
drivers/ubloxmodem/netmon.c:131:10: error: ‘return’ with a value, in
function returning void [-Werror]
   return NULL;
2016-12-01 11:23:29 -06:00
Djalal Harouni a21f175ea1 ubloxmodem: add the netmon driver
This adds a netmon driver for ublox. The driver support both +COPS and
+CESQ commands to return the previously added ofono netmon types:

RSCP: Received Signal Code Power
ECN0: Received Energy Ratio
RSRQ: Reference Signal Received Quality
RSRP: Reference Signal Received Power

Current revision makes the driver use ref countig when chaining multiple
AT commands.
2016-12-01 11:21:59 -06:00
Dragos Tatulea eeaabafdee ubloxmodem: tweak to work on different firmware
The U-Blox documentation specifies the following:
* get interface ip and dns from +CGDCONTRDP
* get gw ip and netmask from +UIPADDR

However, different firmware versions have different befaviour:

* On newer firmware, +UIPADDR returns error. But it's possible to configure
gateway ip == ipterface ip (read from CGDCONTRDP).

* On older firmware, we can actually use the commands specified in the
docs.

This patch runs +CGDCONTRDP, configures everything and then tries to run
+UIPADDR. In that works, reconfigures gw ip and netmask.
2016-11-16 11:49:38 -06:00
Dragos Tatulea 5d276f953e ubloxmodem: add lte atom driver
Adds U-Blox Toby L2 driver for setting the default APN via the
+UCGDFLT command. Currently only IPv4 is supported. APN is
not stored to modem's non-volatile memory. oFono will manage this
default APN via it's config storage.

When receiving an empty default APN, the value is reset.
2016-11-15 13:45:35 -06:00
Dragos Tatulea c43e44b154 ubloxmodem: fix memory leak in gprs_context_remove 2016-11-14 11:27:39 -06:00
Santtu Lakkala 54c9068ff2 huaweimodem: Fix DHCP parsing on 32-bit platforms
strtol clamps returned value between INT_MIN and INT_MAX, causing
invalid value (255.255.255.127) being reported for any address
if last octet > 127 when sizeof(long) == 4.
2016-08-10 11:21:56 -05:00
Samrat Guha Niyogi 2ba2ccbee4 rilmodem: fix cbd init in ril_query_facility_lock 2016-08-06 11:06:58 -05:00
Samrat Guha Niyogi cafd98778d rilmodem: fix num_params in query_facility_lock_cb 2016-08-06 11:06:14 -05:00
Denis Kenzior eaed7dd7e9 rilmodem: Co-locate the callback with invocation 2016-08-06 11:05:12 -05:00
Denis Kenzior d2ec4a2309 rilmodem: Co-locate the callback with invocation 2016-08-06 11:04:20 -05:00
Samrat Guha Niyogi 3047fbd87b rilmodem: split ril_pin_change_state_cb
split ril_pin_change_state_cb based on functionality w.r.t.
facility lock, puk and pin. Rename ril_pin_change_state to
more appropriate name ril_set_facility_lock and rename
ril_pin_change_state_cb to ril_enter_sim_pin_cb.
2016-08-06 10:58:29 -05:00
Samrat Guha Niyogi e3f1eae928 rilmodem: Remove unneeded pin sending logic 2016-08-06 10:53:40 -05:00
Nishanth V ba42155a2c rilmodem: fix WCDMA only in query rat mode 2016-05-20 10:16:23 -05:00
Caiwen Zhang 1eec2fc46e rilmodem: add cell broadcast message support 2016-05-19 10:29:33 -05:00
Suman Mallela 9a584ae2bb rilmodem: Fix PIN retries logic
The SIM PIN retries were not getting reset when the correct PIN/PUK
was entered.
2016-05-17 09:48:03 -05:00
Caiwen Zhang 008eed357d rilmodem/stk: add STK support for rilmodem 2016-05-03 11:14:28 -05:00
Denis Kenzior 29ff4dc2e4 rilmodem: Remove no longer relevant TODO 2016-04-27 11:14:59 -05:00
Denis Kenzior 5d1702fa0e isi: Change query_locked to query_facility_lock 2016-04-27 11:13:33 -05:00
Denis Kenzior 7d5d131e99 isimodem: Remove unimplemented query_locked method 2016-04-27 11:06:52 -05:00
Denis Kenzior 847df8ee78 atmodem: Change query_locked to query_facility_lock 2016-04-27 11:04:43 -05:00
Denis Kenzior 9809aee40c rilmodem: Fix style 2016-04-27 10:58:13 -05:00
Samrat Guha Niyogi 421351cf57 rilmodem: Implement sim atom query_facility_lock 2016-04-27 10:41:33 -05:00
Denis Kenzior c02a97b207 ril: vendorize SoFiA set_band implementation
Since the set_band implementation uses an OEM hook, it should be wrapped
behind a vendor quirk.
2016-04-25 15:26:35 -05:00
Antara Borwankar 2bb515a6ab rilmodem: Driver code to set band mode and value
set_band driver to set GSM band and UMTS band
2016-04-25 15:16:22 -05:00
John Ernberg 3f12d06b20 stemodem: Use g_slist_free_full 2016-04-22 15:22:07 -05:00
John Ernberg 397102bdc5 rilmodem: Use g_slist_free_full 2016-04-22 15:21:39 -05:00
John Ernberg 2db09e4e3f ifxmodem: Use g_slist_free_full 2016-04-22 15:21:11 -05:00
John Ernberg 171ec467e9 hfpmodem: Use g_slist_free_full 2016-04-22 15:20:43 -05:00
John Ernberg 6a07d059d1 atmodem: use g_slist_free_full 2016-04-22 15:20:11 -05:00
Denis Kenzior 756e0215ad rilmodem: Remove some unneeded whitespace 2016-04-22 14:16:27 -05:00
Denis Kenzior 92dba5c21d rilmodem: Rename addrs to addr when not plural
addrs variable seems to be used whenever multiple addresses are being
references.  Either as a strv or a compound string separated by a
separator.  In these cases addrs was used for a single address, which
was confusing.
2016-04-22 14:13:19 -05:00
Denis Kenzior 7b8a6db4af rilmodem: Refactor away some explicit casts 2016-04-22 14:09:36 -05:00
Nishanth V 1fa8338661 rilmodem: Add IPv6 support in gprs-context 2016-04-22 12:26:11 -05:00
Nishanth V dc1116876d rilmodem: Add address to protocol type util func 2016-04-22 12:23:00 -05:00
Nishanth V ca246413d1 ril: don't set an ipv4 netmask if not provided
For historical reasons a netmask was always being set, even if one was
not provided.
2016-04-21 12:22:15 -05:00
Nishanth V b44f59e5e4 gprs-context: fix set ipv4 netmask for rilmodem 2016-04-19 20:53:29 -05:00
Kuba Pawlak 2d80a04a05 drivers/isimodem: fix GCC 6.0 errors
-Werror=misleading-indentation
2016-04-18 09:52:56 -05:00
Kuba Pawlak 31d2dfcfbe hfp: Handle +CCWA at HFP connection setup
Some phones with an active and waiting call at the time of HFP SLC
establishment, may send call waiting notification before all calls
are synchronized. This will lead to call Id mismatch because call
object is created with assumed Id 1 and not Id assigned by the phone.

In example below waiting call is created with Id 1 but in AT+CLCC
this phone returns active call as call with Id 1, and waiting as 2.

< \r\n+CCWA: "+1234567890",145\r\n
< \r\n+CIEV: 2,1\r\n
drivers/hfpmodem/voicecall.c:ccwa_notify() ccwa_notify: +1234567890 145 0
src/voicecall.c:ofono_voicecall_notify() Got a voicecall event, status: 5, id: 1, number: +1234567890 called_number: , called_name
src/voicecall.c:ofono_voicecall_notify() Did not find a call with id: 1
> AT+CIND?\r
< \r\n+CIND: 1,1,1,4,0,2,0\r\n\r\nOK\r\n
src/network.c:ofono_netreg_status_notify() /hfp/org/bluez/hci0/dev_60_AF_6D_F7_8E_37 status 1 tech -1
> AT+VGS=7\r
< \r\nOK\r\n
> AT+VGM=7\r
< \r\nOK\r\n
> AT+CLCC\r
< \r\n+CLCC: 1,1,0,0,0,"+9876543210",145\r\n
< \r\n+CLCC: 2,1,5,0,0,"+1234567890",145\r\n\r\nOK\r\n
src/voicecall.c:ofono_voicecall_notify() Got a voicecall event, status: 0, id: 1, number: +9876543210 called_number: , called_name
src/voicecall.c:ofono_voicecall_notify() Found call with id: 1
src/voicecall.c:ofono_voicecall_notify() Got a voicecall event, status: 5, id: 2, number: +1234567890 called_number: , called_name
src/voicecall.c:ofono_voicecall_notify() Did not find a call with id: 2
src/voicecall.c:ofono_voicecall_mpty_hint() ids: 0
2016-04-04 14:43:11 -05:00
Samrat Guha Niyogi 408b78e285 rilmodem: Add support of IMEISV 2016-03-31 10:16:23 -05:00
Denis Kenzior a259c5439a rilmodem: Fix minor style issues 2016-03-31 09:59:47 -05:00
Nishanth V 6d97528592 rilmodem: Add netmon support 2016-03-31 09:56:32 -05:00
Anirudh Gargi b99a108d00 rilmodem: Add sms bearer set and bearer query func 2016-03-22 10:27:40 -05:00
Denis Kenzior 7bd7a541d0 ubloxmodem: Remove unneeded #include 2016-03-18 10:13:53 -05:00
Dragos Tatulea 0af7ded845 ubloxmodem: support automatic ctx activation
... by imlementing read_settings.
2016-03-18 10:13:04 -05:00
Dragos Tatulea 52b698222c atmodem: gprs: handle automatic context activation
When the event comes, trigger CGCONT? to read the APN for the
activated cid and then call ogono_gprs_cid_activated to handle
the event.
2016-03-18 10:10:09 -05:00
Dragos Tatulea 6504e7090e ubloxmodem: support authentication
If username and password specified, issue an UAUTHREQ
command with the configured authentication method, selected cid
and credentials.
2016-03-17 11:24:42 -05:00
Dragos Tatulea e4d3df016e ubloxmodem: add Toby L2 gprs context driver
For now the driver works only with bridged mode for 2G/3G.

Once it activates the context it reads the ip, netmask,
gw, dns and sets them in the context settings.
2016-03-17 10:59:00 -05:00
Dragos Tatulea 6970a289c2 atmodem: add support for U-Blox TOBY L2 modems
Besides exceptions below, act like normal U-Blox devices.

gprs-context: don't set auth for TOBY L2. U-Blox Toby L2
doesn't support PAP/CHAP APN auth method.

atmodem: TOBY L2 supports only CMER mode 1. Also chaged original
mode variable to ind, which is a more appropriate name.
mode is what is being set first.
2016-03-16 13:15:08 -05:00
Dragos Tatulea 1290fd1410 atmodem: ublox: EPS now supported by newer ublox
Based on UBX-13002752 R33
2016-03-10 08:26:34 -06:00
Dragos Tatulea cf13dcf4a6 atmodem: add vendor enumeration for ublox toby
Required to differentiate between the old LISA family
of supported devices and future TOBY L2 devices.
2016-03-10 08:04:58 -06:00
Kuba Pawlak fc4088fb02 hfpmodem: Handle repeated held call indicator
An issue with iPhone 5C iOS 9.2 triggers desynchronization in call
states. When an active call is put on hold and another call arrives,
it is in WAITING state. It should be possible to answer it by issuing
AT+CHLD=2 but the phone changes its state to INCOMING so ATA should be
used. This change is advertised by sending callheld:2 event, but it is
not handled. This event can be used to trigger CLCC poll to synchronize
call states.

+CIEV: 3,1   <- first call arrives
AT+CLCC
+CLCC: 1,1,4,0,0,"01234567890",129
OK
RING
+CLIP: "01234567890",129
ATA
OK
+CIEV: 2,1
+CIEV: 3,0.
AT+CHLD=2.$  <- first call is put on hold
OK
+CIEV: 7,2   <- notification confirming that call #1 is on hold
+CCWA: "09876543210",129,1     <- second call arrives
+CIEV: 7,2
+CIEV: 3,1
AT+CLCC
+CLCC: 1,1,1,0,0,"01234567890",129
+CLCC: 2,1,5,0,0,"09876543210",129 <- new call is still in WAITING state
OK
+CIEV: 7,2 <- phone iternally promotes WAITING call to INCOMING
AT+CHLD=2  <- there is no WAITING call anymore, ATA should be used
+CME ERROR:3
2016-01-12 10:31:15 -06:00
Denis Kenzior 5ef046d63d rilmodem: Initialize ofono_error correctly 2015-12-17 20:32:28 -06:00
Tony Espy 4cc0bc4d11 rilmodem: fix call_barring_query_cb
The return value from a RIL_REQUEST_GET_FACILITY_LOCK
is the TS 27.007 service class bit vector of services
for the specified barring facility.  The value canf be
zero, which indicates "disabled for all".
2015-12-15 12:22:38 -06:00
Denis Kenzior 2a78ecbbc3 rilmodem: Get rid of ril_gprs_context_data 2015-12-13 22:20:58 -06:00
Denis Kenzior 5896f792e5 rilmodem: Get rid of ril_sim_data 2015-12-13 21:29:57 -06:00
Denis Kenzior 32516c4844 sim: Silence warning on 32-bit 2015-12-13 20:53:17 -06:00
Denis Kenzior 0e3f108edc sim: Tweak debug statement 2015-12-13 20:53:17 -06:00
Denis Kenzior d1d2a16f94 sim: Add additional DBG statements 2015-12-13 20:53:17 -06:00
Tony Espy 65e026b784 rilmodem: fix sim_status_cb debug logging
During the re-factoring of rilmodem's sim atom
messaging code, the sim_status_cb function's
RIL tracing code was converted to DBG calls.
This change adds the same prefix to DBG/trace
calls when a single message's parameters span
more than one DBG call. This makes it easier
to filter out trace messages when looking at a
log file.
2015-12-04 16:26:49 -06:00
Tony Espy 98f3486fb3 rilmodem: restore SET_SMSC_ADDRESS number format
Restore quoting of SMSC number string, as it's
required by at least one rild implementation (mako).
2015-12-04 16:25:08 -06:00
Denis Kenzior b078ea60f0 rilmodem: Remove unneeded include 2015-12-04 13:45:24 -06:00
Denis Kenzior dae1073f13 rilmodem: Don't include grilunsol.h 2015-12-04 13:43:58 -06:00
Denis Kenzior 21e28ed19f rilmodem: Implement ril_setup_data_call_cb inline 2015-12-04 13:38:20 -06:00
Denis Kenzior 1d03261070 rilmodem: Implement get_active_data_calls_cb inline 2015-12-03 18:26:58 -06:00
Denis Kenzior 234dfedbaa rilmodem: Remove drivers/rilmodem/gprs.h 2015-12-03 13:26:15 -06:00
Denis Kenzior 55cedbf109 rilmodem: Don't expose private structures 2015-12-03 13:24:41 -06:00
Denis Kenzior cb2ca76bae rilmodem: Get rid of unnecessary exports 2015-12-03 13:13:36 -06:00
Denis Kenzior b090cf62d3 rilmodem: Get rid of ril_gprs_driver_data 2015-12-03 13:09:34 -06:00
Denis Kenzior 78368c5c88 rilmodem: Get rid of useless member variable 2015-12-03 13:04:21 -06:00
Denis Kenzior 561ab0d34a rilmodem: Remove data reg state query retry logic
This is no longer needed as the query for max_cid is done in a different
logic flow.
2015-12-03 13:02:19 -06:00
Denis Kenzior fcde83dcbf rilmodem: Don't include grilreply.h 2015-12-03 11:41:10 -06:00
Denis Kenzior 69f6a77d78 rilmodem: use g_new0 instead of g_try_new0 2015-12-03 11:38:36 -06:00
Denis Kenzior 5ea2800800 rilmodem: Implement clcc_poll_cb inline 2015-12-03 11:38:04 -06:00
Denis Kenzior f1a79f56b3 rilmodem: Implement ril_pin_change_state_cb inline 2015-12-03 11:22:02 -06:00
Denis Kenzior 4db0659cbd rilmodem: Implement inf_pin_retries_cb inline 2015-12-03 10:50:32 -06:00
Denis Kenzior e3188e7d43 rilmodem: Implement mtk_pin_retries_cb inline 2015-12-03 10:33:10 -06:00
Denis Kenzior 194003912d rilmodem: Don't include grilrequest.h 2015-12-03 10:20:44 -06:00
Denis Kenzior 5f3e3523ef rilmodem: Inline g_ril_request_oem_hook_strings 2015-12-03 10:17:53 -06:00
Denis Kenzior 4c2cd6fce6 rilmodem: inline request_oem_hook_raw 2015-12-03 10:12:02 -06:00
Denis Kenzior c99a5303c9 rilmodem: Refactor ril_data_reg_cb 2015-12-03 10:03:35 -06:00
Denis Kenzior 239008221f rilmodem: Implement reg_cb inline 2015-12-01 12:52:27 -06:00
Denis Kenzior 0f86f7b15c rilmodem: Add ril_util_registration_state_to_status 2015-12-01 12:51:24 -06:00
Denis Kenzior 2dbd1ce771 rilmodem: Implement activate_primary inline 2015-11-30 17:41:28 -06:00
Denis Kenzior 834816f458 rilmodem: Add ril_util_gprs_proto_to_ril_string 2015-11-30 17:40:59 -06:00
Denis Kenzior d13fd042e1 rilmodem: Refactor get_sim_status reply parsing 2015-11-30 13:43:27 -06:00
Denis Kenzior 50a8b36aee rilmodem: Implement sim io parser inline 2015-11-29 17:04:10 -06:00
Denis Kenzior 1c9ed8af0e rilmodem: Remove unused ril_util_sim_state_query 2015-11-29 15:53:46 -06:00
Tony Espy 30e6833f0e rilmodem: fix set_call_barring reply trace (mako)
This change restores the trace output for a reply to a
REQUEST_SET_FACILITY_LOCK used by the set function.
2015-11-29 15:51:12 -06:00
Denis Kenzior 77c7a90049 rilmodem: Remove unused ril_util_call_compare_by_status 2015-11-20 23:10:57 -06:00
Denis Kenzior 1658dfe2d2 rilmodem: Remove unused compare_by_phone_number 2015-11-20 23:09:52 -06:00
Denis Kenzior fbbd11cedd rilmodem: Remove unused ril_util_call_compare 2015-11-20 23:09:27 -06:00
Denis Kenzior 3ed496e00f rilmodem: Remove unused ril_util_call_compare_by_id 2015-11-20 23:08:41 -06:00
Denis Kenzior 43208828ab rilmodem: Implement ril_register_manual inline 2015-11-20 22:54:27 -06:00
Denis Kenzior 45d59d04a9 rilmodem: Use ril_util_build_deactivate_data_call 2015-11-20 22:51:44 -06:00
Denis Kenzior 7172e5cc19 rilmodem: Add ril_util_build_deactivate_data_call 2015-11-20 22:45:26 -06:00
Denis Kenzior c128fbf1e1 rilmodem: implement update_record inline 2015-11-20 22:19:31 -06:00
Denis Kenzior 4affc129c5 rilmodem: Implement ril_sim_update_binary inline 2015-11-20 22:05:22 -06:00
Denis Kenzior 31c4e3ca12 rilmodem: Implement ril_sim_read_record inline 2015-11-20 22:05:19 -06:00
Denis Kenzior 2283493125 rilmodem: Implement ril_sim_read_binary inline 2015-11-20 22:05:17 -06:00
Denis Kenzior f6591998de rilmodem: Implement ril_sim_read_info inline 2015-11-20 22:05:12 -06:00
Denis Kenzior 65398ce382 rilmodem: Simplify ril_gprs_set_attached 2015-11-13 16:10:30 -06:00
Denis Kenzior 659851b1b1 rilmodem: Implement ril_cops_cb inline 2015-11-13 14:27:47 -06:00
Denis Kenzior 2801acc03e rilmodem: Implement ril_cops_list_cb inline 2015-11-13 14:17:50 -06:00
Denis Kenzior 0c3903ff66 rilmodem: Implement ril_nitz_notify inline 2015-11-13 13:34:22 -06:00
Denis Kenzior 828fb72553 rilmodem: Inline signal strength parsing & calc 2015-11-13 13:16:22 -06:00
Denis Kenzior 3e58f7722f rilmodem: Implement lastcause_cb inline 2015-11-12 14:22:36 -06:00
Denis Kenzior c5c6620aa2 rilmodem: Implement ril_ss_notify inline 2015-11-12 14:15:17 -06:00
Denis Kenzior 88f507c1ac rilmodem: Implement dial inline 2015-11-12 14:01:23 -06:00
Denis Kenzior a453157f94 rilmodem: Implement hangups inline 2015-11-12 13:58:15 -06:00
Denis Kenzior 4cbc608e9e rilmodem: Implement send_one_dtmf inline 2015-11-12 13:42:41 -06:00
Denis Kenzior e696d87f34 rilmodem: Implement ril_private_chat inline 2015-11-12 13:27:35 -06:00
Denis Kenzior 5ba7127b10 rilmodem: Implement enable_supp_svc inline 2015-11-12 13:22:25 -06:00
Denis Kenzior 0b23b2b74b rilmodem: Get rid of ril_voicecall_driver_data 2015-11-12 13:17:55 -06:00
Denis Kenzior d351e3ac03 voicecall: Remove redundant comment 2015-11-12 13:17:55 -06:00
Denis Kenzior e3ee401d72 rilmodem: Remove auto-answering logic
This was only used for testing at the factory for a specific product.
Does not belong in the driver code.
2015-11-12 13:17:52 -06:00
Denis Kenzior 433104e953 rilmodem: Implement ril_pin_change_state inline 2015-11-12 11:58:26 -06:00
Denis Kenzior a3e4a52583 rilmodem: Implement ril_change_passwd inline 2015-11-12 11:41:03 -06:00
Denis Kenzior ca06f58fef rilmodem: Implement ril_pin_send_puk inline 2015-11-12 11:06:02 -06:00
Denis Kenzior 740bac3584 rilmodem: Implement ril_pin_send inline 2015-11-12 11:00:59 -06:00
Denis Kenzior 3537e88ff6 rilmodem: Fix up headers in sms 2015-11-05 22:41:04 -06:00
Denis Kenzior 07be422cfa rilmodem: Implement ril_csca_query_cb inline 2015-11-05 22:39:59 -06:00
Denis Kenzior 5bf684207b rilmodem: Implement ril_submit_sms_cb inline 2015-11-05 22:30:44 -06:00
Denis Kenzior cfe8cfb85b rilmodem: Implement ril_ack_delivery inline 2015-11-05 22:25:26 -06:00
Denis Kenzior 5a16ea8c4e rilmodem: Implement ril_cmgs inline 2015-11-05 22:22:47 -06:00
Denis Kenzior faf8744453 rilmodem: Implement ril_csca_set inline 2015-11-05 22:12:07 -06:00
Denis Kenzior 26917d689e rilmodem: Implement ril_sms_notify inline 2015-11-05 22:00:51 -06:00
Denis Kenzior 15c976a437 rilmodem: Remove unneeded code 2015-11-05 21:35:59 -06:00
Denis Kenzior bfa5ca0204 rilmodem: Remove comments that state the obvious 2015-11-05 21:35:47 -06:00
Denis Kenzior 97a6725b9b rilmodem: Move constants from gril 2015-11-05 21:21:38 -06:00
Denis Kenzior e4d65f6cda rilmodem: Implement ril_set_rat_mode inline 2015-11-05 21:19:40 -06:00
Denis Kenzior 5e74fdfd80 rilmodem: Implement ril_rat_mode_cb inline 2015-11-05 21:16:31 -06:00
Denis Kenzior b7d02edd17 rilmodem: Implement ril_set_fast_dormancy inline 2015-11-05 21:03:10 -06:00
Denis Kenzior 2d770c375e rilmodem: Get rid of pointless g_idle_add 2015-11-05 20:59:38 -06:00
Denis Kenzior 8a01d8aced rilmodem: Get rid of ril_radio_settings_driver_data 2015-11-05 20:56:13 -06:00
Denis Kenzior a0ecd17069 rilmodem: Get rid of radio-settings.h 2015-11-05 20:40:22 -06:00
Denis Kenzior 25e99e3631 build: Make distcheck pass again 2015-11-05 20:37:16 -06:00
Denis Kenzior 5cb6273940 rilmodem: Get rid of g_try_new0 2015-11-05 20:35:59 -06:00
Denis Kenzior 37e5c0d8ea rilmodem: Make ril_ussd_request inline 2015-11-05 13:50:24 -06:00
Denis Kenzior 6910a2e2e9 rilmodem: Rework ril_ussd_request 2015-11-05 13:48:45 -06:00
Denis Kenzior 8b6c834a1c rilmodem: Rework ril_ussd_cancel 2015-11-05 13:41:12 -06:00
Denis Kenzior 94ce280545 rilmodem: Implement ril_ussd_notify inline 2015-11-05 12:48:32 -06:00
Denis Kenzior a0eab81cc4 rilmodem: Inline query_serial and query_revision
query_serial was supposed to use parse_imei functionality, but called
baseband_version instead.  Rework both these to use inline parsers.
2015-11-05 11:33:05 -06:00
Denis Kenzior 80e40277ce rilmodem: Rework devinfo driver
Remove comments that state the obvious
Remove pointless allocations / frees
2015-11-05 11:20:17 -06:00
Denis Kenzior 0032cbf4a5 rilmodem: Rework header order in call-volume 2015-11-05 11:13:47 -06:00
Denis Kenzior 492b952f84 rilmodem: Implement probe_mute_cb inline 2015-11-05 11:12:54 -06:00
Denis Kenzior 2722e49484 rilmodem: Implement ril_call_volume_mute inline 2015-11-05 11:09:41 -06:00
Denis Kenzior bbe34cb90a rilmodem: Rework header order in call-settings 2015-11-05 11:02:15 -06:00
Denis Kenzior fc14bde9f1 rilmodem: Rework header order in call-forwarding 2015-11-05 11:01:59 -06:00
Denis Kenzior ec3d719835 rilmodem: Rework header order in call-barring 2015-11-05 11:01:48 -06:00
Denis Kenzior b25ff340db rilmodem: Implement ril_call_barring_set_cb inline 2015-11-05 10:54:50 -06:00
Denis Kenzior acee0e4755 rilmodem: Implement ril_call_barring_query_cb inline 2015-11-05 10:47:02 -06:00
Denis Kenzior b539ac47d9 rilmodem: Make ril_call_barring_set_passwd inline 2015-11-05 10:40:11 -06:00
Denis Kenzior b99df52a78 rilmodem: Implement ril_call_barring_set inline 2015-11-05 10:35:23 -06:00
Denis Kenzior b54e7c9ee8 rilmodem: Implement ril_call_barring_query inline 2015-11-05 10:26:49 -06:00
Denis Kenzior b8fcc3ef21 rilmodem: Implement g_ril_request_call_fwd inline 2015-11-04 23:25:53 -06:00
Denis Kenzior 282b254a5d rilmodem: Rework call-forwarding requests 2015-11-04 23:08:06 -06:00
Denis Kenzior 35a91e191d rilmodem: Implement ril_imsi_cb inline 2015-11-04 21:53:22 -06:00
Denis Kenzior b279a0d10a rilmodem: Implement ril_clir_query_cb inline 2015-11-04 21:44:48 -06:00
Denis Kenzior 8d23f61d90 rilmodem: Implement ril_clip_query_cb inline 2015-11-04 21:34:46 -06:00
Denis Kenzior 861de782f8 rilmodem: Implement ril_cw_query_cb inline 2015-11-04 21:28:36 -06:00
Denis Kenzior 48ab98a449 rilmodem: Implement ril_clir_set inline 2015-11-04 21:13:18 -06:00
Denis Kenzior 626612c48c rilmodem: Implement ril_cw_query inline 2015-11-04 21:08:09 -06:00
Denis Kenzior b093dfe133 rilmodem: Implement ril_cw_set inline 2015-11-04 21:04:21 -06:00
Denis Kenzior 6c21109cb3 rilmodem: Move get_imsi implementation to rilmodem 2015-10-15 09:59:50 -05:00
Alfonso Sanchez-Beato 2de8ba9faa infineon: Definitions for infineon modem 2015-10-13 21:35:07 -05:00
Tony Espy e918a6b222 rilmodem: driver for Android modems
Driver for modems that are accessed through the Android Radio Interface
Layer (RIL) for telephony, using the gril library. The driver is almost
feature complete with some exceptions, being CBS and SAT the most
prominent.

Co-authored-by: Tony Espy <espy@canonical.com>
Co-authored-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
Co-authored-by: Alfonso Sanchez-Beato <alfonso.sanchez-beato@canonical.com>
Co-authored-by: Islam Amer <islam.amer@jollamobile.com>
Co-authored-by: Jussi Kangas <jussi.kangas@tieto.com>
Co-authored-by: Juho Hämäläinen <juho.hamalainen@tieto.com>
Co-authored-by: Petri Takalokastari <petri.takalokastari@oss.tieto.com>
Co-authored-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
Co-authored-by: Tommi Kenakkala <tommi.kenakkala@oss.tieto.com>
Co-authored-by: Miia Leinonen <miia.leinonen@oss.tieto.com>
Co-authored-by: Martti Piirainen <martti.piirainen@canonical.com>
Co-authored-by: You-Sheng Yang <vicamo.yang@canonical.com>
2015-10-13 17:38:45 -05:00
Kuba Pawlak 4e9cbcdb89 hfp: Handle extra CCWA event
When a call is waitng, CCWA event is sent and call object
in state WAITING is created. on ReleaseAndAnswer it is
promoted to INCOMING and later to ACTIVE.
iPhones send an extra CCWA event when active call is ended.
This extra event is creating a second call object in state
WAITING. It is not possible to have two WAITING calls, but
previously waiting call was already promoted to INCOMING.
For a brief time we have two calls from the same number,
one INCOMING and one WAITING. Later WAITING one is removed.
As we cannot have a waiting and incoming call at the same
time, ignore CCWA when there is already an INCOMING call.

< \r\n+CIEV: 3,3\r\n
< \r\n+CIEV: 2,1\r\n
< \r\n+CIEV: 3,0\r\n
< \r\n+CCWA: "01234567890",129,1,"Me"\r\n
< \r\n+CIEV: 3,1\r\n
> AT+CLCC\r
< \r\n+CLCC: 1,0,0,0,0,"09876543210",129,"Me"\r\n
< \r\n+CLCC: 2,1,5,0,0,"01234567890",129,"Me"\r\n
< \r\nOK\r\n
< \r\n+CIEV: 2,0\r\n
< \r\n+CCWA: "01234567890",129,1,"Me"\r\n
< \r\n+CIEV: 2,1\r\n
< \r\n+CIEV: 3,0\r\n
> AT+CLCC\r
< \r\n+CLCC: 2,1,0,0,0,"01234567890",129,"Me"\r\n
< \r\nOK\r\n
2015-08-24 16:29:29 -05:00
Kuba Pawlak 3e6bbc676f hfp: Synchronize call state in case of +CHUP error
It is possible for the phone to accept Dial request
but not actually dial. This leaves a voicecall object
in state 'dialling' that cannot be removed.
Proposed workaround is to trigger AT+CLCC when an error
is returned for Hangup. As the call is not on the list,
this would remove this hanging object and signal CallRemoved.

Windows Phone trace with this fix:
ofonod[273]: > ATD1;\r
ofonod[273]: < \r\nOK\r\n
ofonod[273]: src/voicecall.c:dial_handle_result() Registering new call: 1
ofonod[273]: < \r\n+CIEV: 5,4\r\n
ofonod[273]: src/network.c:ofono_netreg_strength_notify() strength 80
ofonod[273]: > AT+CHUP\r
ofonod[273]: < \r\nERROR\r\n
ofonod[273]: src/voicecall.c:generic_callback() command failed with error: Unknown error type
ofonod[273]: > AT+CLCC\r
ofonod[273]: < \r\nOK\r\n
ofonod[273]: src/voicecall.c:ofono_voicecall_disconnected() Got disconnection event for id: 1, reason: 2
2015-08-05 11:15:33 -05:00
Kuba Pawlak 93ccb84761 hfpmodem: Fix connecting to AG with existing mpty
If there is more then one active or held call, we are in mpty calls.
We won't get indicator update if any of them is released by CHLD=1x.
So we have to poll it.
2015-06-04 16:18:08 -05:00
Alex J Lennon 4242f6ee72 atmodem: Add Cinterion quirk for signal strength
Implement OFONO_VENDOR_CINTERION specific vendor support to register
textual +CIEV indications for signal strength using AT^SIND command.
2015-05-13 09:57:53 -05:00
Kuba Pawlak cede3700f7 hfpmodem: slc.c: make sure to use none_prefix 2015-03-24 11:05:03 -05:00
Kuba Pawlak 318d313fc9 hfpmodem: hfpmodem.c make sure to use none_prefix 2015-03-24 11:04:48 -05:00
Denis Kenzior d6bc91ebfc hfpmodem: Make sure to use none_prefix
ofonod[253]: > AT+CCWA=1\r
ofonod[253]: < \r\n+BCS:2\r\n
ofonod[253]: < \r\nOK\r\n
2015-02-20 10:30:21 -06:00
Denis Kenzior 3d592d7d46 hfpmodem: Make sure to set the prefix properly
ofonod[1239]: > AT+COPS=3,0\r
ofonod[1239]: < \r\n+BCS:2\r\n
ofonod[1239]: < \r\nOK\r\n
2015-02-20 10:28:24 -06:00
Cedric Jehasse d539ed19f3 atmodem: fix retries reporting from AT+CPINR
The retries array was not correctly filled in.
2015-02-02 09:22:21 -06:00
Cedric Jehasse 25f926c733 atmodem: Sierra modems should be polled after CPIN
Sierra modem will return "CME ERROR: 14" when polled right after pin has
been entered. Use the existing vendor quirk to handle this.
2015-02-02 09:21:10 -06:00
Denis Kenzior 2abcb85809 telitmodem: Fix a few coding style violations 2014-10-22 21:21:49 -05:00
Kuba Pawlak a753d6c012 telitmodem: location reporting driver 2014-10-22 21:15:35 -05:00