![]() |
![]() |
![]() |
fwupd Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#define FU_TYPE_QUIRKS FuQuirks * fu_quirks_new (void
); gboolean fu_quirks_load (FuQuirks *self
,GError **error
); const gchar * fu_quirks_lookup_by_id (FuQuirks *self
,const gchar *prefix
,const gchar *id
); const gchar * fu_quirks_lookup_by_glob (FuQuirks *self
,const gchar *prefix
,const gchar *glob
); const gchar * fu_quirks_lookup_by_usb_device (FuQuirks *self
,const gchar *prefix
,GUsbDevice *dev
); #define FU_QUIRKS_DFU #define FU_QUIRKS_UEFI_VERSION_FORMAT #define FU_QUIRKS_DAEMON_VERSION_FORMAT #define FU_QUIRKS_DFU_JABRA_DETACH #define FU_QUIRKS_DFU_AVR_CHIP_ID #define FU_QUIRKS_DFU_FORCE_VERSION #define FU_QUIRKS_USB_SUMMARY #define FU_QUIRKS_USB_ICON #define FU_QUIRKS_USB_NAME #define FU_QUIRKS_USB_GUID #define FU_QUIRKS_USB_VERSION #define FU_QUIRKS_USB_VENDOR #define FU_QUIRKS_CSR_DEVICE #define FU_QUIRKS_EBITDO_DEVICE
Quirks can be used to modify device behaviour. When fwupd is installed in long-term support distros it's very hard to backport new versions as new hardware is released.
There are several reasons why we can't just include the mapping and quirk information in the AppStream metadata:
* The extra data is hugely specific to the installed fwupd plugin versions * The device-id is per-device, and the mapping is usually per-plugin * Often the information is needed before the FuDevice is created * There are security implications in allowing plugins to handle new devices
The idea with quirks is that the end user can drop an additional (or replace an existing) file in a .d director with a simple format and the hardware will magically start working. This assumes no new quirks are required, as this would obviously need code changes, but allows us to get most existing devices working in an easy way without the user compiling anything.
See also: FuDevice, FuPlugin
FuQuirks * fu_quirks_new (void
);
Creates a new quirks object.
Returns : |
a new FuQuirks |
gboolean fu_quirks_load (FuQuirks *self
,GError **error
);
Loads the various files that define the hardware quirks used in plugins.
|
A FuQuirks |
|
A GError, or NULL
|
Returns : |
TRUE for success |
Since 1.0.1
const gchar * fu_quirks_lookup_by_id (FuQuirks *self
,const gchar *prefix
,const gchar *id
);
Looks up an entry in the hardware database using a string value.
|
A FuPlugin |
|
A string prefix that matches the quirks file basename, e.g. "dfu-quirks" |
|
An ID to match the entry, e.g. "012345" |
Returns : |
values from the database, or NULL if not found. [transfer none]
|
Since 1.0.1
const gchar * fu_quirks_lookup_by_glob (FuQuirks *self
,const gchar *prefix
,const gchar *glob
);
Looks up an entry in the hardware database using a key glob.
NOTE: This is *much* slower than using fu_quirks_lookup_by_id()
as each key
in the quirk database is compared.
|
A FuPlugin |
|
A string prefix that matches the quirks file basename, e.g. "dfu-quirks" |
|
An glob to match the entry, e.g. "foo*bar?baz" |
Returns : |
values from the database, or NULL if not found. [transfer none]
|
Since 1.0.1
const gchar * fu_quirks_lookup_by_usb_device (FuQuirks *self
,const gchar *prefix
,GUsbDevice *dev
);
Looks up an entry in the hardware database using various keys generated
from dev
.
|
A FuPlugin |
|
A string prefix that matches the quirks file basename, e.g. "dfu-quirks" |
|
A GUsbDevice |
Returns : |
values from the database, or NULL if not found. [transfer none]
|
Since 1.0.1
#define FU_QUIRKS_DFU "fwupd-dfu"
Assigns optional quirks to use for a DFU device which does not follow the DFU 1.0 or 1.1 specification. The list of supported quirks is thus:
* `none`: No device quirks * `action-required`: User has to do something manually, e.g. press a button * `attach-extra-reset`: Device needs resetting twice for attach * `attach-upload-download`: An upload or download is required for attach * `force-dfu-mode`: Force DFU mode * `ignore-polltimeout`: Ignore the device download timeout * `ignore-runtime`: Device has broken DFU runtime support * `ignore-upload`: Uploading from the device is broken * `no-dfu-runtime`: No DFU runtime interface is provided * `no-get-status-upload`: Do not do GetStatus when uploading * `no-pid-change`: Accept the same VID:PID when changing modes * `use-any-interface`: Use any interface for DFU * `use-atmel-avr`: Device uses the ATMEL bootloader * `use-protocol-zero`: Fix up the protocol number * `legacy-protocol`: Use a legacy protocol version
Default value: `none`
|
the USB device ID, e.g. `USB\VID_0763&PID_2806` |
|
a string, separated using `|`, e.g. `ignore-polltimeout|no-pid-change` |
Since 1.0.1
#define FU_QUIRKS_UEFI_VERSION_FORMAT "fwupd-uefi-version-format"
Assigns the version format to use for a specific manufacturer. A specific version format is sometimes chosen to match the appearance of other systems or specifications.
Default value: `use-triplet`
|
a FU_HWIDS_KEY_MANUFACTURER , e.g. `Alienware` |
|
the version format, e.g. `none` |
Since 1.0.1
#define FU_QUIRKS_DAEMON_VERSION_FORMAT "fwupd-daemon-version-format"
Assigns the version format to use for a specific AppStream component. A specific version format is sometimes chosen to match the appearance of other systems or specifications.
Default value: `use-triplet`
|
the optionally wildcarded AppStream ID e.g. `com.dell.uefi*.firmware` |
|
the version format, e.g. `none` |
Since 1.0.1
#define FU_QUIRKS_DFU_JABRA_DETACH "fwupd-dfu-jabra-detach"
Assigns the two magic bytes sent to the Jabra hardware when the device is in runtime mode to make it switch into DFU mode.
|
the USB device ID, e.g. `USB\VID_0763&PID_2806` |
|
the two uint8_t unlock values, encoded in base 16, e.g. `0201` |
Since 1.0.1
#define FU_QUIRKS_DFU_AVR_CHIP_ID "fwupd-dfu-avr-chip-id"
Assigns a sector description for the chip ID. This is required so fwupd can program the user firmware avoiding the bootloader and for checking the total element size.
The chip ID can be found from a datasheet or using `dfu-tool list` when the hardware is connected and in bootloader mode.
|
the AVR chip ID, e.g. `0x58200204` |
|
the UM0424 sector description, e.g. `Flash /0x2000/1*248Kg` |
Since 1.0.1
#define FU_QUIRKS_DFU_FORCE_VERSION "fwupd-dfu-force-version"
Forces a specific DFU version for the hardware device. This is required if the device does not set, or sets incorrectly, items in the DFU functional descriptor.
|
the USB device ID, e.g. `USB\VID_0763&PID_2806` |
|
the uint16_t DFU version, encoded in base 16, e.g. `0110` |
Since 1.0.1
#define FU_QUIRKS_USB_SUMMARY "FuUsbDevice:summary"
Sets a name for a specific hardware device.
|
the USB device ID, e.g. `USB\VID_0763&PID_2806` |
|
the USB device summary, e.g. `An open source display colorimeter` |
Since 1.0.2
#define FU_QUIRKS_USB_ICON "FuUsbDevice:icon"
Adds an icon name for a specific hardware device.
|
the USB device ID, e.g. `USB\VID_0763&PID_2806` |
|
the USB device icon name, e.g. `media-removable` |
Since 1.0.2
#define FU_QUIRKS_USB_NAME "FuUsbDevice:name"
Sets a name for a specific hardware device.
|
the USB device ID, e.g. `USB\VID_0763&PID_2806` |
|
the USB device name, e.g. `ColorHug` |
Since 1.0.2
#define FU_QUIRKS_USB_GUID "FuUsbDevice:guid"
Adds an extra GUID for a specific hardware device. If the value provided is not already a suitable GUID, it will be converted to one.
|
the USB device ID, e.g. `USB\VID_0763&PID_2806` |
|
the GUID, e.g. `537f7800-8529-5656-b2fa-b0901fe91696` |
Since 1.0.3
#define FU_QUIRKS_USB_VERSION "FuUsbDevice:version"
Sets a version for a specific hardware device.
|
the USB device ID, e.g. `USB\VID_0763&PID_2806&REV_0001` |
|
the version number, e.g. `1.2` |
Since 1.0.3
#define FU_QUIRKS_USB_VENDOR "FuUsbDevice:vendor"
Sets a vendor name for a specific hardware device.
|
the USB device ID, e.g. `USB\VID_0763&PID_2806` |
|
the vendor, e.g. `Hughski Limited` |
Since 1.0.3