aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/telit/77-mm-telit-port-types.rules4
-rw-r--r--plugins/telit/mm-modem-helpers-telit.c179
-rw-r--r--plugins/telit/mm-modem-helpers-telit.h3
-rw-r--r--plugins/telit/mm-shared-telit.c23
-rw-r--r--plugins/telit/tests/test-mm-modem-helpers-telit.c93
5 files changed, 255 insertions, 47 deletions
diff --git a/plugins/telit/77-mm-telit-port-types.rules b/plugins/telit/77-mm-telit-port-types.rules
index 18c270a5..01a44613 100644
--- a/plugins/telit/77-mm-telit-port-types.rules
+++ b/plugins/telit/77-mm-telit-port-types.rules
@@ -107,6 +107,10 @@ ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1051", ENV{ID_MM_TELIT_BND_ALTERNATE
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1060", ENV{ID_MM_TELIT_BND_ALTERNATE}="1"
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1061", ENV{ID_MM_TELIT_BND_ALTERNATE}="1"
+# LN920 use extended 4G bands and 4G bands configured as hex mask
+ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1060", ENV{ID_MM_TELIT_BND_EXT}="1"
+ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1061", ENV{ID_MM_TELIT_BND_EXT}="1"
+
# LM940/960 initial port delay
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1040", ENV{ID_MM_TELIT_PORT_DELAY}="1"
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1041", ENV{ID_MM_TELIT_PORT_DELAY}="1"
diff --git a/plugins/telit/mm-modem-helpers-telit.c b/plugins/telit/mm-modem-helpers-telit.c
index b0d843b5..1d6b5194 100644
--- a/plugins/telit/mm-modem-helpers-telit.c
+++ b/plugins/telit/mm-modem-helpers-telit.c
@@ -182,10 +182,15 @@ initialize_telit_3g_to_mm_band_masks (void)
*/
#define MM_MODEM_BAND_TELIT_4G_FIRST MM_MODEM_BAND_EUTRAN_1
-#define MM_MODEM_BAND_TELIT_4G_LAST MM_MODEM_BAND_EUTRAN_44
+#define MM_MODEM_BAND_TELIT_4G_LAST MM_MODEM_BAND_EUTRAN_64
#define B4G_FLAG(band) (((guint64) 1) << (band - MM_MODEM_BAND_TELIT_4G_FIRST))
+#define MM_MODEM_BAND_TELIT_EXT_4G_FIRST MM_MODEM_BAND_EUTRAN_65
+#define MM_MODEM_BAND_TELIT_EXT_4G_LAST MM_MODEM_BAND_EUTRAN_71
+
+#define B4G_FLAG_EXT(band) (((guint64) 1) << (band - MM_MODEM_BAND_TELIT_EXT_4G_FIRST))
+
/*****************************************************************************/
/* Set current bands helpers */
@@ -195,11 +200,13 @@ mm_telit_build_bnd_request (GArray *bands_array,
gboolean modem_is_3g,
gboolean modem_is_4g,
gboolean modem_alternate_3g_bands,
+ gboolean modem_ext_4g_bands,
GError **error)
{
guint32 mask2g = 0;
guint64 mask3g = 0;
guint64 mask4g = 0;
+ guint64 mask4gext = 0;
guint i;
gint flag2g = -1;
gint64 flag3g = -1;
@@ -237,9 +244,12 @@ mm_telit_build_bnd_request (GArray *bands_array,
/* Convert 4G bands into a bitmask. We use a 64bit explicit bitmask so that
* all values fit correctly. */
- if (modem_is_4g && mm_common_band_is_eutran (band) &&
- (band >= MM_MODEM_BAND_TELIT_4G_FIRST && band <= MM_MODEM_BAND_TELIT_4G_LAST))
- mask4g += B4G_FLAG (band);
+ if (modem_is_4g && mm_common_band_is_eutran (band)) {
+ if (band >= MM_MODEM_BAND_TELIT_4G_FIRST && band <= MM_MODEM_BAND_TELIT_4G_LAST)
+ mask4g += B4G_FLAG (band);
+ else if (band >= MM_MODEM_BAND_TELIT_EXT_4G_FIRST && band <= MM_MODEM_BAND_TELIT_EXT_4G_LAST)
+ mask4gext += B4G_FLAG_EXT (band);
+ }
}
/* Get 2G-specific telit value */
@@ -295,7 +305,7 @@ mm_telit_build_bnd_request (GArray *bands_array,
"None or invalid 3G bands combination in the provided list");
return NULL;
}
- if (modem_is_4g && flag4g == -1) {
+ if (modem_is_4g && mask4g == 0 && mask4gext == 0) {
g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND,
"None or invalid 4G bands combination in the provided list");
return NULL;
@@ -305,17 +315,29 @@ mm_telit_build_bnd_request (GArray *bands_array,
cmd = g_strdup_printf ("#BND=%d", flag2g);
else if (!modem_is_2g && modem_is_3g && !modem_is_4g)
cmd = g_strdup_printf ("#BND=0,%" G_GINT64_FORMAT, flag3g);
- else if (!modem_is_2g && !modem_is_3g && modem_is_4g)
- cmd = g_strdup_printf ("#BND=0,0,%" G_GINT64_FORMAT, flag4g);
else if (modem_is_2g && modem_is_3g && !modem_is_4g)
cmd = g_strdup_printf ("#BND=%d,%" G_GINT64_FORMAT, flag2g, flag3g);
- else if (!modem_is_2g && modem_is_3g && modem_is_4g)
- cmd = g_strdup_printf ("#BND=0,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT, flag3g, flag4g);
- else if (modem_is_2g && !modem_is_3g && modem_is_4g)
- cmd = g_strdup_printf ("#BND=%d,0,%" G_GINT64_FORMAT, flag2g, flag4g);
- else if (modem_is_2g && modem_is_3g && modem_is_4g)
- cmd = g_strdup_printf ("#BND=%d,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT, flag2g, flag3g, flag4g);
- else
+ else if (!modem_is_2g && !modem_is_3g && modem_is_4g) {
+ if (!modem_ext_4g_bands)
+ cmd = g_strdup_printf ("#BND=0,0,%" G_GINT64_FORMAT, flag4g);
+ else
+ cmd = g_strdup_printf ("#BND=0,0,%" G_GINT64_MODIFIER "x" ",%" G_GINT64_MODIFIER "x", mask4g, mask4gext);
+ } else if (!modem_is_2g && modem_is_3g && modem_is_4g) {
+ if (!modem_ext_4g_bands)
+ cmd = g_strdup_printf ("#BND=0,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT, flag3g, flag4g);
+ else
+ cmd = g_strdup_printf ("#BND=0,%" G_GINT64_FORMAT ",%" G_GINT64_MODIFIER "x" ",%" G_GINT64_MODIFIER "x", flag3g, mask4g, mask4gext);
+ } else if (modem_is_2g && !modem_is_3g && modem_is_4g) {
+ if (!modem_ext_4g_bands)
+ cmd = g_strdup_printf ("#BND=%d,0,%" G_GINT64_FORMAT, flag2g, flag4g);
+ else
+ cmd = g_strdup_printf ("#BND=%d,0,%" G_GINT64_MODIFIER "x" ",%" G_GINT64_MODIFIER "x", flag2g, mask4g, mask4gext);
+ } else if (modem_is_2g && modem_is_3g && modem_is_4g) {
+ if (!modem_ext_4g_bands)
+ cmd = g_strdup_printf ("#BND=%d,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT, flag2g, flag3g, flag4g);
+ else
+ cmd = g_strdup_printf ("#BND=%d,%" G_GINT64_FORMAT ",%" G_GINT64_MODIFIER "x" ",%" G_GINT64_MODIFIER "x", flag2g, flag3g, mask4g, mask4gext);
+ } else
g_assert_not_reached ();
return cmd;
@@ -371,6 +393,49 @@ mm_telit_build_bnd_request (GArray *bands_array,
* 0 = 2G band flag 0 is EGSM + DCS
* 4 = 3G band flag 4 is U1900 + U850
*
+ * ----------------
+ *
+ * For modems such as LN920 the #BND configuration/response for LTE bands is different
+ * from what is explained above:
+ *
+ * AT#BND=<GSM_band>[,<UMTS_band>[,<LTE_band>[,<LTE_band_ext>]]]
+ *
+ * <LTE_band>: hex: Indicates the LTE supported bands expressed as the sum of Band number (1+2+8 ...) calculated as shown in the table (mask of 64 bits):
+ *
+ * Band number(Hex) Band i
+ * 0 disable
+ * 1 B1
+ * 2 B2
+ * 4 B3
+ * 8 B4
+ * ...
+ * ...
+ * 80000000 B32
+ * ...
+ * ...
+ * 800000000000 B48
+ *
+ * It can take value, 0 - 87A03B0F38DF: range of the sum of Band number (1+2+4 ...)
+ *
+ * <LTE_band_ext>: hex: Indicates the LTE supported bands from B65 expressed as the sum of Band number (1+2+8 ...) calculated as shown in the table (mask of 64 bits):
+ *
+ * Band number(Hex) Band i
+ * 0 disable
+ * 2 B66
+ * 40 B71
+ *
+ * It can take value, 0 - 42: range of the sum of Band number (2+40)
+ *
+ * Note: LTE_band and LTE_band_ext cannot be 0 at the same time
+ *
+ * Example output:
+ *
+ * AT#BND=?
+ * #BND: (0),(0-11,17,18),(87A03B0F38DF),(42)
+ *
+ * AT#BND?
+ * #BND: 0,18,87A03B0F38DF,42
+ *
*/
static gboolean
@@ -532,6 +597,62 @@ out:
return TRUE;
}
+static gboolean
+telit_get_ext_4g_mm_bands (GMatchInfo *match_info,
+ GArray **bands,
+ GError **error)
+{
+ GError *inner_error = NULL;
+ MMModemBand band;
+ gchar *match_str = NULL;
+ gchar *match_str_ext = NULL;
+ guint64 value;
+
+ match_str = g_match_info_fetch_named (match_info, "Bands4G");
+ if (!match_str || match_str[0] == '\0') {
+ g_set_error (&inner_error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
+ "Could not find 4G band hex mask flag from response");
+ goto out;
+ }
+
+ if (!mm_get_u64_from_hex_str (match_str, &value)) {
+ g_set_error (&inner_error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
+ "Could not parse 4G band hex mask from string: '%s'", match_str);
+ goto out;
+ }
+
+ for (band = MM_MODEM_BAND_TELIT_4G_FIRST; band <= MM_MODEM_BAND_TELIT_4G_LAST; band++) {
+ if ((value & B4G_FLAG (band)) && !mm_common_bands_garray_lookup (*bands, band))
+ g_array_append_val (*bands, band);
+ }
+
+ /* extended bands */
+ match_str_ext = g_match_info_fetch_named (match_info, "Bands4GExt");
+ if (match_str_ext) {
+
+ if (!mm_get_u64_from_hex_str (match_str_ext, &value)) {
+ g_set_error (&inner_error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
+ "Could not parse 4G ext band mask from string: '%s'", match_str_ext);
+ goto out;
+ }
+
+ for (band = MM_MODEM_BAND_TELIT_EXT_4G_FIRST; band <= MM_MODEM_BAND_TELIT_EXT_4G_LAST; band++) {
+ if ((value & B4G_FLAG_EXT (band)) && !mm_common_bands_garray_lookup (*bands, band))
+ g_array_append_val (*bands, band);
+ }
+ }
+
+out:
+ g_free (match_str);
+ g_free (match_str_ext);
+
+ if (inner_error) {
+ g_propagate_error (error, inner_error);
+ return FALSE;
+ }
+ return TRUE;
+}
+
typedef enum {
LOAD_BANDS_TYPE_SUPPORTED,
LOAD_BANDS_TYPE_CURRENT,
@@ -543,6 +664,7 @@ common_parse_bnd_response (const gchar *response,
gboolean modem_is_3g,
gboolean modem_is_4g,
gboolean modem_alternate_3g_bands,
+ gboolean modem_ext_4g_bands,
LoadBandsType load_type,
gpointer log_object,
GError **error)
@@ -552,12 +674,22 @@ common_parse_bnd_response (const gchar *response,
GMatchInfo *match_info = NULL;
GRegex *r;
- static const gchar *load_bands_regex[] = {
- [LOAD_BANDS_TYPE_SUPPORTED] = "#BND:\\s*\\((?P<Bands2G>[0-9\\-,]*)\\)(,\\s*\\((?P<Bands3G>[0-9\\-,]*)\\))?(,\\s*\\((?P<Bands4G>[0-9\\-,]*)\\))?",
- [LOAD_BANDS_TYPE_CURRENT] = "#BND:\\s*(?P<Bands2G>\\d+)(,\\s*(?P<Bands3G>\\d+))?(,\\s*(?P<Bands4G>\\d+))?",
- };
+ if (!modem_ext_4g_bands) {
+ static const gchar *load_bands_regex[] = {
+ [LOAD_BANDS_TYPE_SUPPORTED] = "#BND:\\s*\\((?P<Bands2G>[0-9\\-,]*)\\)(,\\s*\\((?P<Bands3G>[0-9\\-,]*)\\))?(,\\s*\\((?P<Bands4G>[0-9\\-,]*)\\))?",
+ [LOAD_BANDS_TYPE_CURRENT] = "#BND:\\s*(?P<Bands2G>\\d+)(,\\s*(?P<Bands3G>\\d+))?(,\\s*(?P<Bands4G>\\d+))?",
+ };
+
+ r = g_regex_new (load_bands_regex[load_type], G_REGEX_RAW, 0, NULL);
+ } else {
+ static const gchar *load_bands_regex_hex[] = {
+ [LOAD_BANDS_TYPE_SUPPORTED] = "#BND:\\s*\\((?P<Bands2G>[0-9\\-,]*)\\)(,\\s*\\((?P<Bands3G>[0-9\\-,]*)\\))?(,\\s*\\((?P<Bands4G>[0-9A-F]+)\\))?(,\\s*\\((?P<Bands4GExt>[0-9A-F]+)\\))?",
+ [LOAD_BANDS_TYPE_CURRENT] = "#BND:\\s*(?P<Bands2G>\\d+)(,\\s*(?P<Bands3G>\\d+))?(,\\s*(?P<Bands4G>[0-9A-F]+))?(,\\s*(?P<Bands4GExt>[0-9A-F]+))?",
+ };
+
+ r = g_regex_new (load_bands_regex_hex[load_type], G_REGEX_RAW, 0, NULL);
+ }
- r = g_regex_new (load_bands_regex[load_type], G_REGEX_RAW, 0, NULL);
g_assert (r);
if (!g_regex_match (r, response, 0, &match_info)) {
@@ -580,7 +712,10 @@ common_parse_bnd_response (const gchar *response,
if (modem_is_3g && !telit_get_3g_mm_bands (match_info, log_object, modem_alternate_3g_bands, &bands, &inner_error))
goto out;
- if (modem_is_4g && !telit_get_4g_mm_bands (match_info, &bands, &inner_error))
+ if (modem_is_4g && !modem_ext_4g_bands && !telit_get_4g_mm_bands (match_info, &bands, &inner_error))
+ goto out;
+
+ if (modem_is_4g && modem_ext_4g_bands && !telit_get_ext_4g_mm_bands (match_info, &bands, &inner_error))
goto out;
out:
@@ -602,12 +737,14 @@ mm_telit_parse_bnd_query_response (const gchar *response,
gboolean modem_is_3g,
gboolean modem_is_4g,
gboolean modem_alternate_3g_bands,
+ gboolean modem_ext_4g_bands,
gpointer log_object,
GError **error)
{
return common_parse_bnd_response (response,
modem_is_2g, modem_is_3g, modem_is_4g,
modem_alternate_3g_bands,
+ modem_ext_4g_bands,
LOAD_BANDS_TYPE_CURRENT,
log_object,
error);
@@ -619,12 +756,14 @@ mm_telit_parse_bnd_test_response (const gchar *response,
gboolean modem_is_3g,
gboolean modem_is_4g,
gboolean modem_alternate_3g_bands,
+ gboolean modem_ext_4g_bands,
gpointer log_object,
GError **error)
{
return common_parse_bnd_response (response,
modem_is_2g, modem_is_3g, modem_is_4g,
modem_alternate_3g_bands,
+ modem_ext_4g_bands,
LOAD_BANDS_TYPE_SUPPORTED,
log_object,
error);
diff --git a/plugins/telit/mm-modem-helpers-telit.h b/plugins/telit/mm-modem-helpers-telit.h
index 0c52bb7b..6710f4c1 100644
--- a/plugins/telit/mm-modem-helpers-telit.h
+++ b/plugins/telit/mm-modem-helpers-telit.h
@@ -25,6 +25,7 @@ GArray *mm_telit_parse_bnd_query_response (const gchar *response,
gboolean modem_is_3g,
gboolean modem_is_4g,
gboolean modem_alternate_3g_bands,
+ gboolean modem_ext_4g_bands,
gpointer log_object,
GError **error);
GArray *mm_telit_parse_bnd_test_response (const gchar *response,
@@ -32,6 +33,7 @@ GArray *mm_telit_parse_bnd_test_response (const gchar *response,
gboolean modem_is_3g,
gboolean modem_is_4g,
gboolean modem_alternate_3g_bands,
+ gboolean modem_ext_4g_bands,
gpointer log_object,
GError **error);
gchar *mm_telit_build_bnd_request (GArray *bands_array,
@@ -39,6 +41,7 @@ gchar *mm_telit_build_bnd_request (GArray *bands_array,
gboolean modem_is_3g,
gboolean modem_is_4g,
gboolean modem_alternate_3g_bands,
+ gboolean modem_ext_4g_bands,
GError **error);
/* #QSS? response parser */
diff --git a/plugins/telit/mm-shared-telit.c b/plugins/telit/mm-shared-telit.c
index f32bf9af..e391746e 100644
--- a/plugins/telit/mm-shared-telit.c
+++ b/plugins/telit/mm-shared-telit.c
@@ -39,6 +39,7 @@ static GQuark private_quark;
typedef struct {
gboolean alternate_3g_bands;
+ gboolean ext_4g_bands;
GArray *supported_bands;
} Private;
@@ -68,6 +69,24 @@ initialize_alternate_3g_band (MMSharedTelit *self,
}
}
+static void
+initialize_ext_4g_band (MMSharedTelit *self,
+ Private *priv)
+{
+ MMPort *primary;
+ MMKernelDevice *port;
+
+ primary = MM_PORT (mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)));
+ if (primary) {
+ port = mm_port_peek_kernel_device (primary);
+
+ /* Lookup for the tag specifying that we're using the ext 4G band mapping */
+ priv->ext_4g_bands = mm_kernel_device_get_global_property_as_boolean (port, "ID_MM_TELIT_BND_EXT");
+ if (priv->ext_4g_bands)
+ mm_obj_dbg (self, "telit modem using extended 4G band setup");
+ }
+}
+
static Private *
get_private (MMSharedTelit *self)
{
@@ -80,6 +99,7 @@ get_private (MMSharedTelit *self)
if (!priv) {
priv = g_slice_new0 (Private);
initialize_alternate_3g_band (self, priv);
+ initialize_ext_4g_band (self, priv);
g_object_set_qdata_full (G_OBJECT (self), private_quark, priv, (GDestroyNotify)private_free);
}
@@ -199,6 +219,7 @@ mm_shared_telit_load_supported_bands_ready (MMBaseModem *self,
mm_iface_modem_is_3g (MM_IFACE_MODEM (self)),
mm_iface_modem_is_4g (MM_IFACE_MODEM (self)),
priv->alternate_3g_bands,
+ priv->ext_4g_bands,
self,
&error);
if (!bands)
@@ -259,6 +280,7 @@ mm_shared_telit_load_current_bands_ready (MMBaseModem *self,
mm_iface_modem_is_3g (MM_IFACE_MODEM (self)),
mm_iface_modem_is_4g (MM_IFACE_MODEM (self)),
priv->alternate_3g_bands,
+ priv->ext_4g_bands,
self,
&error);
if (!bands)
@@ -340,6 +362,7 @@ mm_shared_telit_modem_set_current_bands (MMIfaceModem *self,
mm_iface_modem_is_3g (self),
mm_iface_modem_is_4g (self),
priv->alternate_3g_bands,
+ priv->ext_4g_bands,
&error);
if (!cmd) {
g_task_return_error (task, error);
diff --git a/plugins/telit/tests/test-mm-modem-helpers-telit.c b/plugins/telit/tests/test-mm-modem-helpers-telit.c
index 251abd1e..16cd776e 100644
--- a/plugins/telit/tests/test-mm-modem-helpers-telit.c
+++ b/plugins/telit/tests/test-mm-modem-helpers-telit.c
@@ -39,20 +39,21 @@ typedef struct {
gboolean modem_is_3g;
gboolean modem_is_4g;
gboolean modem_alternate_3g_bands;
+ gboolean modem_ext_4g_bands;
guint mm_bands_len;
MMModemBand mm_bands [MAX_BANDS_LIST_LEN];
} BndResponseTest;
static BndResponseTest supported_band_mapping_tests [] = {
{
- "#BND: (0-3)", TRUE, FALSE, FALSE, FALSE, 4,
+ "#BND: (0-3)", TRUE, FALSE, FALSE, FALSE, FALSE, 4,
{ MM_MODEM_BAND_EGSM,
MM_MODEM_BAND_DCS,
MM_MODEM_BAND_PCS,
MM_MODEM_BAND_G850 }
},
{
- "#BND: (0-3),(0,2,5,6)", TRUE, TRUE, FALSE, FALSE, 7,
+ "#BND: (0-3),(0,2,5,6)", TRUE, TRUE, FALSE, FALSE, FALSE, 7,
{ MM_MODEM_BAND_EGSM,
MM_MODEM_BAND_DCS,
MM_MODEM_BAND_PCS,
@@ -62,7 +63,7 @@ static BndResponseTest supported_band_mapping_tests [] = {
MM_MODEM_BAND_UTRAN_8 }
},
{
- "#BND: (0,3),(0,2,5,6)", TRUE, TRUE, FALSE, FALSE, 7,
+ "#BND: (0,3),(0,2,5,6)", TRUE, TRUE, FALSE, FALSE, FALSE, 7,
{ MM_MODEM_BAND_EGSM,
MM_MODEM_BAND_DCS,
MM_MODEM_BAND_PCS,
@@ -72,7 +73,7 @@ static BndResponseTest supported_band_mapping_tests [] = {
MM_MODEM_BAND_UTRAN_8 }
},
{
- "#BND: (0,2),(0,2,5,6)", TRUE, TRUE, FALSE, FALSE, 6,
+ "#BND: (0,2),(0,2,5,6)", TRUE, TRUE, FALSE, FALSE, FALSE, 6,
{ MM_MODEM_BAND_EGSM,
MM_MODEM_BAND_DCS,
MM_MODEM_BAND_G850,
@@ -81,7 +82,7 @@ static BndResponseTest supported_band_mapping_tests [] = {
MM_MODEM_BAND_UTRAN_8 }
},
{
- "#BND: (0,2),(0-4,5,6)", TRUE, TRUE, FALSE, FALSE, 7,
+ "#BND: (0,2),(0-4,5,6)", TRUE, TRUE, FALSE, FALSE, FALSE, 7,
{ MM_MODEM_BAND_EGSM,
MM_MODEM_BAND_DCS,
MM_MODEM_BAND_G850,
@@ -91,7 +92,7 @@ static BndResponseTest supported_band_mapping_tests [] = {
MM_MODEM_BAND_UTRAN_8 }
},
{
- "#BND: (0-3),(0,2,5,6),(1-1)", TRUE, TRUE, TRUE, FALSE, 8,
+ "#BND: (0-3),(0,2,5,6),(1-1)", TRUE, TRUE, TRUE, FALSE, FALSE, 8,
{ MM_MODEM_BAND_EGSM,
MM_MODEM_BAND_DCS,
MM_MODEM_BAND_PCS,
@@ -102,7 +103,7 @@ static BndResponseTest supported_band_mapping_tests [] = {
MM_MODEM_BAND_EUTRAN_1 }
},
{
- "#BND: (0),(0),(1-3)", TRUE, TRUE, TRUE, FALSE, 5,
+ "#BND: (0),(0),(1-3)", TRUE, TRUE, TRUE, FALSE, FALSE, 5,
{ MM_MODEM_BAND_EGSM,
MM_MODEM_BAND_DCS,
MM_MODEM_BAND_UTRAN_1,
@@ -110,13 +111,13 @@ static BndResponseTest supported_band_mapping_tests [] = {
MM_MODEM_BAND_EUTRAN_2 }
},
{
- "#BND: (0),(0),(1-3)", FALSE, FALSE, TRUE, FALSE, 2,
+ "#BND: (0),(0),(1-3)", FALSE, FALSE, TRUE, FALSE, FALSE, 2,
{ MM_MODEM_BAND_EUTRAN_1,
MM_MODEM_BAND_EUTRAN_2 }
},
/* 3G alternate band settings: default */
{
- "#BND: (0),(0,2,5,6,12,25)", FALSE, TRUE, FALSE, FALSE, 5,
+ "#BND: (0),(0,2,5,6,12,25)", FALSE, TRUE, FALSE, FALSE, FALSE, 5,
{ MM_MODEM_BAND_UTRAN_1,
MM_MODEM_BAND_UTRAN_5,
MM_MODEM_BAND_UTRAN_8,
@@ -125,7 +126,7 @@ static BndResponseTest supported_band_mapping_tests [] = {
},
/* 3G alternate band settings: alternate */
{
- "#BND: (0),(0,2,5,6,12,13)", FALSE, TRUE, FALSE, TRUE, 4,
+ "#BND: (0),(0,2,5,6,12,13)", FALSE, TRUE, FALSE, TRUE, FALSE, 4,
{ MM_MODEM_BAND_UTRAN_1,
MM_MODEM_BAND_UTRAN_3,
MM_MODEM_BAND_UTRAN_5,
@@ -135,7 +136,7 @@ static BndResponseTest supported_band_mapping_tests [] = {
* 168695967: 0xA0E189F: 0000 1010 0000 1110 0001 1000 1001 1111
*/
{
- "#BND: (0-5),(0),(1-168695967)", TRUE, FALSE, TRUE, FALSE, 17,
+ "#BND: (0-5),(0),(1-168695967)", TRUE, FALSE, TRUE, FALSE, FALSE, 17,
{ MM_MODEM_BAND_EGSM,
MM_MODEM_BAND_DCS,
MM_MODEM_BAND_PCS,
@@ -153,6 +154,23 @@ static BndResponseTest supported_band_mapping_tests [] = {
MM_MODEM_BAND_EUTRAN_20,
MM_MODEM_BAND_EUTRAN_26,
MM_MODEM_BAND_EUTRAN_28 }
+ },
+ /* 4G ext band settings: devices such as LN920 */
+ {
+ "#BND: (0),(0),(1003100185A),(42)", FALSE, TRUE, TRUE, FALSE, TRUE, 13,
+ { MM_MODEM_BAND_UTRAN_1,
+ MM_MODEM_BAND_EUTRAN_2,
+ MM_MODEM_BAND_EUTRAN_4,
+ MM_MODEM_BAND_EUTRAN_5,
+ MM_MODEM_BAND_EUTRAN_7,
+ MM_MODEM_BAND_EUTRAN_12,
+ MM_MODEM_BAND_EUTRAN_13,
+ MM_MODEM_BAND_EUTRAN_25,
+ MM_MODEM_BAND_EUTRAN_29,
+ MM_MODEM_BAND_EUTRAN_30,
+ MM_MODEM_BAND_EUTRAN_41,
+ MM_MODEM_BAND_EUTRAN_66,
+ MM_MODEM_BAND_EUTRAN_71 }
}
};
@@ -170,6 +188,7 @@ test_parse_supported_bands_response (void)
supported_band_mapping_tests[i].modem_is_3g,
supported_band_mapping_tests[i].modem_is_4g,
supported_band_mapping_tests[i].modem_alternate_3g_bands,
+ supported_band_mapping_tests[i].modem_ext_4g_bands,
NULL,
&error);
g_assert_no_error (error);
@@ -184,18 +203,18 @@ test_parse_supported_bands_response (void)
static BndResponseTest current_band_mapping_tests [] = {
{
- "#BND: 0", TRUE, FALSE, FALSE, FALSE, 2,
+ "#BND: 0", TRUE, FALSE, FALSE, FALSE, FALSE, 2,
{ MM_MODEM_BAND_EGSM,
MM_MODEM_BAND_DCS }
},
{
- "#BND: 0,5", TRUE, TRUE, FALSE, FALSE, 3,
+ "#BND: 0,5", TRUE, TRUE, FALSE, FALSE, FALSE, 3,
{ MM_MODEM_BAND_EGSM,
MM_MODEM_BAND_DCS,
MM_MODEM_BAND_UTRAN_8 }
},
{
- "#BND: 1,3", TRUE, TRUE, FALSE, FALSE, 5,
+ "#BND: 1,3", TRUE, TRUE, FALSE, FALSE, FALSE, 5,
{ MM_MODEM_BAND_EGSM,
MM_MODEM_BAND_PCS,
MM_MODEM_BAND_UTRAN_1,
@@ -203,38 +222,38 @@ static BndResponseTest current_band_mapping_tests [] = {
MM_MODEM_BAND_UTRAN_5 }
},
{
- "#BND: 2,7", TRUE, TRUE, FALSE, FALSE, 3,
+ "#BND: 2,7", TRUE, TRUE, FALSE, FALSE, FALSE, 3,
{ MM_MODEM_BAND_DCS,
MM_MODEM_BAND_G850,
MM_MODEM_BAND_UTRAN_4 }
},
{
- "#BND: 3,0,1", TRUE, TRUE, TRUE, FALSE, 4,
+ "#BND: 3,0,1", TRUE, TRUE, TRUE, FALSE, FALSE, 4,
{ MM_MODEM_BAND_PCS,
MM_MODEM_BAND_G850,
MM_MODEM_BAND_UTRAN_1,
MM_MODEM_BAND_EUTRAN_1 }
},
{
- "#BND: 0,0,3", TRUE, FALSE, TRUE, FALSE, 4,
+ "#BND: 0,0,3", TRUE, FALSE, TRUE, FALSE, FALSE, 4,
{ MM_MODEM_BAND_EGSM,
MM_MODEM_BAND_DCS,
MM_MODEM_BAND_EUTRAN_1,
MM_MODEM_BAND_EUTRAN_2 }
},
{
- "#BND: 0,0,3", FALSE, FALSE, TRUE, FALSE, 2,
+ "#BND: 0,0,3", FALSE, FALSE, TRUE, FALSE, FALSE, 2,
{ MM_MODEM_BAND_EUTRAN_1,
MM_MODEM_BAND_EUTRAN_2 }
},
/* 3G alternate band settings: default */
{
- "#BND: 0,12", FALSE, TRUE, FALSE, FALSE, 1,
+ "#BND: 0,12", FALSE, TRUE, FALSE, FALSE, FALSE, 1,
{ MM_MODEM_BAND_UTRAN_6 }
},
/* 3G alternate band settings: alternate */
{
- "#BND: 0,12", FALSE, TRUE, FALSE, TRUE, 4,
+ "#BND: 0,12", FALSE, TRUE, FALSE, TRUE, FALSE, 4,
{ MM_MODEM_BAND_UTRAN_1,
MM_MODEM_BAND_UTRAN_3,
MM_MODEM_BAND_UTRAN_5,
@@ -244,7 +263,7 @@ static BndResponseTest current_band_mapping_tests [] = {
* 168695967: 0xA0E189F: 0000 1010 0000 1110 0001 1000 1001 1111
*/
{
- "#BND: 5,0,168695967", TRUE, FALSE, TRUE, FALSE, 17,
+ "#BND: 5,0,168695967", TRUE, FALSE, TRUE, FALSE, FALSE, 17,
{ MM_MODEM_BAND_EGSM,
MM_MODEM_BAND_DCS,
MM_MODEM_BAND_PCS,
@@ -262,6 +281,23 @@ static BndResponseTest current_band_mapping_tests [] = {
MM_MODEM_BAND_EUTRAN_20,
MM_MODEM_BAND_EUTRAN_26,
MM_MODEM_BAND_EUTRAN_28 }
+ },
+ /* 4G ext band settings: devices such as LN920 */
+ {
+ "#BND: 0,0,1003100185A,42", FALSE, TRUE, TRUE, FALSE, TRUE, 13,
+ { MM_MODEM_BAND_UTRAN_1,
+ MM_MODEM_BAND_EUTRAN_2,
+ MM_MODEM_BAND_EUTRAN_4,
+ MM_MODEM_BAND_EUTRAN_5,
+ MM_MODEM_BAND_EUTRAN_7,
+ MM_MODEM_BAND_EUTRAN_12,
+ MM_MODEM_BAND_EUTRAN_13,
+ MM_MODEM_BAND_EUTRAN_25,
+ MM_MODEM_BAND_EUTRAN_29,
+ MM_MODEM_BAND_EUTRAN_30,
+ MM_MODEM_BAND_EUTRAN_41,
+ MM_MODEM_BAND_EUTRAN_66,
+ MM_MODEM_BAND_EUTRAN_71 }
}
};
@@ -279,6 +315,7 @@ test_parse_current_bands_response (void)
current_band_mapping_tests[i].modem_is_3g,
current_band_mapping_tests[i].modem_is_4g,
current_band_mapping_tests[i].modem_alternate_3g_bands,
+ current_band_mapping_tests[i].modem_ext_4g_bands,
NULL,
&error);
g_assert_no_error (error);
@@ -299,6 +336,7 @@ test_common_bnd_cmd (const gchar *expected_cmd,
gboolean modem_is_3g,
gboolean modem_is_4g,
gboolean modem_alternate_3g_bands,
+ gboolean modem_ext_4g_bands,
GArray *bands_array)
{
gchar *cmd;
@@ -307,15 +345,16 @@ test_common_bnd_cmd (const gchar *expected_cmd,
cmd = mm_telit_build_bnd_request (bands_array,
modem_is_2g, modem_is_3g, modem_is_4g,
modem_alternate_3g_bands,
+ modem_ext_4g_bands,
&error);
g_assert_no_error (error);
g_assert_cmpstr (cmd, ==, expected_cmd);
g_free (cmd);
}
-#define test_common_bnd_cmd_2g(EXPECTED_CMD, BANDS_ARRAY) test_common_bnd_cmd (EXPECTED_CMD, TRUE, FALSE, FALSE, FALSE, BANDS_ARRAY)
-#define test_common_bnd_cmd_3g(EXPECTED_CMD, ALTERNATE, BANDS_ARRAY) test_common_bnd_cmd (EXPECTED_CMD, FALSE, TRUE, FALSE, ALTERNATE, BANDS_ARRAY)
-#define test_common_bnd_cmd_4g(EXPECTED_CMD, BANDS_ARRAY) test_common_bnd_cmd (EXPECTED_CMD, FALSE, FALSE, TRUE, FALSE, BANDS_ARRAY)
+#define test_common_bnd_cmd_2g(EXPECTED_CMD, BANDS_ARRAY) test_common_bnd_cmd (EXPECTED_CMD, TRUE, FALSE, FALSE, FALSE, FALSE, BANDS_ARRAY)
+#define test_common_bnd_cmd_3g(EXPECTED_CMD, ALTERNATE, BANDS_ARRAY) test_common_bnd_cmd (EXPECTED_CMD, FALSE, TRUE, FALSE, ALTERNATE, FALSE, BANDS_ARRAY)
+#define test_common_bnd_cmd_4g(EXPECTED_CMD, EXTENDED, BANDS_ARRAY) test_common_bnd_cmd (EXPECTED_CMD, FALSE, FALSE, TRUE, FALSE, EXTENDED, BANDS_ARRAY)
static void
test_common_bnd_cmd_error (gboolean modem_is_2g,
@@ -329,7 +368,7 @@ test_common_bnd_cmd_error (gboolean modem_is_2g,
cmd = mm_telit_build_bnd_request (bands_array,
modem_is_2g, modem_is_3g, modem_is_4g,
- FALSE,
+ FALSE, FALSE,
&error);
g_assert_error (error, MM_CORE_ERROR, (gint)expected_error);
g_assert (!cmd);
@@ -512,14 +551,14 @@ test_telit_get_4g_bnd_flag (void)
/* Test flag 1 */
bands_array = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), 1);
g_array_append_val (bands_array, eutran_i);
- test_common_bnd_cmd_4g ("#BND=0,0,1", bands_array);
+ test_common_bnd_cmd_4g ("#BND=0,0,1", FALSE, bands_array);
g_array_unref (bands_array);
/* Test flag 3 */
bands_array = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), 2);
g_array_append_val (bands_array, eutran_i);
g_array_append_val (bands_array, eutran_ii);
- test_common_bnd_cmd_4g ("#BND=0,0,3", bands_array);
+ test_common_bnd_cmd_4g ("#BND=0,0,3", FALSE, bands_array);
g_array_unref (bands_array);
/* Test unmatched band array */