fwupd/plugins/modem-manager/fu-mm-device.h
Aleksander Morgado fab3ee97c7 modem-manager: make sure the correct interface number is used for QMI
The upgrade process requires that the USB interface layout is not
changed between upgrades, something that we require for AT and we also
require now for QMI. We store the USB interface number of the QMI port
as soon as the device is probed, and we use it to match the interface
number once the Udev based device is created.

squash! modem-manager: make sure the correct interface number is used for QMI
2020-11-29 07:08:05 +00:00

53 lines
1.8 KiB
C

/*
* Copyright (C) 2018-2019 Richard Hughes <richard@hughsie.com>
* Copyright (C) 2019 Aleksander Morgado <aleksander@aleksander.es>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#ifndef __FU_MM_DEVICE_H
#define __FU_MM_DEVICE_H
#include <libmm-glib.h>
#include "fu-plugin.h"
#define FU_TYPE_MM_DEVICE (fu_mm_device_get_type ())
G_DECLARE_FINAL_TYPE (FuMmDevice, fu_mm_device, FU, MM_DEVICE, FuDevice)
FuMmDevice *fu_mm_device_new (MMManager *manager,
MMObject *omodem);
const gchar *fu_mm_device_get_inhibition_uid (FuMmDevice *device);
const gchar *fu_mm_device_get_detach_fastboot_at (FuMmDevice *device);
gint fu_mm_device_get_port_at_ifnum (FuMmDevice *device);
gint fu_mm_device_get_port_qmi_ifnum (FuMmDevice *device);
MMModemFirmwareUpdateMethod fu_mm_device_get_update_methods (FuMmDevice *device);
/* support for udev-based devices */
typedef struct FuPluginMmInhibitedDeviceInfo FuPluginMmInhibitedDeviceInfo;
struct FuPluginMmInhibitedDeviceInfo {
gchar *inhibited_uid;
gchar *physical_id;
gchar *vendor;
gchar *name;
gchar *version;
GPtrArray *guids;
MMModemFirmwareUpdateMethod update_methods;
gchar *detach_fastboot_at;
gint port_at_ifnum;
gint port_qmi_ifnum;
};
FuPluginMmInhibitedDeviceInfo *fu_plugin_mm_inhibited_device_info_new (FuMmDevice *device);
void fu_plugin_mm_inhibited_device_info_free (FuPluginMmInhibitedDeviceInfo *info);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FuPluginMmInhibitedDeviceInfo, fu_plugin_mm_inhibited_device_info_free);
FuMmDevice *fu_mm_device_udev_new (MMManager *manager,
FuPluginMmInhibitedDeviceInfo *info);
void fu_mm_device_udev_add_port (FuMmDevice *device,
const gchar *subsystem,
const gchar *path,
gint ifnum);
#endif /* __FU_MM_DEVICE_H */