foxconn: add new MBIM QDU firmware update method support

Based on the QDU service newly added in libmbim,
T99W175 module (vid: 0x105b) supports MBIM QDU based update.
This commit is contained in:
Freedom Liu
2021-04-30 01:52:12 +00:00
committed by Aleksander Morgado
parent d5041cc814
commit 35b1672b85
2 changed files with 15 additions and 4 deletions

View File

@@ -1515,6 +1515,7 @@ typedef enum { /*< underscore_name=mm_call_direction >*/
* @MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE: No method specified.
* @MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT: Device supports fastboot-based update.
* @MM_MODEM_FIRMWARE_UPDATE_METHOD_QMI_PDC: Device supports QMI PDC based update.
* @MM_MODEM_FIRMWARE_UPDATE_METHOD_MBIM_QDU: Device supports MBIM QDU based update. Since 1.18.
*
* Type of firmware update method supported by the module.
*
@@ -1524,6 +1525,7 @@ typedef enum { /*< underscore_name=mm_modem_firmware_update_method >*/
MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE = 0,
MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT = 1 << 0,
MM_MODEM_FIRMWARE_UPDATE_METHOD_QMI_PDC = 1 << 1,
MM_MODEM_FIRMWARE_UPDATE_METHOD_MBIM_QDU = 1 << 2,
} MMModemFirmwareUpdateMethod;
/**

View File

@@ -89,15 +89,24 @@ foxconn_get_firmware_version_ready (QmiClientDms *client,
GError *error = NULL;
MMFirmwareUpdateSettings *update_settings = NULL;
const gchar *str;
MMIfaceModemFirmware *self;
output = qmi_client_dms_foxconn_get_firmware_version_finish (client, res, &error);
if (!output || !qmi_message_dms_foxconn_get_firmware_version_output_get_result (output, &error))
goto out;
/* Create update settings now */
update_settings = mm_firmware_update_settings_new (MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT |
MM_MODEM_FIRMWARE_UPDATE_METHOD_QMI_PDC);
mm_firmware_update_settings_set_fastboot_at (update_settings, "AT^FASTBOOT");
/* Create update settings now:
* 0x105b is the T99W175 module, T99W175 supports QDU,
* else support FASTBOOT and QMI PDC.
*/
self = g_task_get_source_object (task);
if (mm_base_modem_get_vendor_id (MM_BASE_MODEM (self)) == 0x105b)
update_settings = mm_firmware_update_settings_new (MM_MODEM_FIRMWARE_UPDATE_METHOD_MBIM_QDU);
else {
update_settings = mm_firmware_update_settings_new (MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT |
MM_MODEM_FIRMWARE_UPDATE_METHOD_QMI_PDC);
mm_firmware_update_settings_set_fastboot_at (update_settings, "AT^FASTBOOT");
}
qmi_message_dms_foxconn_get_firmware_version_output_get_version (output, &str, NULL);
mm_firmware_update_settings_set_version (update_settings, str);