mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-07 17:45:23 +00:00
Export the attribute and quirk values in libdfu
This commit is contained in:
parent
c9620ac61e
commit
d8b6d8a1f5
@ -32,65 +32,9 @@ G_BEGIN_DECLS
|
|||||||
|
|
||||||
#define DFU_DEVICE_REPLUG_TIMEOUT 5000 /* ms */
|
#define DFU_DEVICE_REPLUG_TIMEOUT 5000 /* ms */
|
||||||
|
|
||||||
/**
|
|
||||||
* DfuDeviceQuirks:
|
|
||||||
* @DFU_DEVICE_QUIRK_NONE: No device quirks
|
|
||||||
* @DFU_DEVICE_QUIRK_IGNORE_POLLTIMEOUT: Ignore the device download timeout
|
|
||||||
* @DFU_DEVICE_QUIRK_FORCE_DFU_MODE: Force DFU mode
|
|
||||||
* @DFU_DEVICE_QUIRK_IGNORE_INVALID_VERSION: Ignore invalid version numbers
|
|
||||||
* @DFU_DEVICE_QUIRK_USE_PROTOCOL_ZERO: Fix up the protocol number
|
|
||||||
* @DFU_DEVICE_QUIRK_NO_PID_CHANGE: Accept the same VID:PID when changing modes
|
|
||||||
* @DFU_DEVICE_QUIRK_NO_GET_STATUS_UPLOAD: Do not do GetStatus when uploading
|
|
||||||
* @DFU_DEVICE_QUIRK_NO_DFU_RUNTIME: No DFU runtime interface is provided
|
|
||||||
* @DFU_DEVICE_QUIRK_ATTACH_UPLOAD_DOWNLOAD: An upload or download is required for attach
|
|
||||||
* @DFU_DEVICE_QUIRK_IGNORE_RUNTIME: Device has broken DFU runtime support
|
|
||||||
*
|
|
||||||
* The workarounds for different devices.
|
|
||||||
**/
|
|
||||||
typedef enum {
|
|
||||||
DFU_DEVICE_QUIRK_NONE = 0,
|
|
||||||
DFU_DEVICE_QUIRK_IGNORE_POLLTIMEOUT = (1 << 0),
|
|
||||||
DFU_DEVICE_QUIRK_FORCE_DFU_MODE = (1 << 1),
|
|
||||||
DFU_DEVICE_QUIRK_IGNORE_INVALID_VERSION = (1 << 2),
|
|
||||||
DFU_DEVICE_QUIRK_USE_PROTOCOL_ZERO = (1 << 3),
|
|
||||||
DFU_DEVICE_QUIRK_NO_PID_CHANGE = (1 << 4),
|
|
||||||
DFU_DEVICE_QUIRK_NO_GET_STATUS_UPLOAD = (1 << 5),
|
|
||||||
DFU_DEVICE_QUIRK_NO_DFU_RUNTIME = (1 << 6),
|
|
||||||
DFU_DEVICE_QUIRK_ATTACH_UPLOAD_DOWNLOAD = (1 << 7),
|
|
||||||
DFU_DEVICE_QUIRK_IGNORE_RUNTIME = (1 << 8),
|
|
||||||
/*< private >*/
|
|
||||||
DFU_DEVICE_QUIRK_LAST
|
|
||||||
} DfuDeviceQuirks;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DfuDeviceAttributes:
|
|
||||||
* @DFU_DEVICE_ATTRIBUTE_NONE: No attributes set
|
|
||||||
* @DFU_DEVICE_ATTRIBUTE_CAN_DOWNLOAD: Can download from host->device
|
|
||||||
* @DFU_DEVICE_ATTRIBUTE_CAN_UPLOAD: Can upload from device->host
|
|
||||||
* @DFU_DEVICE_ATTRIBUTE_MANIFEST_TOL: Can answer GetStatus in manifest
|
|
||||||
* @DFU_DEVICE_ATTRIBUTE_WILL_DETACH: Will self-detach
|
|
||||||
* @DFU_DEVICE_ATTRIBUTE_CAN_ACCELERATE: Use a larger transfer size for speed
|
|
||||||
*
|
|
||||||
* The device DFU attributes.
|
|
||||||
**/
|
|
||||||
typedef enum {
|
|
||||||
DFU_DEVICE_ATTRIBUTE_NONE = 0,
|
|
||||||
DFU_DEVICE_ATTRIBUTE_CAN_DOWNLOAD = (1 << 0),
|
|
||||||
DFU_DEVICE_ATTRIBUTE_CAN_UPLOAD = (1 << 1),
|
|
||||||
DFU_DEVICE_ATTRIBUTE_MANIFEST_TOL = (1 << 2),
|
|
||||||
DFU_DEVICE_ATTRIBUTE_WILL_DETACH = (1 << 3),
|
|
||||||
DFU_DEVICE_ATTRIBUTE_CAN_ACCELERATE = (1 << 7),
|
|
||||||
/*< private >*/
|
|
||||||
DFU_DEVICE_ATTRIBUTE_LAST
|
|
||||||
} DfuDeviceAttributes;
|
|
||||||
|
|
||||||
GUsbDevice *dfu_device_get_usb_dev (DfuDevice *device);
|
GUsbDevice *dfu_device_get_usb_dev (DfuDevice *device);
|
||||||
|
|
||||||
gboolean dfu_device_has_dfuse_support (DfuDevice *device);
|
gboolean dfu_device_has_dfuse_support (DfuDevice *device);
|
||||||
gboolean dfu_device_has_attribute (DfuDevice *device,
|
|
||||||
DfuDeviceAttributes attribute);
|
|
||||||
gboolean dfu_device_has_quirk (DfuDevice *device,
|
|
||||||
DfuDeviceQuirks quirk);
|
|
||||||
|
|
||||||
void dfu_device_error_fixup (DfuDevice *device,
|
void dfu_device_error_fixup (DfuDevice *device,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
|
@ -49,6 +49,58 @@ typedef enum {
|
|||||||
DFU_DEVICE_OPEN_FLAG_LAST,
|
DFU_DEVICE_OPEN_FLAG_LAST,
|
||||||
} DfuDeviceOpenFlags;
|
} DfuDeviceOpenFlags;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DfuDeviceQuirks:
|
||||||
|
* @DFU_DEVICE_QUIRK_NONE: No device quirks
|
||||||
|
* @DFU_DEVICE_QUIRK_IGNORE_POLLTIMEOUT: Ignore the device download timeout
|
||||||
|
* @DFU_DEVICE_QUIRK_FORCE_DFU_MODE: Force DFU mode
|
||||||
|
* @DFU_DEVICE_QUIRK_IGNORE_INVALID_VERSION: Ignore invalid version numbers
|
||||||
|
* @DFU_DEVICE_QUIRK_USE_PROTOCOL_ZERO: Fix up the protocol number
|
||||||
|
* @DFU_DEVICE_QUIRK_NO_PID_CHANGE: Accept the same VID:PID when changing modes
|
||||||
|
* @DFU_DEVICE_QUIRK_NO_GET_STATUS_UPLOAD: Do not do GetStatus when uploading
|
||||||
|
* @DFU_DEVICE_QUIRK_NO_DFU_RUNTIME: No DFU runtime interface is provided
|
||||||
|
* @DFU_DEVICE_QUIRK_ATTACH_UPLOAD_DOWNLOAD: An upload or download is required for attach
|
||||||
|
* @DFU_DEVICE_QUIRK_IGNORE_RUNTIME: Device has broken DFU runtime support
|
||||||
|
*
|
||||||
|
* The workarounds for different devices.
|
||||||
|
**/
|
||||||
|
typedef enum {
|
||||||
|
DFU_DEVICE_QUIRK_NONE = 0,
|
||||||
|
DFU_DEVICE_QUIRK_IGNORE_POLLTIMEOUT = (1 << 0),
|
||||||
|
DFU_DEVICE_QUIRK_FORCE_DFU_MODE = (1 << 1),
|
||||||
|
DFU_DEVICE_QUIRK_IGNORE_INVALID_VERSION = (1 << 2),
|
||||||
|
DFU_DEVICE_QUIRK_USE_PROTOCOL_ZERO = (1 << 3),
|
||||||
|
DFU_DEVICE_QUIRK_NO_PID_CHANGE = (1 << 4),
|
||||||
|
DFU_DEVICE_QUIRK_NO_GET_STATUS_UPLOAD = (1 << 5),
|
||||||
|
DFU_DEVICE_QUIRK_NO_DFU_RUNTIME = (1 << 6),
|
||||||
|
DFU_DEVICE_QUIRK_ATTACH_UPLOAD_DOWNLOAD = (1 << 7),
|
||||||
|
DFU_DEVICE_QUIRK_IGNORE_RUNTIME = (1 << 8),
|
||||||
|
/*< private >*/
|
||||||
|
DFU_DEVICE_QUIRK_LAST
|
||||||
|
} DfuDeviceQuirks;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DfuDeviceAttributes:
|
||||||
|
* @DFU_DEVICE_ATTRIBUTE_NONE: No attributes set
|
||||||
|
* @DFU_DEVICE_ATTRIBUTE_CAN_DOWNLOAD: Can download from host->device
|
||||||
|
* @DFU_DEVICE_ATTRIBUTE_CAN_UPLOAD: Can upload from device->host
|
||||||
|
* @DFU_DEVICE_ATTRIBUTE_MANIFEST_TOL: Can answer GetStatus in manifest
|
||||||
|
* @DFU_DEVICE_ATTRIBUTE_WILL_DETACH: Will self-detach
|
||||||
|
* @DFU_DEVICE_ATTRIBUTE_CAN_ACCELERATE: Use a larger transfer size for speed
|
||||||
|
*
|
||||||
|
* The device DFU attributes.
|
||||||
|
**/
|
||||||
|
typedef enum {
|
||||||
|
DFU_DEVICE_ATTRIBUTE_NONE = 0,
|
||||||
|
DFU_DEVICE_ATTRIBUTE_CAN_DOWNLOAD = (1 << 0),
|
||||||
|
DFU_DEVICE_ATTRIBUTE_CAN_UPLOAD = (1 << 1),
|
||||||
|
DFU_DEVICE_ATTRIBUTE_MANIFEST_TOL = (1 << 2),
|
||||||
|
DFU_DEVICE_ATTRIBUTE_WILL_DETACH = (1 << 3),
|
||||||
|
DFU_DEVICE_ATTRIBUTE_CAN_ACCELERATE = (1 << 7),
|
||||||
|
/*< private >*/
|
||||||
|
DFU_DEVICE_ATTRIBUTE_LAST
|
||||||
|
} DfuDeviceAttributes;
|
||||||
|
|
||||||
struct _DfuDeviceClass
|
struct _DfuDeviceClass
|
||||||
{
|
{
|
||||||
GObjectClass parent_class;
|
GObjectClass parent_class;
|
||||||
@ -129,6 +181,11 @@ guint dfu_device_get_timeout (DfuDevice *device);
|
|||||||
gboolean dfu_device_can_upload (DfuDevice *device);
|
gboolean dfu_device_can_upload (DfuDevice *device);
|
||||||
gboolean dfu_device_can_download (DfuDevice *device);
|
gboolean dfu_device_can_download (DfuDevice *device);
|
||||||
|
|
||||||
|
gboolean dfu_device_has_attribute (DfuDevice *device,
|
||||||
|
DfuDeviceAttributes attribute);
|
||||||
|
gboolean dfu_device_has_quirk (DfuDevice *device,
|
||||||
|
DfuDeviceQuirks quirk);
|
||||||
|
|
||||||
void dfu_device_set_transfer_size (DfuDevice *device,
|
void dfu_device_set_transfer_size (DfuDevice *device,
|
||||||
guint16 transfer_size);
|
guint16 transfer_size);
|
||||||
void dfu_device_set_timeout (DfuDevice *device,
|
void dfu_device_set_timeout (DfuDevice *device,
|
||||||
|
Loading…
Reference in New Issue
Block a user