mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-08 10:54:41 +00:00
modem-manager: add firehose prog name quirk
Adds FirehoseProgFile quirk to determine the correct filename for the firehose prog depending on the device VID:PID.
This commit is contained in:
parent
b20737fe4a
commit
d1fc1d1f93
@ -30,6 +30,12 @@ AT command to execute to determine the firmware branch currently installed on th
|
|||||||
|
|
||||||
Since: 1.7.4
|
Since: 1.7.4
|
||||||
|
|
||||||
|
### ModemManagerFirehoseProgFile
|
||||||
|
|
||||||
|
Firehose program file to use during the switch to EDL (Emergency Download) mode.
|
||||||
|
|
||||||
|
Since: 1.8.10
|
||||||
|
|
||||||
## Vendor ID Security
|
## Vendor ID Security
|
||||||
|
|
||||||
The vendor ID is set from the USB or PCI vendor, for example `USB:0x413C` `PCI:0x105B`
|
The vendor ID is set from the USB or PCI vendor, for example `USB:0x413C` `PCI:0x105B`
|
||||||
|
@ -88,10 +88,12 @@ struct _FuMmDevice {
|
|||||||
/* firehose update handling */
|
/* firehose update handling */
|
||||||
gchar *port_qcdm;
|
gchar *port_qcdm;
|
||||||
gchar *port_edl;
|
gchar *port_edl;
|
||||||
|
gchar *firehose_prog_file;
|
||||||
FuSaharaLoader *sahara_loader;
|
FuSaharaLoader *sahara_loader;
|
||||||
#if MM_CHECK_VERSION(1, 17, 2)
|
#if MM_CHECK_VERSION(1, 17, 2)
|
||||||
FuFirehoseUpdater *firehose_updater;
|
FuFirehoseUpdater *firehose_updater;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* for sahara */
|
/* for sahara */
|
||||||
FuUsbDevice *usb_device;
|
FuUsbDevice *usb_device;
|
||||||
|
|
||||||
@ -1473,11 +1475,19 @@ fu_mm_copy_firehose_prog(FuMmDevice *self, GBytes *prog, GError **error)
|
|||||||
g_autofree gchar *qcom_fw_dir = NULL;
|
g_autofree gchar *qcom_fw_dir = NULL;
|
||||||
g_autofree gchar *firehose_file_path = NULL;
|
g_autofree gchar *firehose_file_path = NULL;
|
||||||
|
|
||||||
|
if (self->firehose_prog_file == NULL) {
|
||||||
|
g_set_error(error,
|
||||||
|
FWUPD_ERROR,
|
||||||
|
FWUPD_ERROR_NOT_FOUND,
|
||||||
|
"Firehose prog filename is not set for the device");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
qcom_fw_dir = g_build_filename(self->firmware_path, "qcom", NULL);
|
qcom_fw_dir = g_build_filename(self->firmware_path, "qcom", NULL);
|
||||||
if (!fu_path_mkdir_parent(qcom_fw_dir, error))
|
if (!fu_path_mkdir_parent(qcom_fw_dir, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
firehose_file_path = g_build_filename(qcom_fw_dir, "prog_firehose_sdx24.mbn", NULL);
|
firehose_file_path = g_build_filename(qcom_fw_dir, self->firehose_prog_file, NULL);
|
||||||
|
|
||||||
if (!fu_bytes_set_contents(firehose_file_path, prog, error))
|
if (!fu_bytes_set_contents(firehose_file_path, prog, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1681,6 +1691,11 @@ fu_mm_device_set_quirk_kv(FuDevice *device, const gchar *key, const gchar *value
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g_strcmp0(key, "ModemManagerFirehoseProgFile") == 0) {
|
||||||
|
self->firehose_prog_file = g_strdup(value);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* failed */
|
/* failed */
|
||||||
g_set_error_literal(error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "quirk key not supported");
|
g_set_error_literal(error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "quirk key not supported");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1947,6 +1962,7 @@ fu_mm_device_finalize(GObject *object)
|
|||||||
g_free(self->inhibition_uid);
|
g_free(self->inhibition_uid);
|
||||||
g_free(self->firmware_path);
|
g_free(self->firmware_path);
|
||||||
g_free(self->restore_firmware_path);
|
g_free(self->restore_firmware_path);
|
||||||
|
g_free(self->firehose_prog_file);
|
||||||
G_OBJECT_CLASS(fu_mm_device_parent_class)->finalize(object);
|
G_OBJECT_CLASS(fu_mm_device_parent_class)->finalize(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,3 +58,13 @@ ModemManagerBranchAtCommand = AT+GETFWBRANCH
|
|||||||
[USB\VID_05C6&PID_9008]
|
[USB\VID_05C6&PID_9008]
|
||||||
Summary = Qualcomm based modems in EDL (sahara)
|
Summary = Qualcomm based modems in EDL (sahara)
|
||||||
Plugin = modem_manager
|
Plugin = modem_manager
|
||||||
|
|
||||||
|
# Quectel EM120 firehose prog file
|
||||||
|
[PCI\VID_1EAC&PID_1001]
|
||||||
|
Summary = Quectel EM120 firehose prog file
|
||||||
|
ModemManagerFirehoseProgFile = prog_firehose_sdx24.mbn
|
||||||
|
|
||||||
|
# Quectel EM160 firehose prog file
|
||||||
|
[PCI\VID_1EAC&PID_1002]
|
||||||
|
Summary = Quectel EM160 firehose prog file
|
||||||
|
ModemManagerFirehoseProgFile = prog_firehose_sdx24.mbn
|
||||||
|
Loading…
Reference in New Issue
Block a user