Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/bhnd/nvram/bhnd_nvram_if.m
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
* @param dev The NVRAM device. | * @param dev The NVRAM device. | ||||
* @param name The NVRAM variable name. | * @param name The NVRAM variable name. | ||||
* @param[out] buf On success, the requested value will be written | * @param[out] buf On success, the requested value will be written | ||||
* to this buffer. This argment may be NULL if | * to this buffer. This argment may be NULL if | ||||
* the value is not desired. | * the value is not desired. | ||||
* @param[in,out] len The maximum capacity of @p buf. On success, | * @param[in,out] len The maximum capacity of @p buf. On success, | ||||
* will be set to the actual size of the requested | * will be set to the actual size of the requested | ||||
* value. | * value. | ||||
* @param type The data type to be written to @p buf. | |||||
* | * | ||||
* @retval 0 success | * @retval 0 success | ||||
* @retval ENOENT The requested variable was not found. | * @retval ENOENT The requested variable was not found. | ||||
* @retval ENOMEM If @p buf is non-NULL and a buffer of @p len is too | * @retval ENOMEM If @p buf is non-NULL and a buffer of @p len is too | ||||
* small to hold the requested value. | * small to hold the requested value. | ||||
* @retval ENODEV If no supported NVRAM hardware is accessible via this | * @retval ENODEV If no supported NVRAM hardware is accessible via this | ||||
* device. | * device. | ||||
* @retval EOPNOTSUPP If any coercion to @p type is unsupported. | |||||
* @retval EFTYPE If the @p name's data type cannot be coerced to @p type. | |||||
* @retval ERANGE If value coercion would overflow @p type. | |||||
* @retval non-zero If reading @p name otherwise fails, a regular unix | * @retval non-zero If reading @p name otherwise fails, a regular unix | ||||
* error code will be returned. | * error code will be returned. | ||||
*/ | */ | ||||
METHOD int getvar { | METHOD int getvar { | ||||
device_t dev; | device_t dev; | ||||
const char *name; | const char *name; | ||||
void *buf; | void *buf; | ||||
size_t *len; | size_t *len; | ||||
bhnd_nvram_type type; | |||||
}; | }; | ||||
/** | /** | ||||
* Set an NVRAM variable's local value. | * Set an NVRAM variable's value. | ||||
* | * | ||||
* No changes should be written to non-volatile storage. | * No changes will be written to non-volatile storage until explicitly | ||||
* committed. | |||||
* | * | ||||
* @param dev The NVRAM device. | * @param dev The NVRAM device. | ||||
* @param name The NVRAM variable name. | * @param name The NVRAM variable name. | ||||
* @param buf The new value. | * @param value The new value. | ||||
* @param len The size of @p buf. | * @param len The size of @p value. | ||||
* @param type The data type of @p value. | |||||
* | * | ||||
* @retval 0 success | * @retval 0 success | ||||
* @retval ENOENT The specified variable name is not recognized. | * @retval ENOENT The specified variable name is not recognized. | ||||
* @retval EINVAL If @p len does not match the expected variable size. | |||||
* @retval ENODEV If no supported NVRAM hardware is accessible via this | * @retval ENODEV If no supported NVRAM hardware is accessible via this | ||||
* device. | * device. | ||||
* @retval EOPNOTSUPP If any coercion to @p type is unsupported. | |||||
* @retval EFTYPE If the @p name's data type cannot be coerced to @p type. | |||||
* @retval ERANGE If value coercion from @p type would overflow. | |||||
* @retval non-zero If reading @p name otherwise fails, a regular unix | * @retval non-zero If reading @p name otherwise fails, a regular unix | ||||
* error code will be returned. | * error code will be returned. | ||||
*/ | */ | ||||
METHOD int setvar { | METHOD int setvar { | ||||
device_t dev; | device_t dev; | ||||
const char *name; | const char *name; | ||||
const void *buf; | const void *value; | ||||
size_t len; | size_t len; | ||||
bhnd_nvram_type type; | |||||
}; | }; |