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

#pragma once
#include <fu-input-stream.h>
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructBcm57xxNvramHeader;

FuStructBcm57xxNvramHeader *fu_struct_bcm57xx_nvram_header_ref(FuStructBcm57xxNvramHeader *st) G_GNUC_NON_NULL(1);
void fu_struct_bcm57xx_nvram_header_unref(FuStructBcm57xxNvramHeader *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructBcm57xxNvramHeader, fu_struct_bcm57xx_nvram_header_unref)
FuStructBcm57xxNvramHeader *fu_struct_bcm57xx_nvram_header_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_bcm57xx_nvram_header_get_magic(const FuStructBcm57xxNvramHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_bcm57xx_nvram_header_get_phys_addr(const FuStructBcm57xxNvramHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_bcm57xx_nvram_header_get_size_wrds(const FuStructBcm57xxNvramHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_bcm57xx_nvram_header_get_offset(const FuStructBcm57xxNvramHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_bcm57xx_nvram_header_get_crc(const FuStructBcm57xxNvramHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_BCM57XX_NVRAM_HEADER_OFFSET_MAGIC 0x0
#define FU_STRUCT_BCM57XX_NVRAM_HEADER_OFFSET_PHYS_ADDR 0x4
#define FU_STRUCT_BCM57XX_NVRAM_HEADER_OFFSET_SIZE_WRDS 0x8
#define FU_STRUCT_BCM57XX_NVRAM_HEADER_OFFSET_OFFSET 0xC
#define FU_STRUCT_BCM57XX_NVRAM_HEADER_OFFSET_CRC 0x10
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_BCM57XX_NVRAM_HEADER_SIZE 0x14
#endif

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

FuStructBcm57xxNvramDirectory *fu_struct_bcm57xx_nvram_directory_ref(FuStructBcm57xxNvramDirectory *st) G_GNUC_NON_NULL(1);
void fu_struct_bcm57xx_nvram_directory_unref(FuStructBcm57xxNvramDirectory *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructBcm57xxNvramDirectory, fu_struct_bcm57xx_nvram_directory_unref)
FuStructBcm57xxNvramDirectory *fu_struct_bcm57xx_nvram_directory_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_bcm57xx_nvram_directory_get_addr(const FuStructBcm57xxNvramDirectory *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_bcm57xx_nvram_directory_get_size_wrds(const FuStructBcm57xxNvramDirectory *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_bcm57xx_nvram_directory_get_offset(const FuStructBcm57xxNvramDirectory *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_BCM57XX_NVRAM_DIRECTORY_OFFSET_ADDR 0x0
#define FU_STRUCT_BCM57XX_NVRAM_DIRECTORY_OFFSET_SIZE_WRDS 0x4
#define FU_STRUCT_BCM57XX_NVRAM_DIRECTORY_OFFSET_OFFSET 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_BCM57XX_NVRAM_DIRECTORY_SIZE 0xC
#endif

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

FuStructBcm57xxNvramInfo *fu_struct_bcm57xx_nvram_info_ref(FuStructBcm57xxNvramInfo *st) G_GNUC_NON_NULL(1);
void fu_struct_bcm57xx_nvram_info_unref(FuStructBcm57xxNvramInfo *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructBcm57xxNvramInfo, fu_struct_bcm57xx_nvram_info_unref)
FuStructBcm57xxNvramInfo *fu_struct_bcm57xx_nvram_info_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructBcm57xxNvramInfo *fu_struct_bcm57xx_nvram_info_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
GBytes *fu_struct_bcm57xx_nvram_info_to_bytes(const FuStructBcm57xxNvramInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_bcm57xx_nvram_info_get_mac_addr(const FuStructBcm57xxNvramInfo *st, guint idx) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_bcm57xx_nvram_info_get_device(const FuStructBcm57xxNvramInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_bcm57xx_nvram_info_get_vendor(const FuStructBcm57xxNvramInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_bcm57xx_nvram_info_set_mac_addr(FuStructBcm57xxNvramInfo *st, guint idx, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_bcm57xx_nvram_info_set_device(FuStructBcm57xxNvramInfo *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_bcm57xx_nvram_info_set_vendor(FuStructBcm57xxNvramInfo *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_BCM57XX_NVRAM_INFO_OFFSET_MAC_ADDR 0x0
#define FU_STRUCT_BCM57XX_NVRAM_INFO_OFFSET_DEVICE 0x2C
#define FU_STRUCT_BCM57XX_NVRAM_INFO_OFFSET_VENDOR 0x2E
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_BCM57XX_NVRAM_INFO_SIZE_MAC_ADDR 0x2C
#define FU_STRUCT_BCM57XX_NVRAM_INFO_N_ELEMENTS_MAC_ADDR 11
#define FU_STRUCT_BCM57XX_NVRAM_INFO_SIZE 0x8C
#endif

#ifndef __GI_SCANNER__
#endif
