diff --git a/plugins/thunderbolt/Makefile.am b/plugins/thunderbolt/Makefile.am index f8c72592b..0fc7f1238 100644 --- a/plugins/thunderbolt/Makefile.am +++ b/plugins/thunderbolt/Makefile.am @@ -17,6 +17,13 @@ libfu_plugin_thunderbolt_la_LDFLAGS = -module -avoid-version libfu_plugin_thunderbolt_la_CFLAGS = $(WARN_CFLAGS) \ -DG_LOG_DOMAIN=\"FuPluginThunderbolt\" +if HAVE_DELL +AM_CPPFLAGS += \ + $(LIBSMBIOS_CFLAGS) +libfu_plugin_thunderbolt_la_LIBADD = \ + $(LIBSMBIOS_LIBS) +endif + EXTRA_DIST = README.md -include $(top_srcdir)/git.mk diff --git a/plugins/thunderbolt/fu-plugin-thunderbolt.c b/plugins/thunderbolt/fu-plugin-thunderbolt.c index 637bd4c34..6ef2ac8fa 100644 --- a/plugins/thunderbolt/fu-plugin-thunderbolt.c +++ b/plugins/thunderbolt/fu-plugin-thunderbolt.c @@ -32,6 +32,11 @@ #define FU_PLUGIN_THUNDERBOLT_MAX_ID_LEN 255 #define FU_PLUGIN_THUNDERBOLT_DAEMON_DELAY 3000 /* ms */ +#ifdef HAVE_DELL +#include +#include +#endif /* HAVE_DELL */ + struct FuPluginData { /* A handle on a list of libtbtfwu controller objects. These must * eventually be freed. @@ -129,6 +134,10 @@ fu_plugin_thunderbolt_rescan (FuPlugin *plugin, GError **error) g_autofree gchar *guid_id = NULL; g_autofree gchar *version = NULL; gint safe_mode = 0; +#ifdef HAVE_DELL + guint8 dell_supported; + struct smbios_struct *de_table; +#endif /* HAVE_DELL */ /* get the ID */ rc = tbt_fwu_Controller_getID (data->controllers[i], @@ -168,6 +177,18 @@ fu_plugin_thunderbolt_rescan (FuPlugin *plugin, GError **error) "Please visit https://github.com/01org/tbtfwupd/wiki " "for information on how to restore normal operation.", info->id); + + /* Dell systems are known to have the system ID as the model_id + when in safe mode, they can be flashed */ +#ifdef HAVE_DELL + de_table = smbios_get_next_struct_by_type (0, 0xDE); + smbios_struct_get_data (de_table, &dell_supported, 0x00, sizeof(guint8)); + if (dell_supported == 0xDE) { + info->vendor_id = 0x00d4; + info->model_id = sysinfo_get_dell_system_id (); + safe_mode = 0; + } +#endif /* HAVE_DELL */ } else { /* get the vendor ID */ rc = tbt_fwu_Controller_getVendorID (data->controllers[i],