Changeset View
Changeset View
Standalone View
Standalone View
sys/mips/broadcom/bcm_nvram_cfevar.h
- This file was moved from sys/dev/bhnd/nvram/bhnd_sprom_parser.h.
/*- | /*- | ||||
* Copyright (c) 2015-2016 Landon Fuller <landon@landonf.org> | * Copyright (c) 2015-2016 Landon Fuller <landonf@FreeBSD.org> | ||||
* All rights reserved. | * All rights reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions | * modification, are permitted provided that the following conditions | ||||
* are met: | * are met: | ||||
* 1. Redistributions of source code must retain the above copyright | * 1. Redistributions of source code must retain the above copyright | ||||
* notice, this list of conditions and the following disclaimer, | * notice, this list of conditions and the following disclaimer, | ||||
* without modification. | * without modification. | ||||
Show All 13 Lines | |||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER | ||||
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||||
* THE POSSIBILITY OF SUCH DAMAGES. | * THE POSSIBILITY OF SUCH DAMAGES. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _BHND_NVRAM_BHND_SPROM_PARSER_H_ | #ifndef _MIPS_BROADCOM_BCM_NVRAM_CFE_H_ | ||||
#define _BHND_NVRAM_BHND_SPROM_PARSER_H_ | #define _MIPS_BROADCOM_BCM_NVRAM_CFE_H_ | ||||
#include <dev/bhnd/bhnd.h> | #include <sys/param.h> | ||||
#include <sys/bus.h> | |||||
struct bhnd_sprom; | #include <dev/bhnd/nvram/bhnd_nvram.h> | ||||
#include <dev/bhnd/nvram/bhnd_nvram_store.h> | |||||
int bhnd_sprom_init(struct bhnd_sprom *sprom, struct bhnd_resource *r, | /** bhnd_nvram_cfe driver instance state. */ | ||||
bus_size_t offset); | struct bhnd_nvram_cfe_softc { | ||||
void bhnd_sprom_fini(struct bhnd_sprom *sprom); | device_t dev; | ||||
int bhnd_sprom_getvar(struct bhnd_sprom *sc, const char *name, void *buf, | struct bhnd_nvram_store *store; /**< nvram store */ | ||||
size_t *len, bhnd_nvram_type type); | |||||
int bhnd_sprom_setvar(struct bhnd_sprom *sc, const char *name, | |||||
const void *buf, size_t len, bhnd_nvram_type type); | |||||
/** | |||||
* bhnd sprom parser instance state. | |||||
*/ | |||||
struct bhnd_sprom { | |||||
device_t dev; /**< sprom parent device */ | |||||
uint8_t sp_rev; /**< sprom revision */ | |||||
struct bhnd_resource *sp_res; /**< sprom resource. */ | |||||
bus_size_t sp_res_off; /**< offset to sprom image */ | |||||
uint8_t *sp_shadow; /**< sprom shadow */ | |||||
bus_size_t sp_size_max; /**< maximum possible sprom length */ | |||||
size_t sp_size; /**< shadow size */ | |||||
size_t sp_capacity; /**< shadow buffer capacity */ | |||||
}; | }; | ||||
#endif /* _BHND_NVRAM_BHND_SPROM_PARSER_H_ */ | #endif /* _MIPS_BROADCOM_BCM_NVRAM_CFE_H_ */ |