forked from sailfishos/ofono
Compare commits
32 Commits
mer/1.22+g
...
mer/1.23+g
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf91be9742 | ||
|
|
087771dc0f | ||
|
|
645dfe47e5 | ||
|
|
68e8b02d3b | ||
|
|
aa4309e8cb | ||
|
|
cb6b24d950 | ||
|
|
6d1ab13c74 | ||
|
|
45424a3f96 | ||
|
|
4f7398e39d | ||
|
|
cd118ce70b | ||
|
|
99d4ce538e | ||
|
|
9b2c4bcf76 | ||
|
|
0122db04a3 | ||
|
|
021db194cb | ||
|
|
e0a0896205 | ||
|
|
49d0bbbb28 | ||
|
|
9193d06b77 | ||
|
|
b0cd3e4544 | ||
|
|
29cce6969b | ||
|
|
b87f666e4b | ||
|
|
1c1e4fa28b | ||
|
|
f597119845 | ||
|
|
633888932d | ||
|
|
a37f325d4a | ||
|
|
0afceac554 | ||
|
|
109751bcc0 | ||
|
|
30dfbf8fd7 | ||
|
|
c7aab2e790 | ||
|
|
412a2a0e7f | ||
|
|
f1aeedd113 | ||
|
|
639fce8eca | ||
|
|
9cfd0a195e |
@@ -1,3 +1,8 @@
|
||||
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.
|
||||
|
||||
@@ -305,6 +305,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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
AC_PREREQ(2.60)
|
||||
AC_INIT(ofono, 1.22)
|
||||
AC_INIT(ofono, 1.23)
|
||||
|
||||
AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -422,6 +422,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)
|
||||
@@ -1287,6 +1309,7 @@ static struct ofono_voicecall_driver driver = {
|
||||
.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,
|
||||
|
||||
@@ -29,12 +29,16 @@
|
||||
|
||||
#include "qmi.h"
|
||||
#include "nas.h"
|
||||
#include "wds.h"
|
||||
|
||||
#include "src/common.h"
|
||||
#include "qmimodem.h"
|
||||
|
||||
struct gprs_data {
|
||||
struct qmi_device *dev;
|
||||
struct qmi_service *nas;
|
||||
struct qmi_service *wds;
|
||||
unsigned int last_auto_context_id;
|
||||
};
|
||||
|
||||
static bool extract_ss_info(struct qmi_result *result, int *status, int *tech)
|
||||
@@ -64,8 +68,124 @@ static bool extract_ss_info(struct qmi_result *result, int *status, int *tech)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void get_lte_attach_param_cb(struct qmi_result *result, void *user_data)
|
||||
{
|
||||
struct ofono_gprs *gprs = user_data;
|
||||
struct gprs_data *data = ofono_gprs_get_data(gprs);
|
||||
char *apn = NULL;
|
||||
uint16_t error;
|
||||
uint8_t iptype;
|
||||
|
||||
DBG("");
|
||||
|
||||
if (qmi_result_set_error(result, &error)) {
|
||||
ofono_error("Failed to query LTE attach params: %hd", error);
|
||||
goto noapn;
|
||||
}
|
||||
|
||||
/* APN */
|
||||
apn = qmi_result_get_string(result, 0x10);
|
||||
if (!apn) {
|
||||
DBG("Default profile has no APN setting");
|
||||
goto noapn;
|
||||
}
|
||||
|
||||
if (qmi_result_get_uint8(result, 0x11, &iptype))
|
||||
ofono_info("LTE attach IP type: %hhd", iptype);
|
||||
|
||||
ofono_gprs_cid_activated(gprs, data->last_auto_context_id, apn);
|
||||
g_free(apn);
|
||||
|
||||
return;
|
||||
|
||||
noapn:
|
||||
data->last_auto_context_id = 0;
|
||||
ofono_error("LTE bearer established but APN not set");
|
||||
}
|
||||
|
||||
static void get_default_profile_cb(struct qmi_result *result, void *user_data)
|
||||
{
|
||||
struct ofono_gprs* gprs = user_data;
|
||||
struct gprs_data *data = ofono_gprs_get_data(gprs);
|
||||
uint16_t error;
|
||||
uint8_t index;
|
||||
|
||||
DBG("");
|
||||
|
||||
if (qmi_result_set_error(result, &error)) {
|
||||
ofono_error("Get default profile error: %hd", error);
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Profile index */
|
||||
if (!qmi_result_get_uint8(result, 0x01, &index)) {
|
||||
ofono_error("Failed query default profile");
|
||||
goto error;
|
||||
}
|
||||
|
||||
DBG("Default profile index: %hhd", index);
|
||||
|
||||
data->last_auto_context_id = index;
|
||||
|
||||
/* Get LTE Attach Parameters */
|
||||
if (qmi_service_send(data->wds, 0x85, NULL,
|
||||
get_lte_attach_param_cb, gprs, NULL) > 0)
|
||||
return;
|
||||
|
||||
error:
|
||||
data->last_auto_context_id = 0;
|
||||
ofono_error("LTE bearer established but APN not set");
|
||||
}
|
||||
|
||||
/*
|
||||
* Query the settings in effect on the default bearer. These may be
|
||||
* implicit or may even be something other than requested as the gateway
|
||||
* is allowed to override whatever was requested by the user.
|
||||
*/
|
||||
static void get_lte_attach_params(struct ofono_gprs* gprs)
|
||||
{
|
||||
struct gprs_data *data = ofono_gprs_get_data(gprs);
|
||||
struct {
|
||||
uint8_t type;
|
||||
uint8_t family;
|
||||
} __attribute((packed)) p = {
|
||||
.type = 0, /* 3GPP */
|
||||
.family = 0, /* embedded */
|
||||
};
|
||||
struct qmi_param *param;
|
||||
|
||||
DBG("");
|
||||
|
||||
if (data->last_auto_context_id != 0)
|
||||
return; /* Established or in progress */
|
||||
|
||||
/* Set query in progress */
|
||||
data->last_auto_context_id = -1;
|
||||
|
||||
/* First we query the default profile in order to find out which
|
||||
* context the modem has activated.
|
||||
*/
|
||||
param = qmi_param_new();
|
||||
if (!param)
|
||||
goto error;
|
||||
|
||||
/* Profile type */
|
||||
qmi_param_append(param, 0x1, sizeof(p), &p);
|
||||
|
||||
/* Get default profile */
|
||||
if (qmi_service_send(data->wds, 0x49, param,
|
||||
get_default_profile_cb, gprs, NULL) > 0)
|
||||
return;
|
||||
|
||||
qmi_param_free(param);
|
||||
|
||||
error:
|
||||
ofono_warn("Unable to query LTE APN... will not activate context");
|
||||
}
|
||||
|
||||
static int handle_ss_info(struct qmi_result *result, struct ofono_gprs *gprs)
|
||||
{
|
||||
struct gprs_data *data = ofono_gprs_get_data(gprs);
|
||||
int status;
|
||||
int tech;
|
||||
|
||||
@@ -74,17 +194,20 @@ static int handle_ss_info(struct qmi_result *result, struct ofono_gprs *gprs)
|
||||
if (!extract_ss_info(result, &status, &tech))
|
||||
return -1;
|
||||
|
||||
if (status == NETWORK_REGISTRATION_STATUS_REGISTERED)
|
||||
if (status == NETWORK_REGISTRATION_STATUS_REGISTERED) {
|
||||
if (tech == ACCESS_TECHNOLOGY_EUTRAN) {
|
||||
/* On LTE we are effectively always attached; and
|
||||
* the default bearer is established as soon as the
|
||||
* network is joined.
|
||||
* network is joined. We just need to query the
|
||||
* parameters in effect on the default bearer and
|
||||
* let the ofono core know about the activated
|
||||
* context.
|
||||
*/
|
||||
/* FIXME: query default profile number and APN
|
||||
* instead of assuming profile 1 and ""
|
||||
*/
|
||||
ofono_gprs_cid_activated(gprs, 1 , "automatic");
|
||||
get_lte_attach_params(gprs);
|
||||
}
|
||||
} else {
|
||||
data->last_auto_context_id = 0;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -198,7 +321,7 @@ static void qmi_attached_status(struct ofono_gprs *gprs,
|
||||
g_free(cbd);
|
||||
}
|
||||
|
||||
static void create_nas_cb(struct qmi_service *service, void *user_data)
|
||||
static void create_wds_cb(struct qmi_service *service, void *user_data)
|
||||
{
|
||||
struct ofono_gprs *gprs = user_data;
|
||||
struct gprs_data *data = ofono_gprs_get_data(gprs);
|
||||
@@ -206,12 +329,12 @@ static void create_nas_cb(struct qmi_service *service, void *user_data)
|
||||
DBG("");
|
||||
|
||||
if (!service) {
|
||||
ofono_error("Failed to request NAS service");
|
||||
ofono_error("Failed to request WDS service");
|
||||
ofono_gprs_remove(gprs);
|
||||
return;
|
||||
}
|
||||
|
||||
data->nas = qmi_service_ref(service);
|
||||
data->wds = qmi_service_ref(service);
|
||||
|
||||
/*
|
||||
* First get the SS info - the modem may already be connected,
|
||||
@@ -228,6 +351,25 @@ static void create_nas_cb(struct qmi_service *service, void *user_data)
|
||||
ofono_gprs_register(gprs);
|
||||
}
|
||||
|
||||
static void create_nas_cb(struct qmi_service *service, void *user_data)
|
||||
{
|
||||
struct ofono_gprs *gprs = user_data;
|
||||
struct gprs_data *data = ofono_gprs_get_data(gprs);
|
||||
|
||||
DBG("");
|
||||
|
||||
if (!service) {
|
||||
ofono_error("Failed to request NAS service");
|
||||
ofono_gprs_remove(gprs);
|
||||
return;
|
||||
}
|
||||
|
||||
data->nas = qmi_service_ref(service);
|
||||
|
||||
qmi_service_create_shared(data->dev, QMI_SERVICE_WDS,
|
||||
create_wds_cb, gprs, NULL);
|
||||
}
|
||||
|
||||
static int qmi_gprs_probe(struct ofono_gprs *gprs,
|
||||
unsigned int vendor, void *user_data)
|
||||
{
|
||||
@@ -240,6 +382,8 @@ static int qmi_gprs_probe(struct ofono_gprs *gprs,
|
||||
|
||||
ofono_gprs_set_data(gprs, data);
|
||||
|
||||
data->dev = device;
|
||||
|
||||
qmi_service_create_shared(device, QMI_SERVICE_NAS,
|
||||
create_nas_cb, gprs, NULL);
|
||||
|
||||
@@ -254,6 +398,9 @@ static void qmi_gprs_remove(struct ofono_gprs *gprs)
|
||||
|
||||
ofono_gprs_set_data(gprs, NULL);
|
||||
|
||||
qmi_service_unregister_all(data->wds);
|
||||
qmi_service_unref(data->wds);
|
||||
|
||||
qmi_service_unregister_all(data->nas);
|
||||
|
||||
qmi_service_unref(data->nas);
|
||||
|
||||
264
ofono/drivers/qmimodem/lte.c
Normal file
264
ofono/drivers/qmimodem/lte.c
Normal file
@@ -0,0 +1,264 @@
|
||||
/*
|
||||
*
|
||||
* oFono - Open Source Telephony
|
||||
*
|
||||
* Copyright (C) 2018 Jonas Bonn. All rights reserved.
|
||||
* Copyright (C) 2018 Norrbonn AB. All rights reserved.
|
||||
* Copyright (C) 2018 Data Respons ASA. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include <ofono/modem.h>
|
||||
#include <ofono/gprs-context.h>
|
||||
#include <ofono/log.h>
|
||||
#include <ofono/lte.h>
|
||||
|
||||
#include "qmi.h"
|
||||
#include "wds.h"
|
||||
|
||||
#include "qmimodem.h"
|
||||
|
||||
struct lte_data {
|
||||
struct qmi_service *wds;
|
||||
uint8_t default_profile;
|
||||
};
|
||||
|
||||
static void modify_profile_cb(struct qmi_result *result, void *user_data)
|
||||
{
|
||||
struct cb_data *cbd = user_data;
|
||||
ofono_lte_cb_t cb = cbd->cb;
|
||||
uint16_t error;
|
||||
|
||||
DBG("");
|
||||
|
||||
if (qmi_result_set_error(result, &error)) {
|
||||
DBG("Failed to modify profile: %d", error);
|
||||
CALLBACK_WITH_FAILURE(cb, cbd->data);
|
||||
return;
|
||||
}
|
||||
|
||||
CALLBACK_WITH_SUCCESS(cb, cbd->data);
|
||||
}
|
||||
|
||||
static void qmimodem_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_data *ldd = ofono_lte_get_data(lte);
|
||||
struct cb_data *cbd = cb_data_new(cb, data);
|
||||
struct qmi_param* param;
|
||||
struct {
|
||||
uint8_t type;
|
||||
uint8_t index;
|
||||
} __attribute__((packed)) p = {
|
||||
.type = 0, /* 3GPP */
|
||||
};
|
||||
|
||||
DBG("");
|
||||
|
||||
p.index = ldd->default_profile;
|
||||
|
||||
param = qmi_param_new();
|
||||
if (!param)
|
||||
goto error;
|
||||
|
||||
/* Profile selector */
|
||||
qmi_param_append(param, 0x01, sizeof(p), &p);
|
||||
|
||||
/* WDS APN Name */
|
||||
qmi_param_append(param, QMI_WDS_PARAM_APN,
|
||||
strlen(info->apn), info->apn);
|
||||
|
||||
/* Modify profile */
|
||||
if (qmi_service_send(ldd->wds, 0x28, param,
|
||||
modify_profile_cb, cbd, g_free) > 0)
|
||||
return;
|
||||
|
||||
qmi_param_free(param);
|
||||
|
||||
error:
|
||||
CALLBACK_WITH_FAILURE(cb, cbd->data);
|
||||
}
|
||||
|
||||
static void reset_profile_cb(struct qmi_result *result, void *user_data)
|
||||
{
|
||||
struct ofono_lte *lte = user_data;
|
||||
uint16_t error;
|
||||
|
||||
DBG("");
|
||||
|
||||
if (qmi_result_set_error(result, &error))
|
||||
ofono_error("Reset profile error: %hd", error);
|
||||
|
||||
ofono_lte_register(lte);
|
||||
}
|
||||
|
||||
static void get_default_profile_cb(struct qmi_result *result, void *user_data)
|
||||
{
|
||||
struct ofono_lte *lte = user_data;
|
||||
struct lte_data *ldd = ofono_lte_get_data(lte);
|
||||
uint16_t error;
|
||||
uint8_t index;
|
||||
struct qmi_param *param;
|
||||
struct {
|
||||
uint8_t type;
|
||||
uint8_t index;
|
||||
} __attribute__((packed)) p = {
|
||||
.type = 0, /* 3GPP */
|
||||
};
|
||||
|
||||
DBG("");
|
||||
|
||||
if (qmi_result_set_error(result, &error)) {
|
||||
ofono_error("Get default profile error: %hd", error);
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Profile index */
|
||||
if (!qmi_result_get_uint8(result, 0x01, &index)) {
|
||||
ofono_error("Failed query default profile");
|
||||
goto error;
|
||||
}
|
||||
|
||||
DBG("Default profile index: %hhd", index);
|
||||
|
||||
ldd->default_profile = index;
|
||||
|
||||
p.index = index;
|
||||
|
||||
param = qmi_param_new();
|
||||
if (!param)
|
||||
goto error;
|
||||
|
||||
/* Profile selector */
|
||||
qmi_param_append(param, 0x01, sizeof(p), &p);
|
||||
|
||||
/* Reset profile */
|
||||
if (qmi_service_send(ldd->wds, 0x4b, param,
|
||||
reset_profile_cb, lte, NULL) > 0)
|
||||
return;
|
||||
|
||||
qmi_param_free(param);
|
||||
|
||||
error:
|
||||
ofono_error("Failed to reset profile %hhd", index);
|
||||
ofono_lte_remove(lte);
|
||||
}
|
||||
|
||||
static void create_wds_cb(struct qmi_service *service, void *user_data)
|
||||
{
|
||||
struct ofono_lte *lte = user_data;
|
||||
struct lte_data *ldd = ofono_lte_get_data(lte);
|
||||
struct qmi_param *param;
|
||||
struct {
|
||||
uint8_t type;
|
||||
uint8_t family;
|
||||
} __attribute((packed)) p = {
|
||||
.type = 0, /* 3GPP */
|
||||
.family = 0, /* embedded */
|
||||
};
|
||||
|
||||
DBG("");
|
||||
|
||||
if (!service) {
|
||||
ofono_error("Failed to request WDS service");
|
||||
ofono_lte_remove(lte);
|
||||
return;
|
||||
}
|
||||
|
||||
ldd->wds = qmi_service_ref(service);
|
||||
|
||||
/* Query the default profile */
|
||||
param = qmi_param_new();
|
||||
if (!param)
|
||||
goto error;
|
||||
|
||||
/* Profile type */
|
||||
qmi_param_append(param, 0x1, sizeof(p), &p);
|
||||
|
||||
/* Get default profile */
|
||||
if (qmi_service_send(ldd->wds, 0x49, param,
|
||||
get_default_profile_cb, lte, NULL) > 0)
|
||||
return;
|
||||
|
||||
qmi_param_free(param);
|
||||
|
||||
error:
|
||||
ofono_error("Failed to query default profile");
|
||||
ofono_lte_register(lte);
|
||||
}
|
||||
|
||||
static int qmimodem_lte_probe(struct ofono_lte *lte, void *data)
|
||||
{
|
||||
struct qmi_device *device = data;
|
||||
struct lte_data *ldd;
|
||||
|
||||
DBG("qmimodem lte probe");
|
||||
|
||||
ldd = g_try_new0(struct lte_data, 1);
|
||||
if (!ldd)
|
||||
return -ENOMEM;
|
||||
|
||||
ofono_lte_set_data(lte, ldd);
|
||||
|
||||
qmi_service_create_shared(device, QMI_SERVICE_WDS,
|
||||
create_wds_cb, lte, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void qmimodem_lte_remove(struct ofono_lte *lte)
|
||||
{
|
||||
struct lte_data *ldd = ofono_lte_get_data(lte);
|
||||
|
||||
DBG("");
|
||||
|
||||
ofono_lte_set_data(lte, NULL);
|
||||
|
||||
qmi_service_unregister_all(ldd->wds);
|
||||
|
||||
qmi_service_unref(ldd->wds);
|
||||
|
||||
g_free(ldd);
|
||||
}
|
||||
|
||||
static struct ofono_lte_driver driver = {
|
||||
.name = "qmimodem",
|
||||
.probe = qmimodem_lte_probe,
|
||||
.remove = qmimodem_lte_remove,
|
||||
.set_default_attach_info = qmimodem_lte_set_default_attach_info,
|
||||
};
|
||||
|
||||
void qmi_lte_init(void)
|
||||
{
|
||||
ofono_lte_driver_register(&driver);
|
||||
}
|
||||
|
||||
void qmi_lte_exit(void)
|
||||
{
|
||||
ofono_lte_driver_unregister(&driver);
|
||||
}
|
||||
@@ -39,6 +39,7 @@ static int qmimodem_init(void)
|
||||
qmi_ussd_init();
|
||||
qmi_gprs_init();
|
||||
qmi_gprs_context_init();
|
||||
qmi_lte_init();
|
||||
qmi_radio_settings_init();
|
||||
qmi_location_reporting_init();
|
||||
qmi_netmon_init();
|
||||
@@ -51,6 +52,7 @@ static void qmimodem_exit(void)
|
||||
qmi_netmon_exit();
|
||||
qmi_location_reporting_exit();
|
||||
qmi_radio_settings_exit();
|
||||
qmi_lte_exit();
|
||||
qmi_gprs_context_exit();
|
||||
qmi_gprs_exit();
|
||||
qmi_ussd_exit();
|
||||
|
||||
@@ -48,6 +48,9 @@ extern void qmi_gprs_exit(void);
|
||||
extern void qmi_gprs_context_init(void);
|
||||
extern void qmi_gprs_context_exit(void);
|
||||
|
||||
extern void qmi_lte_init(void);
|
||||
extern void qmi_lte_exit(void);
|
||||
|
||||
extern void qmi_radio_settings_init(void);
|
||||
extern void qmi_radio_settings_exit(void);
|
||||
|
||||
|
||||
@@ -277,6 +277,9 @@ static void qmi_radio_settings_remove(struct ofono_radio_settings *rs)
|
||||
|
||||
ofono_radio_settings_set_data(rs, NULL);
|
||||
|
||||
qmi_service_unregister_all(data->dms);
|
||||
qmi_service_unref(data->dms);
|
||||
|
||||
qmi_service_unregister_all(data->nas);
|
||||
|
||||
qmi_service_unref(data->nas);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2013 Canonical Ltd.
|
||||
* Copyright (C) 2013-2019 Jolla Ltd.
|
||||
* Copyright (C) 2013-2020 Jolla Ltd.
|
||||
*
|
||||
* 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
|
||||
@@ -205,10 +205,44 @@ enum ril_data_call_fail_cause {
|
||||
PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22,
|
||||
PDP_FAIL_NSAPI_IN_USE = 0x23,
|
||||
PDP_FAIL_REGULAR_DEACTIVATION = 0x24,
|
||||
PDP_FAIL_QOS_NOT_ACCEPTED = 0x25,
|
||||
PDP_FAIL_NETWORK_FAILURE = 0x26,
|
||||
PDP_FAIL_UMTS_REACTIVATION_REQ = 0x27,
|
||||
PDP_FAIL_FEATURE_NOT_SUPP = 0x28,
|
||||
PDP_FAIL_TFT_SEMANTIC_ERROR = 0x29,
|
||||
PDP_FAIL_TFT_SYTAX_ERROR = 0x2A,
|
||||
PDP_FAIL_UNKNOWN_PDP_CONTEXT = 0x2B,
|
||||
PDP_FAIL_FILTER_SEMANTIC_ERROR = 0x2C,
|
||||
PDP_FAIL_FILTER_SYTAX_ERROR = 0x2D,
|
||||
PDP_FAIL_PDP_WITHOUT_ACTIVE_TFT = 0x2E,
|
||||
PDP_FAIL_ONLY_IPV4_ALLOWED = 0x32,
|
||||
PDP_FAIL_ONLY_IPV6_ALLOWED = 0x33,
|
||||
PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED = 0x34,
|
||||
PDP_FAIL_ESM_INFO_NOT_RECEIVED = 0x35,
|
||||
PDP_FAIL_PDN_CONN_DOES_NOT_EXIST = 0x36,
|
||||
PDP_FAIL_MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 0x37,
|
||||
PDP_FAIL_MAX_ACTIVE_PDP_CONTEXT_REACHED = 0x41,
|
||||
PDP_FAIL_UNSUPPORTED_APN_IN_CURRENT_PLMN = 0x42,
|
||||
PDP_FAIL_INVALID_TRANSACTION_ID = 0x51,
|
||||
PDP_FAIL_MESSAGE_INCORRECT_SEMANTIC = 0x5F,
|
||||
PDP_FAIL_INVALID_MANDATORY_INFO = 0x60,
|
||||
PDP_FAIL_MESSAGE_TYPE_UNSUPPORTED = 0x61,
|
||||
PDP_FAIL_MSG_TYPE_NONCOMPATIBLE_STATE = 0x62,
|
||||
PDP_FAIL_UNKNOWN_INFO_ELEMENT = 0x63,
|
||||
PDP_FAIL_CONDITIONAL_IE_ERROR = 0x64,
|
||||
PDP_FAIL_MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 0x65,
|
||||
PDP_FAIL_PROTOCOL_ERRORS = 0x6F,
|
||||
PDP_FAIL_APN_TYPE_CONFLICT = 0x70,
|
||||
PDP_FAIL_INVALID_PCSCF_ADDR = 0x71,
|
||||
PDP_FAIL_INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 0x72,
|
||||
PDP_FAIL_EMM_ACCESS_BARRED = 0x73,
|
||||
PDP_FAIL_EMERGENCY_IFACE_ONLY = 0x74,
|
||||
PDP_FAIL_IFACE_MISMATCH = 0x75,
|
||||
PDP_FAIL_COMPANION_IFACE_IN_USE = 0x76,
|
||||
PDP_FAIL_IP_ADDRESS_MISMATCH = 0x77,
|
||||
PDP_FAIL_IFACE_AND_POL_FAMILY_MISMATCH = 0x78,
|
||||
PDP_FAIL_EMM_ACCESS_BARRED_INFINITE_RETRY = 0x79,
|
||||
PDP_FAIL_AUTH_FAILURE_ON_EMERGENCY_CALL = 0x7A,
|
||||
PDP_FAIL_VOICE_REGISTRATION_FAIL = -1,
|
||||
PDP_FAIL_DATA_REGISTRATION_FAIL = -2,
|
||||
PDP_FAIL_SIGNAL_LOST = -3,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* oFono - Open Source Telephony - RIL-based devices
|
||||
*
|
||||
* Copyright (C) 2016-2019 Jolla Ltd.
|
||||
* Copyright (C) 2016-2020 Jolla Ltd.
|
||||
* Copyright (C) 2019 Open Mobile Platform LLC.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -14,6 +14,8 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "ril_data.h"
|
||||
#include "ril_radio.h"
|
||||
#include "ril_network.h"
|
||||
@@ -29,6 +31,8 @@
|
||||
#include <grilio_parser.h>
|
||||
#include <grilio_request.h>
|
||||
|
||||
#include "common.h" /* ACCESS_TECHNOLOGY_EUTRAN */
|
||||
|
||||
/* Yes, it does sometimes take minutes in roaming */
|
||||
#define SETUP_DATA_CALL_TIMEOUT (300*1000) /* ms */
|
||||
|
||||
@@ -115,6 +119,7 @@ struct ril_data_priv {
|
||||
gulong io_event_id[IO_EVENT_COUNT];
|
||||
gulong settings_event_id[SETTINGS_EVENT_COUNT];
|
||||
GHashTable* grab;
|
||||
gboolean downgraded_tech; /* Status 55 workaround */
|
||||
};
|
||||
|
||||
enum ril_data_signal {
|
||||
@@ -815,6 +820,31 @@ static gboolean ril_data_call_setup_retry(void *user_data)
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static gboolean ril_data_call_retry(struct ril_data_request_setup *setup)
|
||||
{
|
||||
struct ril_data_request *req = &setup->req;
|
||||
const struct ril_data_options *options = &req->data->priv->options;
|
||||
|
||||
if (setup->retry_count < options->data_call_retry_limit) {
|
||||
req->pending_id = 0;
|
||||
GASSERT(!setup->retry_delay_id);
|
||||
if (!setup->retry_count) {
|
||||
/* No delay first time */
|
||||
setup->retry_count++;
|
||||
DBG("silent retry %u out of %u", setup->retry_count,
|
||||
options->data_call_retry_limit);
|
||||
req->submit(req);
|
||||
} else {
|
||||
const guint ms = options->data_call_retry_delay_ms;
|
||||
DBG("silent retry scheduled in %u ms", ms);
|
||||
setup->retry_delay_id = g_timeout_add(ms,
|
||||
ril_data_call_setup_retry, setup);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void ril_data_call_setup_cb(GRilIoChannel *io, int ril_status,
|
||||
const void *data, guint len, void *user_data)
|
||||
{
|
||||
@@ -839,33 +869,49 @@ static void ril_data_call_setup_cb(GRilIoChannel *io, int ril_status,
|
||||
}
|
||||
}
|
||||
|
||||
if (call && call->status == PDP_FAIL_ERROR_UNSPECIFIED &&
|
||||
setup->retry_count < priv->options.data_call_retry_limit) {
|
||||
if (call) {
|
||||
switch (call->status) {
|
||||
/*
|
||||
* According to the comment from ril.h we should silently
|
||||
* retry. First time we retry immediately and if that doedsn't
|
||||
* retry. First time we retry immediately and if that doesn't
|
||||
* work, then after certain delay.
|
||||
*/
|
||||
req->pending_id = 0;
|
||||
GASSERT(!setup->retry_delay_id);
|
||||
if (!setup->retry_count) {
|
||||
setup->retry_count++;
|
||||
DBG("silent retry %u out of %u", setup->retry_count,
|
||||
priv->options.data_call_retry_limit);
|
||||
req->submit(req);
|
||||
} else {
|
||||
guint ms = priv->options.data_call_retry_delay_ms;
|
||||
DBG("silent retry scheduled in %u ms", ms);
|
||||
setup->retry_delay_id = g_timeout_add(ms,
|
||||
ril_data_call_setup_retry, setup);
|
||||
case PDP_FAIL_ERROR_UNSPECIFIED:
|
||||
if (ril_data_call_retry(setup)) {
|
||||
ril_data_call_list_free(list);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
case PDP_FAIL_MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED:
|
||||
if (priv->network->data.access_tech ==
|
||||
ACCESS_TECHNOLOGY_EUTRAN &&
|
||||
!priv->downgraded_tech) {
|
||||
DBG("downgrading preferred technology");
|
||||
priv->downgraded_tech = TRUE;
|
||||
ril_data_manager_check_network_mode(priv->dm);
|
||||
/* And let this call fail */
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ril_data_call_list_free(list);
|
||||
return;
|
||||
}
|
||||
|
||||
ril_data_request_completed(req);
|
||||
|
||||
if (call && call->status == PDP_FAIL_NONE) {
|
||||
if (priv->downgraded_tech) {
|
||||
DBG("done with status 55 workaround");
|
||||
priv->downgraded_tech = FALSE;
|
||||
ril_data_manager_check_network_mode(priv->dm);
|
||||
}
|
||||
if (ril_data_call_list_move_calls(self->data_calls, list) > 0) {
|
||||
DBG("data call(s) added");
|
||||
ril_data_signal_emit(self, SIGNAL_CALLS_CHANGED);
|
||||
@@ -1151,6 +1197,11 @@ static struct ril_data_request *ril_data_allow_new(struct ril_data *data,
|
||||
/*==========================================================================*
|
||||
* ril_data
|
||||
*==========================================================================*/
|
||||
static enum ofono_radio_access_mode ril_data_max_mode(struct ril_data *self)
|
||||
{
|
||||
return self->priv->downgraded_tech ? OFONO_RADIO_ACCESS_MODE_UMTS :
|
||||
OFONO_RADIO_ACCESS_MODE_ANY;
|
||||
}
|
||||
|
||||
gulong ril_data_add_allow_changed_handler(struct ril_data *self,
|
||||
ril_data_cb_t cb, void *arg)
|
||||
@@ -1684,7 +1735,7 @@ static void ril_data_manager_check_network_mode(struct ril_data_manager *self)
|
||||
|
||||
ril_network_set_max_pref_mode(network,
|
||||
(network == lte_network) ?
|
||||
OFONO_RADIO_ACCESS_MODE_ANY :
|
||||
ril_data_max_mode(data) :
|
||||
OFONO_RADIO_ACCESS_MODE_GSM,
|
||||
FALSE);
|
||||
}
|
||||
@@ -1694,7 +1745,7 @@ static void ril_data_manager_check_network_mode(struct ril_data_manager *self)
|
||||
for (l= self->data_list; l; l = l->next) {
|
||||
struct ril_data *data = l->data;
|
||||
ril_network_set_max_pref_mode(data->priv->network,
|
||||
OFONO_RADIO_ACCESS_MODE_ANY, FALSE);
|
||||
ril_data_max_mode(data), FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1723,7 +1774,7 @@ static void ril_data_manager_switch_data_on(struct ril_data_manager *self,
|
||||
|
||||
if (ril_data_manager_handover(self)) {
|
||||
ril_network_set_max_pref_mode(priv->network,
|
||||
OFONO_RADIO_ACCESS_MODE_ANY, TRUE);
|
||||
ril_data_max_mode(data), TRUE);
|
||||
}
|
||||
|
||||
if (priv->options.allow_data == RIL_ALLOW_DATA_ENABLED) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* oFono - Open Source Telephony - RIL-based devices
|
||||
*
|
||||
* Copyright (C) 2016-2019 Jolla Ltd.
|
||||
* Copyright (C) 2016-2020 Jolla Ltd.
|
||||
* Copyright (C) 2019 Open Mobile Platform LLC.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -14,6 +14,8 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "ril_ecclist.h"
|
||||
#include "ril_log.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* oFono - Open Source Telephony - RIL-based devices
|
||||
*
|
||||
* Copyright (C) 2015-2019 Jolla Ltd.
|
||||
* Copyright (C) 2015-2020 Jolla Ltd.
|
||||
* Copyright (C) 2019 Open Mobile Platform LLC.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include <ofono/watch.h>
|
||||
|
||||
#define MAX_PDP_CONTEXTS (2)
|
||||
#define ONLINE_TIMEOUT_SECS (15) /* 20 sec is hardcoded in ofono core */
|
||||
|
||||
enum ril_modem_power_state {
|
||||
@@ -307,15 +306,22 @@ static void ril_modem_post_sim(struct ofono_modem *modem)
|
||||
ofono_sms_create(modem, 0, RILMODEM_DRIVER, md);
|
||||
gprs = ofono_gprs_create(modem, 0, RILMODEM_DRIVER, md);
|
||||
if (gprs) {
|
||||
int i;
|
||||
guint i;
|
||||
static const enum ofono_gprs_context_type ap_types[] = {
|
||||
OFONO_GPRS_CONTEXT_TYPE_INTERNET,
|
||||
OFONO_GPRS_CONTEXT_TYPE_MMS,
|
||||
OFONO_GPRS_CONTEXT_TYPE_IMS
|
||||
};
|
||||
|
||||
for (i = 0; i < MAX_PDP_CONTEXTS; i++) {
|
||||
/* Create a context for each type */
|
||||
for (i = 0; i < G_N_ELEMENTS(ap_types); i++) {
|
||||
struct ofono_gprs_context *gc =
|
||||
ofono_gprs_context_create(modem, 0,
|
||||
RILMODEM_DRIVER, md);
|
||||
if (gc == NULL)
|
||||
break;
|
||||
|
||||
ofono_gprs_context_set_type(gc, ap_types[i]);
|
||||
ofono_gprs_add_context(gprs, gc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* oFono - Open Source Telephony - RIL-based devices
|
||||
*
|
||||
* Copyright (C) 2015-2019 Jolla Ltd.
|
||||
* Copyright (C) 2015-2020 Jolla Ltd.
|
||||
* Copyright (C) 2019 Open Mobile Platform LLC.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -14,6 +14,8 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "ril_network.h"
|
||||
#include "ril_radio.h"
|
||||
#include "ril_sim_card.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* oFono - Open Source Telephony - RIL-based devices
|
||||
*
|
||||
* Copyright (C) 2015-2019 Jolla Ltd.
|
||||
* Copyright (C) 2015-2020 Jolla Ltd.
|
||||
*
|
||||
* 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
|
||||
@@ -13,6 +13,8 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "ril_radio.h"
|
||||
#include "ril_util.h"
|
||||
#include "ril_log.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* oFono - Open Source Telephony - RIL-based devices
|
||||
*
|
||||
* Copyright (C) 2015-2018 Jolla Ltd.
|
||||
* Copyright (C) 2015-2020 Jolla Ltd.
|
||||
*
|
||||
* 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
|
||||
@@ -13,6 +13,8 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "ril_sim_card.h"
|
||||
#include "ril_radio.h"
|
||||
#include "ril_util.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* oFono - Open Source Telephony - RIL-based devices
|
||||
*
|
||||
* Copyright (C) 2016-2019 Jolla Ltd.
|
||||
* Copyright (C) 2016-2020 Jolla Ltd.
|
||||
*
|
||||
* 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
|
||||
@@ -13,6 +13,8 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "ril_sim_settings.h"
|
||||
#include "ril_log.h"
|
||||
|
||||
|
||||
0
ofono/drivers/xmm7modem/ims.c
Executable file → Normal file
0
ofono/drivers/xmm7modem/ims.c
Executable file → Normal file
@@ -139,7 +139,12 @@ struct ofono_voicecall_driver {
|
||||
/* Dials the last number again, this handles the hfp profile last number
|
||||
* dialing with the +BLDN AT command
|
||||
*/
|
||||
void (*dial_last)(struct ofono_voicecall *vc, ofono_voicecall_cb_t cb, void *data);
|
||||
void (*dial_last)(struct ofono_voicecall *vc, ofono_voicecall_cb_t cb,
|
||||
void *data);
|
||||
/* dials a number at a given memory location */
|
||||
void (*dial_memory)(struct ofono_voicecall *vc,
|
||||
unsigned int memory_location, ofono_voicecall_cb_t cb,
|
||||
void *data);
|
||||
};
|
||||
|
||||
void ofono_voicecall_en_list_notify(struct ofono_voicecall *vc,
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <ofono/ussd.h>
|
||||
#include <ofono/gprs.h>
|
||||
#include <ofono/gprs-context.h>
|
||||
#include <ofono/lte.h>
|
||||
#include <ofono/radio-settings.h>
|
||||
#include <ofono/location-reporting.h>
|
||||
#include <ofono/log.h>
|
||||
@@ -483,6 +484,8 @@ static void gobi_post_sim(struct ofono_modem *modem)
|
||||
|
||||
DBG("%p", modem);
|
||||
|
||||
ofono_lte_create(modem, "qmimodem", data->device);
|
||||
|
||||
if (data->features & GOBI_CAT)
|
||||
ofono_stk_create(modem, 0, "qmimodem", data->device);
|
||||
else if (data->features & GOBI_CAT_OLD)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* oFono - Open Source Telephony
|
||||
*
|
||||
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
||||
* Copyright (C) 2015-2017 Jolla Ltd.
|
||||
* Copyright (C) 2015-2020 Jolla Ltd.
|
||||
*
|
||||
* 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
|
||||
@@ -60,6 +60,7 @@ const char *mbpi_database = MBPI_DATABASE;
|
||||
*/
|
||||
enum ofono_gprs_proto mbpi_default_internet_proto = OFONO_GPRS_PROTO_IPV4V6;
|
||||
enum ofono_gprs_proto mbpi_default_mms_proto = OFONO_GPRS_PROTO_IP;
|
||||
enum ofono_gprs_proto mbpi_default_ims_proto = OFONO_GPRS_PROTO_IPV4V6;
|
||||
enum ofono_gprs_proto mbpi_default_proto = OFONO_GPRS_PROTO_IP;
|
||||
enum ofono_gprs_auth_method mbpi_default_auth_method = OFONO_GPRS_AUTH_METHOD_ANY;
|
||||
|
||||
@@ -246,6 +247,9 @@ static void usage_start(GMarkupParseContext *context,
|
||||
} else if (strcmp(text, "mms") == 0) {
|
||||
apn->type = OFONO_GPRS_CONTEXT_TYPE_MMS;
|
||||
apn->proto = mbpi_default_mms_proto;
|
||||
} else if (strcmp(text, "ims") == 0) {
|
||||
apn->type = OFONO_GPRS_CONTEXT_TYPE_IMS;
|
||||
apn->proto = mbpi_default_ims_proto;
|
||||
} else if (strcmp(text, "wap") == 0)
|
||||
apn->type = OFONO_GPRS_CONTEXT_TYPE_WAP;
|
||||
else
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* oFono - Open Source Telephony
|
||||
*
|
||||
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
||||
* Copyright (C) 2013-2020 Jolla Ltd.
|
||||
*
|
||||
* 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
|
||||
@@ -22,6 +23,7 @@
|
||||
extern const char *mbpi_database;
|
||||
extern enum ofono_gprs_proto mbpi_default_internet_proto;
|
||||
extern enum ofono_gprs_proto mbpi_default_mms_proto;
|
||||
extern enum ofono_gprs_proto mbpi_default_ims_proto;
|
||||
extern enum ofono_gprs_proto mbpi_default_proto;
|
||||
extern enum ofono_gprs_auth_method mbpi_default_auth_method;
|
||||
|
||||
|
||||
@@ -743,18 +743,32 @@ static int sailfish_manager_update_modem_paths(struct sailfish_manager_priv *p)
|
||||
*/
|
||||
if (sailfish_manager_all_sims_are_initialized(p)) {
|
||||
slot = sailfish_manager_find_slot_imsi(p, NULL);
|
||||
if (slot && slot->watch->online &&
|
||||
if (slot && slot->watch->imsi && slot->watch->online &&
|
||||
p->auto_data_sim == SIM_AUTO_SELECT_ONCE) {
|
||||
const char *imsi = slot->watch->imsi;
|
||||
|
||||
/*
|
||||
* Data SIM only needs to be auto-selected
|
||||
* once and it's done. Write that down.
|
||||
*/
|
||||
DBG("Default data sim set to %s once", imsi);
|
||||
p->auto_data_sim_done = TRUE;
|
||||
g_key_file_set_boolean(p->storage,
|
||||
SF_STORE_GROUP,
|
||||
SF_STORE_AUTO_DATA_SIM_DONE,
|
||||
p->auto_data_sim_done);
|
||||
|
||||
g_free(p->default_data_imsi);
|
||||
p->pub.default_data_imsi =
|
||||
p->default_data_imsi = g_strdup(imsi);
|
||||
g_key_file_set_string(p->storage,
|
||||
SF_STORE_GROUP,
|
||||
SF_STORE_DEFAULT_DATA_SIM,
|
||||
imsi);
|
||||
|
||||
storage_sync(NULL, SF_STORE, p->storage);
|
||||
sailfish_manager_dbus_signal(p->dbus,
|
||||
SAILFISH_MANAGER_SIGNAL_DATA_IMSI);
|
||||
}
|
||||
} else {
|
||||
DBG("Skipping auto-selection of data SIM");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* oFono - Open Source Telephony
|
||||
*
|
||||
* Copyright (C) 2017-2019 Jolla Ltd.
|
||||
* Copyright (C) 2017-2020 Jolla Ltd.
|
||||
*
|
||||
* 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
|
||||
@@ -13,6 +13,8 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* oFono - Open Source Telephony
|
||||
*
|
||||
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
||||
* Copyright (C) 2013-2017 Jolla Ltd.
|
||||
* Copyright (C) 2013-2020 Jolla Ltd.
|
||||
*
|
||||
* 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
|
||||
@@ -136,38 +136,56 @@ static GSList *provision_pick_best_ap(GSList *list, const char *spn,
|
||||
}
|
||||
}
|
||||
|
||||
/* Returns the list containing exactly one INTERNET and one MMS access point */
|
||||
/**
|
||||
* Returns the list containing INTERNET, MMS and IMS access points,
|
||||
* always all three of them and always in this order.
|
||||
*/
|
||||
static GSList *provision_normalize_apn_list(GSList *apns, const char *spn)
|
||||
{
|
||||
static const struct provision_ap_defaults internet_defaults =
|
||||
{ OFONO_GPRS_CONTEXT_TYPE_INTERNET, "Internet", "internet" };
|
||||
static const struct provision_ap_defaults mms_defaults =
|
||||
{ OFONO_GPRS_CONTEXT_TYPE_MMS, "MMS", "mms" };
|
||||
static const struct provision_ap_defaults ims_defaults =
|
||||
{ OFONO_GPRS_CONTEXT_TYPE_IMS, "IMS", "ims" };
|
||||
|
||||
GSList *internet_apns = NULL;
|
||||
GSList *mms_apns = NULL;
|
||||
GSList *ims_apns = NULL;
|
||||
|
||||
/* Split internet and mms apns, delete all others */
|
||||
/* Build separate apn list for each type */
|
||||
while (apns) {
|
||||
GSList *link = apns;
|
||||
struct ofono_gprs_provision_data *ap = link->data;
|
||||
|
||||
apns = g_slist_remove_link(apns, link);
|
||||
if (ap->type == OFONO_GPRS_CONTEXT_TYPE_INTERNET) {
|
||||
switch (ap->type) {
|
||||
case OFONO_GPRS_CONTEXT_TYPE_INTERNET:
|
||||
internet_apns = g_slist_concat(internet_apns, link);
|
||||
} else if (ap->type == OFONO_GPRS_CONTEXT_TYPE_MMS) {
|
||||
break;
|
||||
case OFONO_GPRS_CONTEXT_TYPE_MMS:
|
||||
mms_apns = g_slist_concat(mms_apns, link);
|
||||
} else {
|
||||
break;
|
||||
case OFONO_GPRS_CONTEXT_TYPE_IMS:
|
||||
ims_apns = g_slist_concat(ims_apns, link);
|
||||
break;
|
||||
default:
|
||||
g_slist_free_full(link, provision_free_ap);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Pick the best ap of each type and concatenate them */
|
||||
return g_slist_concat(
|
||||
provision_pick_best_ap(internet_apns, spn,
|
||||
mbpi_default_internet_proto, &internet_defaults),
|
||||
provision_pick_best_ap(mms_apns, spn,
|
||||
mbpi_default_mms_proto, &mms_defaults));
|
||||
/* Pick the best ap of each type */
|
||||
internet_apns = provision_pick_best_ap(internet_apns, spn,
|
||||
mbpi_default_internet_proto, &internet_defaults);
|
||||
mms_apns = provision_pick_best_ap(mms_apns, spn,
|
||||
mbpi_default_mms_proto, &mms_defaults);
|
||||
ims_apns = provision_pick_best_ap(ims_apns, spn,
|
||||
mbpi_default_ims_proto, &ims_defaults);
|
||||
|
||||
/* And concatenate them in the right order */
|
||||
return g_slist_concat(internet_apns, g_slist_concat(mms_apns,
|
||||
ims_apns));
|
||||
}
|
||||
|
||||
int provision_get_settings(const char *mcc, const char *mnc,
|
||||
|
||||
@@ -1731,6 +1731,8 @@ static gboolean create_modem(gpointer key, gpointer value, gpointer user_data)
|
||||
continue;
|
||||
|
||||
if (driver_list[i].setup(modem) == TRUE) {
|
||||
ofono_modem_set_string(modem->modem, "SystemPath",
|
||||
syspath);
|
||||
ofono_modem_register(modem->modem);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* oFono - Open Source Telephony
|
||||
*
|
||||
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
||||
* Copyright (C) 2015-2019 Jolla Ltd.
|
||||
* Copyright (C) 2015-2020 Jolla Ltd.
|
||||
*
|
||||
* 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
|
||||
@@ -2874,12 +2874,53 @@ static void provision_contexts(struct ofono_gprs *gprs, const char *mcc,
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
provision_context(&settings[i], gprs);
|
||||
for (i = 0; i < count; i++) {
|
||||
const struct ofono_gprs_provision_data *ap = settings + i;
|
||||
|
||||
if (!ofono_gprs_context_settings_by_type(gprs, ap->type)) {
|
||||
provision_context(ap, gprs);
|
||||
}
|
||||
}
|
||||
|
||||
__ofono_gprs_provision_free_settings(settings, count);
|
||||
}
|
||||
|
||||
static gboolean all_contexts_configured(struct ofono_gprs *gprs)
|
||||
{
|
||||
GSList *l;
|
||||
|
||||
for (l = gprs->context_drivers; l; l = l->next) {
|
||||
struct ofono_gprs_context *gc = l->data;
|
||||
|
||||
if (gc->type != OFONO_GPRS_CONTEXT_TYPE_ANY &&
|
||||
!ofono_gprs_context_settings_by_type(gprs, gc->type)) {
|
||||
return FALSE; /* Not yet */
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void configure_remaining_contexts(struct ofono_gprs *gprs)
|
||||
{
|
||||
GSList *l;
|
||||
|
||||
for (l = gprs->context_drivers; l; l = l->next) {
|
||||
struct ofono_gprs_context *gc = l->data;
|
||||
|
||||
if (gc->type != OFONO_GPRS_CONTEXT_TYPE_ANY &&
|
||||
!ofono_gprs_context_settings_by_type(gprs, gc->type)) {
|
||||
add_context(gprs, NULL, gc->type);
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure internet context is there */
|
||||
if (!ofono_gprs_context_settings_by_type(gprs,
|
||||
OFONO_GPRS_CONTEXT_TYPE_INTERNET)) {
|
||||
add_context(gprs, NULL, OFONO_GPRS_CONTEXT_TYPE_INTERNET);
|
||||
}
|
||||
}
|
||||
|
||||
static void remove_non_active_context(struct ofono_gprs *gprs,
|
||||
struct pri_context *ctx, DBusConnection *conn)
|
||||
{
|
||||
@@ -2960,8 +3001,7 @@ static DBusMessage *gprs_reset_contexts(DBusConnection *conn,
|
||||
provision_contexts(gprs, ofono_sim_get_mcc(sim),
|
||||
ofono_sim_get_mnc(sim), ofono_sim_get_spn(sim));
|
||||
|
||||
if (gprs->contexts == NULL) /* Automatic provisioning failed */
|
||||
add_context(gprs, NULL, OFONO_GPRS_CONTEXT_TYPE_INTERNET);
|
||||
configure_remaining_contexts(gprs);
|
||||
|
||||
for (l = gprs->contexts; l; l = l->next) {
|
||||
struct pri_context *ctx = l->data;
|
||||
@@ -3832,8 +3872,7 @@ static void ofono_gprs_finish_register(struct ofono_gprs *gprs)
|
||||
struct ofono_modem *modem = __ofono_atom_get_modem(gprs->atom);
|
||||
const char *path = __ofono_atom_get_path(gprs->atom);
|
||||
|
||||
if (gprs->contexts == NULL) /* Automatic provisioning failed */
|
||||
add_context(gprs, NULL, OFONO_GPRS_CONTEXT_TYPE_INTERNET);
|
||||
configure_remaining_contexts(gprs);
|
||||
|
||||
if (!g_dbus_register_interface(conn, path,
|
||||
OFONO_CONNECTION_MANAGER_INTERFACE,
|
||||
@@ -3856,56 +3895,14 @@ static void ofono_gprs_finish_register(struct ofono_gprs *gprs)
|
||||
__ofono_atom_register(gprs->atom, gprs_unregister);
|
||||
}
|
||||
|
||||
static gboolean mms_context_configured(struct ofono_gprs *gprs)
|
||||
{
|
||||
GSList *l;
|
||||
|
||||
for (l = gprs->contexts; l; l = l->next) {
|
||||
struct pri_context *ctx = l->data;
|
||||
|
||||
if (ctx->type == OFONO_GPRS_CONTEXT_TYPE_MMS)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void provision_mms_context(struct ofono_gprs *gprs, const char *mcc,
|
||||
const char *mnc, const char *spn)
|
||||
{
|
||||
struct ofono_gprs_provision_data *settings;
|
||||
int count;
|
||||
int i;
|
||||
|
||||
if (__ofono_gprs_provision_get_settings(mcc, mnc, spn,
|
||||
&settings, &count) == FALSE) {
|
||||
ofono_warn("Provisioning failed");
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
if (settings[i].type == OFONO_GPRS_CONTEXT_TYPE_MMS) {
|
||||
provision_context(&settings[i], gprs);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
__ofono_gprs_provision_free_settings(settings, count);
|
||||
}
|
||||
|
||||
static void spn_read_cb(const char *spn, const char *dc, void *data)
|
||||
{
|
||||
struct ofono_gprs *gprs = data;
|
||||
struct ofono_modem *modem = __ofono_atom_get_modem(gprs->atom);
|
||||
struct ofono_sim *sim = __ofono_atom_find(OFONO_ATOM_TYPE_SIM, modem);
|
||||
|
||||
if (gprs->contexts == NULL) {
|
||||
provision_contexts(gprs, ofono_sim_get_mcc(sim),
|
||||
provision_contexts(gprs, ofono_sim_get_mcc(sim),
|
||||
ofono_sim_get_mnc(sim), spn);
|
||||
} else if (!mms_context_configured(gprs)) {
|
||||
provision_mms_context(gprs, ofono_sim_get_mcc(sim),
|
||||
ofono_sim_get_mnc(sim), spn);
|
||||
}
|
||||
|
||||
ofono_sim_remove_spn_watch(sim, &gprs->spn_watch);
|
||||
|
||||
@@ -3927,7 +3924,7 @@ void ofono_gprs_register(struct ofono_gprs *gprs)
|
||||
|
||||
gprs_load_settings(gprs, ofono_sim_get_imsi(sim));
|
||||
|
||||
if (mms_context_configured(gprs))
|
||||
if (all_contexts_configured(gprs))
|
||||
goto finish;
|
||||
|
||||
ofono_sim_add_spn_watch(sim, &gprs->spn_watch, spn_read_cb, gprs, NULL);
|
||||
|
||||
@@ -805,6 +805,7 @@ void __ofono_modem_append_properties(struct ofono_modem *modem,
|
||||
struct ofono_devinfo *info;
|
||||
dbus_bool_t emergency = ofono_modem_get_emergency_mode(modem);
|
||||
const char *strtype;
|
||||
const char *system_path;
|
||||
|
||||
ofono_dbus_dict_append(dict, "Online", DBUS_TYPE_BOOLEAN,
|
||||
&modem->online);
|
||||
@@ -845,6 +846,11 @@ void __ofono_modem_append_properties(struct ofono_modem *modem,
|
||||
&info->svn);
|
||||
}
|
||||
|
||||
system_path = ofono_modem_get_string(modem, "SystemPath");
|
||||
if (system_path)
|
||||
ofono_dbus_dict_append(dict, "SystemPath", DBUS_TYPE_STRING,
|
||||
&system_path);
|
||||
|
||||
interfaces = g_new0(char *, g_slist_length(modem->interface_list) + 1);
|
||||
for (i = 0, l = modem->interface_list; l; l = l->next, i++)
|
||||
interfaces[i] = l->data;
|
||||
|
||||
@@ -139,8 +139,17 @@ static void sim_auth_unregister(struct ofono_atom *atom)
|
||||
struct ofono_sim_auth *sa = __ofono_atom_get_data(atom);
|
||||
|
||||
free_apps(sa);
|
||||
g_free(sa->nai);
|
||||
|
||||
g_free(sa->pending);
|
||||
if (sa->pending) {
|
||||
__ofono_dbus_pending_reply(&sa->pending->msg,
|
||||
__ofono_error_sim_not_ready(sa->pending->msg));
|
||||
|
||||
__ofono_sim_remove_session_watch(sa->pending->session,
|
||||
sa->pending->watch_id);
|
||||
g_free(sa->pending);
|
||||
sa->pending = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void sim_auth_remove(struct ofono_atom *atom)
|
||||
|
||||
@@ -1798,7 +1798,7 @@ static DBusMessage *manager_dial(DBusConnection *conn,
|
||||
return __ofono_error_failed(msg);
|
||||
}
|
||||
|
||||
static void manager_dial_last_callback(const struct ofono_error *error,
|
||||
static void manager_dial_hfp_callback(const struct ofono_error *error,
|
||||
void *data)
|
||||
{
|
||||
struct ofono_voicecall *vc = data;
|
||||
@@ -1827,8 +1827,8 @@ error:
|
||||
__ofono_error_failed(vc->pending));
|
||||
}
|
||||
|
||||
static int voicecall_dial_last(struct ofono_voicecall *vc,
|
||||
ofono_voicecall_cb_t cb, void *data)
|
||||
static int voicecall_dial_hfp(struct ofono_voicecall *vc, unsigned int position,
|
||||
ofono_voicecall_cb_t cb, void *data)
|
||||
{
|
||||
struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom);
|
||||
|
||||
@@ -1838,9 +1838,6 @@ static int voicecall_dial_last(struct ofono_voicecall *vc,
|
||||
if (ofono_modem_get_online(modem) == FALSE)
|
||||
return -ENETDOWN;
|
||||
|
||||
if (vc->driver->dial_last == NULL)
|
||||
return -ENOTSUP;
|
||||
|
||||
if (voicecalls_have_incoming(vc))
|
||||
return -EBUSY;
|
||||
|
||||
@@ -1851,7 +1848,18 @@ static int voicecall_dial_last(struct ofono_voicecall *vc,
|
||||
if (voicecalls_have_active(vc) && voicecalls_have_held(vc))
|
||||
return -EBUSY;
|
||||
|
||||
vc->driver->dial_last(vc, cb, vc);
|
||||
/* when position is not given we dial the last called number */
|
||||
if (position == 0) {
|
||||
if (vc->driver->dial_last == NULL)
|
||||
return -ENOTSUP;
|
||||
|
||||
vc->driver->dial_last(vc, cb, vc);
|
||||
} else {
|
||||
if (vc->driver->dial_memory == NULL )
|
||||
return -ENOTSUP;
|
||||
|
||||
vc->driver->dial_memory(vc, position, cb, vc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1867,7 +1875,7 @@ static DBusMessage *manager_dial_last(DBusConnection *conn,
|
||||
|
||||
vc->pending = dbus_message_ref(msg);
|
||||
|
||||
err = voicecall_dial_last(vc, manager_dial_last_callback, vc);
|
||||
err = voicecall_dial_hfp(vc, 0, manager_dial_hfp_callback, vc);
|
||||
|
||||
if (err >= 0)
|
||||
return NULL;
|
||||
@@ -1889,6 +1897,44 @@ static DBusMessage *manager_dial_last(DBusConnection *conn,
|
||||
return __ofono_error_failed(msg);
|
||||
}
|
||||
|
||||
static DBusMessage *manager_dial_memory(DBusConnection *conn,
|
||||
DBusMessage *msg, void *data)
|
||||
{
|
||||
struct ofono_voicecall *vc = data;
|
||||
int memory_location;
|
||||
int err;
|
||||
|
||||
if (vc->pending || vc->dial_req || vc->pending_em)
|
||||
return __ofono_error_busy(msg);
|
||||
|
||||
if (dbus_message_get_args(msg, NULL, DBUS_TYPE_UINT32, &memory_location,
|
||||
DBUS_TYPE_INVALID) == FALSE)
|
||||
return __ofono_error_invalid_args(msg);
|
||||
|
||||
vc->pending = dbus_message_ref(msg);
|
||||
|
||||
err = voicecall_dial_hfp(vc, memory_location,
|
||||
manager_dial_hfp_callback, vc);
|
||||
if (err >= 0)
|
||||
return NULL;
|
||||
|
||||
vc->pending = NULL;
|
||||
dbus_message_unref(msg);
|
||||
|
||||
switch (err) {
|
||||
case -EINVAL:
|
||||
return __ofono_error_invalid_format(msg);
|
||||
|
||||
case -ENETDOWN:
|
||||
return __ofono_error_not_available(msg);
|
||||
|
||||
case -ENOTSUP:
|
||||
return __ofono_error_not_implemented(msg);
|
||||
}
|
||||
|
||||
return __ofono_error_failed(msg);
|
||||
}
|
||||
|
||||
static DBusMessage *manager_transfer(DBusConnection *conn,
|
||||
DBusMessage *msg, void *data)
|
||||
{
|
||||
@@ -2552,6 +2598,9 @@ static const GDBusMethodTable manager_methods[] = {
|
||||
GDBUS_ARGS({ "path", "o" }),
|
||||
manager_dial) },
|
||||
{ GDBUS_ASYNC_METHOD("DialLast", NULL, NULL, manager_dial_last)},
|
||||
{ GDBUS_ASYNC_METHOD("DialMemory",
|
||||
GDBUS_ARGS({"memory_location", "u" }), NULL,
|
||||
manager_dial_memory) },
|
||||
{ GDBUS_ASYNC_METHOD("Transfer", NULL, NULL, manager_transfer) },
|
||||
{ GDBUS_ASYNC_METHOD("SwapCalls", NULL, NULL, manager_swap_calls) },
|
||||
{ GDBUS_ASYNC_METHOD("ReleaseAndAnswer", NULL, NULL,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* oFono - Open Source Telephony
|
||||
*
|
||||
* Copyright (C) 2014-2017 Jolla. All rights reserved.
|
||||
* Copyright (C) 2014-2020 Jolla. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -105,21 +105,21 @@ static void test_provision(gconstpointer test_data)
|
||||
|
||||
g_assert(actual->type == expected->type);
|
||||
g_assert(actual->proto == expected->proto);
|
||||
g_assert(!g_strcmp0(actual->provider_name,
|
||||
expected->provider_name));
|
||||
g_assert(!g_strcmp0(actual->name, expected->name));
|
||||
g_assert_cmpstr(actual->provider_name, ==,
|
||||
expected->provider_name);
|
||||
g_assert_cmpstr(actual->name, ==, expected->name);
|
||||
g_assert(actual->provider_primary ==
|
||||
expected->provider_primary);
|
||||
g_assert(!g_strcmp0(actual->apn, expected->apn));
|
||||
g_assert(!g_strcmp0(actual->username,
|
||||
expected->username));
|
||||
g_assert(!g_strcmp0(actual->password,
|
||||
expected->password));
|
||||
g_assert_cmpstr(actual->apn, ==, expected->apn);
|
||||
g_assert_cmpstr(actual->username, ==,
|
||||
expected->username);
|
||||
g_assert_cmpstr(actual->password, ==,
|
||||
expected->password);
|
||||
g_assert(actual->auth_method == expected->auth_method);
|
||||
g_assert(!g_strcmp0(actual->message_proxy,
|
||||
expected->message_proxy));
|
||||
g_assert(!g_strcmp0(actual->message_center,
|
||||
expected->message_center));
|
||||
g_assert_cmpstr(actual->message_proxy, ==,
|
||||
expected->message_proxy);
|
||||
g_assert_cmpstr(actual->message_center, ==,
|
||||
expected->message_center);
|
||||
}
|
||||
} else {
|
||||
g_assert(!__ofono_gprs_provision_get_settings(test->mcc,
|
||||
@@ -212,6 +212,14 @@ static char telia_fi_message_center [] = "http://mms/";
|
||||
.apn = "mms", \
|
||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||
|
||||
/* Default IMS settings */
|
||||
#define DEFAULT_IMS_SETTINGS \
|
||||
.type = OFONO_GPRS_CONTEXT_TYPE_IMS, \
|
||||
.proto = OFONO_GPRS_PROTO_IPV4V6, \
|
||||
.name = "IMS", \
|
||||
.apn = "ims", \
|
||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||
|
||||
static const struct ofono_gprs_provision_data telia_fi_internet_mms_p[] = {
|
||||
{
|
||||
.type = OFONO_GPRS_CONTEXT_TYPE_INTERNET,
|
||||
@@ -231,7 +239,8 @@ static const struct ofono_gprs_provision_data telia_fi_internet_mms_p[] = {
|
||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE,
|
||||
.message_proxy = telia_fi_message_proxy,
|
||||
.message_center = telia_fi_message_center
|
||||
}
|
||||
},
|
||||
{ DEFAULT_IMS_SETTINGS }
|
||||
};
|
||||
|
||||
static const struct ofono_gprs_provision_data telia_fi_internet_mms[] = {
|
||||
@@ -251,7 +260,8 @@ static const struct ofono_gprs_provision_data telia_fi_internet_mms[] = {
|
||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE,
|
||||
.message_proxy = telia_fi_message_proxy,
|
||||
.message_center = telia_fi_message_center
|
||||
}
|
||||
},
|
||||
{ DEFAULT_IMS_SETTINGS }
|
||||
};
|
||||
|
||||
static const struct ofono_gprs_provision_data telia_fi_internet[] = {
|
||||
@@ -263,7 +273,8 @@ static const struct ofono_gprs_provision_data telia_fi_internet[] = {
|
||||
.apn = telia_fi_apn_internet,
|
||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||
},
|
||||
{ DEFAULT_MMS_SETTINGS }
|
||||
{ DEFAULT_MMS_SETTINGS },
|
||||
{ DEFAULT_IMS_SETTINGS }
|
||||
};
|
||||
|
||||
static const struct ofono_gprs_provision_data telia_fi_mms[] = {
|
||||
@@ -277,12 +288,14 @@ static const struct ofono_gprs_provision_data telia_fi_mms[] = {
|
||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE,
|
||||
.message_proxy = telia_fi_message_proxy,
|
||||
.message_center = telia_fi_message_center
|
||||
}
|
||||
},
|
||||
{ DEFAULT_IMS_SETTINGS }
|
||||
};
|
||||
|
||||
static const struct ofono_gprs_provision_data default_settings[] = {
|
||||
{ DEFAILT_INTERNET_SETTINGS },
|
||||
{ DEFAULT_MMS_SETTINGS }
|
||||
{ DEFAULT_MMS_SETTINGS },
|
||||
{ DEFAULT_IMS_SETTINGS }
|
||||
};
|
||||
|
||||
static const struct ofono_gprs_provision_data no_auth_settings[] = {
|
||||
@@ -300,7 +313,8 @@ static const struct ofono_gprs_provision_data no_auth_settings[] = {
|
||||
.name = "MMS",
|
||||
.apn = "mms",
|
||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||
}
|
||||
},
|
||||
{ DEFAULT_IMS_SETTINGS }
|
||||
};
|
||||
|
||||
static const struct ofono_gprs_provision_data auth_settings[] = {
|
||||
@@ -318,7 +332,8 @@ static const struct ofono_gprs_provision_data auth_settings[] = {
|
||||
.apn = "mms",
|
||||
.password = "password",
|
||||
.auth_method = OFONO_GPRS_AUTH_METHOD_ANY
|
||||
}
|
||||
},
|
||||
{ DEFAULT_IMS_SETTINGS }
|
||||
};
|
||||
|
||||
static const struct ofono_gprs_provision_data settings_ip[] = {
|
||||
@@ -329,7 +344,8 @@ static const struct ofono_gprs_provision_data settings_ip[] = {
|
||||
.apn = "internet",
|
||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||
},
|
||||
{ DEFAULT_MMS_SETTINGS }
|
||||
{ DEFAULT_MMS_SETTINGS },
|
||||
{ DEFAULT_IMS_SETTINGS }
|
||||
};
|
||||
|
||||
static const struct ofono_gprs_provision_data settings_ipv6[] = {
|
||||
@@ -345,7 +361,8 @@ static const struct ofono_gprs_provision_data settings_ipv6[] = {
|
||||
.name = "MMS",
|
||||
.apn = "mms",
|
||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||
}
|
||||
},
|
||||
{ DEFAULT_IMS_SETTINGS }
|
||||
};
|
||||
|
||||
static const struct ofono_gprs_provision_data settings_ipv4v6[] = {
|
||||
@@ -356,7 +373,40 @@ static const struct ofono_gprs_provision_data settings_ipv4v6[] = {
|
||||
.name = "MMS",
|
||||
.apn = "mms",
|
||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||
}
|
||||
},
|
||||
{ DEFAULT_IMS_SETTINGS }
|
||||
};
|
||||
|
||||
static char beeline_provider_name [] = "Beeline";
|
||||
static const struct ofono_gprs_provision_data beeline_ims[] = {
|
||||
{
|
||||
.type = OFONO_GPRS_CONTEXT_TYPE_INTERNET,
|
||||
.proto = OFONO_GPRS_PROTO_IPV4V6,
|
||||
.provider_name = beeline_provider_name,
|
||||
.name = "Beeline Internet",
|
||||
.apn = "internet.beeline.ru",
|
||||
.username = "beeline",
|
||||
.password = "beeline",
|
||||
.auth_method = OFONO_GPRS_AUTH_METHOD_ANY
|
||||
}, {
|
||||
.type = OFONO_GPRS_CONTEXT_TYPE_MMS,
|
||||
.proto = OFONO_GPRS_PROTO_IP,
|
||||
.provider_name = beeline_provider_name,
|
||||
.name = "Beeline MMS",
|
||||
.apn = "mms.beeline.ru",
|
||||
.username = "beeline",
|
||||
.password = "beeline",
|
||||
.auth_method = OFONO_GPRS_AUTH_METHOD_PAP,
|
||||
.message_proxy = "192.168.94.23:8080",
|
||||
.message_center = "http://mms/"
|
||||
}, {
|
||||
.type = OFONO_GPRS_CONTEXT_TYPE_IMS,
|
||||
.proto = OFONO_GPRS_PROTO_IPV4V6,
|
||||
.provider_name = beeline_provider_name,
|
||||
.name = "Beeline IMS",
|
||||
.apn = "ims.beeline.ru",
|
||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||
}
|
||||
};
|
||||
|
||||
static char test_provider_name[] = "Test provider";
|
||||
@@ -382,7 +432,8 @@ static const struct ofono_gprs_provision_data test_username_password[] = {
|
||||
.auth_method = OFONO_GPRS_AUTH_METHOD_CHAP,
|
||||
.message_proxy = test_message_proxy,
|
||||
.message_center = test_message_center
|
||||
}
|
||||
},
|
||||
{ DEFAULT_IMS_SETTINGS }
|
||||
};
|
||||
|
||||
static const char telia_fi_internet_xml[] =
|
||||
@@ -806,6 +857,42 @@ static const struct provision_test_case test_cases[] = {
|
||||
.mnc = "91",
|
||||
.settings = telia_fi_mms,
|
||||
.count = G_N_ELEMENTS(telia_fi_mms)
|
||||
},{
|
||||
.name = TEST_SUITE "ims",
|
||||
.xml =
|
||||
"<serviceproviders format=\"2.0\">\n\
|
||||
<country code=\"ru\">\n\
|
||||
<provider>\n\
|
||||
<name>Beeline</name>\n\
|
||||
<gsm>\n\
|
||||
<network-id mcc=\"250\" mnc=\"99\"/>\n\
|
||||
<apn value=\"internet.beeline.ru\">\n\
|
||||
<usage type=\"internet\"/>\n\
|
||||
<name>Beeline Internet</name>\n\
|
||||
<username>beeline</username>\n\
|
||||
<password>beeline</password>\n\
|
||||
</apn>\n\
|
||||
<apn value=\"mms.beeline.ru\">\n\
|
||||
<usage type=\"mms\"/>\n\
|
||||
<name>Beeline MMS</name>\n\
|
||||
<authentication method=\"pap\"/>\n\
|
||||
<username>beeline</username>\n\
|
||||
<password>beeline</password>\n\
|
||||
<mmsc>http://mms/</mmsc>\n\
|
||||
<mmsproxy>192.168.94.23:8080</mmsproxy>\n\
|
||||
</apn>\n\
|
||||
<apn value=\"ims.beeline.ru\">\n\
|
||||
<usage type=\"ims\"/>\n\
|
||||
<name>Beeline IMS</name>\n\
|
||||
</apn>\n\
|
||||
</gsm>\n\
|
||||
</provider>\n\
|
||||
</country>\n\
|
||||
</serviceproviders>\n",
|
||||
.mcc = "250",
|
||||
.mnc = "99",
|
||||
.settings = beeline_ims,
|
||||
.count = G_N_ELEMENTS(beeline_ims)
|
||||
},{
|
||||
.name = TEST_SUITE "not_found_mcc",
|
||||
.xml = telia_fi_internet_xml,
|
||||
@@ -1297,3 +1384,11 @@ int main(int argc, char **argv)
|
||||
}
|
||||
return g_test_run();
|
||||
}
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: C
|
||||
* c-basic-offset: 8
|
||||
* indent-tabs-mode: t
|
||||
* End:
|
||||
*/
|
||||
|
||||
@@ -500,8 +500,8 @@ static void test_application_entry_decode(void)
|
||||
g_assert(app[1]->label != NULL);
|
||||
g_assert(!strcmp(app[1]->label, "MIDPfiles"));
|
||||
|
||||
g_free(ef_dir);
|
||||
g_slist_free_full(entries, (GDestroyNotify) sim_app_record_free);
|
||||
g_free(ef_dir);
|
||||
}
|
||||
|
||||
static void test_get_3g_path(void)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Name: ofono
|
||||
Summary: Open Source Telephony
|
||||
Version: 1.22
|
||||
Version: 1.23
|
||||
Release: 1
|
||||
Group: Communications/Connectivity Adaptation
|
||||
License: GPLv2
|
||||
|
||||
2
upstream
2
upstream
Submodule upstream updated: 82f54044a8...8766cedac6
Reference in New Issue
Block a user