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

#pragma once
#include <fu-input-stream.h>
/**
 * FuStructCrosEcFirstResponsePduHeaderType:
 */
typedef enum {
    /**
     * FU_STRUCT_CROS_EC_FIRST_RESPONSE_PDU_HEADER_TYPE_CR50:
     *
     * must be 0 for backwards compatibility
     */
    FU_STRUCT_CROS_EC_FIRST_RESPONSE_PDU_HEADER_TYPE_CR50,
    /**
     * FU_STRUCT_CROS_EC_FIRST_RESPONSE_PDU_HEADER_TYPE_COMMON:
     */
    FU_STRUCT_CROS_EC_FIRST_RESPONSE_PDU_HEADER_TYPE_COMMON,
}  FuStructCrosEcFirstResponsePduHeaderType;
#define FU_STRUCT_CROS_EC_FIRST_RESPONSE_PDU_HEADER_TYPE_LAST 2
/**
 * FuCrosEcUpdateExtraCmd:
 */
typedef enum {
    /**
     * FU_CROS_EC_UPDATE_EXTRA_CMD_IMMEDIATE_RESET:
     */
    FU_CROS_EC_UPDATE_EXTRA_CMD_IMMEDIATE_RESET,
    /**
     * FU_CROS_EC_UPDATE_EXTRA_CMD_JUMP_TO_RW:
     */
    FU_CROS_EC_UPDATE_EXTRA_CMD_JUMP_TO_RW,
    /**
     * FU_CROS_EC_UPDATE_EXTRA_CMD_STAY_IN_RO:
     */
    FU_CROS_EC_UPDATE_EXTRA_CMD_STAY_IN_RO,
    /**
     * FU_CROS_EC_UPDATE_EXTRA_CMD_UNLOCK_RW:
     */
    FU_CROS_EC_UPDATE_EXTRA_CMD_UNLOCK_RW,
    /**
     * FU_CROS_EC_UPDATE_EXTRA_CMD_UNLOCK_ROLLBACK:
     */
    FU_CROS_EC_UPDATE_EXTRA_CMD_UNLOCK_ROLLBACK,
    /**
     * FU_CROS_EC_UPDATE_EXTRA_CMD_INJECT_ENTROPY:
     */
    FU_CROS_EC_UPDATE_EXTRA_CMD_INJECT_ENTROPY,
    /**
     * FU_CROS_EC_UPDATE_EXTRA_CMD_PAIR_CHALLENGE:
     */
    FU_CROS_EC_UPDATE_EXTRA_CMD_PAIR_CHALLENGE,
    /**
     * FU_CROS_EC_UPDATE_EXTRA_CMD_TOUCHPAD_INFO:
     */
    FU_CROS_EC_UPDATE_EXTRA_CMD_TOUCHPAD_INFO,
    /**
     * FU_CROS_EC_UPDATE_EXTRA_CMD_TOUCHPAD_DEBUG:
     */
    FU_CROS_EC_UPDATE_EXTRA_CMD_TOUCHPAD_DEBUG,
    /**
     * FU_CROS_EC_UPDATE_EXTRA_CMD_CONSOLE_READ_INIT:
     */
    FU_CROS_EC_UPDATE_EXTRA_CMD_CONSOLE_READ_INIT,
    /**
     * FU_CROS_EC_UPDATE_EXTRA_CMD_CONSOLE_READ_NEXT:
     */
    FU_CROS_EC_UPDATE_EXTRA_CMD_CONSOLE_READ_NEXT,
}  FuCrosEcUpdateExtraCmd;
#define FU_CROS_EC_UPDATE_EXTRA_CMD_LAST 11
/**
 * FuCrosEcFirmwareUpgradeStatus:
 *
 * Each RO or RW section of the new image can be in one of the following states
 */
typedef enum {
    /**
     * FU_CROS_EC_FIRMWARE_UPGRADE_STATUS_NOT_NEEDED:
     *
     * below or equal that on the target
     */
    FU_CROS_EC_FIRMWARE_UPGRADE_STATUS_NOT_NEEDED,
    /**
     * FU_CROS_EC_FIRMWARE_UPGRADE_STATUS_NOT_POSSIBLE:
     *
     * RO is newer, but can't be transferred due to target RW shortcomings
     */
    FU_CROS_EC_FIRMWARE_UPGRADE_STATUS_NOT_POSSIBLE,
    /**
     * FU_CROS_EC_FIRMWARE_UPGRADE_STATUS_NEEDED:
     *
     * section needs to be transferred to the target
     */
    FU_CROS_EC_FIRMWARE_UPGRADE_STATUS_NEEDED,
}  FuCrosEcFirmwareUpgradeStatus;
#define FU_CROS_EC_FIRMWARE_UPGRADE_STATUS_LAST 3
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructCrosEcUpdateFrameHeader;

