/*
 * This file is auto-generated, do not modify!
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#pragma once
#include <fu-input-stream.h>
/**
 * FuIntelCvsDeviceState:
 *
 * CV SoC device status
 */
typedef enum {
    /**
     * FU_INTEL_CVS_DEVICE_STATE_DEVICE_OFF:
     */
    FU_INTEL_CVS_DEVICE_STATE_DEVICE_OFF = 0,
    /**
     * FU_INTEL_CVS_DEVICE_STATE_PRIVACY_ON:
     */
    FU_INTEL_CVS_DEVICE_STATE_PRIVACY_ON = 1 << 0,
    /**
     * FU_INTEL_CVS_DEVICE_STATE_DEVICE_ON:
     */
    FU_INTEL_CVS_DEVICE_STATE_DEVICE_ON = 1 << 1,
    /**
     * FU_INTEL_CVS_DEVICE_STATE_SENSOR_OWNER:
     */
    FU_INTEL_CVS_DEVICE_STATE_SENSOR_OWNER = 1 << 2,
    /**
     * FU_INTEL_CVS_DEVICE_STATE_DEVICE_DWNLD_STATE:
     */
    FU_INTEL_CVS_DEVICE_STATE_DEVICE_DWNLD_STATE = 1 << 4,
    /**
     * FU_INTEL_CVS_DEVICE_STATE_DEVICE_DWNLD_ERROR:
     */
    FU_INTEL_CVS_DEVICE_STATE_DEVICE_DWNLD_ERROR = 1 << 6,
    /**
     * FU_INTEL_CVS_DEVICE_STATE_DEVICE_DWNLD_BUSY:
     */
    FU_INTEL_CVS_DEVICE_STATE_DEVICE_DWNLD_BUSY = 1 << 7,
} G_GNUC_FLAG_ENUM FuIntelCvsDeviceState;
/**
 * FuIntelCvsSensorState:
 *
 * CVS sensor Status
 */
typedef enum {
    /**
     * FU_INTEL_CVS_SENSOR_STATE_RELEASED:
     */
    FU_INTEL_CVS_SENSOR_STATE_RELEASED = 0,
    /**
     * FU_INTEL_CVS_SENSOR_STATE_VISION_ACQUIRED:
     */
    FU_INTEL_CVS_SENSOR_STATE_VISION_ACQUIRED = 1 << 0,
    /**
     * FU_INTEL_CVS_SENSOR_STATE_IPU_ACQUIRED:
     */
    FU_INTEL_CVS_SENSOR_STATE_IPU_ACQUIRED = 1 << 1,
} G_GNUC_FLAG_ENUM FuIntelCvsSensorState;
/**
 * FuIntelCvsState:
 *
 * CVS driver Status
 */
typedef enum {
    /**
     * FU_INTEL_CVS_STATE_INIT:
     */
    FU_INTEL_CVS_STATE_INIT = 0,
    /**
     * FU_INTEL_CVS_STATE_FW_DOWNLOADING:
     */
    FU_INTEL_CVS_STATE_FW_DOWNLOADING = 1 << 1,
    /**
     * FU_INTEL_CVS_STATE_FW_FLASHING:
     */
    FU_INTEL_CVS_STATE_FW_FLASHING = 1 << 3,
    /**
     * FU_INTEL_CVS_STATE_STOPPING:
     */
    FU_INTEL_CVS_STATE_STOPPING = 1 << 7,
} G_GNUC_FLAG_ENUM FuIntelCvsState;
/**
 * FuIntelCvsCameraOwner:
 */
typedef enum {
    /**
     * FU_INTEL_CVS_CAMERA_OWNER_NONE:
     */
    FU_INTEL_CVS_CAMERA_OWNER_NONE,
    /**
     * FU_INTEL_CVS_CAMERA_OWNER_CVS:
     */
    FU_INTEL_CVS_CAMERA_OWNER_CVS,
    /**
     * FU_INTEL_CVS_CAMERA_OWNER_IPU:
     */
    FU_INTEL_CVS_CAMERA_OWNER_IPU,
}  FuIntelCvsCameraOwner;
#define FU_INTEL_CVS_CAMERA_OWNER_LAST 3
/**
 * FuStructIntelCvsDevCapability:
 */
