dell-dock: Capture the dock SKU in metadata

Should be helpful in reproducing failure reports.
This commit is contained in:
Mario Limonciello 2020-05-26 00:07:19 -05:00 committed by Mario Limonciello
parent 4a844c3024
commit a42daefb9e
3 changed files with 36 additions and 0 deletions

View File

@ -172,6 +172,22 @@ fu_dell_dock_ec_set_board (FuDevice *device)
fu_device_set_summary (device, summary); fu_device_set_summary (device, summary);
} }
const gchar *
fu_dell_dock_ec_get_module_type (FuDevice *device)
{
FuDellDockEc *self = FU_DELL_DOCK_EC (device);
switch (self->data->module_type) {
case MODULE_TYPE_SINGLE:
return "WD19";
case MODULE_TYPE_DUAL:
return "WD19DC";
case MODULE_TYPE_TBT:
return "WD19TB";
default:
return NULL;
}
}
gboolean gboolean
fu_dell_dock_ec_needs_tbt (FuDevice *device) fu_dell_dock_ec_needs_tbt (FuDevice *device)
{ {

View File

@ -26,6 +26,7 @@ G_DECLARE_FINAL_TYPE (FuDellDockEc, fu_dell_dock_ec, FU, DELL_DOCK_EC, FuDevice)
FuDellDockEc *fu_dell_dock_ec_new (FuDevice *proxy); FuDellDockEc *fu_dell_dock_ec_new (FuDevice *proxy);
const gchar *fu_dell_dock_ec_get_module_type (FuDevice *device);
gboolean fu_dell_dock_ec_needs_tbt (FuDevice *device); gboolean fu_dell_dock_ec_needs_tbt (FuDevice *device);
gboolean fu_dell_dock_ec_tbt_passive (FuDevice *device); gboolean fu_dell_dock_ec_tbt_passive (FuDevice *device);
gboolean fu_dell_dock_ec_modify_lock (FuDevice *self, gboolean fu_dell_dock_ec_modify_lock (FuDevice *self,

View File

@ -164,6 +164,25 @@ fu_plugin_dell_dock_get_ec (GPtrArray *devices)
return ec_parent; return ec_parent;
} }
gboolean
fu_plugin_composite_prepare (FuPlugin *plugin, GPtrArray *devices,
GError **error)
{
FuDevice *parent = fu_plugin_dell_dock_get_ec (devices);
const gchar *sku;
if (parent == NULL)
return TRUE;
sku = fu_dell_dock_ec_get_module_type (parent);
if (sku == NULL) {
g_set_error_literal (error, FWUPD_ERROR, FWUPD_ERROR_INTERNAL,
"unable to detect SKU");
return FALSE;
}
fu_plugin_add_report_metadata (plugin, "DellDockSKU", sku);
return TRUE;
}
gboolean gboolean
fu_plugin_composite_cleanup (FuPlugin *plugin, fu_plugin_composite_cleanup (FuPlugin *plugin,
GPtrArray *devices, GPtrArray *devices,