Skip to content

Commit

Permalink
Merge pull request #6 from PsychoGame/ofono-new
Browse files Browse the repository at this point in the history
[ofono] Update baseline to 1.24. JB#54354
  • Loading branch information
monich authored Sep 13, 2021
2 parents deecd82 + 005f36b commit c45e207
Show file tree
Hide file tree
Showing 34 changed files with 880 additions and 248 deletions.
5 changes: 5 additions & 0 deletions ofono/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,8 @@ Joey Hewitt <[email protected]>
Richard Röjfors <[email protected]>
Philippe De Swert <[email protected]>
Gabriel Lucas <[email protected]>
Mariem Cherif <[email protected]>
Bassem Boubaker <[email protected]>
Bob Ham <[email protected]>
Varun Gargi <[email protected]>
Florent Beillonnet <[email protected]>
13 changes: 13 additions & 0 deletions ofono/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
ver 1.24:
Fix issue with property changed signals and CDMA networks.
Fix issue with handling SIM filesystem and SIM removal.
Fix issue with handling PIN state and incorrect codes.
Fix issue with handling of parsing AID type.
Fix issue with SIM detection and QMI devices.
Fix issue with PIN handling and QMI devices.
Fix issue with USSD handling and QMI devices.
Fix issue with handling USSD TERMINATED response.
Fix issue with handling USSD reset and STK REFRESH.
Add support for detecting Gemalto ALS3 modems.
Add support for SIMCom based SIM7100E modems.

ver 1.23:
Fix issue with handling SIM AID sessions.
Add support for QMI LTE bearer handling.
Expand Down
6 changes: 6 additions & 0 deletions ofono/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,12 @@ builtin_sources += plugins/samsung.c
builtin_modules += sim900
builtin_sources += plugins/sim900.c

builtin_modules += sim7100
builtin_sources += plugins/sim7100.c

builtin_modules += connman
builtin_sources += plugins/connman.c

builtin_modules += telit
builtin_sources += plugins/telit.c

Expand Down
2 changes: 1 addition & 1 deletion ofono/configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AC_PREREQ(2.60)
AC_INIT(ofono, 1.23)
AC_INIT(ofono, 1.24)

AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
AC_CONFIG_HEADERS(config.h)
Expand Down
64 changes: 64 additions & 0 deletions ofono/drivers/atmodem/cbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,51 @@ struct cbs_data {
unsigned int vendor;
};

static void at_xmm_etw_sec_notify(GAtResult *result, gpointer user_data)
{
struct ofono_cbs *cbs = user_data;
const char *hexpdu;
int pdulen;
GAtResultIter iter;
unsigned char pdu[88];
long hexpdulen;

DBG("");

g_at_result_iter_init(&iter, result);

if (!g_at_result_iter_next(&iter, "+XETWSECWARN:"))
return;

if (!g_at_result_iter_next_number(&iter, &pdulen))
return;

if (pdulen != 88) {
ofono_error("Got a CBM message with invalid PDU size!");
return;
}

hexpdu = g_at_result_pdu(result);
if (hexpdu == NULL) {
ofono_error("Got a CBM, but no PDU. Are we in text mode?");
return;
}

DBG("Got new Cell Broadcast via XETWSECWARN: %s, %d", hexpdu, pdulen);

if (decode_hex_own_buf(hexpdu, -1, &hexpdulen, 0, pdu) == NULL) {
ofono_error("Unable to hex-decode the PDU");
return;
}

if (hexpdulen != pdulen) {
ofono_error("hexpdu length not equal to reported pdu length");
return;
}

ofono_cbs_notify(cbs, pdu, pdulen);
}

