intel: new MBIM capable device

This commit is contained in:
som
2022-03-07 09:51:43 +00:00
committed by Aleksander Morgado
parent 40c791e293
commit fcf5e3af0d
5 changed files with 121 additions and 2 deletions
@@ -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)
{
}
@@ -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 */
+2 -2
View File
@@ -24,7 +24,7 @@
#include "mm-broadband-modem.h"
#if defined WITH_MBIM
#include "mm-broadband-modem-mbim.h"
#include "mm-broadband-modem-mbim-intel.h"
#endif
G_DEFINE_TYPE (MMPluginIntel, mm_plugin_intel, MM_TYPE_PLUGIN)
@@ -44,7 +44,7 @@ create_modem (MMPlugin *self,
#if defined WITH_MBIM
if (mm_port_probe_list_has_mbim_port (probes)) {
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,
mm_plugin_get_name (self),
vendor,