vli: Skip probing the Dell DA300 device

Although 2109:2820 and 2109:0820 is the generic reference firmware,
firmware revision 3003 is specific to this device.

Fixes https://github.com/fwupd/fwupd/issues/4305
This commit is contained in:
Richard Hughes 2022-02-22 12:34:03 +00:00
parent 2472b51b9e
commit 7ef94d7a31
4 changed files with 39 additions and 0 deletions

View File

@ -237,6 +237,8 @@ fu_device_internal_flag_to_string(FuDeviceInternalFlags flag)
return "md-set-vendor";
if (flag == FU_DEVICE_INTERNAL_FLAG_NO_LID_CLOSED)
return "no-lid-closed";
if (flag == FU_DEVICE_INTERNAL_FLAG_NO_PROBE)
return "no-probe";
return NULL;
}
@ -297,6 +299,8 @@ fu_device_internal_flag_from_string(const gchar *flag)
return FU_DEVICE_INTERNAL_FLAG_MD_SET_VENDOR;
if (g_strcmp0(flag, "no-lid-closed") == 0)
return FU_DEVICE_INTERNAL_FLAG_NO_LID_CLOSED;
if (g_strcmp0(flag, "no-probe") == 0)
return FU_DEVICE_INTERNAL_FLAG_NO_PROBE;
return FU_DEVICE_INTERNAL_FLAG_UNKNOWN;
}
@ -4162,11 +4166,25 @@ fu_device_probe(FuDevice *self, GError **error)
if (priv->done_probe)
return TRUE;
/* device self-assigned */
if (fu_device_has_internal_flag(self, FU_DEVICE_INTERNAL_FLAG_NO_PROBE)) {
g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED, "not probing");
return FALSE;
}
/* subclassed */
if (klass->probe != NULL) {
if (!klass->probe(self, error))
return FALSE;
}
/* vfunc skipped device */
if (fu_device_has_internal_flag(self, FU_DEVICE_INTERNAL_FLAG_NO_PROBE)) {
g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED, "not probing");
return FALSE;
}
/* success */
priv->done_probe = TRUE;
return TRUE;
}
@ -4297,6 +4315,12 @@ fu_device_setup(FuDevice *self, GError **error)
return FALSE;
}
/* vfunc skipped device */
if (fu_device_has_internal_flag(self, FU_DEVICE_INTERNAL_FLAG_NO_PROBE)) {
g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED, "not probing");
return FALSE;
}
/* run setup on the children too (unless done already) */
children = fu_device_get_children(self);
for (guint i = 0; i < children->len; i++) {

View File

@ -429,6 +429,15 @@ typedef guint64 FuDeviceInternalFlags;
*/
#define FU_DEVICE_INTERNAL_FLAG_NO_LID_CLOSED (1ull << 21)
/**
* FU_DEVICE_INTERNAL_FLAG_NO_PROBE:
*
* Do not probe this device.
*
* Since: 1.7.6
*/
#define FU_DEVICE_INTERNAL_FLAG_NO_PROBE (1ull << 22)
/* accessors */
gchar *
fu_device_to_string(FuDevice *self);

View File

@ -4,6 +4,7 @@ cargs = ['-DG_LOG_DOMAIN="FuPluginVliUsbhub"']
install_data([
'vli-pd.quirk',
'vli-usbhub.quirk',
'vli-usbhub-dell.quirk',
'vli-usbhub-lenovo.quirk',
'vli-usbhub-hyper.quirk',
'vli-usbhub-bizlink.quirk',

View File

@ -0,0 +1,5 @@
# Dell DA300
[USB\VID_2109&PID_0820&REV_3003]
Flags = no-probe
[USB\VID_2109&PID_2820&REV_3003]
Flags = no-probe