intel: new MBIM capable device
This commit is contained in:
@@ -891,6 +891,13 @@ libmm_plugin_intel_la_SOURCES = \
|
|||||||
intel/mm-plugin-intel.c \
|
intel/mm-plugin-intel.c \
|
||||||
intel/mm-plugin-intel.h \
|
intel/mm-plugin-intel.h \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
if WITH_MBIM
|
||||||
|
libmm_plugin_intel_la_SOURCES += \
|
||||||
|
intel/mm-broadband-modem-mbim-intel.h \
|
||||||
|
intel/mm-broadband-modem-mbim-intel.c \
|
||||||
|
$(NULL)
|
||||||
|
endif
|
||||||
|
|
||||||
libmm_plugin_intel_la_CPPFLAGS = \
|
libmm_plugin_intel_la_CPPFLAGS = \
|
||||||
$(PLUGIN_COMMON_COMPILER_FLAGS) \
|
$(PLUGIN_COMMON_COMPILER_FLAGS) \
|
||||||
-DMM_MODULE_NAME=\"intel\" \
|
-DMM_MODULE_NAME=\"intel\" \
|
||||||
|
61
plugins/intel/mm-broadband-modem-mbim-intel.c
Normal file
61
plugins/intel/mm-broadband-modem-mbim-intel.c
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021-2022 Intel Corporation
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
#include <ModemManager.h>
|
||||||
|
#define _LIBMM_INSIDE_MM
|
||||||
|
#include <libmm-glib.h>
|
||||||
|
|
||||||
|
#include "mm-broadband-modem-mbim-intel.h"
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (MMBroadbandModemMbimIntel, mm_broadband_modem_mbim_intel, MM_TYPE_BROADBAND_MODEM_MBIM)
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
MMBroadbandModemMbimIntel *
|
||||||
|
mm_broadband_modem_mbim_intel_new (const gchar *device,
|
||||||
|
const gchar **drivers,
|
||||||
|
const gchar *plugin,
|
||||||
|
guint16 vendor_id,
|
||||||
|
guint16 product_id)
|
||||||
|
{
|
||||||
|
return g_object_new (MM_TYPE_BROADBAND_MODEM_MBIM_INTEL,
|
||||||
|
MM_BASE_MODEM_DEVICE, device,
|
||||||
|
MM_BASE_MODEM_DRIVERS, drivers,
|
||||||
|
MM_BASE_MODEM_PLUGIN, plugin,
|
||||||
|
MM_BASE_MODEM_VENDOR_ID, vendor_id,
|
||||||
|
MM_BASE_MODEM_PRODUCT_ID, product_id,
|
||||||
|
/* MBIM bearer supports NET only */
|
||||||
|
MM_BASE_MODEM_DATA_NET_SUPPORTED, TRUE,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
mm_broadband_modem_mbim_intel_init (MMBroadbandModemMbimIntel *self)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
mm_broadband_modem_mbim_intel_class_init (MMBroadbandModemMbimIntelClass *klass)
|
||||||
|
{
|
||||||
|
}
|
47
plugins/intel/mm-broadband-modem-mbim-intel.h
Normal file
47
plugins/intel/mm-broadband-modem-mbim-intel.h
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021-2022 Intel Corporation
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MM_BROADBAND_MODEM_MBIM_INTEL_H
|
||||||
|
#define MM_BROADBAND_MODEM_MBIM_INTEL_H
|
||||||
|
|
||||||
|
#include "mm-broadband-modem-mbim.h"
|
||||||
|
|
||||||
|
#define MM_TYPE_BROADBAND_MODEM_MBIM_INTEL (mm_broadband_modem_mbim_intel_get_type ())
|
||||||
|
#define MM_BROADBAND_MODEM_MBIM_INTEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_MODEM_MBIM_INTEL, MMBroadbandModemMbimIntel))
|
||||||
|
#define MM_BROADBAND_MODEM_MBIM_INTEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BROADBAND_MODEM_MBIM_INTEL, MMBroadbandModemMbimIntelClass))
|
||||||
|
#define MM_IS_BROADBAND_MODEM_MBIM_INTEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BROADBAND_MODEM_MBIM_INTEL))
|
||||||
|
#define MM_IS_BROADBAND_MODEM_MBIM_INTEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BROADBAND_MODEM_MBIM_INTEL))
|
||||||
|
#define MM_BROADBAND_MODEM_MBIM_INTEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BROADBAND_MODEM_MBIM_INTEL, MMBroadbandModemMbimIntelClass))
|
||||||
|
|
||||||
|
typedef struct _MMBroadbandModemMbimIntel MMBroadbandModemMbimIntel;
|
||||||
|
typedef struct _MMBroadbandModemMbimIntelClass MMBroadbandModemMbimIntelClass;
|
||||||
|
|
||||||
|
struct _MMBroadbandModemMbimIntel {
|
||||||
|
MMBroadbandModemMbim parent;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MMBroadbandModemMbimIntelClass{
|
||||||
|
MMBroadbandModemMbimClass parent;
|
||||||
|
};
|
||||||
|
|
||||||
|
GType mm_broadband_modem_mbim_intel_get_type (void);
|
||||||
|
|
||||||
|
MMBroadbandModemMbimIntel *mm_broadband_modem_mbim_intel_new (const gchar *device,
|
||||||
|
const gchar **driver,
|
||||||
|
const gchar *plugin,
|
||||||
|
guint16 vendor_id,
|
||||||
|
guint16 product_id);
|
||||||
|
|
||||||
|
#endif /* MM_BROADBAND_MODEM_MBIM_INTEL_H */
|
@@ -24,7 +24,7 @@
|
|||||||
#include "mm-broadband-modem.h"
|
#include "mm-broadband-modem.h"
|
||||||
|
|
||||||
#if defined WITH_MBIM
|
#if defined WITH_MBIM
|
||||||
#include "mm-broadband-modem-mbim.h"
|
#include "mm-broadband-modem-mbim-intel.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
G_DEFINE_TYPE (MMPluginIntel, mm_plugin_intel, MM_TYPE_PLUGIN)
|
G_DEFINE_TYPE (MMPluginIntel, mm_plugin_intel, MM_TYPE_PLUGIN)
|
||||||
@@ -44,7 +44,7 @@ create_modem (MMPlugin *self,
|
|||||||
#if defined WITH_MBIM
|
#if defined WITH_MBIM
|
||||||
if (mm_port_probe_list_has_mbim_port (probes)) {
|
if (mm_port_probe_list_has_mbim_port (probes)) {
|
||||||
mm_obj_dbg (self, "MBIM-powered Intel modem found...");
|
mm_obj_dbg (self, "MBIM-powered Intel modem found...");
|
||||||
return MM_BASE_MODEM (mm_broadband_modem_mbim_new (uid,
|
return MM_BASE_MODEM (mm_broadband_modem_mbim_intel_new (uid,
|
||||||
drivers,
|
drivers,
|
||||||
mm_plugin_get_name (self),
|
mm_plugin_get_name (self),
|
||||||
vendor,
|
vendor,
|
||||||
|
@@ -462,6 +462,10 @@ if plugins_options['intel']
|
|||||||
'intel/mm-plugin-intel.c',
|
'intel/mm-plugin-intel.c',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if enable_mbim
|
||||||
|
sources += files('intel/mm-broadband-modem-mbim-intel.c')
|
||||||
|
endif
|
||||||
|
|
||||||
common_c_args = '-DMM_MODULE_NAME="intel"'
|
common_c_args = '-DMM_MODULE_NAME="intel"'
|
||||||
|
|
||||||
plugins += {'plugin-intel': {
|
plugins += {'plugin-intel': {
|
||||||
|
Reference in New Issue
Block a user