[PATCH] atmodem: set PDP/EPS minimum context ID to 1.
by Jimmy Gysens
There are manufacturers, like Huawei, returning profile 0 as the minimum
PDP/EPS context ID. Profile 0, however, is the default profile used to
register to the LTE network. It contains manufacturer specific settings and
should not be created by +CGDCONT.
Reference: ETSI TS 127 007: AT command set for User Equipment (UE), section
10.1.0.
---
drivers/atmodem/gprs.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/atmodem/gprs.c b/drivers/atmodem/gprs.c
index 58d4eed3..bcf1eaaf 100644
--- a/drivers/atmodem/gprs.c
+++ b/drivers/atmodem/gprs.c
@@ -787,6 +787,13 @@ static void at_cgdcont_test_cb(gboolean ok, GAtResult *result,
if (found == FALSE)
goto error;
+ /*
+ * ETSI TS 127 007: profile 0 is manufacturer specific.
+ * Start from PDP/EPS context ID 1.
+ */
+ if (min <= 0)
+ min = 1;
+
ofono_gprs_set_cid_range(gprs, min, max);
g_at_chat_send(gd->chat, "AT+CGREG=?", cgreg_prefix,
--
2.17.1
7 months
[PATCH] lte: Use the right D-Bus interface for property change signal
by Slava Monich
---
src/lte.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lte.c b/src/lte.c
index fbe0116..951a06f 100644
--- a/src/lte.c
+++ b/src/lte.c
@@ -212,7 +212,7 @@ static void lte_set_default_attach_info_cb(const struct ofono_error *error,
}
ofono_dbus_signal_property_changed(conn, path,
- OFONO_CONNECTION_CONTEXT_INTERFACE,
+ OFONO_LTE_INTERFACE,
key,
DBUS_TYPE_STRING, &value);
--
1.9.1
7 months, 1 week
[PATCH] cbs: Allow the last CBS fragment to be truncated
by Slava Monich
That does happen in real life.
---
src/smsutil.c | 23 +++++++++++++++--------
src/smsutil.h | 1 +
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/src/smsutil.c b/src/smsutil.c
index 8c084d4..450a1d3 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -1756,7 +1756,7 @@ gboolean sms_udh_iter_init_from_cbs(const struct cbs *cbs,
return FALSE;
hdr = cbs->ud;
- max_ud_len = 82;
+ max_ud_len = cbs->udlen;
/* Must have at least one information-element if udhi is true */
if (hdr[0] < 2)
@@ -3862,8 +3862,8 @@ gboolean cbs_dcs_decode(guint8 dcs, gboolean *udhi, enum sms_class *cls,
gboolean cbs_decode(const unsigned char *pdu, int len, struct cbs *out)
{
- /* CBS is always a fixed length of 88 bytes */
- if (len != 88)
+ /* CBS is (almost) always a fixed length of 88 bytes */
+ if (len < 6 || len > 88)
return FALSE;
out->gs = (enum cbs_geo_scope) ((pdu[0] >> 6) & 0x03);
@@ -3874,6 +3874,10 @@ gboolean cbs_decode(const unsigned char *pdu, int len, struct cbs *out)
out->max_pages = pdu[5] & 0xf;
out->page = (pdu[5] >> 4) & 0xf;
+ /* Allow the last fragment to be truncated */
+ if (len != 88 && out->max_pages != out->page)
+ return FALSE;
+
/*
* If a mobile receives the code 0000 in either the first field or
* the second field then it shall treat the CBS message exactly the
@@ -3885,7 +3889,10 @@ gboolean cbs_decode(const unsigned char *pdu, int len, struct cbs *out)
out->page = 1;
}
- memcpy(out->ud, pdu + 6, 82);
+ out->udlen = (guint8)(len - 6);
+ memcpy(out->ud, pdu + 6, out->udlen);
+ if (out->udlen < 82)
+ memset(out->ud + out->udlen, 0, 82 - out->udlen);
return TRUE;
}
@@ -4078,7 +4085,7 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
if (iso639)
bufsize -= 3;
} else {
- bufsize += 82;
+ bufsize += cbs->udlen;
if (iso639)
bufsize -= 2;
@@ -4095,7 +4102,7 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
if (sms_udh_iter_init_from_cbs(cbs, &iter))
taken = sms_udh_iter_get_udh_length(&iter) + 1;
- unpack_7bit_own_buf(cbs->ud + taken, 82 - taken,
+ unpack_7bit_own_buf(cbs->ud + taken, cbs->udlen - taken,
taken, false, 2,
NULL, 0,
(unsigned char *)iso639_lang);
@@ -4128,7 +4135,7 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
max_chars =
sms_text_capacity_gsm(CBS_MAX_GSM_CHARS, taken);
- unpack_7bit_own_buf(ud + taken, 82 - taken,
+ unpack_7bit_own_buf(ud + taken, cbs->udlen - taken,
taken, false, max_chars,
&written, 0, unpacked);
@@ -4162,7 +4169,7 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
* the check here since the specification isn't clear
*/
} else {
- int num_ucs2_chars = (82 - taken) >> 1;
+ int num_ucs2_chars = (cbs->udlen - taken) >> 1;
int i = taken;
int max_offset = taken + num_ucs2_chars * 2;
diff --git a/src/smsutil.h b/src/smsutil.h
index 0adba51..01487de 100644
--- a/src/smsutil.h
+++ b/src/smsutil.h
@@ -408,6 +408,7 @@ struct cbs {
guint8 dcs; /* 8 bits */
guint8 max_pages; /* 4 bits */
guint8 page; /* 4 bits */
+ guint8 udlen;
guint8 ud[82];
};
--
1.9.1
7 months, 1 week
Re: [PATCH] create stk atom for Esim Handling
by Denis Kenzior
Hi Shweta,
On 6/11/20 2:06 AM, shweta wrote:
> From: Shweta Jain <shweta2.jain(a)intel.com>
>
> ---
> plugins/xmm7xxx.c | 22 +++++++++++++++++++---
> 1 file changed, 19 insertions(+), 3 deletions(-)
>
This patch does not apply cleanly. In fact, I see three distinct series from
you and it isn't clear in what order I would even apply these. Since it looks
like all these series are related, can you please rebase all patches on top of
git HEAD (for example, via 'git pull --rebase') and resubmit the entire set as a
single series?
> diff --git a/plugins/xmm7xxx.c b/plugins/xmm7xxx.c
> index 6afc8cb..3959583 100644
> --- a/plugins/xmm7xxx.c
> +++ b/plugins/xmm7xxx.c
> @@ -123,6 +123,8 @@ struct xmm7xxx_data {
> int coex_lte_id;
> int coex_wlan_id;
> int coex_bt_id;
> + ofono_bool_t stk_enable;
> + ofono_bool_t enable_euicc;
> };
>
> /* eUICC Implementation */
> @@ -1888,7 +1890,10 @@ static void switch_sim_state_status(struct ofono_modem *modem, int status)
> ofono_phonebook_create(modem, 0, "atmodem", data->chat);
> data->sms_phonebook_added = TRUE;
> }
> -
> + break;
> + case 18:
> + data->enable_euicc=TRUE;
> + ofono_warn("Esim State With no Profile %d ", status);
why ofono_warn?
> break;
> default:
> ofono_warn("Unknown SIM state %d received", status);
> @@ -2077,15 +2082,24 @@ static void xmm7xxx_pre_sim(struct ofono_modem *modem)
> data->sim = ofono_sim_create(modem, OFONO_VENDOR_XMM, "atmodem",
> data->chat);
> xmm_euicc_enable(modem, data->chat);
> + ofono_stk_create(modem, OFONO_VENDOR_XMM, "atmodem", data->chat);
Generally STK isn't available until the PIN has been entered, and thus should be
available only in post_sim state. Is esim somehow different?
> }
>
> static void set_online_cb(gboolean ok, GAtResult *result, gpointer user_data)
> {
> struct cb_data *cbd = user_data;
> ofono_modem_online_cb_t cb = cbd->cb;
> + char * strng = cbd->cb;
What does this do??
> + DBG("");
Hmm, not sure what compiler you're using, but C99 doesn't support mixed
declarations and expressions. Nor does our coding style. Please move this
after all the variable declaration block.
> struct ofono_error error;
> -
> + struct ofono_modem *modem = cbd->data;
> + struct xmm7xxx_data *data = ofono_modem_get_data(modem);
> decode_at_error(&error, g_at_result_final_response(result));
> + if(data->enable_euicc==TRUE && data->stk_enable==TRUE )
> + {
> + g_at_chat_send(data->chat, "AT+CFUN=16", none_prefix,
> + NULL, NULL, NULL);
> + }
Okay, but this is not following our coding style. Refer to doc/coding-style.txt
for details.
> cb(&error, cbd->data);
> }
>
> @@ -2108,8 +2122,10 @@ static void xmm7xxx_set_online(struct ofono_modem *modem, ofono_bool_t online,
> data->coex_wlan_id = 0;
> g_at_chat_unregister(data->chat, data->coex_bt_id);
> data->coex_bt_id = 0;
> + data->stk_enable=FALSE;
> }
> -
> + else
> + data->stk_enable=TRUE;
Coding style is all wrong here...
> if (g_at_chat_send(data->chat, command, none_prefix,
> set_online_cb, cbd, g_free) > 0) {
> if (online)
>
Regards,
-Denis
7 months, 1 week
Re: [PATCH 2/2] Remove extra code for Esim Handling
by Denis Kenzior
Hi Shweta,
On 6/11/20 2:06 AM, shweta wrote:
> From: Shweta Jain <shweta2.jain(a)intel.com>
>
Can you elaborate a bit more why this code is no longer needed? Also, how does
the driver now guarantee that +CUSATP will be received by the stk atom? I
believe this was originally added for those devices that didn't shut down fully
(like USB ones) and kept the sim initialized even when .disable() callback was
called.
If this new device/firmware doesn't need this logic, it might be simpler to just
not pass in the OFONO_VENDOR_XMM (use 0 instead) in plugins/xmm7xxx.c
> ---
> drivers/atmodem/stk.c | 18 +-----------------
> 1 file changed, 1 insertion(+), 17 deletions(-)
>
> diff --git a/drivers/atmodem/stk.c b/drivers/atmodem/stk.c
> index b2d2081..18510fe 100644
> --- a/drivers/atmodem/stk.c
> +++ b/drivers/atmodem/stk.c
> @@ -180,7 +180,7 @@ static gboolean at_stk_register(gpointer user)
> {
> struct ofono_stk *stk = user;
> struct stk_data *sd = ofono_stk_get_data(stk);
> -
> + DBG("");
This code not according to our coding style. Nor is it really related to this
commit description.
> g_at_chat_register(sd->chat, "+CUSATP:", phonesim_cusatp_notify,
> FALSE, stk, NULL);
>
> @@ -190,25 +190,9 @@ static gboolean at_stk_register(gpointer user)
> if (sd->vendor == OFONO_VENDOR_PHONESIM)
> g_at_chat_register(sd->chat, "*HCMD:", phonesim_hcmd_notify,
> FALSE, stk, NULL);
> -
> - if (sd->vendor == OFONO_VENDOR_XMM) {
> - /* enabling stk */
> - g_at_chat_send(sd->chat, "AT+CFUN=6", none_prefix,
> - NULL, NULL, NULL);
> - /* Here ofono has missed stk menu proactive command
> - * that comes after sim initialization only. Doing a
> - * sim reset will enable the stk driver to get the
> - * missed +CUSATP notifications.
> - */
> - g_at_chat_send(sd->chat, "AT+CFUN=27,1", none_prefix,
> - NULL, NULL, NULL);
> - }
> -
> ofono_stk_register(stk);
> -
> return FALSE;
> }
> -
This change results in a violation of the coding style as well. See
doc/coding-style.txt for more details.
> static int at_stk_probe(struct ofono_stk *stk, unsigned int vendor, void *data)
> {
> GAtChat *chat = data;
>
Regards,
-Denis
7 months, 1 week
[PATCH 1/1] huawei: use AT^SYSCFG for radio setting operations on 3G only modems
by Christophe Ronco
AT^SYSCFGEX must be used on LTE Huawei modems to enable LTE support.
But some modems (or firmwares?) do not support this command and AT^SYSCFG
must be used to get/set radio settings.
This has been introduced in commit:
22adf6402c828f8b8cca1b65d8a46ba7792eb787
There is a bug in this commit and AT^SYSCFGEX commands are used even on
modems not supporting it.
---
drivers/huaweimodem/radio-settings.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/huaweimodem/radio-settings.c b/drivers/huaweimodem/radio-settings.c
index 40431d3..20181d2 100644
--- a/drivers/huaweimodem/radio-settings.c
+++ b/drivers/huaweimodem/radio-settings.c
@@ -532,6 +532,7 @@ static void syscfgex_support_cb(gboolean ok, GAtResult *result,
if (!ok) {
g_at_chat_send(rsd->chat, "AT^SYSCFG=?", syscfg_prefix,
syscfg_support_cb, rs, NULL);
+ return;
}
rsd->syscfgex_cap = 1;
--
2.7.4
7 months, 2 weeks
Re: Weird Droid 4 modem protocol and a way to support it
by Denis Kenzior
Hi Tony,
<snip>
>
> All we need to do with the TS 27.010 packets is parse the network
> strength, operate the voice modem, ack SMS notifications, and pass all
> the other notifications to the qmimodem to deal with over USB.
>
> To me it seems ideal would be simple read/write type functions in
> drivers/motorolamodem. Is there some preferred existing exaple for
> doing something like that?
Not sure I understand. Example of using ell? See drivers/mbimmodem/*.
Regards,
-Denis
7 months, 2 weeks
[PATCH v2] [qmimodem] Implement data capability bearer notify
by Marius Gripsgard
This implements data capability bearer notify to qmi modem.
Since this is included in the serving system response this
just adds a new data extraction for dc.
---
drivers/qmimodem/gprs.c | 27 +++++++++++++++++++++++++++
drivers/qmimodem/nas.c | 36 ++++++++++++++++++++++++++++++++++++
drivers/qmimodem/nas.h | 23 +++++++++++++++++++++++
3 files changed, 86 insertions(+)
diff --git a/drivers/qmimodem/gprs.c b/drivers/qmimodem/gprs.c
index 07adbe9a..d2bbb2d5 100644
--- a/drivers/qmimodem/gprs.c
+++ b/drivers/qmimodem/gprs.c
@@ -68,6 +68,28 @@ static bool extract_ss_info(struct qmi_result *result, int *status, int *tech)
return true;
}
+static bool extract_dc_info(struct qmi_result *result, int *bearer_tech)
+{
+ const struct qmi_nas_data_capability *dc;
+ uint16_t len;
+ int i;
+
+ DBG("");
+
+ dc = qmi_result_get(result, QMI_NAS_RESULT_DATA_CAPABILITY_STATUS, &len);
+ if (!dc)
+ return false;
+
+ *bearer_tech = -1;
+ for (i = 0; i < dc->cap_count; i++) {
+ DBG("radio tech in use %d", dc->cap[i]);
+
+ *bearer_tech = qmi_nas_cap_to_bearer_tech(dc->cap[i]);
+ }
+
+ return true;
+}
+
static void get_lte_attach_param_cb(struct qmi_result *result, void *user_data)
{
struct ofono_gprs *gprs = user_data;
@@ -188,6 +210,7 @@ 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;
+ int bearer_tech;
DBG("");
@@ -209,6 +232,10 @@ static int handle_ss_info(struct qmi_result *result, struct ofono_gprs *gprs)
data->last_auto_context_id = 0;
}
+ // DC is optional so only notify on successful extraction
+ if (extract_dc_info(result, &bearer_tech))
+ ofono_gprs_bearer_notify(gprs, bearer_tech);
+
return status;
}
diff --git a/drivers/qmimodem/nas.c b/drivers/qmimodem/nas.c
index 48d7f11c..630f901d 100644
--- a/drivers/qmimodem/nas.c
+++ b/drivers/qmimodem/nas.c
@@ -36,3 +36,39 @@ int qmi_nas_rat_to_tech(uint8_t rat)
return -1;
}
+
+int qmi_nas_cap_to_bearer_tech(int cap_tech)
+{
+
+ switch (cap_tech) {
+ case QMI_NAS_DATA_CAPABILITY_GSM:
+ case QMI_NAS_DATA_CAPABILITY_NONE:
+ return PACKET_BEARER_NONE;
+ case QMI_NAS_DATA_CAPABILITY_GPRS:
+ return PACKET_BEARER_GPRS;
+ case QMI_NAS_DATA_CAPABILITY_EDGE:
+ return PACKET_BEARER_EGPRS;
+ case QMI_NAS_DATA_CAPABILITY_EVDO_REV_0:
+ case QMI_NAS_DATA_CAPABILITY_EVDO_REV_A:
+ case QMI_NAS_DATA_CAPABILITY_EVDO_REV_B:
+ return PACKET_BEARER_UMTS;
+ case QMI_NAS_DATA_CAPABILITY_HSDPA:
+ return PACKET_BEARER_HSDPA;
+ case QMI_NAS_DATA_CAPABILITY_HSUPA:
+ return PACKET_BEARER_HSUPA;
+ case QMI_NAS_DATA_CAPABILITY_HSDPA_PLUS:
+ case QMI_NAS_DATA_CAPABILITY_DC_HSDPA_PLUS:
+ /*
+ * HSPAP is HSPA+; which ofono doesn't define;
+ * so, if differentiating HSPA and HSPA+ is
+ * important, then ofono needs to be patched,
+ * and we probably also need to introduce a
+ * new indicator icon.
+ */
+ return PACKET_BEARER_HSUPA_HSDPA;
+ case QMI_NAS_DATA_CAPABILITY_LTE:
+ return PACKET_BEARER_EPS;
+ default:
+ return PACKET_BEARER_NONE;
+ }
+}
diff --git a/drivers/qmimodem/nas.h b/drivers/qmimodem/nas.h
index 9f67707e..30badabe 100644
--- a/drivers/qmimodem/nas.h
+++ b/drivers/qmimodem/nas.h
@@ -135,6 +135,28 @@ struct qmi_nas_serving_system {
uint8_t radio_if[0];
} __attribute__((__packed__));
#define QMI_NAS_RESULT_ROAMING_STATUS 0x10 /* uint8 */
+
+#define QMI_NAS_RESULT_DATA_CAPABILITY_STATUS 0x11 /* uint8 */
+struct qmi_nas_data_capability {
+ uint8_t cap_count;
+ uint8_t cap[0];
+} __attribute__((__packed__));
+
+#define QMI_NAS_DATA_CAPABILITY_NONE 0x00
+#define QMI_NAS_DATA_CAPABILITY_GPRS 0x01
+#define QMI_NAS_DATA_CAPABILITY_EDGE 0x02
+#define QMI_NAS_DATA_CAPABILITY_HSDPA 0x03
+#define QMI_NAS_DATA_CAPABILITY_HSUPA 0x04
+#define QMI_NAS_DATA_CAPABILITY_WCDMA 0x05
+#define QMI_NAS_DATA_CAPABILITY_CDMA 0x06
+#define QMI_NAS_DATA_CAPABILITY_EVDO_REV_0 0x07
+#define QMI_NAS_DATA_CAPABILITY_EVDO_REV_A 0x08
+#define QMI_NAS_DATA_CAPABILITY_GSM 0x09
+#define QMI_NAS_DATA_CAPABILITY_EVDO_REV_B 0x0A
+#define QMI_NAS_DATA_CAPABILITY_LTE 0x0B
+#define QMI_NAS_DATA_CAPABILITY_HSDPA_PLUS 0x0C
+#define QMI_NAS_DATA_CAPABILITY_DC_HSDPA_PLUS 0x0D
+
#define QMI_NAS_RESULT_CURRENT_PLMN 0x12
struct qmi_nas_current_plmn {
uint16_t mcc;
@@ -188,3 +210,4 @@ struct qmi_nas_home_network {
#define QMI_NAS_RESULT_SYSTEM_SELECTION_PREF_MODE 0x11
int qmi_nas_rat_to_tech(uint8_t rat);
+int qmi_nas_cap_to_bearer_tech(int cap_tech);
--
2.25.1
7 months, 2 weeks
[PATCH] [qmimodem] Implement data capability bearer notify
by Marius Gripsgard
This implements data capability bearer notify to qmi modem.
Since this is included in the serving system response this
just adds a new data extraction for dc.
---
drivers/qmimodem/gprs.c | 29 +++++++++++++++++++++++++++++
drivers/qmimodem/nas.c | 36 ++++++++++++++++++++++++++++++++++++
drivers/qmimodem/nas.h | 23 +++++++++++++++++++++++
3 files changed, 88 insertions(+)
diff --git a/drivers/qmimodem/gprs.c b/drivers/qmimodem/gprs.c
index 07adbe9a..0ba24da7 100644
--- a/drivers/qmimodem/gprs.c
+++ b/drivers/qmimodem/gprs.c
@@ -68,6 +68,29 @@ static bool extract_ss_info(struct qmi_result *result, int *status, int *tech)
return true;
}
+static bool extract_dc_info(struct qmi_result *result, int *bearer_tech)
+{
+ const struct qmi_nas_data_capability *dc;
+ uint16_t len;
+ int i;
+
+ DBG("");
+
+ dc = qmi_result_get(result, QMI_NAS_RESULT_DATA_CAPABILIT_STATUS, &len);
+ if (!dc)
+ return false;
+
+ *bearer_tech = -1;
+ for (i = 0; i < dc->cap_count; i++) {
+ DBG("radio tech in use %d", dc->cap[i]);
+
+ *bearer_tech = qmi_nas_cap_to_bearer_tech(dc->cap[i]);
+ }
+
+ return true;
+}
+
+
static void get_lte_attach_param_cb(struct qmi_result *result, void *user_data)
{
struct ofono_gprs *gprs = user_data;
@@ -188,6 +211,7 @@ 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;
+ int bearer_tech;
DBG("");
@@ -209,6 +233,11 @@ static int handle_ss_info(struct qmi_result *result, struct ofono_gprs *gprs)
data->last_auto_context_id = 0;
}
+ if (!extract_dc_info(result, &bearer_tech))
+ return -1;
+
+ ofono_gprs_bearer_notify(gprs, bearer_tech);
+
return status;
}
diff --git a/drivers/qmimodem/nas.c b/drivers/qmimodem/nas.c
index 48d7f11c..630f901d 100644
--- a/drivers/qmimodem/nas.c
+++ b/drivers/qmimodem/nas.c
@@ -36,3 +36,39 @@ int qmi_nas_rat_to_tech(uint8_t rat)
return -1;
}
+
+int qmi_nas_cap_to_bearer_tech(int cap_tech)
+{
+
+ switch (cap_tech) {
+ case QMI_NAS_DATA_CAPABILITY_GSM:
+ case QMI_NAS_DATA_CAPABILITY_NONE:
+ return PACKET_BEARER_NONE;
+ case QMI_NAS_DATA_CAPABILITY_GPRS:
+ return PACKET_BEARER_GPRS;
+ case QMI_NAS_DATA_CAPABILITY_EDGE:
+ return PACKET_BEARER_EGPRS;
+ case QMI_NAS_DATA_CAPABILITY_EVDO_REV_0:
+ case QMI_NAS_DATA_CAPABILITY_EVDO_REV_A:
+ case QMI_NAS_DATA_CAPABILITY_EVDO_REV_B:
+ return PACKET_BEARER_UMTS;
+ case QMI_NAS_DATA_CAPABILITY_HSDPA:
+ return PACKET_BEARER_HSDPA;
+ case QMI_NAS_DATA_CAPABILITY_HSUPA:
+ return PACKET_BEARER_HSUPA;
+ case QMI_NAS_DATA_CAPABILITY_HSDPA_PLUS:
+ case QMI_NAS_DATA_CAPABILITY_DC_HSDPA_PLUS:
+ /*
+ * HSPAP is HSPA+; which ofono doesn't define;
+ * so, if differentiating HSPA and HSPA+ is
+ * important, then ofono needs to be patched,
+ * and we probably also need to introduce a
+ * new indicator icon.
+ */
+ return PACKET_BEARER_HSUPA_HSDPA;
+ case QMI_NAS_DATA_CAPABILITY_LTE:
+ return PACKET_BEARER_EPS;
+ default:
+ return PACKET_BEARER_NONE;
+ }
+}
diff --git a/drivers/qmimodem/nas.h b/drivers/qmimodem/nas.h
index 9f67707e..93f541b2 100644
--- a/drivers/qmimodem/nas.h
+++ b/drivers/qmimodem/nas.h
@@ -135,6 +135,28 @@ struct qmi_nas_serving_system {
uint8_t radio_if[0];
} __attribute__((__packed__));
#define QMI_NAS_RESULT_ROAMING_STATUS 0x10 /* uint8 */
+
+#define QMI_NAS_RESULT_DATA_CAPABILIT_STATUS 0x11 /* uint8 */
+struct qmi_nas_data_capability {
+ uint8_t cap_count;
+ uint8_t cap[0];
+} __attribute__((__packed__));
+
+#define QMI_NAS_DATA_CAPABILITY_NONE 0x00
+#define QMI_NAS_DATA_CAPABILITY_GPRS 0x01
+#define QMI_NAS_DATA_CAPABILITY_EDGE 0x02
+#define QMI_NAS_DATA_CAPABILITY_HSDPA 0x03
+#define QMI_NAS_DATA_CAPABILITY_HSUPA 0x04
+#define QMI_NAS_DATA_CAPABILITY_WCDMA 0x05
+#define QMI_NAS_DATA_CAPABILITY_CDMA 0x06
+#define QMI_NAS_DATA_CAPABILITY_EVDO_REV_0 0x07
+#define QMI_NAS_DATA_CAPABILITY_EVDO_REV_A 0x08
+#define QMI_NAS_DATA_CAPABILITY_GSM 0x09
+#define QMI_NAS_DATA_CAPABILITY_EVDO_REV_B 0x0A
+#define QMI_NAS_DATA_CAPABILITY_LTE 0x0B
+#define QMI_NAS_DATA_CAPABILITY_HSDPA_PLUS 0x0C
+#define QMI_NAS_DATA_CAPABILITY_DC_HSDPA_PLUS 0x0D
+
#define QMI_NAS_RESULT_CURRENT_PLMN 0x12
struct qmi_nas_current_plmn {
uint16_t mcc;
@@ -188,3 +210,4 @@ struct qmi_nas_home_network {
#define QMI_NAS_RESULT_SYSTEM_SELECTION_PREF_MODE 0x11
int qmi_nas_rat_to_tech(uint8_t rat);
+int qmi_nas_cap_to_bearer_tech(int cap_tech);
--
2.25.1
7 months, 2 weeks