static void at_cbm_notify(GAtResult *result, gpointer user_data)
{
struct ofono_cbs *cbs = user_data;
Expand Down Expand Up @@ -124,6 +169,10 @@ static void at_cbs_set_topics(struct ofono_cbs *cbs, const char *topics,
g_at_chat_send(data->chat, "AT+CSCB=0", none_prefix,
NULL, NULL, NULL);
break;
case OFONO_VENDOR_XMM:
g_at_chat_send(data->chat, "AT+XETWNTFYSTART=2", none_prefix,
NULL, NULL, NULL);
break;
default:
break;
}
Expand Down Expand Up @@ -151,6 +200,10 @@ static void at_cbs_clear_topics(struct ofono_cbs *cbs,

DBG("");

if (data->vendor == OFONO_VENDOR_XMM)
g_at_chat_send(data->chat, "AT+XETWNTFYSTOP=2", none_prefix,
NULL, NULL, NULL);

if (g_at_chat_send(data->chat, "AT+CSCB=0", none_prefix,
at_cscb_set_cb, cbd, g_free) > 0)
return;
Expand All @@ -175,6 +228,10 @@ static void at_cbs_register(gboolean ok, GAtResult *result, gpointer user)
*/
g_at_chat_register(data->chat, "+CBM:", at_cbm_notify, TRUE, cbs, NULL);

if (data->vendor == OFONO_VENDOR_XMM)
g_at_chat_register(data->chat, "+XETWSECWARN:",
at_xmm_etw_sec_notify, TRUE, cbs, NULL);

ofono_cbs_register(cbs);
}

Expand Down Expand Up @@ -223,6 +280,13 @@ static int at_cbs_probe(struct ofono_cbs *cbs, unsigned int vendor,

ofono_cbs_set_data(cbs, data);

if (vendor == OFONO_VENDOR_XMM) {
g_at_chat_send(data->chat, "AT+XCMAS=1", cscb_prefix,
NULL, NULL, NULL);
g_at_chat_send(data->chat, "AT+XETWCFG=1,1,0,0; ", none_prefix,
NULL, NULL, NULL);
}

g_at_chat_send(data->chat, "AT+CSCB=?", cscb_prefix,
at_cscb_support_cb, cbs, NULL);

Expand Down
2 changes: 1 addition & 1 deletion ofono/drivers/atmodem/lte.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static gboolean lte_delayed_register(gpointer user_data)
return FALSE;
}

static int at_lte_probe(struct ofono_lte *lte, void *data)
static int at_lte_probe(struct ofono_lte *lte, unsigned int vendor, void *data)
{
GAtChat *chat = data;
struct lte_driver_data *ldd;
Expand Down
44 changes: 44 additions & 0 deletions ofono/drivers/atmodem/network-registration.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ static const char *cops_prefix[] = { "+COPS:", NULL };
static const char *csq_prefix[] = { "+CSQ:", NULL };
static const char *cind_prefix[] = { "+CIND:", NULL };
static const char *cmer_prefix[] = { "+CMER:", NULL };
static const char *smoni_prefix[] = { "^SMONI:", NULL };
static const char *zpas_prefix[] = { "+ZPAS:", NULL };
static const char *option_tech_prefix[] = { "_OCTI:", "_OUWCTI:", NULL };

Expand Down Expand Up @@ -178,6 +179,31 @@ static int option_parse_tech(GAtResult *result)
return tech;
}

static int cinterion_parse_tech(GAtResult *result)
{
int tech = -1;
GAtResultIter iter;
const char *technology;

g_at_result_iter_init(&iter, result);

if (!g_at_result_iter_next(&iter, "^SMONI: "))
return tech;

if (!g_at_result_iter_next_unquoted_string(&iter, &technology))
return tech;

if (strcmp(technology, "2G") == 0) {
tech = ACCESS_TECHNOLOGY_GSM_EGPRS;
} else if (strcmp(technology, "3G") == 0) {
tech = ACCESS_TECHNOLOGY_UTRAN;
} else if (strcmp(technology, "4G") == 0) {
tech = ACCESS_TECHNOLOGY_EUTRAN;
}

return tech;
}

static void at_creg_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
Expand Down Expand Up @@ -205,6 +231,18 @@ static void at_creg_cb(gboolean ok, GAtResult *result, gpointer user_data)
cb(&error, status, lac, ci, tech, cbd->data);
}

static void cinterion_query_tech_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct tech_query *tq = user_data;
int tech;

tech = cinterion_parse_tech(result);

ofono_netreg_status_notify(tq->netreg,
tq->status, tq->lac, tq->ci, tech);
}

static void zte_tech_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
Expand Down Expand Up @@ -1518,6 +1556,12 @@ static void creg_notify(GAtResult *result, gpointer user_data)
option_query_tech_cb, tq, g_free) > 0)
return;
break;
case OFONO_VENDOR_CINTERION:
if (g_at_chat_send(nd->chat, "AT^SMONI",
smoni_prefix,
cinterion_query_tech_cb, tq, g_free) > 0)
return;
break;
}

g_free(tq);
Expand Down
4 changes: 2 additions & 2 deletions ofono/drivers/atmodem/sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -1359,12 +1359,12 @@ static void at_pin_send_puk(struct ofono_sim *sim, const char *puk,
char buf[64];
int ret;

cbd->user = sd;
cbd->user = sim;

snprintf(buf, sizeof(buf), "AT+CPIN=\"%s\",\"%s\"", puk, passwd);

ret = g_at_chat_send(sd->chat, buf, none_prefix,
at_pin_send_cb, cbd, NULL);
at_pin_send_cb, cbd, g_free);

memset(buf, 0, sizeof(buf));

Expand Down
1 change: 1 addition & 0 deletions ofono/drivers/atmodem/voicecall.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,7 @@ static int at_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,

switch (vd->vendor) {
case OFONO_VENDOR_QUALCOMM_MSM:
case OFONO_VENDOR_SIMCOM:
g_at_chat_send(vd->chat, "AT+COLP=0", NULL, NULL, NULL, NULL);
break;
default:
Expand Down
1 change: 1 addition & 0 deletions ofono/drivers/qmimodem/devinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ static void get_ids_cb(struct qmi_result *result, void *user_data)
str = qmi_result_get_string(result, QMI_DMS_RESULT_ESN);
/* Telit qmi modems return a "0" string when ESN is not available. */
if (!str || strcmp(str, "0") == 0) {
qmi_free(str);
str = qmi_result_get_string(result, QMI_DMS_RESULT_IMEI);
if (!str) {
CALLBACK_WITH_FAILURE(cb, NULL, cbd->data);
Expand Down
3 changes: 2 additions & 1 deletion ofono/drivers/qmimodem/lte.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ static void create_wds_cb(struct qmi_service *service, void *user_data)
ofono_lte_register(lte);
}

static int qmimodem_lte_probe(struct ofono_lte *lte, void *data)
static int qmimodem_lte_probe(struct ofono_lte *lte,
unsigned int vendor, void *data)
{
struct qmi_device *device = data;
struct lte_data *ldd;
Expand Down
Loading

0 comments on commit c45e207

Please sign in to comment.