typedef enum {
    /**
     * FU_STRUCT_INTEL_CVS_DEV_CAPABILITY_CV_POWER_DOMAIN:
     */
    FU_STRUCT_INTEL_CVS_DEV_CAPABILITY_CV_POWER_DOMAIN = 1 << 10,
    /**
     * FU_STRUCT_INTEL_CVS_DEV_CAPABILITY_NOCAMERA_DURING_FWUPDATE:
     */
    FU_STRUCT_INTEL_CVS_DEV_CAPABILITY_NOCAMERA_DURING_FWUPDATE = 1 << 11,
    /**
     * FU_STRUCT_INTEL_CVS_DEV_CAPABILITY_FWUPDATE_RESET_REQUIRED:
     */
    FU_STRUCT_INTEL_CVS_DEV_CAPABILITY_FWUPDATE_RESET_REQUIRED = 1 << 12,
    /**
     * FU_STRUCT_INTEL_CVS_DEV_CAPABILITY_PRIVACY2VISIONDRIVER:
     */
    FU_STRUCT_INTEL_CVS_DEV_CAPABILITY_PRIVACY2VISIONDRIVER = 1 << 13,
    /**
     * FU_STRUCT_INTEL_CVS_DEV_CAPABILITY_FW_ANTIROLLBACK:
     */
    FU_STRUCT_INTEL_CVS_DEV_CAPABILITY_FW_ANTIROLLBACK = 1 << 14,
    /**
     * FU_STRUCT_INTEL_CVS_DEV_CAPABILITY_HOST_MIPI_CONFIG_REQUIRED:
     */
    FU_STRUCT_INTEL_CVS_DEV_CAPABILITY_HOST_MIPI_CONFIG_REQUIRED = 1 << 15,
} G_GNUC_FLAG_ENUM FuStructIntelCvsDevCapability;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructIntelCvsFw;

