aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2018-12-09 15:31:21 +0100
committerDan Williams <dcbw@redhat.com>2019-01-03 18:53:52 +0000
commit4b21546f532991dceddab8e573ae6fbb87b28576 (patch)
tree669c7a38c596c850512a99845735332162a16394
parent3c7437d791cf4e805d989ef940aa805f9ecc3848 (diff)
dell,dw5821e: report fastboot-based firmware update method and settings
The DW5821e uses the AT^FASTBOOT command to reset the module in fastboot mode, ready to download new firmware. Note: we cannot use AT^FASTBOOT=? to query for support, as that command also triggers the reset :/
-rw-r--r--plugins/dell/mm-broadband-modem-dell-dw5821e.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/plugins/dell/mm-broadband-modem-dell-dw5821e.c b/plugins/dell/mm-broadband-modem-dell-dw5821e.c
index cd3fa29a..2c791ca5 100644
--- a/plugins/dell/mm-broadband-modem-dell-dw5821e.c
+++ b/plugins/dell/mm-broadband-modem-dell-dw5821e.c
@@ -32,14 +32,17 @@
#include "mm-base-modem-at.h"
#include "mm-iface-modem.h"
#include "mm-iface-modem-location.h"
+#include "mm-iface-modem-firmware.h"
#include "mm-broadband-modem-dell-dw5821e.h"
static void iface_modem_location_init (MMIfaceModemLocation *iface);
+static void iface_modem_firmware_init (MMIfaceModemFirmware *iface);
static MMIfaceModemLocation *iface_modem_location_parent;
G_DEFINE_TYPE_EXTENDED (MMBroadbandModemDellDw5821e, mm_broadband_modem_dell_dw5821e, MM_TYPE_BROADBAND_MODEM_MBIM, 0,
- G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_LOCATION, iface_modem_location_init))
+ G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_LOCATION, iface_modem_location_init)
+ G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_FIRMWARE, iface_modem_firmware_init))
typedef enum {
FEATURE_SUPPORT_UNKNOWN,
@@ -52,6 +55,34 @@ struct _MMBroadbandModemDellDw5821ePrivate {
};
/*****************************************************************************/
+/* Firmware update settings */
+
+static MMFirmwareUpdateSettings *
+firmware_load_update_settings_finish (MMIfaceModemFirmware *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ return g_task_propagate_pointer (G_TASK (res), error);
+}
+
+static void
+firmware_load_update_settings (MMIfaceModemFirmware *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ MMFirmwareUpdateSettings *update_settings;
+ GTask *task;
+
+ task = g_task_new (self, NULL, callback, user_data);
+
+ update_settings = mm_firmware_update_settings_new (MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT);
+ mm_firmware_update_settings_set_fastboot_at (update_settings, "AT^FASTBOOT");
+
+ g_task_return_pointer (task, update_settings, g_object_unref);
+ g_object_unref (task);
+}
+
+/*****************************************************************************/
/* Location capabilities loading (Location interface) */
static MMModemLocationSource
@@ -313,6 +344,13 @@ iface_modem_location_init (MMIfaceModemLocation *iface)
}
static void
+iface_modem_firmware_init (MMIfaceModemFirmware *iface)
+{
+ iface->load_update_settings = firmware_load_update_settings;
+ iface->load_update_settings_finish = firmware_load_update_settings_finish;
+}
+
+static void
mm_broadband_modem_dell_dw5821e_class_init (MMBroadbandModemDellDw5821eClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);