Commit Graph

8181 Commits

Author SHA1 Message Date
Denis Kenzior aff02b297c test: Add list-applications
This calls SimAuthentication.GetApplications
2017-10-26 10:23:47 -05:00
Denis Kenzior 2dd64cda80 mbm: Add sim-auth 2017-10-26 10:23:47 -05:00
Denis Kenzior 3b951d20f4 voicecall: expand synthesize_outgoing_call
synthethize_outgoing_call was only used once from dial_handle_result.
So move all the logic of registering the call to D-Bus and adding it to
the voicecalls list to that function.

This will allow synthethize_outgoing_call to be used from other
callbacks where the dial callback is guaranteed to return before any
call state notifications, e.g. in the case of +BLDN.
2017-10-26 10:23:47 -05:00
Slava Monich b26abc8f78 atmodem: Query the list of supported <fac>s from the modem
Not all modems support all <fac>s (particularly, "PS"), let's be polite
and not ask them for the ones they don't support.
2017-10-23 17:24:02 -05:00
Slava Monich bf5f4242a2 gatmux: Remove write watch source at shutdown
Otherwise write_watcher_destroy_notify can be invoked after
GAtMux has been deallocated which results in write after free:

==3952== Invalid write of size 4
==3952==    at 0xABF54: write_watcher_destroy_notify (gatmux.c:285)
==3952==    by 0x4AF21E7: g_source_callback_unref (gmain.c:1561)
==3952==    by 0x4AF2E53: g_source_destroy_internal.constprop.8 (gmain.c:1207)
==3952==    by 0x4AF61CF: g_main_dispatch (gmain.c:3177)
==3952==    by 0x4AF61CF: g_main_context_dispatch (gmain.c:3769)
==3952==    by 0x4AF658F: g_main_loop_run (gmain.c:4034)
==3952==    by 0xBDDBB: main (main.c:261)
==3952==  Address 0x50c6cb0 is 8 bytes inside a block of size 4,396 free'd
==3952==    at 0x4840B28: free (vg_replace_malloc.c:530)
==3952==    by 0xACB53: g_at_mux_unref (gatmux.c:642)
==3952==  Block was alloc'd at
==3952==    at 0x4841BF0: calloc (vg_replace_malloc.c:711)
==3952==    by 0xAC9DF: g_at_mux_new (gatmux.c:603)
==3952==    by 0xADF2F: g_at_mux_new_gsm0710_basic (gatmux.c:1160)
2017-10-23 17:22:56 -05:00
Slava Monich bb637a12c5 gatmux: Remove finalized watches from the list
Leaving them there may result in invalid reads like this:

==2312== Invalid read of size 4
==2312==    at 0xAB8C0: dispatch_sources (gatmux.c:134)
==2312==    by 0xAC5D3: channel_close (gatmux.c:479)
==2312==    by 0x4AE8885: g_io_channel_shutdown (giochannel.c:523)
==2312==    by 0x4AE8A1D: g_io_channel_unref (giochannel.c:240)
==2312==    by 0xAC423: watch_finalize (gatmux.c:426)
==2312==    by 0x4AF2CC9: g_source_unref_internal (gmain.c:2048)
==2312==    by 0x4AF44E1: g_source_destroy_internal (gmain.c:1230)
==2312==    by 0x4AF44E1: g_source_destroy (gmain.c:1256)
==2312==    by 0x4AF5257: g_source_remove (gmain.c:2282)
==2312==    by 0xAB5CB: io_shutdown (gatio.c:325)
==2312==    by 0xAB667: g_at_io_unref (gatio.c:345)
==2312==    by 0xA72C7: at_chat_unref (gatchat.c:972)
==2312==    by 0xA829B: g_at_chat_unref (gatchat.c:1446)
==2312==  Address 0x51420f0 is 56 bytes inside a block of size 60 free'd
==2312==    at 0x4840B28: free (vg_replace_malloc.c:530)
==2312==    by 0x4AF2D33: g_source_unref_internal (gmain.c:2075)
==2312==    by 0x4AF44E1: g_source_destroy_internal (gmain.c:1230)
==2312==    by 0x4AF44E1: g_source_destroy (gmain.c:1256)
==2312==    by 0x4AF5257: g_source_remove (gmain.c:2282)
==2312==    by 0xAB46B: g_at_io_set_write_handler (gatio.c:283)
==2312==    by 0xA713F: at_chat_suspend (gatchat.c:938)
==2312==    by 0xA72B7: at_chat_unref (gatchat.c:971)
==2312==    by 0xA829B: g_at_chat_unref (gatchat.c:1446)
==2312==  Block was alloc'd at
==2312==    at 0x4841BF0: calloc (vg_replace_malloc.c:711)
==2312==    by 0x4AFB117: g_malloc0 (gmem.c:124)
==2312==    by 0x4AF401F: g_source_new (gmain.c:892)
==2312==    by 0xAC6A7: channel_create_watch (gatmux.c:506)
==2312==    by 0x4AE7C4F: g_io_add_watch_full (giochannel.c:649)
==2312==    by 0xAB4EB: g_at_io_set_write_handler (gatio.c:297)
==2312==    by 0xA7103: chat_wakeup_writer (gatchat.c:931)
==2312==    by 0xA753F: at_chat_send_common (gatchat.c:1045)
==2312==    by 0xA850F: g_at_chat_send (gatchat.c:1502)

