pciehpc_impl.h revision 28cae8e27cd02e5b8df9666bb34af9786c217a1a
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_HOTPLUG_PCI_PCIEHPC_IMPL_H
#define _SYS_HOTPLUG_PCI_PCIEHPC_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* PCI Express Hot Plug slot softstate structure
*
*/
typedef struct pciehpc_slot
{
/* synchronization variable(s) for hot plug events */
typedef enum {
typedef uint32_t pciehpc_soft_state_t;
/* init_flags */
#define PCIEHPC_SOFT_STATE_UNINITIALIZED 0x01
#define PCIEHPC_SOFT_STATE_INITIALIZED 0x02
#define PCIEHPC_SOFT_STATE_INIT_HTABLE 0x04
#define PCIEHPC_SOFT_STATE_INIT_ALLOC 0x08
#define PCIEHPC_SOFT_STATE_INIT_HANDLER 0x10
#define PCIEHPC_SOFT_STATE_INIT_ENABLE 0x20
#define PCIEHPC_SOFT_STATE_INIT_BLOCK 0x40
#define PCIEHPC_SOFT_STATE_INIT_FM 0x80
#define PCIEHPC_SOFT_STATE_PCIE_DEV 0x10000
/*
* PCI Express Hotplug controller soft state structure
*/
typedef struct pciehpc
{
/* PCIE Hot Plug Controller register access */
/* slot information */
/* link capablities */
/* platform specific ops (Native HP, ACPI, etc.) */
struct pciehpc_ops {
/* initialize/setup hot plug controller hw */
/* initialize slot information structure */
/* disable hot plug interrupts/events */
/* enable hot plug interrupts/events */
/* uninitialize hot plug controller hw */
/* uninitialize slot information structure */
/* probe for HPC */
} ops;
/* platform implementation specific data if any: ACPI, CK804,... */
void *misc_data;
} pciehpc_t;
typedef struct pciehpc_ops pciehpc_ops_t;
/*
* PCI-E HPC Command Completion delay in microseconds and the max retry
* count.
*/
#define PCIEHPC_CMD_WAIT_TIME 10000
#define PCIEHPC_CMD_WAIT_RETRY 100
/*
* PCI-E HPC Dll State Change time out in seconds
*/
#define PCIEHPC_DLL_STATE_CHANGE_TIMEOUT 1
#define SLOTCTL_SUPPORTED_INTRS_MASK \
#define SLOT_STATUS_EVENTS \
/*
* function prototype defintions for common native mode functions in
* PCIEHPC module.
*/
#endif /* defined(__i386) || defined(__amd64) */
#ifdef DEBUG
extern int pciehpc_debug;
#else
#define PCIEHPC_DEBUG(args)
#define PCIEHPC_DEBUG2(args)
#define PCIEHPC_DEBUG3(args)
#endif
/* default interrupt priority for Hot Plug interrupts */
#define PCIEHPC_INTR_PRI 1
#if defined(__sparc)
#else
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_HOTPLUG_PCI_PCIEHPC_IMPL_H */