fwupd/plugins/ata/fu-plugin-ata.c
Richard Hughes dbcc8e1137 ata: Include a vendor ID for ATA hardware
Some vendors want to ship updates for ATA hardware, but there are currently no
lock-down restrictions in place for these kind of devices.

There is the OUI from the WWN block which is supposed to identify the vendor,
but this is not always set and so we have to be a little creative. We can match
90% of hardware using the vendor name prefix, and the last 10% can be detected
with a heuristic that was the result of comparing over 900 drive models.

I'm not including very old drive models, media converters, raid controllers,
or external 'portable' drives as I don't think it is useful. Also, if the drive
contains a Dell vendor block just hardcode this as Dell rather than trying to
be clever.

Also ask the user to contribute OUI values if this data is found with no quirk
data as this is the only real sane way to manage this data long term.
The list of OUIs can be found here: http://standards-oui.ieee.org/oui.txt
2020-02-20 16:02:44 +00:00

29 lines
660 B
C

/*
* Copyright (C) 2019 Richard Hughes <richard@hughsie.com>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#include "config.h"
#include "fu-plugin-vfuncs.h"
#include "fu-hash.h"
#include "fu-ata-device.h"
void
fu_plugin_init (FuPlugin *plugin)
{
fu_plugin_set_build_hash (plugin, FU_BUILD_HASH);
fu_plugin_add_udev_subsystem (plugin, "block");
fu_plugin_set_device_gtype (plugin, FU_TYPE_ATA_DEVICE);
}
gboolean
fu_plugin_device_created (FuPlugin *plugin, FuDevice *dev, GError **error)
{
gboolean tmp = fu_plugin_get_config_value_boolean (plugin, "UnknownOuiReport");
fu_ata_device_set_unknown_oui_report (FU_ATA_DEVICE (dev), tmp);
return TRUE;
}