plugins,telit: Detect alternate_3g_bands flag from modem model
Currently, mm-shared-telit:Private:alternate_3g_bands value provided via ID_MM_TELIT_BND_ALTERNATE tag. This commit maps the value of alternate_3g_bands to the modem model, detected via software version string.
This commit is contained in:
@@ -122,20 +122,6 @@ ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="7011", ENV{.MM_USBIFNUM}=="02", ENV{
|
||||
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="7011", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1"
|
||||
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="7011", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
|
||||
|
||||
# LM940/960 use alternate settings for 3G band management
|
||||
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1040", ENV{ID_MM_TELIT_BND_ALTERNATE}="1"
|
||||
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1041", ENV{ID_MM_TELIT_BND_ALTERNATE}="1"
|
||||
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1042", ENV{ID_MM_TELIT_BND_ALTERNATE}="1"
|
||||
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1043", ENV{ID_MM_TELIT_BND_ALTERNATE}="1"
|
||||
|
||||
# FN980 use alternate settings for 3G band management
|
||||
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1050", ENV{ID_MM_TELIT_BND_ALTERNATE}="1"
|
||||
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1051", ENV{ID_MM_TELIT_BND_ALTERNATE}="1"
|
||||
|
||||
# LN920 use alternate settings for 3G band management
|
||||
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"
|
||||
|
||||
# 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"
|
||||
|
||||
@@ -57,6 +57,19 @@ private_free (Private *priv)
|
||||
g_slice_free (Private, priv);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
has_alternate_3g_bands (const gchar *revision)
|
||||
{
|
||||
MMTelitModel model;
|
||||
|
||||
model = mm_telit_model_from_revision (revision);
|
||||
return (model == MM_TELIT_MODEL_FN980 ||
|
||||
model == MM_TELIT_MODEL_FN990 ||
|
||||
model == MM_TELIT_MODEL_LM940 ||
|
||||
model == MM_TELIT_MODEL_LM960 ||
|
||||
model == MM_TELIT_MODEL_LN920);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_bnd_4g_format_hex (const gchar *revision)
|
||||
{
|
||||
@@ -82,24 +95,6 @@ has_extended_4g_bands (const gchar *revision)
|
||||
model == MM_TELIT_MODEL_LN920);
|
||||
}
|
||||
|
||||
static void
|
||||
initialize_alternate_3g_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 alternate 3G band mapping */
|
||||
priv->alternate_3g_bands = mm_kernel_device_get_global_property_as_boolean (port, "ID_MM_TELIT_BND_ALTERNATE");
|
||||
if (priv->alternate_3g_bands)
|
||||
mm_obj_dbg (self, "telit modem using alternate 3G band mask setup");
|
||||
}
|
||||
}
|
||||
|
||||
static Private *
|
||||
get_private (MMSharedTelit *self)
|
||||
{
|
||||
@@ -111,7 +106,6 @@ get_private (MMSharedTelit *self)
|
||||
priv = g_object_get_qdata (G_OBJECT (self), private_quark);
|
||||
if (!priv) {
|
||||
priv = g_slice_new0 (Private);
|
||||
initialize_alternate_3g_band (self, priv);
|
||||
|
||||
if (MM_SHARED_TELIT_GET_INTERFACE (self)->peek_parent_modem_interface)
|
||||
priv->iface_modem_parent = MM_SHARED_TELIT_GET_INTERFACE (self)->peek_parent_modem_interface (self);
|
||||
@@ -141,6 +135,7 @@ mm_shared_telit_store_revision (MMSharedTelit *self,
|
||||
priv = get_private (MM_SHARED_TELIT (self));
|
||||
g_clear_pointer (&priv->software_package_version, g_free);
|
||||
priv->software_package_version = g_strdup (revision);
|
||||
priv->alternate_3g_bands = has_alternate_3g_bands (revision);
|
||||
priv->ext_4g_bands = has_extended_4g_bands (revision);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user