schpc.h revision 03831d35f7499c87d51205817c93e9a8d42c4bae
/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_SCHPC_H
#define _SYS_SCHPC_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Slot LED Descriptor
*
* be on, off, or flashing.
*/
typedef struct slot_led {
char led_power;
char led_service;
char led_fault;
char reserved;
} slot_led_t;
#define LED_OFF 0x00
#define LED_ON 0x01
#define LED_FLASH 0x02
/*
* LED Commands
*/
#define POWER_LED_ON 0x00000001
#define POWER_LED_OFF 0x00000002
#define POWER_LED_FLASH 0x00000004
#define SERVICE_LED_ON 0x00000010
#define SERVICE_LED_OFF 0x00000020
#define SERVICE_LED_FLASH 0x00000040
#define FAULT_LED_ON 0x00000100
#define FAULT_LED_OFF 0x00000200
#define FAULT_LED_FLASH 0x00000400
/*
* Hot Plug Slot Descriptor. Each hot pluggable slot will have
* a schpc_slot_t structure allocated for it.
*/
typedef struct {
int saved_size; /* Size of saved off regs */
} schpc_slot_t;
/*
*/
/*
* Soft state structure definition for each schpc instance.
* There will be a single soft state stucture for each IO Board.
*/
typedef struct schpc {
char *schpc_property; /* Ptr to slot-table */
} schpc_t;
/*
*/
#define SCHPC_HOTPLUGTYPE_NOTHOTPLUGGABLE 0
#define SCHPC_HOTPLUGTYPE_CPCIHOTPLUG 1
#define SCHPC_HOTPLUGTYPE_CPCIHOTSWAPBASIC 2
#define SCHPC_HOTPLUGTYPE_CPCIHOTSWAPFULL 3
#define SCHPC_HOTPLUGTYPE_PCIHOTPLUG 4
/*
* schpc_t's slot table, schpc_slot[], is indexed by
* a value in the range [0,STARCAT_MAX_SLOTS).
*
* That index is composed of these bit-fields:
*
* <-- slot num -->
* |----------------------------|
* | expander | schizo | leaf |
* |------------|--------|------|
* 7 2 1 0
*
*/
/* Extract various bit-fields from a slot table index: */
/* Build a slot index from component bit-fields: */
/*
* Integer values for the clock-frequency property.
*/
/*
* module-revision# for the XMITS versions
*/
#define XMITS_10 1
#define XMITS_20 2
#define XMITS_21 3
#define XMITS_30 4
#define XMITS_31 5
extern int schpc_add_pci(dev_info_t *);
extern int schpc_remove_pci(dev_info_t *);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SCHPC_H */