It's also necessary to add additional references to the sources
for the duration of the dispatch_sources loop because any source
can be removed when any callback is invoked (and not necessarily
the one being dispatched).
2017-10-23 15:25:20 -05:00
James Prestwood 2bc262b3af simauth: Fixed incorrect AUTS length
The initial SimAuth implementation incorrectly parsed
the AUTS value as 16 bytes, not 14.
2017-10-20 14:08:57 -05:00
Jonas Bonn 35636752ad qmi: support SMS receive on Quectel EC21
The Quectel EC21 does not provide the SMS PDU on the message event
notification.

This patch adds a call to 'raw read' on the message ID from the event
notification if the event notification does not already contain the
message data.

The message data begins with the SMSC length, type, and address so
the TPDU length is adjusted accordingly in the raw_read callback.  This
differs from the way the raw message data is handled in the case
that it is included in the event notification itself.  As I don't have
access to any other QMI modem at this time, I'm can not confirm that
this difference is reasonable.
2017-10-17 09:35:02 -05:00
James Prestwood 95e795b62d simauth: fixup adding more dbus return checks 2017-10-16 11:16:27 -05:00
James Prestwood 472d84386f phonesim: Added sim-auth to phonesim plugin 2017-10-12 15:33:46 -05:00
James Prestwood 6105412d09 xmm7xxx: add sim-auth driver to xmm7xxx plugin 2017-10-12 15:33:43 -05:00
James Prestwood 1b5e95a32a atmodem: implemented sim-auth functionality in atmodem
Implemented the core API's needed for sim-auth:

list_apps: already implemented
open_channel: Opens a logical channel with +CCHO
close_channel: Closes logical channel with +CCHC
logical_access: Access an opened channel with +CGLA
2017-10-12 15:33:27 -05:00
James Prestwood 5ba90f6b09 sim-auth: implementation of core sim-auth atom
The sim-auth module atom can now be used for SIM application discovery
and authentication. The atom will automatically discover SIM
applications available on the SIM and register a new DBus object under
the modem, whos name is the AID string e.g.

/modem1/A0000000871004FFFFFFFF8906190000

A list of discovered AID object paths and types can be retrieved by
calling GetApplications() under the modems (new)
org.ofono.SimAuthentication interface which returns "a{oa{sv}}" where

o = path (e.g. above)

and the dictionary contains the following properties:

Type: "Umts" or "Ims"
Name: "USim" or "ISim"

The Type signifies which interfaces the AID object will have:

Umts = org.ofono.USimApplication
Ims = org.ofono.ISimApplication

These interfaces will contain the supported USIM/ISIM authentication
algorithms. Where:

org.ofono.USimApplication has:
    GetProperties()
    GsmAuthenticate()
    UmtsAuthenticate()

org.ofono.ISimApplication has:
    GetProperties()
    ImsAuthenticate()
