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

#pragma once
#include <fu-input-stream.h>
/**
 * FuFwid:
 */
typedef enum {
    /**
     * FU_FWID_ATOM_CSM:
     */
    FU_FWID_ATOM_CSM = 0x1,
    /**
     * FU_FWID_PARTITION_A_L2:
     */
    FU_FWID_PARTITION_A_L2 = 0x014D,
    /**
     * FU_FWID_PARTITION_B_L2:
     */
    FU_FWID_PARTITION_B_L2 = 0x014E,
    /**
     * FU_FWID_ISH_A:
     */
    FU_FWID_ISH_A = 0x013C,
    /**
     * FU_FWID_ISH_B:
     */
    FU_FWID_ISH_B = 0x013D,
}  FuFwid;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructEfs;

FuStructEfs *fu_struct_efs_ref(FuStructEfs *st) G_GNUC_NON_NULL(1);
void fu_struct_efs_unref(FuStructEfs *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructEfs, fu_struct_efs_unref)
FuStructEfs *fu_struct_efs_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_efs_get_signature(const FuStructEfs *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_efs_get_psp_dir_loc(const FuStructEfs *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_EFS_OFFSET_SIGNATURE 0x0
#define FU_STRUCT_EFS_OFFSET_PSP_DIR_LOC 0x14
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_EFS_SIZE 0x54
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_EFS_DEFAULT_SIGNATURE 0x55aa55aa
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructPspDir;

FuStructPspDir *fu_struct_psp_dir_ref(FuStructPspDir *st) G_GNUC_NON_NULL(1);
void fu_struct_psp_dir_unref(FuStructPspDir *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructPspDir, fu_struct_psp_dir_unref)
FuStructPspDir *fu_struct_psp_dir_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_psp_dir_validate_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_psp_dir_get_checksum(const FuStructPspDir *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_psp_dir_get_total_entries(const FuStructPspDir *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_PSP_DIR_OFFSET_COOKIE 0x0
#define FU_STRUCT_PSP_DIR_OFFSET_CHECKSUM 0x4
#define FU_STRUCT_PSP_DIR_OFFSET_TOTAL_ENTRIES 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_PSP_DIR_SIZE_COOKIE 0x4
#define FU_STRUCT_PSP_DIR_N_ELEMENTS_COOKIE 4
#define FU_STRUCT_PSP_DIR_SIZE 0x10
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_PSP_DIR_DEFAULT_COOKIE "$PSP"
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructPspDirTable;

FuStructPspDirTable *fu_struct_psp_dir_table_ref(FuStructPspDirTable *st) G_GNUC_NON_NULL(1);
void fu_struct_psp_dir_table_unref(FuStructPspDirTable *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructPspDirTable, fu_struct_psp_dir_table_unref)
FuStructPspDirTable *fu_struct_psp_dir_table_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_psp_dir_table_get_fw_id(const FuStructPspDirTable *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_psp_dir_table_get_size(const FuStructPspDirTable *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint64 fu_struct_psp_dir_table_get_loc(const FuStructPspDirTable *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_PSP_DIR_TABLE_OFFSET_FW_ID 0x0
#define FU_STRUCT_PSP_DIR_TABLE_OFFSET_SIZE 0x4
#define FU_STRUCT_PSP_DIR_TABLE_OFFSET_LOC 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_PSP_DIR_TABLE_SIZE 0x10
#endif

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

FuStructImageSlotHeader *fu_struct_image_slot_header_ref(FuStructImageSlotHeader *st) G_GNUC_NON_NULL(1);
void fu_struct_image_slot_header_unref(FuStructImageSlotHeader *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructImageSlotHeader, fu_struct_image_slot_header_unref)
FuStructImageSlotHeader *fu_struct_image_slot_header_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_image_slot_header_get_checksum(const FuStructImageSlotHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_image_slot_header_get_boot_priority(const FuStructImageSlotHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_image_slot_header_get_update_retries(const FuStructImageSlotHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_image_slot_header_get_glitch_retries(const FuStructImageSlotHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_image_slot_header_get_fw_id(const FuStructImageSlotHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_image_slot_header_get_loc(const FuStructImageSlotHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_image_slot_header_get_psp_id(const FuStructImageSlotHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_image_slot_header_get_slot_max_size(const FuStructImageSlotHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_image_slot_header_get_loc_csm(const FuStructImageSlotHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_IMAGE_SLOT_HEADER_OFFSET_CHECKSUM 0x0
#define FU_STRUCT_IMAGE_SLOT_HEADER_OFFSET_BOOT_PRIORITY 0x4
#define FU_STRUCT_IMAGE_SLOT_HEADER_OFFSET_UPDATE_RETRIES 0x8
#define FU_STRUCT_IMAGE_SLOT_HEADER_OFFSET_GLITCH_RETRIES 0xC
#define FU_STRUCT_IMAGE_SLOT_HEADER_OFFSET_FW_ID 0xD
#define FU_STRUCT_IMAGE_SLOT_HEADER_OFFSET_LOC 0x10
#define FU_STRUCT_IMAGE_SLOT_HEADER_OFFSET_PSP_ID 0x14
#define FU_STRUCT_IMAGE_SLOT_HEADER_OFFSET_SLOT_MAX_SIZE 0x18
#define FU_STRUCT_IMAGE_SLOT_HEADER_OFFSET_LOC_CSM 0x1C
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_IMAGE_SLOT_HEADER_SIZE 0x20
#endif

#ifndef __GI_SCANNER__
#endif
