schpc.h revision 03831d35f7499c87d51205817c93e9a8d42c4bae
03831d35f7499c87d51205817c93e9a8d42c4baestevel * CDDL HEADER START
03831d35f7499c87d51205817c93e9a8d42c4baestevel * The contents of this file are subject to the terms of the
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Common Development and Distribution License (the "License").
03831d35f7499c87d51205817c93e9a8d42c4baestevel * You may not use this file except in compliance with the License.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
03831d35f7499c87d51205817c93e9a8d42c4baestevel * See the License for the specific language governing permissions
03831d35f7499c87d51205817c93e9a8d42c4baestevel * and limitations under the License.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * When distributing Covered Code, include this CDDL HEADER in each
03831d35f7499c87d51205817c93e9a8d42c4baestevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * If applicable, add the following below this CDDL HEADER, with the
03831d35f7499c87d51205817c93e9a8d42c4baestevel * fields enclosed by brackets "[]" replaced with your own identifying
03831d35f7499c87d51205817c93e9a8d42c4baestevel * information: Portions Copyright [yyyy] [name of copyright owner]
03831d35f7499c87d51205817c93e9a8d42c4baestevel * CDDL HEADER END
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Use is subject to license terms.
03831d35f7499c87d51205817c93e9a8d42c4baestevel#pragma ident "%Z%%M% %I% %E% SMI"
03831d35f7499c87d51205817c93e9a8d42c4baestevelextern "C" {
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Slot LED Descriptor
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Each hot pluggable PCI/cPCI slot has three leds. Each LED can
03831d35f7499c87d51205817c93e9a8d42c4baestevel * be on, off, or flashing.
03831d35f7499c87d51205817c93e9a8d42c4baesteveltypedef struct slot_led {
03831d35f7499c87d51205817c93e9a8d42c4baestevel * LED Commands
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Hot Plug Slot Descriptor. Each hot pluggable slot will have
03831d35f7499c87d51205817c93e9a8d42c4baestevel * a schpc_slot_t structure allocated for it.
03831d35f7499c87d51205817c93e9a8d42c4baesteveltypedef struct {
03831d35f7499c87d51205817c93e9a8d42c4baestevel hpc_slot_info_t slot_info; /* Bus Specific SlotInfo */
03831d35f7499c87d51205817c93e9a8d42c4baestevel caddr_t saved_regs_va[3]; /* Reg set virtual addresses */
03831d35f7499c87d51205817c93e9a8d42c4baestevel ddi_acc_handle_t saved_handle[3]; /* Handle from map in */
03831d35f7499c87d51205817c93e9a8d42c4baestevel * PCI/cPCI Hot Plug states for an attachment point
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCHPC_SLOTSTATE_REC_GOOD 0x01 /* Receptacle is Good */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCHPC_SLOTSTATE_OCC_GOOD 0x02 /* Occupant is Good */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCHPC_SLOTSTATE_BAD_NEXUS 0x04 /* Invalid PCI Nexus */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCHPC_SLOTSTATE_PRESENT 0x10 /* Occupant Present */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCHPC_SLOTSTATE_CONNECTED 0x100 /* Receptacle Connected */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCHPC_SLOTSTATE_CONFIGURED 0x1000 /* Occupant Configured */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCHPC_SLOTSTATE_AUTOCFG_ENABLE 0x10000 /* Auto Configuration Enabled */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCHPC_SLOTSTATE_ENUM 0x100000 /* ENUM Handling in progress */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCHPC_SLOTSTATE_EXECUTING 0x200000 /* Executing a mailbox cmd */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCHPC_SLOTSTATE_HPCINITED 0x400000 /* Ready to accept commands */
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Soft state structure definition for each schpc instance.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * There will be a single soft state stucture for each IO Board.
03831d35f7499c87d51205817c93e9a8d42c4baesteveltypedef struct schpc {
03831d35f7499c87d51205817c93e9a8d42c4baestevel uint32_t schpc_property_size; /* Size of slot-table */
03831d35f7499c87d51205817c93e9a8d42c4baestevel uint16_t schpc_number_of_slots; /* Slot on IO Board */
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Types of Hot Plug/Hot Swap Models
03831d35f7499c87d51205817c93e9a8d42c4baestevel * schpc_t's slot table, schpc_slot[], is indexed by
03831d35f7499c87d51205817c93e9a8d42c4baestevel * a value in the range [0,STARCAT_MAX_SLOTS).
03831d35f7499c87d51205817c93e9a8d42c4baestevel * That index is composed of these bit-fields:
03831d35f7499c87d51205817c93e9a8d42c4baestevel * <-- slot num -->
03831d35f7499c87d51205817c93e9a8d42c4baestevel * |----------------------------|
03831d35f7499c87d51205817c93e9a8d42c4baestevel * | expander | schizo | leaf |
03831d35f7499c87d51205817c93e9a8d42c4baestevel * |------------|--------|------|
03831d35f7499c87d51205817c93e9a8d42c4baestevel/* Extract various bit-fields from a slot table index: */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCHPC_SLOT_EXPANDER(idx) (((idx) & 0xfc) >> 2)
03831d35f7499c87d51205817c93e9a8d42c4baestevel/* Build a slot index from component bit-fields: */
03831d35f7499c87d51205817c93e9a8d42c4baestevel#define SCHPC_MAKE_SLOT_INDEX3(expander, schizo, leaf)\
03831d35f7499c87d51205817c93e9a8d42c4baestevel * Integer values for the clock-frequency property.
03831d35f7499c87d51205817c93e9a8d42c4baestevel * module-revision# for the XMITS versions
03831d35f7499c87d51205817c93e9a8d42c4baestevel#endif /* _SYS_SCHPC_H */