diff options
Diffstat (limited to 'src/qmi-firmware-update/qfu-main.c')
-rw-r--r-- | src/qmi-firmware-update/qfu-main.c | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/src/qmi-firmware-update/qfu-main.c b/src/qmi-firmware-update/qfu-main.c index 590d9d47..4ee0b2de 100644 --- a/src/qmi-firmware-update/qfu-main.c +++ b/src/qmi-firmware-update/qfu-main.c @@ -42,20 +42,17 @@ /* Options */ /* Generic device selections */ -#if defined WITH_UDEV -static guint busnum; -static guint devnum; -static guint16 vid; -static guint16 pid; -#endif -static gchar *cdc_wdm_str; -static gchar *tty_str; +static guint busnum; +static guint devnum; +static guint16 vid; +static guint16 pid; +static gchar *cdc_wdm_str; +static gchar *tty_str; #if defined MM_RUNTIME_CHECK_ENABLED static gboolean ignore_mm_runtime_check_flag; #endif -#if defined WITH_UDEV /* Update */ static gboolean action_update_flag; static gchar *firmware_version_str; @@ -65,7 +62,6 @@ static gboolean ignore_version_errors_flag; static gboolean override_download_flag; static gint modem_storage_index_int; static gboolean skip_validation_flag; -#endif /* Reset */ static gboolean action_reset_flag; @@ -89,8 +85,6 @@ static gboolean version_flag; static gboolean help_flag; static gboolean help_examples_flag; -#if defined WITH_UDEV - static gboolean parse_busnum_devnum (const gchar *option_name, const gchar *value, @@ -186,10 +180,7 @@ out: return result; } -#endif /* WITH_UDEV */ - static GOptionEntry context_selection_entries[] = { -#if defined WITH_UDEV { "busnum-devnum", 's', 0, G_OPTION_ARG_CALLBACK, &parse_busnum_devnum, "Select device by bus and device number (in decimal).", "[BUS:]DEV" @@ -198,7 +189,6 @@ static GOptionEntry context_selection_entries[] = { "Select device by device vendor and product id (in hexadecimal).", "VID[:PID]" }, -#endif /* WITH_UDEV */ { "cdc-wdm", 'w', 0, G_OPTION_ARG_FILENAME, &cdc_wdm_str, "Select device by QMI/MBIM cdc-wdm device path (e.g. /dev/cdc-wdm0).", "[PATH]" @@ -210,7 +200,6 @@ static GOptionEntry context_selection_entries[] = { { NULL } }; -#if defined WITH_UDEV static GOptionEntry context_update_entries[] = { { "update", 'u', 0, G_OPTION_ARG_NONE, &action_update_flag, "Launch firmware update process.", @@ -246,7 +235,6 @@ static GOptionEntry context_update_entries[] = { }, { NULL } }; -#endif /* WITH_UDEV */ static GOptionEntry context_reset_entries[] = { { "reset", 'b', 0, G_OPTION_ARG_NONE, &action_reset_flag, @@ -368,7 +356,6 @@ print_help (GOptionContext *context) static void print_help_examples (void) { -#if defined WITH_UDEV g_print ("\n" "********************************************************************************\n" "\n" @@ -451,8 +438,6 @@ print_help_examples (void) " --cdc-wdm /dev/cdc-wdm0 \\\n" " 9999999_9999999_9200_03.05.14.00_00_generic_000.000_001_SPKG_MC.cwe\n"); -#endif /* WITH_UDEV */ - g_print ("\n" "********************************************************************************\n" "\n" @@ -565,11 +550,9 @@ int main (int argc, char **argv) g_option_group_add_entries (group, context_selection_entries); g_option_context_add_group (context, group); -#if defined WITH_UDEV group = g_option_group_new ("update", "Update options (normal mode):", "", NULL, NULL); g_option_group_add_entries (group, context_update_entries); g_option_context_add_group (context, group); -#endif group = g_option_group_new ("reset", "Reset options (normal mode):", "", NULL, NULL); g_option_group_add_entries (group, context_reset_entries); @@ -622,12 +605,10 @@ int main (int argc, char **argv) /* Actions that allow using a cdc-wdm device */ n_actions_cdc_wdm_needed = (action_reset_flag); -#if defined WITH_UDEV n_actions += action_update_flag; n_actions_cdc_wdm_needed += action_update_flag; n_actions_images_needed += action_update_flag; n_actions_device_needed += action_update_flag; -#endif /* We don't allow multiple actions at the same time */ if (n_actions == 0) { @@ -647,11 +628,7 @@ int main (int argc, char **argv) /* device selection must be performed for update and reset operations */ if (n_actions_device_needed) { -#if defined WITH_UDEV device_selection = qfu_device_selection_new (cdc_wdm_str, tty_str, vid, pid, busnum, devnum, &error); -#else - device_selection = qfu_device_selection_new (cdc_wdm_str, tty_str, 0, 0, 0, 0, &error); -#endif if (!device_selection) { g_printerr ("error: couldn't select device:: %s\n", error->message); g_error_free (error); @@ -703,7 +680,6 @@ int main (int argc, char **argv) /* Run */ -#if defined WITH_UDEV if (action_update_flag) { g_assert (QFU_IS_DEVICE_SELECTION (device_selection)); @@ -726,7 +702,6 @@ int main (int argc, char **argv) skip_validation_flag); goto out; } -#endif /* WITH_UDEV */ if (action_update_download_flag) { g_assert (QFU_IS_DEVICE_SELECTION (device_selection)); |