2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _LIBPOWER_IMPL_H
2N/A#define _LIBPOWER_IMPL_H
2N/A
2N/A/*
2N/A * Internal definitions and data structures to implement libpower
2N/A */
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A#include <sys/types.h>
2N/A#include <sys/pm.h>
2N/A#include <errno.h>
2N/A#include <libuutil.h>
2N/A#include <libnvpair.h>
2N/A
2N/A#define PM_DEV_PATH "/dev/pm"
2N/A#define PM_LOG_DOMAIN "libpower"
2N/A#define PM_PROP_VALUE_AUTH "value_authorization"
2N/A#define PM_ENV_DEBUG "LIBPOWER_DEBUG"
2N/A
2N/Astruct pm_authorities_s {
2N/A pm_authority_t a_auth;
2N/A const char *a_name;
2N/A};
2N/A
2N/Aextern uu_dprintf_t *pm_log;
2N/A
2N/Achar *pm_parse_propname(char *, char **);
2N/Apm_authority_t pm_authority_next(pm_authority_t);
2N/Aboolean_t pm_get_suspendenable(void);
2N/Apm_error_t pm_kernel_listprop(nvlist_t **);
2N/Apm_error_t pm_kernel_update(nvlist_t *);
2N/Apm_error_t pm_parse_boolean(const char *, boolean_t *);
2N/Apm_error_t pm_parse_integer(const char *, int64_t *);
2N/Apm_error_t pm_result_add(nvlist_t **, pm_authority_t, const char *,
2N/A const char *, data_type_t, void *, uint_t);
2N/Apm_error_t pm_result_filter(nvlist_t **, nvlist_t *, pm_authority_t,
2N/A char **propv, uint_t propc);
2N/Apm_error_t pm_smf_add_pgname(nvlist_t *, const char *);
2N/Apm_error_t pm_smf_listprop(nvlist_t **, const char *);
2N/Apm_error_t pm_smf_setprop(nvpair_t *, const char *);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _LIBPOWER_IMPL_H */