/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 2009, Intel Corporation.
* All Rights Reserved.
*/
#ifndef _SYS_PPMVAR_H
#define _SYS_PPMVAR_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ppm_unit {
} ppm_unit_t;
/*
* driver states
*/
/*
* Check for domain operational
*/
/*
* LED constants
*/
/*
* internal form of "ppm.conf" data
*/
struct ppm_db {
};
struct ppm_cdata {
};
/*
* ppm device info
*/
struct ppm_dev {
};
/*
* ppm_dev.flags field
*/
/* from PM is in progress. */
/* changed through */
/* pm_power_has_changed path */
/* while power level change, */
/* initiated from PM is in */
/* progress. */
/*
* per domain record of device _ever_ managed by ppm
*/
struct ppm_owned {
};
/*
* domain control data structure -
* when you need to do an op for a domain, look up the op in the
* cmd member of the struct, and then perform the method on the
* path using iowr cmd with the args specified in val or val and
* mask or the speed index.
*/
struct ppm_dc {
/* one of: PPMDC_CPU_NEXT */
/* PPMDC_CPU_GO, PPMDC_FET_ON, */
/* PPMDC_FET_OFF, PPMDC_LED_ON, */
/* PPMDC_LED_OFF, PPMDC_PCI_ON, */
/* PPMDC_ENTER_S3, PPMDC_PCI_OFF */
/* PPMDC_EXIT_S3 commands */
/* one of PPMDC_KIO, PPMDC_I2CKIO, */
/* PPMDC_CPUSPEEDKIO */
union {
/* In each sub struct in union, the first three fields */
/* must be .iord, .iowr and .val and in such order. */
/* The .method field above selects a union sub struct */
/* for a particular .cmd operation. */
/* The association between .method and .cmd is platform */
/* specific, therefore described in ppm.conf file. */
/* PPMDC_KIO: simple KIO */
struct m_kio {
/* operation can be carried out */
} kio;
#ifdef sun4u
/* PPMDC_I2CKIO: KIO requires 'arg' as struct i2c_gpio */
/* (defined in i2c_client.h) */
struct m_i2ckio {
/* of register content */
/* operation can be carried out */
} i2c;
#endif
/* PPMDC_CPUSPEEDKIO, PPMDC_VCORE: cpu estar related */
/* simple KIO */
struct m_cpu {
} cpu;
} m_un;
};
/*
* ppm_dc.cmd field -
*/
/*
* ppm_dc.method field - select union element
*/
#ifdef sun4u
#endif
/*
* devices that are powered by the same source
* are grouped by this struct as a "power domain"
*/
struct ppm_domain {
};
/*
* ppm_domain.model field -
*/
/*
* ppm_domain.status field -
*/
/*
* ppm_domain.dflags field -
*/
struct ppm_domit {
char *name;
int model;
int dflags;
int status;
};
extern struct ppm_domit ppm_domit_data[];
/*
* XXppm driver-specific routines called from common code (s10)
*/
struct ppm_funcs {
};
extern ppm_domain_t *ppm_domain_p;
extern void *ppm_statep;
extern int ppm_inst;
extern void ppm_dev_init(ppm_dev_t *);
extern void ppm_dev_fini(ppm_dev_t *);
extern int ppm_create_db(dev_info_t *);
extern int ppm_claim_dev(dev_info_t *);
extern void ppm_rem_dev(dev_info_t *);
extern void ppm_init_cb(dev_info_t *);
extern ppm_domain_t *ppm_lookup_domain(char *);
extern ppm_domain_t *ppm_get_domain_by_dev(const char *);
extern int ppm_change_cpu_power(ppm_dev_t *, int);
extern int ppm_revert_cpu_power(ppm_dev_t *, int);
}
}
/*
* debug support
*/
#ifdef DEBUG
extern char *ppm_get_ctlstr(int, uint_t);
extern void ppm_print_dc(struct ppm_dc *);
} \
}
/* (s10) */
#else /* DEBUG */
#endif /* DEBUG */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_PPMVAR_H */