2017-10-12 15:28:40 -05:00
James Prestwood 5556e2ac57 test: added tests for GSM/UMTS auth algorithms 2017-10-12 09:51:48 -05:00
James Prestwood cd92f86ad4 doc: documentation for SimAuth dbus interfaces 2017-10-12 09:49:11 -05:00
James Prestwood fd9b13ac42 sim-auth: prep simauth/dbus headers
Added new dbus interfaces for SimAuth module as well as
function prototype definitions to simauth header.

org.ofono.SimAuthentication:
   Interface to hold the auth object to type mapping property

org.ofono.USimApplication:
   Application with USim functionality (GSM/UMTS auth)

org.ofono.ISimApplication:
   Application with ISim functionality (IMS auth)
2017-10-11 14:17:03 -05:00
James Prestwood a8f609727d sim: new API to check for a UST service only
The existing service check API takes both SST and UST services
and could inadvertently return success on a service if one
(SST or UST) service did not exist. This adds an API specifically
for checking for a UST service, and if the UST dir is not available
it will return FALSE, rather than possibly returning true on some
other SST service.
2017-10-11 10:31:10 -05:00
Denis Kenzior ee34967a52 unit: Fix up style issues 2017-10-11 10:29:16 -05:00
James Prestwood 43ca69afbb unit: add gsm and umts parse/build unit tests 2017-10-11 10:29:16 -05:00
James Prestwood 2a1982e8c0 simutil: Added authenticate builder/parser API
Used to compose/parse non-TLV formatted authenticate commands
for GSM and UMTS authentication.
2017-10-11 10:29:13 -05:00
James Prestwood eb2915e231 simutil: Added app type to application parser
Parsing a SIM application only copied the 16 byte AID
portion, which included the application type. Parsing out
the type makes sorting much easier for modules using the
parser.
2017-10-11 10:26:24 -05:00
Denis Kenzior b7c768c74a mbim: Set device online and offline properly
At initialization time set the radio off and implement .set_online
to toggle the radio state.
2017-10-09 20:35:51 -05:00
Denis Kenzior 187b0840d6 mbim: Add sim atom to mbim modem driver 2017-10-09 16:37:57 -05:00
Denis Kenzior 92296924ff mbim: Add basic SIM driver 2017-10-09 16:37:39 -05:00
Denis Kenzior b90d393652 AUTHORS: Mention Ankit's contributions 2017-10-09 12:23:52 -05:00
Ankit Navik 33fae2e057 doc: Add IMS interface to Interfaces list 2017-10-09 12:07:34 -05:00
Ankit Navik 14031eabb5 xmm7modem: Add support for ims 2017-10-09 12:07:23 -05:00
Ankit Navik 2518c0e9d2 xmm7modem: Add ims atom driver 2017-10-09 11:39:03 -05:00
Denis Kenzior 8a09ad56fe ims: Rework initialization
We should bootstrap the registration status prior to registering the
interface with D-Bus
2017-10-09 11:35:46 -05:00
Denis Kenzior b002a79f4b ims: Remove logic checking presence of SIM atom
This part is not required
2017-10-09 11:35:05 -05:00
Ankit Navik 32d7596ff4 ims: add implementation for IMS atom
This implementation includes:
* D-Bus interface
* interaction with driver
2017-10-09 11:23:04 -05:00
Ankit Navik 7f6b9e1040 test: add scripts to test ims registration 2017-10-05 11:47:38 -05:00
Ankit Navik 551e41b31a include: added IpMultimediaSystem interface 2017-10-05 11:38:17 -05:00
Ankit Navik 42e93fbbc1 doc: add ims atom documentation 2017-10-05 11:37:18 -05:00
Clayton Craft c33c567ef6 nokia-gpio: do not create links to gpios in /dev/cmt
The nokia-gpio plugin should not try to create symlinks to relevant gpio
pins under /dev/cmt, since the location it is looking is no longer
correct on newer kernels and it might change again in the future. This
patch removes code from nokia-gpio that tries to create a symlink.

Users will now need to symlink the modem gpios to /dev/cmt themselves.
On the 4.13 kernel, this can be done by, for example, adding a udev rule
to:
 # ln -sf /sys/bus/hsi/devices/n900-modem /dev/cmt
