mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-18 13:15:38 +00:00

If a device reports that qmi-pdc is supported (e.g. DW5821e that supports both fastboot and qmi-pdc), we'll end up first running the fastboot installation before doing the qmi-pdc installation procedure. These changes also make sure that the MM device inhibition is kept for as long as the whole process is ongoing. Only after the last method is run, the inhibition will be removed. In order to handle devices being exposed in the system while the MM inhibition is in place, e.g. to be able to run qmi-pdc after fastboot, a simple udev based watcher is included, which will take care of creating the FuMmDevice that is not associated to any modem currently exposed by MM, but that shares all the details of the original device. This new logic assumes that the devices don't change their USB layout during a firmware upgrade, which is not a very good assumption, but it works for the case at hand. If this is not the case, we may need to end up doing some custom AT port probing instead of relying on the original one reported by MM being still valid (note that we don't rely on the device name, as that may change if some other device is plugged in the system while we're doing the update, we rely on the USB interface number).
35 lines
821 B
C
35 lines
821 B
C
/*
|
|
* Copyright (C) 2019 Aleksander Morgado <aleksander@aleksander.es>
|
|
*
|
|
* SPDX-License-Identifier: LGPL-2.1+
|
|
*/
|
|
|
|
#ifndef __FU_MM_UTILS_H
|
|
#define __FU_MM_UTILS_H
|
|
|
|
#include "config.h"
|
|
#include <gudev/gudev.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
#ifndef HAVE_GUDEV_232
|
|
#pragma clang diagnostic push
|
|
#pragma clang diagnostic ignored "-Wunused-function"
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUdevClient, g_object_unref)
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUdevDevice, g_object_unref)
|
|
#pragma clang diagnostic pop
|
|
#endif
|
|
|
|
gboolean fu_mm_utils_get_udev_port_info (GUdevDevice *dev,
|
|
gchar **device_sysfs_path,
|
|
gint *port_ifnum,
|
|
GError **error);
|
|
gboolean fu_mm_utils_get_port_info (const gchar *path,
|
|
gchar **device_sysfs_path,
|
|
gint *port_ifnum,
|
|
GError **error);
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __FU_MM_UTILS_H */
|