Lines Matching full:nv
270 * @param[out] nv On success, a pointer to the newly allocated NVRAM data instance.
278 bhnd_nvram_data_new(bhnd_nvram_data_class *cls, struct bhnd_nvram_data **nv, in bhnd_nvram_data_new() argument
286 return (bhnd_nvram_data_probe_classes(nv, io, NULL, 0)); in bhnd_nvram_data_new()
303 *nv = data; in bhnd_nvram_data_new()
310 * @param nv The reference to be retained.
313 bhnd_nvram_data_retain(struct bhnd_nvram_data *nv) in bhnd_nvram_data_retain() argument
315 refcount_acquire(&nv->refs); in bhnd_nvram_data_retain()
316 return (nv); in bhnd_nvram_data_retain()
325 * @param nv The reference to be released.
328 bhnd_nvram_data_release(struct bhnd_nvram_data *nv) in bhnd_nvram_data_release() argument
330 if (!refcount_release(&nv->refs)) in bhnd_nvram_data_release()
334 nv->cls->op_free(nv); in bhnd_nvram_data_release()
337 bhnd_nv_free(nv); in bhnd_nvram_data_release()
341 * Return a pointer to @p nv's data class.
343 * @param nv The NVRAM data instance to be queried.
346 bhnd_nvram_data_get_class(struct bhnd_nvram_data *nv) in bhnd_nvram_data_get_class() argument
348 return (nv->cls); in bhnd_nvram_data_get_class()
352 * Return the number of variables in @p nv.
354 * @param nv The NVRAM data to be queried.
357 bhnd_nvram_data_count(struct bhnd_nvram_data *nv) in bhnd_nvram_data_count() argument
359 return (nv->cls->op_count(nv)); in bhnd_nvram_data_count()
363 * Return a borrowed reference to the serialization options for @p nv,
366 * @param nv The NVRAM data to be queried.
369 bhnd_nvram_data_options(struct bhnd_nvram_data *nv) in bhnd_nvram_data_options() argument
371 return (nv->cls->op_options(nv)); in bhnd_nvram_data_options()
375 * Return the capability flags (@see BHND_NVRAM_DATA_CAP_*) for @p nv.
377 * @param nv The NVRAM data to be queried.
380 bhnd_nvram_data_caps(struct bhnd_nvram_data *nv) in bhnd_nvram_data_caps() argument
382 return (nv->cls->op_caps(nv)); in bhnd_nvram_data_caps()
386 * Iterate over @p nv, returning the names of subsequent variables.
388 * @param nv The NVRAM data to be iterated.
394 * variables defined in @p nv.
397 bhnd_nvram_data_next(struct bhnd_nvram_data *nv, void **cookiep) in bhnd_nvram_data_next() argument
405 if ((name = nv->cls->op_next(nv, cookiep)) == NULL) in bhnd_nvram_data_next()
412 bhnd_nvram_data_getvar_order(nv, prev, *cookiep) > 0) in bhnd_nvram_data_next()
422 * Search @p nv for a named variable, returning the variable's opaque reference
426 * bhnd_nvram_data_caps() if @p nv supports effecient name-based
429 * @param nv The NVRAM data to search.
437 bhnd_nvram_data_find(struct bhnd_nvram_data *nv, const char *name) in bhnd_nvram_data_find() argument
439 return (nv->cls->op_find(nv, name)); in bhnd_nvram_data_find()
449 bhnd_nvram_data_generic_find(struct bhnd_nvram_data *nv, const char *name) in bhnd_nvram_data_generic_find() argument
455 while ((next = bhnd_nvram_data_next(nv, &cookiep))) { in bhnd_nvram_data_generic_find()
474 * @param nv The NVRAM data.
489 bhnd_nvram_data_getvar_order(struct bhnd_nvram_data *nv, void *cookiep1, in bhnd_nvram_data_getvar_order() argument
492 return (nv->cls->op_getvar_order(nv, cookiep1, cookiep2)); in bhnd_nvram_data_getvar_order()
498 * @param nv The NVRAM data.
516 bhnd_nvram_data_getvar(struct bhnd_nvram_data *nv, void *cookiep, void *buf, in bhnd_nvram_data_getvar() argument
519 return (nv->cls->op_getvar(nv, cookiep, buf, len, type)); in bhnd_nvram_data_getvar()
531 bhnd_nvram_data_getvar_ptr_info(struct bhnd_nvram_data *nv, void *cookiep, in bhnd_nvram_data_getvar_ptr_info() argument
538 BHND_NV_ASSERT(bhnd_nvram_data_caps(nv) & BHND_NVRAM_DATA_CAP_READ_PTR, in bhnd_nvram_data_getvar_ptr_info()
542 vptr = bhnd_nvram_data_getvar_ptr(nv, cookiep, len, type); in bhnd_nvram_data_getvar_ptr_info()
549 name = bhnd_nvram_data_getvar_name(nv, cookiep); in bhnd_nvram_data_getvar_ptr_info()
553 if (bhnd_nvram_data_caps(nv) & BHND_NVRAM_DATA_CAP_DEVPATHS) in bhnd_nvram_data_getvar_ptr_info()
586 bhnd_nvram_data_generic_rp_getvar(struct bhnd_nvram_data *nv, void *cookiep, in bhnd_nvram_data_generic_rp_getvar() argument
596 BHND_NV_ASSERT(bhnd_nvram_data_caps(nv) & BHND_NVRAM_DATA_CAP_READ_PTR, in bhnd_nvram_data_generic_rp_getvar()
600 vptr = bhnd_nvram_data_getvar_ptr_info(nv, cookiep, &vlen, &vtype, in bhnd_nvram_data_generic_rp_getvar()
624 * @param nv The NVRAM data.
635 bhnd_nvram_data_copy_val(struct bhnd_nvram_data *nv, void *cookiep, in bhnd_nvram_data_copy_val() argument
638 return (nv->cls->op_copy_val(nv, cookiep, value)); in bhnd_nvram_data_copy_val()
653 bhnd_nvram_data_generic_rp_copy_val(struct bhnd_nvram_data *nv, in bhnd_nvram_data_generic_rp_copy_val() argument
661 BHND_NV_ASSERT(bhnd_nvram_data_caps(nv) & BHND_NVRAM_DATA_CAP_READ_PTR, in bhnd_nvram_data_generic_rp_copy_val()
665 vptr = bhnd_nvram_data_getvar_ptr_info(nv, cookiep, &vlen, &vtype, in bhnd_nvram_data_generic_rp_copy_val()
681 * @param nv The NVRAM data.
690 * @retval NULL if direct data access is unsupported by @p nv, or
694 bhnd_nvram_data_getvar_ptr(struct bhnd_nvram_data *nv, void *cookiep, in bhnd_nvram_data_getvar_ptr() argument
697 return (nv->cls->op_getvar_ptr(nv, cookiep, len, type)); in bhnd_nvram_data_getvar_ptr()
702 * @param nv The NVRAM data to be iterated.
710 bhnd_nvram_data_getvar_name(struct bhnd_nvram_data *nv, void *cookiep) in bhnd_nvram_data_getvar_name() argument
712 return (nv->cls->op_getvar_name(nv, cookiep)); in bhnd_nvram_data_getvar_name()
721 * @param nv The NVRAM data instance.
728 * @retval ENOENT if @p name is unrecognized by @p nv.
734 bhnd_nvram_data_filter_setvar(struct bhnd_nvram_data *nv, const char *name, in bhnd_nvram_data_filter_setvar() argument
737 return (nv->cls->op_filter_setvar(nv, name, value, result)); in bhnd_nvram_data_filter_setvar()
743 * @param nv The NVRAM data instance.
747 * @retval ENOENT if @p name is unrecognized by @p nv.
751 bhnd_nvram_data_filter_unsetvar(struct bhnd_nvram_data *nv, const char *name) in bhnd_nvram_data_filter_unsetvar() argument
753 return (nv->cls->op_filter_unsetvar(nv, name)); in bhnd_nvram_data_filter_unsetvar()