2017-10-05 11:32:59 -05:00
Slava Monich 61bbbb0d7a modem: Implement ofono_modem_get_sim 2017-10-05 11:22:54 -05:00
Slava Monich 6cd169b05b include: Add ofono_modem_get_sim 2017-10-05 11:22:49 -05:00
Denis Kenzior 8d06cfd2df AUTHORS: Mention Richard's contributions 2017-10-05 11:20:33 -05:00
Richard Röjfors 5b4539fd9a ublox: Disable DCD to avoid HUP when leaving data mode.
The HUP results in errors in gatio which will deref parts
of the AT channel. This makes it impossible to recover and
send further AT commands after the HUP.
2017-10-05 11:20:05 -05:00
John Ernberg b33470bcf9 doc: Add missing LTE interface to Interfaces list 2017-10-05 11:12:35 -05:00
Slava Monich 4a2915d52d atmodem: Fix use after free in sim_state_cb
==2941== Invalid read of size 4
==2941==    at 0x69338: sim_state_cb (sim.c:1301)
==2941==    by 0x71DCB: cpin_check_cb (atutil.c:567)
==2941==    by 0xA602B: at_chat_finish_command (gatchat.c:459)
==2941==    by 0xA6277: at_chat_handle_command_response (gatchat.c:521)
==2941==    by 0xA6587: have_line (gatchat.c:600)
==2941==    by 0xA6BB7: new_bytes (gatchat.c:759)
==2941==    by 0xAAFAF: received_data (gatio.c:124)
==2941==    by 0x4AF606F: g_main_dispatch (gmain.c:3154)
==2941==    by 0x4AF606F: g_main_context_dispatch (gmain.c:3769)
==2941==    by 0x4AF658F: g_main_loop_run (gmain.c:4034)
==2941==    by 0xBDDBB: main (main.c:261)
==2941==  Address 0x519c344 is 4 bytes inside a block of size 12 free'd
==2941==    at 0x4840B28: free (vg_replace_malloc.c:530)
==2941==    by 0x71F33: at_util_sim_state_query_free (atutil.c:613)
==2941==    by 0x6930B: sim_state_cb (sim.c:1297)
==2941==    by 0x71DCB: cpin_check_cb (atutil.c:567)
==2941==    by 0xA602B: at_chat_finish_command (gatchat.c:459)
==2941==    by 0xA6277: at_chat_handle_command_response (gatchat.c:521)
==2941==    by 0xA6587: have_line (gatchat.c:600)
==2941==    by 0xA6BB7: new_bytes (gatchat.c:759)
==2941==    by 0xAAFAF: received_data (gatio.c:124)
==2941==    by 0x4AF606F: g_main_dispatch (gmain.c:3154)
==2941==    by 0x4AF606F: g_main_context_dispatch (gmain.c:3769)
==2941==    by 0x4AF658F: g_main_loop_run (gmain.c:4034)
==2941==    by 0xBDDBB: main (main.c:261)
2017-10-05 11:11:13 -05:00
Denis Kenzior 94cefc7cff mbim: Add CIDs from the specification 2017-10-05 11:08:38 -05:00
Denis Kenzior f0c1bdcf88 mbim: Support all types in _mbim_message_build 2017-10-05 11:08:38 -05:00
Denis Kenzior ab17a278c6 mbim: Instantiate devinfo atom 2017-10-05 11:08:38 -05:00
Denis Kenzior 978752bcd6 mbim: Add devinfo driver
Querying Manufacturer and Model is still not supported
2017-10-05 11:08:38 -05:00
Denis Kenzior e6268d1eb7 devinfo: Implement ofono_devinfo_get_modem 2017-10-05 11:08:38 -05:00
Denis Kenzior ab4a4c6604 include: add ofono_devinfo_get_modem 2017-10-05 11:08:38 -05:00
Denis Kenzior cc90b1f71e mbim: Add mbim_device_cancel_group 2017-10-05 11:08:38 -05:00
Denis Kenzior db42e75a9c mbim: Add mbim_device_cancel 2017-10-05 11:08:38 -05:00
Denis Kenzior 09eed88553 mbim: Add basic enable/disable 2017-10-05 11:08:38 -05:00