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

#pragma once
#include <fu-input-stream.h>
/**
 * FuAgUsbcrScsiopVendor:
 */
typedef enum {
    /**
     * FU_AG_USBCR_SCSIOP_VENDOR_EEPROM_RD:
     */
    FU_AG_USBCR_SCSIOP_VENDOR_EEPROM_RD = 0xC0,
    /**
     * FU_AG_USBCR_SCSIOP_VENDOR_EEPROM_WR:
     */
    FU_AG_USBCR_SCSIOP_VENDOR_EEPROM_WR,
    /**
     * FU_AG_USBCR_SCSIOP_VENDOR_FIRMWARE_REVISION:
     */
    FU_AG_USBCR_SCSIOP_VENDOR_FIRMWARE_REVISION = 0xC3,
    /**
     * FU_AG_USBCR_SCSIOP_VENDOR_GENERIC_CMD:
     */
    FU_AG_USBCR_SCSIOP_VENDOR_GENERIC_CMD = 0xC7,
}  FuAgUsbcrScsiopVendor;
/**
 * FuAgUsbcr:
 */
typedef enum {
    /**
     * FU_AG_USBCR_WRSR:
     */
    FU_AG_USBCR_WRSR = 0x01,
    /**
     * FU_AG_USBCR_RDSR:
     */
    FU_AG_USBCR_RDSR = 0x05,
    /**
     * FU_AG_USBCR_WREN:
     */
    FU_AG_USBCR_WREN,
    /**
     * FU_AG_USBCR_ERASE:
     */
    FU_AG_USBCR_ERASE = 0xC7,
}  FuAgUsbcr;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAgUsbcrFirmwareHdr;

FuStructAgUsbcrFirmwareHdr *fu_struct_ag_usbcr_firmware_hdr_ref(FuStructAgUsbcrFirmwareHdr *st) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_firmware_hdr_unref(FuStructAgUsbcrFirmwareHdr *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAgUsbcrFirmwareHdr, fu_struct_ag_usbcr_firmware_hdr_unref)
FuStructAgUsbcrFirmwareHdr *fu_struct_ag_usbcr_firmware_hdr_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructAgUsbcrFirmwareHdr *fu_struct_ag_usbcr_firmware_hdr_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_ag_usbcr_firmware_hdr_get_fw_addr(const FuStructAgUsbcrFirmwareHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_ag_usbcr_firmware_hdr_get_fw_len(const FuStructAgUsbcrFirmwareHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_ag_usbcr_firmware_hdr_get_emmc_ver(const FuStructAgUsbcrFirmwareHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_ag_usbcr_firmware_hdr_set_fw_addr(FuStructAgUsbcrFirmwareHdr *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_firmware_hdr_set_fw_len(FuStructAgUsbcrFirmwareHdr *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_firmware_hdr_set_emmc_ver(FuStructAgUsbcrFirmwareHdr *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_FIRMWARE_HDR_OFFSET_FW_ADDR 0xB
#define FU_STRUCT_AG_USBCR_FIRMWARE_HDR_OFFSET_FW_LEN 0xD
#define FU_STRUCT_AG_USBCR_FIRMWARE_HDR_OFFSET_EMMC_VER 0x1FE
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_FIRMWARE_HDR_SIZE 0x200
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_FIRMWARE_HDR_DEFAULT_EMMC_VER 0x123
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAgUsbcrFirmwareInfo;

FuStructAgUsbcrFirmwareInfo *fu_struct_ag_usbcr_firmware_info_ref(FuStructAgUsbcrFirmwareInfo *st) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_firmware_info_unref(FuStructAgUsbcrFirmwareInfo *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAgUsbcrFirmwareInfo, fu_struct_ag_usbcr_firmware_info_unref)
FuStructAgUsbcrFirmwareInfo *fu_struct_ag_usbcr_firmware_info_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructAgUsbcrFirmwareInfo *fu_struct_ag_usbcr_firmware_info_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_ag_usbcr_firmware_info_get_app_ver(const FuStructAgUsbcrFirmwareInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_ag_usbcr_firmware_info_get_boot_ver(const FuStructAgUsbcrFirmwareInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_ag_usbcr_firmware_info_get_emmc_support_ver(const FuStructAgUsbcrFirmwareInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_ag_usbcr_firmware_info_set_app_ver(FuStructAgUsbcrFirmwareInfo *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_firmware_info_set_boot_ver(FuStructAgUsbcrFirmwareInfo *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_firmware_info_set_emmc_support_ver(FuStructAgUsbcrFirmwareInfo *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_FIRMWARE_INFO_OFFSET_APP_VER 0x0
#define FU_STRUCT_AG_USBCR_FIRMWARE_INFO_OFFSET_BOOT_VER 0x2
#define FU_STRUCT_AG_USBCR_FIRMWARE_INFO_OFFSET_EMMC_SUPPORT_VER 0x2C
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_FIRMWARE_INFO_SIZE 0x33
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_FIRMWARE_INFO_DEFAULT_EMMC_SUPPORT_VER 0x123
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAgUsbcrFirmwareRevisionCdb;

FuStructAgUsbcrFirmwareRevisionCdb *fu_struct_ag_usbcr_firmware_revision_cdb_ref(FuStructAgUsbcrFirmwareRevisionCdb *st) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_firmware_revision_cdb_unref(FuStructAgUsbcrFirmwareRevisionCdb *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAgUsbcrFirmwareRevisionCdb, fu_struct_ag_usbcr_firmware_revision_cdb_unref)
FuStructAgUsbcrFirmwareRevisionCdb *fu_struct_ag_usbcr_firmware_revision_cdb_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_ag_usbcr_firmware_revision_cdb_set_cmd(FuStructAgUsbcrFirmwareRevisionCdb *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_firmware_revision_cdb_set_subcmd(FuStructAgUsbcrFirmwareRevisionCdb *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_firmware_revision_cdb_set_ramdest(FuStructAgUsbcrFirmwareRevisionCdb *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_firmware_revision_cdb_set_addr(FuStructAgUsbcrFirmwareRevisionCdb *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_firmware_revision_cdb_set_val(FuStructAgUsbcrFirmwareRevisionCdb *st, guint8 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_FIRMWARE_REVISION_CDB_OFFSET_OPCODE 0x0
#define FU_STRUCT_AG_USBCR_FIRMWARE_REVISION_CDB_OFFSET_SUBOPCODE 0x1
#define FU_STRUCT_AG_USBCR_FIRMWARE_REVISION_CDB_OFFSET_SIG 0x2
#define FU_STRUCT_AG_USBCR_FIRMWARE_REVISION_CDB_OFFSET_CMD 0x4
#define FU_STRUCT_AG_USBCR_FIRMWARE_REVISION_CDB_OFFSET_SUBCMD 0x5
#define FU_STRUCT_AG_USBCR_FIRMWARE_REVISION_CDB_OFFSET_SIG2 0x6
#define FU_STRUCT_AG_USBCR_FIRMWARE_REVISION_CDB_OFFSET_RAMDEST 0xA
#define FU_STRUCT_AG_USBCR_FIRMWARE_REVISION_CDB_OFFSET_ADDR 0xB
#define FU_STRUCT_AG_USBCR_FIRMWARE_REVISION_CDB_OFFSET_VAL 0xD
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_FIRMWARE_REVISION_CDB_SIZE 0x10
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_FIRMWARE_REVISION_CDB_DEFAULT_OPCODE FU_AG_USBCR_SCSIOP_VENDOR_FIRMWARE_REVISION
#define FU_STRUCT_AG_USBCR_FIRMWARE_REVISION_CDB_DEFAULT_SUBOPCODE 0x1F
#define FU_STRUCT_AG_USBCR_FIRMWARE_REVISION_CDB_DEFAULT_SIG 0x058F
#define FU_STRUCT_AG_USBCR_FIRMWARE_REVISION_CDB_DEFAULT_SIG2 0x30353846
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAgUsbcrRegCdb;

FuStructAgUsbcrRegCdb *fu_struct_ag_usbcr_reg_cdb_ref(FuStructAgUsbcrRegCdb *st) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_reg_cdb_unref(FuStructAgUsbcrRegCdb *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAgUsbcrRegCdb, fu_struct_ag_usbcr_reg_cdb_unref)
FuStructAgUsbcrRegCdb *fu_struct_ag_usbcr_reg_cdb_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_ag_usbcr_reg_cdb_set_cmd(FuStructAgUsbcrRegCdb *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_reg_cdb_set_subcmd(FuStructAgUsbcrRegCdb *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_reg_cdb_set_ramdest(FuStructAgUsbcrRegCdb *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_reg_cdb_set_addr(FuStructAgUsbcrRegCdb *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_reg_cdb_set_val(FuStructAgUsbcrRegCdb *st, guint8 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_REG_CDB_OFFSET_OPCODE 0x0
#define FU_STRUCT_AG_USBCR_REG_CDB_OFFSET_SUBOPCODE 0x1
#define FU_STRUCT_AG_USBCR_REG_CDB_OFFSET_SIG 0x2
#define FU_STRUCT_AG_USBCR_REG_CDB_OFFSET_CMD 0x4
#define FU_STRUCT_AG_USBCR_REG_CDB_OFFSET_SUBCMD 0x5
#define FU_STRUCT_AG_USBCR_REG_CDB_OFFSET_SIG2 0x6
#define FU_STRUCT_AG_USBCR_REG_CDB_OFFSET_RAMDEST 0xA
#define FU_STRUCT_AG_USBCR_REG_CDB_OFFSET_ADDR 0xB
#define FU_STRUCT_AG_USBCR_REG_CDB_OFFSET_VAL 0xD
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_REG_CDB_SIZE 0x10
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_REG_CDB_DEFAULT_OPCODE FU_AG_USBCR_SCSIOP_VENDOR_GENERIC_CMD
#define FU_STRUCT_AG_USBCR_REG_CDB_DEFAULT_SUBOPCODE 0x1F
#define FU_STRUCT_AG_USBCR_REG_CDB_DEFAULT_SIG 0x058F
#define FU_STRUCT_AG_USBCR_REG_CDB_DEFAULT_SIG2 0x30353846
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAgUsbcrResetCdb;

FuStructAgUsbcrResetCdb *fu_struct_ag_usbcr_reset_cdb_ref(FuStructAgUsbcrResetCdb *st) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_reset_cdb_unref(FuStructAgUsbcrResetCdb *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAgUsbcrResetCdb, fu_struct_ag_usbcr_reset_cdb_unref)
FuStructAgUsbcrResetCdb *fu_struct_ag_usbcr_reset_cdb_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_ag_usbcr_reset_cdb_set_cmd(FuStructAgUsbcrResetCdb *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_reset_cdb_set_subcmd(FuStructAgUsbcrResetCdb *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_reset_cdb_set_val(FuStructAgUsbcrResetCdb *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_reset_cdb_set_val2(FuStructAgUsbcrResetCdb *st, guint8 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_RESET_CDB_OFFSET_OPCODE 0x0
#define FU_STRUCT_AG_USBCR_RESET_CDB_OFFSET_SUBOPCODE 0x1
#define FU_STRUCT_AG_USBCR_RESET_CDB_OFFSET_SIG 0x2
#define FU_STRUCT_AG_USBCR_RESET_CDB_OFFSET_CMD 0x4
#define FU_STRUCT_AG_USBCR_RESET_CDB_OFFSET_SUBCMD 0x5
#define FU_STRUCT_AG_USBCR_RESET_CDB_OFFSET_SIG2 0x6
#define FU_STRUCT_AG_USBCR_RESET_CDB_OFFSET_VAL 0xA
#define FU_STRUCT_AG_USBCR_RESET_CDB_OFFSET_VAL2 0xB
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_RESET_CDB_SIZE 0x10
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_RESET_CDB_DEFAULT_OPCODE FU_AG_USBCR_SCSIOP_VENDOR_GENERIC_CMD
#define FU_STRUCT_AG_USBCR_RESET_CDB_DEFAULT_SUBOPCODE 0x1F
#define FU_STRUCT_AG_USBCR_RESET_CDB_DEFAULT_SIG 0x058F
#define FU_STRUCT_AG_USBCR_RESET_CDB_DEFAULT_SIG2 0x30353846
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAgUsbcrSpiCdb;

FuStructAgUsbcrSpiCdb *fu_struct_ag_usbcr_spi_cdb_ref(FuStructAgUsbcrSpiCdb *st) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_spi_cdb_unref(FuStructAgUsbcrSpiCdb *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAgUsbcrSpiCdb, fu_struct_ag_usbcr_spi_cdb_unref)
FuStructAgUsbcrSpiCdb *fu_struct_ag_usbcr_spi_cdb_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_ag_usbcr_spi_cdb_set_cmd(FuStructAgUsbcrSpiCdb *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_spi_cdb_set_addr(FuStructAgUsbcrSpiCdb *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_spi_cdb_set_bufsz(FuStructAgUsbcrSpiCdb *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_spi_cdb_set_tag(FuStructAgUsbcrSpiCdb *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_spi_cdb_set_valid(FuStructAgUsbcrSpiCdb *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_spi_cdb_set_spisig1(FuStructAgUsbcrSpiCdb *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_spi_cdb_set_spisig2(FuStructAgUsbcrSpiCdb *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ag_usbcr_spi_cdb_set_spicmd(FuStructAgUsbcrSpiCdb *st, guint8 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_SPI_CDB_OFFSET_OPCODE 0x0
#define FU_STRUCT_AG_USBCR_SPI_CDB_OFFSET_SUBOPCODE 0x1
#define FU_STRUCT_AG_USBCR_SPI_CDB_OFFSET_SIG 0x2
#define FU_STRUCT_AG_USBCR_SPI_CDB_OFFSET_CMD 0x4
#define FU_STRUCT_AG_USBCR_SPI_CDB_OFFSET_ADDR 0x5
#define FU_STRUCT_AG_USBCR_SPI_CDB_OFFSET_BUFSZ 0x7
#define FU_STRUCT_AG_USBCR_SPI_CDB_OFFSET_TAG 0x8
#define FU_STRUCT_AG_USBCR_SPI_CDB_OFFSET_VALID 0x9
#define FU_STRUCT_AG_USBCR_SPI_CDB_OFFSET_SPISIG1 0xA
#define FU_STRUCT_AG_USBCR_SPI_CDB_OFFSET_SPISIG2 0xB
#define FU_STRUCT_AG_USBCR_SPI_CDB_OFFSET_SPICMD 0xC
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_SPI_CDB_SIZE 0x10
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_AG_USBCR_SPI_CDB_DEFAULT_OPCODE FU_AG_USBCR_SCSIOP_VENDOR_GENERIC_CMD
#define FU_STRUCT_AG_USBCR_SPI_CDB_DEFAULT_SUBOPCODE 0x1F
#define FU_STRUCT_AG_USBCR_SPI_CDB_DEFAULT_SIG 0x058F
#endif
