From 39a5fb6b0fff0cbce42921784a127496e9cad6b0 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 9 Mar 2022 12:35:58 +0100 Subject: qmi-firmware-update: rename 'qfu-udev-helpers.h' to 'qfu-helpers.h' The header contains logic that is generic, not everything is udev specific. --- src/qmi-firmware-update/qfu-device-selection.c | 2 +- src/qmi-firmware-update/qfu-helpers.h | 73 ++++++++++++++++++++++++++ src/qmi-firmware-update/qfu-main.c | 2 +- src/qmi-firmware-update/qfu-udev-helpers.c | 2 +- src/qmi-firmware-update/qfu-udev-helpers.h | 73 -------------------------- src/qmi-firmware-update/qfu-updater.c | 2 +- 6 files changed, 77 insertions(+), 77 deletions(-) create mode 100644 src/qmi-firmware-update/qfu-helpers.h delete mode 100644 src/qmi-firmware-update/qfu-udev-helpers.h diff --git a/src/qmi-firmware-update/qfu-device-selection.c b/src/qmi-firmware-update/qfu-device-selection.c index 5e0b2f03..7eeaf17a 100644 --- a/src/qmi-firmware-update/qfu-device-selection.c +++ b/src/qmi-firmware-update/qfu-device-selection.c @@ -27,7 +27,7 @@ #include #include "qfu-device-selection.h" -#include "qfu-udev-helpers.h" +#include "qfu-helpers.h" G_DEFINE_TYPE (QfuDeviceSelection, qfu_device_selection, G_TYPE_OBJECT) diff --git a/src/qmi-firmware-update/qfu-helpers.h b/src/qmi-firmware-update/qfu-helpers.h new file mode 100644 index 00000000..60dac914 --- /dev/null +++ b/src/qmi-firmware-update/qfu-helpers.h @@ -0,0 +1,73 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * qmi-firmware-update -- Command line tool to update firmware in QMI devices + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Copyright (C) 2016 Zodiac Inflight Innovations + * Copyright (C) 2016-2017 Aleksander Morgado + */ + +#ifndef QFU_HELPERS_H +#define QFU_HELPERS_H + +#include "config.h" + +#include + +G_BEGIN_DECLS + +typedef enum { + QFU_HELPERS_DEVICE_TYPE_TTY, + QFU_HELPERS_DEVICE_TYPE_CDC_WDM, + QFU_HELPERS_DEVICE_TYPE_LAST +} QfuHelpersDeviceType; + +const gchar *qfu_helpers_device_type_to_string (QfuHelpersDeviceType type); + +#if defined WITH_UDEV + +gchar *qfu_udev_helper_find_by_file (GFile *file, + GError **error); +gchar *qfu_udev_helper_find_by_file_path (const gchar *path, + GError **error); +gchar *qfu_udev_helper_find_peer_port (const gchar *sysfs_path, + GError **error); +gchar *qfu_udev_helper_find_by_device_info (guint16 vid, + guint16 pid, + guint busnum, + guint devnum, + GError **error); + +GList *qfu_udev_helper_list_devices (QfuHelpersDeviceType device_type, + const gchar *sysfs_path); + +void qfu_udev_helper_wait_for_device (QfuHelpersDeviceType device_type, + const gchar *sysfs_path, + const gchar *peer_port, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GFile *qfu_udev_helper_wait_for_device_finish (GAsyncResult *res, + GError **error); + +typedef struct _QfuUdevHelperGenericMonitor QfuUdevHelperGenericMonitor; +QfuUdevHelperGenericMonitor *qfu_udev_helper_generic_monitor_new (const gchar *sysfs_path); +void qfu_udev_helper_generic_monitor_free (QfuUdevHelperGenericMonitor *self); + +#endif + +G_END_DECLS + +#endif /* QFU_HELPERS_H */ diff --git a/src/qmi-firmware-update/qfu-main.c b/src/qmi-firmware-update/qfu-main.c index 5547862c..590d9d47 100644 --- a/src/qmi-firmware-update/qfu-main.c +++ b/src/qmi-firmware-update/qfu-main.c @@ -32,7 +32,7 @@ #include "qfu-log.h" #include "qfu-operation.h" #include "qfu-device-selection.h" -#include "qfu-udev-helpers.h" +#include "qfu-helpers.h" #include "qfu-utils.h" #define PROGRAM_NAME "qmi-firmware-update" diff --git a/src/qmi-firmware-update/qfu-udev-helpers.c b/src/qmi-firmware-update/qfu-udev-helpers.c index 3eff81d8..7faf26cc 100644 --- a/src/qmi-firmware-update/qfu-udev-helpers.c +++ b/src/qmi-firmware-update/qfu-udev-helpers.c @@ -29,7 +29,7 @@ # include #endif -#include "qfu-udev-helpers.h" +#include "qfu-helpers.h" /******************************************************************************/ diff --git a/src/qmi-firmware-update/qfu-udev-helpers.h b/src/qmi-firmware-update/qfu-udev-helpers.h deleted file mode 100644 index d634b475..00000000 --- a/src/qmi-firmware-update/qfu-udev-helpers.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * qmi-firmware-update -- Command line tool to update firmware in QMI devices - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * Copyright (C) 2016 Zodiac Inflight Innovations - * Copyright (C) 2016-2017 Aleksander Morgado - */ - -#ifndef QFU_UDEV_HELPERS_H -#define QFU_UDEV_HELPERS_H - -#include "config.h" - -#include - -G_BEGIN_DECLS - -typedef enum { - QFU_HELPERS_DEVICE_TYPE_TTY, - QFU_HELPERS_DEVICE_TYPE_CDC_WDM, - QFU_HELPERS_DEVICE_TYPE_LAST -} QfuHelpersDeviceType; - -const gchar *qfu_helpers_device_type_to_string (QfuHelpersDeviceType type); - -#if defined WITH_UDEV - -gchar *qfu_udev_helper_find_by_file (GFile *file, - GError **error); -gchar *qfu_udev_helper_find_by_file_path (const gchar *path, - GError **error); -gchar *qfu_udev_helper_find_peer_port (const gchar *sysfs_path, - GError **error); -gchar *qfu_udev_helper_find_by_device_info (guint16 vid, - guint16 pid, - guint busnum, - guint devnum, - GError **error); - -GList *qfu_udev_helper_list_devices (QfuHelpersDeviceType device_type, - const gchar *sysfs_path); - -void qfu_udev_helper_wait_for_device (QfuHelpersDeviceType device_type, - const gchar *sysfs_path, - const gchar *peer_port, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); -GFile *qfu_udev_helper_wait_for_device_finish (GAsyncResult *res, - GError **error); - -typedef struct _QfuUdevHelperGenericMonitor QfuUdevHelperGenericMonitor; -QfuUdevHelperGenericMonitor *qfu_udev_helper_generic_monitor_new (const gchar *sysfs_path); -void qfu_udev_helper_generic_monitor_free (QfuUdevHelperGenericMonitor *self); - -#endif - -G_END_DECLS - -#endif /* QFU_UDEV_HELPERS_H */ diff --git a/src/qmi-firmware-update/qfu-updater.c b/src/qmi-firmware-update/qfu-updater.c index 895df255..a33fc78e 100644 --- a/src/qmi-firmware-update/qfu-updater.c +++ b/src/qmi-firmware-update/qfu-updater.c @@ -31,7 +31,7 @@ #include "qfu-updater.h" #include "qfu-reseter.h" #include "qfu-utils.h" -#include "qfu-udev-helpers.h" +#include "qfu-helpers.h" #include "qfu-qdl-device.h" #include "qfu-sahara-device.h" #include "qfu-enum-types.h" -- cgit v1.2.1