aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2022-02-10 10:31:11 +0100
committerAleksander Morgado <aleksander@aleksander.es>2022-03-07 09:51:43 +0000
commitdeaf0646c4a3da4a1dc3a1bfd4157cc0ee74921f (patch)
treed5eb20f42ed5a1e5f0e83f5d8bead0f7b780c7dc
parentc3c4cdde7a957ea1aab501783c0f4e5f66a51135 (diff)
intel: inherit GNSS location support from the shared XMM interface
We're not going to implement all XMM shared operations from the shared utils, as the newer Intel modems support the new operations in the Microsoft MBIM Extensions. Just inherit the GNSS management capabilities.
-rw-r--r--plugins/Makefile.am1
-rw-r--r--plugins/intel/mm-broadband-modem-mbim-intel.c50
-rw-r--r--plugins/meson.build2
3 files changed, 51 insertions, 2 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 0900e6b9..3374bd96 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -900,6 +900,7 @@ endif
libmm_plugin_intel_la_CPPFLAGS = \
$(PLUGIN_COMMON_COMPILER_FLAGS) \
+ $(XMM_COMMON_COMPILER_FLAGS) \
-DMM_MODULE_NAME=\"intel\" \
$(NULL)
libmm_plugin_intel_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS)
diff --git a/plugins/intel/mm-broadband-modem-mbim-intel.c b/plugins/intel/mm-broadband-modem-mbim-intel.c
index 063d1408..c58adeb6 100644
--- a/plugins/intel/mm-broadband-modem-mbim-intel.c
+++ b/plugins/intel/mm-broadband-modem-mbim-intel.c
@@ -27,8 +27,17 @@
#include <libmm-glib.h>
#include "mm-broadband-modem-mbim-intel.h"
+#include "mm-iface-modem-location.h"
+#include "mm-shared-xmm.h"
-G_DEFINE_TYPE (MMBroadbandModemMbimIntel, mm_broadband_modem_mbim_intel, MM_TYPE_BROADBAND_MODEM_MBIM)
+static void iface_modem_location_init (MMIfaceModemLocation *iface);
+static void shared_xmm_init (MMSharedXmm *iface);
+
+static MMIfaceModemLocation *iface_modem_location_parent;
+
+G_DEFINE_TYPE_EXTENDED (MMBroadbandModemMbimIntel, mm_broadband_modem_mbim_intel, MM_TYPE_BROADBAND_MODEM_MBIM, 0,
+ G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_LOCATION, iface_modem_location_init)
+ G_IMPLEMENT_INTERFACE (MM_TYPE_SHARED_XMM, shared_xmm_init))
/*****************************************************************************/
@@ -63,6 +72,45 @@ mm_broadband_modem_mbim_intel_init (MMBroadbandModemMbimIntel *self)
}
static void
+iface_modem_location_init (MMIfaceModemLocation *iface)
+{
+ iface_modem_location_parent = g_type_interface_peek_parent (iface);
+
+ iface->load_capabilities = mm_shared_xmm_location_load_capabilities;
+ iface->load_capabilities_finish = mm_shared_xmm_location_load_capabilities_finish;
+ iface->enable_location_gathering = mm_shared_xmm_enable_location_gathering;
+ iface->enable_location_gathering_finish = mm_shared_xmm_enable_location_gathering_finish;
+ iface->disable_location_gathering = mm_shared_xmm_disable_location_gathering;
+ iface->disable_location_gathering_finish = mm_shared_xmm_disable_location_gathering_finish;
+ iface->load_supl_server = mm_shared_xmm_location_load_supl_server;
+ iface->load_supl_server_finish = mm_shared_xmm_location_load_supl_server_finish;
+ iface->set_supl_server = mm_shared_xmm_location_set_supl_server;
+ iface->set_supl_server_finish = mm_shared_xmm_location_set_supl_server_finish;
+}
+
+static MMBroadbandModemClass *
+peek_parent_broadband_modem_class (MMSharedXmm *self)
+{
+ return MM_BROADBAND_MODEM_CLASS (mm_broadband_modem_mbim_intel_parent_class);
+}
+
+static MMIfaceModemLocation *
+peek_parent_location_interface (MMSharedXmm *self)
+{
+ return iface_modem_location_parent;
+}
+
+static void
+shared_xmm_init (MMSharedXmm *iface)
+{
+ iface->peek_parent_broadband_modem_class = peek_parent_broadband_modem_class;
+ iface->peek_parent_location_interface = peek_parent_location_interface;
+}
+
+static void
mm_broadband_modem_mbim_intel_class_init (MMBroadbandModemMbimIntelClass *klass)
{
+ MMBroadbandModemClass *broadband_modem_class = MM_BROADBAND_MODEM_CLASS (klass);
+
+ broadband_modem_class->setup_ports = mm_shared_xmm_setup_ports;
}
diff --git a/plugins/meson.build b/plugins/meson.build
index 90135988..5a66f62e 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -470,7 +470,7 @@ if plugins_options['intel']
plugins += {'plugin-intel': {
'plugin': true,
- 'module': {'sources': sources, 'include_directories': plugins_incs, 'c_args': common_c_args},
+ 'module': {'sources': sources, 'include_directories': plugins_incs + [xmm_inc], 'c_args': common_c_args},
}}
endif