scfstate.h revision 25cf1a301a396c38e8adf52c15f537b80d2483f7
/*
* 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
*/
/*
* All Rights Reserved, Copyright (c) FUJITSU LIMITED 2006
*/
#ifndef _SCFSTATE_H
#define _SCFSTATE_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* SCF driver's software state structure
*/
typedef struct scf_state {
/* SCF device infomation pointer */
/* SCF state table address */
/* flag */
/* Register hardware register */
/* Register data access handle */
/* Register size */
/* error retry count */
/* error counter memo */
/* IOMP control area */
int instance; /* instance */
int path_status; /* IOMP path status */
int old_path_status; /* IOMP old path status */
/* Register memo */
/* SRAM driver trace memo */
/* SCF device value */
} scf_state_t;
/*
* (resource_flag) macro for resource allocate flag
*/
#define S_DID_REG1 (1 << 0)
/*
* (scf_herr) hard error code
*/
#define HERR_TESUM (1 << 0)
/* ddi_dev_regsize(), ddi_regs_map_setup register index number define */
#define REG_INDEX_SCF 0 /* SCF register */
/*
* scf_path_check()/scf_offline_check() return code
*/
#define SCF_PATH_ONLINE 0 /* SCF path exec state */
/*
* scf_cmdbusy_check() return code
*/
#define SCF_COMMAND_READY 0 /* SCF command ready state */
/*
* scf_dscp_start()/scf_dscp_stop() arg "factor" value
*/
#define FACTOR_ONLINE 0 /* Factor SCF online */
/* path status (path_status) */
#define PATH_STAT_ACTIVE 1
#define PATH_STAT_STANDBY 2
#define PATH_STAT_STOP 3
#define PATH_STAT_FAIL 4
#define PATH_STAT_DISCON 5
#define PATH_STAT_ENCAP 6
#define PATH_STAT_EMPTY 0
#ifdef __cplusplus
}
#endif
#endif /* _SCFSTATE_H */