FuStructCrosEcUpdateFrameHeader *fu_struct_cros_ec_update_frame_header_ref(FuStructCrosEcUpdateFrameHeader *st) G_GNUC_NON_NULL(1);
void fu_struct_cros_ec_update_frame_header_unref(FuStructCrosEcUpdateFrameHeader *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCrosEcUpdateFrameHeader, fu_struct_cros_ec_update_frame_header_unref)
FuStructCrosEcUpdateFrameHeader *fu_struct_cros_ec_update_frame_header_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_cros_ec_update_frame_header_set_block_size(FuStructCrosEcUpdateFrameHeader *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_cros_ec_update_frame_header_set_cmd_block_digest(FuStructCrosEcUpdateFrameHeader *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_cros_ec_update_frame_header_set_cmd_block_base(FuStructCrosEcUpdateFrameHeader *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_CROS_EC_UPDATE_FRAME_HEADER_OFFSET_BLOCK_SIZE 0x0
#define FU_STRUCT_CROS_EC_UPDATE_FRAME_HEADER_OFFSET_CMD_BLOCK_DIGEST 0x4
#define FU_STRUCT_CROS_EC_UPDATE_FRAME_HEADER_OFFSET_CMD_BLOCK_BASE 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CROS_EC_UPDATE_FRAME_HEADER_SIZE 0xC
#endif

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

FuStructCrosEcUpdateDone *fu_struct_cros_ec_update_done_ref(FuStructCrosEcUpdateDone *st) G_GNUC_NON_NULL(1);
void fu_struct_cros_ec_update_done_unref(FuStructCrosEcUpdateDone *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCrosEcUpdateDone, fu_struct_cros_ec_update_done_unref)
FuStructCrosEcUpdateDone *fu_struct_cros_ec_update_done_new(void) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_CROS_EC_UPDATE_DONE_OFFSET_VALUE 0x0
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CROS_EC_UPDATE_DONE_SIZE 0x4
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CROS_EC_UPDATE_DONE_DEFAULT_VALUE 0xB007AB1E
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructCrosEcSignedHeaderVersion;

FuStructCrosEcSignedHeaderVersion *fu_struct_cros_ec_signed_header_version_ref(FuStructCrosEcSignedHeaderVersion *st) G_GNUC_NON_NULL(1);
void fu_struct_cros_ec_signed_header_version_unref(FuStructCrosEcSignedHeaderVersion *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCrosEcSignedHeaderVersion, fu_struct_cros_ec_signed_header_version_unref)

#ifndef __GI_SCANNER__
#define FU_STRUCT_CROS_EC_SIGNED_HEADER_VERSION_OFFSET_MINOR 0x0
#define FU_STRUCT_CROS_EC_SIGNED_HEADER_VERSION_OFFSET_MAJOR 0x4
#define FU_STRUCT_CROS_EC_SIGNED_HEADER_VERSION_OFFSET_EPOCH 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CROS_EC_SIGNED_HEADER_VERSION_SIZE 0xC
#endif

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

FuStructCrosEcFirstResponsePdu *fu_struct_cros_ec_first_response_pdu_ref(FuStructCrosEcFirstResponsePdu *st) G_GNUC_NON_NULL(1);
void fu_struct_cros_ec_first_response_pdu_unref(FuStructCrosEcFirstResponsePdu *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCrosEcFirstResponsePdu, fu_struct_cros_ec_first_response_pdu_unref)
FuStructCrosEcFirstResponsePdu *fu_struct_cros_ec_first_response_pdu_new(void) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_cros_ec_first_response_pdu_get_return_value(const FuStructCrosEcFirstResponsePdu *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuStructCrosEcFirstResponsePduHeaderType fu_struct_cros_ec_first_response_pdu_get_header_type(const FuStructCrosEcFirstResponsePdu *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_cros_ec_first_response_pdu_get_protocol_version(const FuStructCrosEcFirstResponsePdu *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_cros_ec_first_response_pdu_get_maximum_pdu_size(const FuStructCrosEcFirstResponsePdu *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_cros_ec_first_response_pdu_get_flash_protection(const FuStructCrosEcFirstResponsePdu *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_cros_ec_first_response_pdu_get_offset(const FuStructCrosEcFirstResponsePdu *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_cros_ec_first_response_pdu_get_version(const FuStructCrosEcFirstResponsePdu *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_cros_ec_first_response_pdu_set_return_value(FuStructCrosEcFirstResponsePdu *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_cros_ec_first_response_pdu_set_header_type(FuStructCrosEcFirstResponsePdu *st, FuStructCrosEcFirstResponsePduHeaderType value) G_GNUC_NON_NULL(1);
void fu_struct_cros_ec_first_response_pdu_set_protocol_version(FuStructCrosEcFirstResponsePdu *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_cros_ec_first_response_pdu_set_maximum_pdu_size(FuStructCrosEcFirstResponsePdu *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_cros_ec_first_response_pdu_set_flash_protection(FuStructCrosEcFirstResponsePdu *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_cros_ec_first_response_pdu_set_offset(FuStructCrosEcFirstResponsePdu *st, guint32 value) G_GNUC_NON_NULL(1);
gboolean fu_struct_cros_ec_first_response_pdu_set_version(FuStructCrosEcFirstResponsePdu *st, const gchar *value, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_CROS_EC_FIRST_RESPONSE_PDU_OFFSET_RETURN_VALUE 0x0
#define FU_STRUCT_CROS_EC_FIRST_RESPONSE_PDU_OFFSET_HEADER_TYPE 0x4
#define FU_STRUCT_CROS_EC_FIRST_RESPONSE_PDU_OFFSET_PROTOCOL_VERSION 0x6
#define FU_STRUCT_CROS_EC_FIRST_RESPONSE_PDU_OFFSET_MAXIMUM_PDU_SIZE 0x8
#define FU_STRUCT_CROS_EC_FIRST_RESPONSE_PDU_OFFSET_FLASH_PROTECTION 0xC
#define FU_STRUCT_CROS_EC_FIRST_RESPONSE_PDU_OFFSET_OFFSET 0x10
#define FU_STRUCT_CROS_EC_FIRST_RESPONSE_PDU_OFFSET_VERSION 0x14
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CROS_EC_FIRST_RESPONSE_PDU_SIZE_VERSION 0x20
#define FU_STRUCT_CROS_EC_FIRST_RESPONSE_PDU_N_ELEMENTS_VERSION 32
#define FU_STRUCT_CROS_EC_FIRST_RESPONSE_PDU_SIZE 0x3C
#endif

#ifndef __GI_SCANNER__
#endif