FuStructIntelCvsFw *fu_struct_intel_cvs_fw_ref(FuStructIntelCvsFw *st) G_GNUC_NON_NULL(1);
void fu_struct_intel_cvs_fw_unref(FuStructIntelCvsFw *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructIntelCvsFw, fu_struct_intel_cvs_fw_unref)
guint32 fu_struct_intel_cvs_fw_get_major(const FuStructIntelCvsFw *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_intel_cvs_fw_get_minor(const FuStructIntelCvsFw *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_intel_cvs_fw_get_hotfix(const FuStructIntelCvsFw *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_intel_cvs_fw_get_build(const FuStructIntelCvsFw *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_INTEL_CVS_FW_OFFSET_MAJOR 0x0
#define FU_STRUCT_INTEL_CVS_FW_OFFSET_MINOR 0x4
#define FU_STRUCT_INTEL_CVS_FW_OFFSET_HOTFIX 0x8
#define FU_STRUCT_INTEL_CVS_FW_OFFSET_BUILD 0xC
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_INTEL_CVS_FW_SIZE 0x10
#endif

#ifndef __GI_SCANNER__
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructIntelCvsId;

FuStructIntelCvsId *fu_struct_intel_cvs_id_ref(FuStructIntelCvsId *st) G_GNUC_NON_NULL(1);
void fu_struct_intel_cvs_id_unref(FuStructIntelCvsId *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructIntelCvsId, fu_struct_intel_cvs_id_unref)
guint16 fu_struct_intel_cvs_id_get_vid(const FuStructIntelCvsId *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_intel_cvs_id_get_pid(const FuStructIntelCvsId *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_INTEL_CVS_ID_OFFSET_VID 0x0
#define FU_STRUCT_INTEL_CVS_ID_OFFSET_PID 0x2
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_INTEL_CVS_ID_SIZE 0x4
#endif

#ifndef __GI_SCANNER__
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructIntelCvsFirmwareHdr;

FuStructIntelCvsFirmwareHdr *fu_struct_intel_cvs_firmware_hdr_ref(FuStructIntelCvsFirmwareHdr *st) G_GNUC_NON_NULL(1);
void fu_struct_intel_cvs_firmware_hdr_unref(FuStructIntelCvsFirmwareHdr *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructIntelCvsFirmwareHdr, fu_struct_intel_cvs_firmware_hdr_unref)
FuStructIntelCvsFirmwareHdr *fu_struct_intel_cvs_firmware_hdr_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_intel_cvs_firmware_hdr_validate_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuStructIntelCvsFw *fu_struct_intel_cvs_firmware_hdr_get_fw_version(const FuStructIntelCvsFirmwareHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuStructIntelCvsId *fu_struct_intel_cvs_firmware_hdr_get_vid_pid(const FuStructIntelCvsFirmwareHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_intel_cvs_firmware_hdr_get_fw_offset(const FuStructIntelCvsFirmwareHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_intel_cvs_firmware_hdr_get_header_checksum(const FuStructIntelCvsFirmwareHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_INTEL_CVS_FIRMWARE_HDR_OFFSET_MAGIC_NUMBER 0x0
#define FU_STRUCT_INTEL_CVS_FIRMWARE_HDR_OFFSET_FW_VERSION 0x8
#define FU_STRUCT_INTEL_CVS_FIRMWARE_HDR_OFFSET_VID_PID 0x18
#define FU_STRUCT_INTEL_CVS_FIRMWARE_HDR_OFFSET_FW_OFFSET 0x1C
#define FU_STRUCT_INTEL_CVS_FIRMWARE_HDR_OFFSET_HEADER_CHECKSUM 0xFC
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_INTEL_CVS_FIRMWARE_HDR_SIZE_MAGIC_NUMBER 0x8
#define FU_STRUCT_INTEL_CVS_FIRMWARE_HDR_N_ELEMENTS_MAGIC_NUMBER 8
#define FU_STRUCT_INTEL_CVS_FIRMWARE_HDR_SIZE 0x100
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_INTEL_CVS_FIRMWARE_HDR_DEFAULT_MAGIC_NUMBER "VISSOCFW"
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructIntelCvsProbe;

FuStructIntelCvsProbe *fu_struct_intel_cvs_probe_ref(FuStructIntelCvsProbe *st) G_GNUC_NON_NULL(1);
void fu_struct_intel_cvs_probe_unref(FuStructIntelCvsProbe *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructIntelCvsProbe, fu_struct_intel_cvs_probe_unref)
FuStructIntelCvsProbe *fu_struct_intel_cvs_probe_parse_bytes(GBytes *blob, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_intel_cvs_probe_get_major(const FuStructIntelCvsProbe *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_intel_cvs_probe_get_minor(const FuStructIntelCvsProbe *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_intel_cvs_probe_get_hotfix(const FuStructIntelCvsProbe *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_intel_cvs_probe_get_build(const FuStructIntelCvsProbe *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_intel_cvs_probe_get_vid(const FuStructIntelCvsProbe *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_intel_cvs_probe_get_pid(const FuStructIntelCvsProbe *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_intel_cvs_probe_get_opid(const FuStructIntelCvsProbe *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuStructIntelCvsDevCapability fu_struct_intel_cvs_probe_get_dev_capabilities(const FuStructIntelCvsProbe *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_INTEL_CVS_PROBE_OFFSET_MAJOR 0x0
#define FU_STRUCT_INTEL_CVS_PROBE_OFFSET_MINOR 0x4
#define FU_STRUCT_INTEL_CVS_PROBE_OFFSET_HOTFIX 0x8
#define FU_STRUCT_INTEL_CVS_PROBE_OFFSET_BUILD 0xC
#define FU_STRUCT_INTEL_CVS_PROBE_OFFSET_VID 0x10
#define FU_STRUCT_INTEL_CVS_PROBE_OFFSET_PID 0x12
#define FU_STRUCT_INTEL_CVS_PROBE_OFFSET_OPID 0x14
#define FU_STRUCT_INTEL_CVS_PROBE_OFFSET_DEV_CAPABILITIES 0x18
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_INTEL_CVS_PROBE_SIZE 0x1C
#endif

#ifndef __GI_SCANNER__
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructIntelCvsWrite;

FuStructIntelCvsWrite *fu_struct_intel_cvs_write_ref(FuStructIntelCvsWrite *st) G_GNUC_NON_NULL(1);
void fu_struct_intel_cvs_write_unref(FuStructIntelCvsWrite *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructIntelCvsWrite, fu_struct_intel_cvs_write_unref)
FuStructIntelCvsWrite *fu_struct_intel_cvs_write_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_intel_cvs_write_set_max_download_time(FuStructIntelCvsWrite *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_intel_cvs_write_set_max_flash_time(FuStructIntelCvsWrite *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_intel_cvs_write_set_max_fwupd_retry_count(FuStructIntelCvsWrite *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_intel_cvs_write_set_fw_bin_fd(FuStructIntelCvsWrite *st, gint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_INTEL_CVS_WRITE_OFFSET_MAX_DOWNLOAD_TIME 0x0
#define FU_STRUCT_INTEL_CVS_WRITE_OFFSET_MAX_FLASH_TIME 0x4
#define FU_STRUCT_INTEL_CVS_WRITE_OFFSET_MAX_FWUPD_RETRY_COUNT 0x8
#define FU_STRUCT_INTEL_CVS_WRITE_OFFSET_FW_BIN_FD 0xC
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_INTEL_CVS_WRITE_SIZE 0x10
#endif

#ifndef __GI_SCANNER__
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructIntelCvsStatus;

FuStructIntelCvsStatus *fu_struct_intel_cvs_status_ref(FuStructIntelCvsStatus *st) G_GNUC_NON_NULL(1);
void fu_struct_intel_cvs_status_unref(FuStructIntelCvsStatus *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructIntelCvsStatus, fu_struct_intel_cvs_status_unref)
FuStructIntelCvsStatus *fu_struct_intel_cvs_status_parse_bytes(GBytes *blob, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuIntelCvsDeviceState fu_struct_intel_cvs_status_get_dev_state(const FuStructIntelCvsStatus *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_intel_cvs_status_get_fw_upd_retries(const FuStructIntelCvsStatus *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_intel_cvs_status_get_total_packets(const FuStructIntelCvsStatus *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_intel_cvs_status_get_num_packets_sent(const FuStructIntelCvsStatus *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_intel_cvs_status_get_fw_dl_finished(const FuStructIntelCvsStatus *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_intel_cvs_status_get_fw_dl_status_code(const FuStructIntelCvsStatus *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_INTEL_CVS_STATUS_OFFSET_DEV_STATE 0x0
#define FU_STRUCT_INTEL_CVS_STATUS_OFFSET_FW_UPD_RETRIES 0x1
#define FU_STRUCT_INTEL_CVS_STATUS_OFFSET_TOTAL_PACKETS 0x5
#define FU_STRUCT_INTEL_CVS_STATUS_OFFSET_NUM_PACKETS_SENT 0x9
#define FU_STRUCT_INTEL_CVS_STATUS_OFFSET_FW_DL_FINISHED 0xD
#define FU_STRUCT_INTEL_CVS_STATUS_OFFSET_FW_DL_STATUS_CODE 0xE
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_INTEL_CVS_STATUS_SIZE 0x12
#endif

#ifndef __GI_SCANNER__
#endif
