cmlb_impl.h revision c26dc428cee0f025b14a5ad03a7722f2a52f8383
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_CMLB_IMPL_H
#define _SYS_CMLB_IMPL_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* FDISK partitions - 4 primary and MAX_EXT_PARTS number of Extended
* Partitions.
*/
#if defined(_SUNOS_VTOC_8)
#elif defined(_SUNOS_VTOC_16)
#else
#error "No VTOC format defined."
#endif
#define WD_NODE 7
#define P0_RAW_DISK (NDKMAP)
#endif /* __i386 || __amd64 */
/* Driver Logging Levels */
#define CMLB_LOGMASK_ERROR 0x00000001
#define CMLB_LOGMASK_INFO 0x00000002
#define CMLB_LOGMASK_TRACE 0x00000004
#define CMLB_TRACE 0x00000001
#define CMLB_INFO 0x00000002
#define CMLB_ERROR 0x00000004
#if defined(_SUNOS_VTOC_8)
#define CMLBUNIT_SHIFT 3
#define CMLBPART_MASK 7
#elif defined(_SUNOS_VTOC_16)
#define CMLBUNIT_SHIFT 6
#define CMLBPART_MASK 63
#else
#error "No VTOC format defined."
#endif
#define TRUE 1
#define FALSE 0
/*
* Return codes of cmlb_uselabel().
*/
#define CMLB_LABEL_IS_VALID 0
#define CMLB_LABEL_IS_INVALID 1
#define CMLB_2TB_BLOCKS 0xffffffff
#define CMLB_1TB_BLOCKS 0x7fffffff
#define CMLB_EXTVTOC_LIMIT CMLB_2TB_BLOCKS
#define CMLB_OLDVTOC_LIMIT CMLB_1TB_BLOCKS
/*
* fdisk partition mapping structure
*/
struct fmap {
};
/* for cm_state */
typedef enum {
CMLB_INITED = 0,
} cmlb_state_t;
typedef enum
{
CMLB_LABEL_UNDEF = 0,
} cmlb_label_t;
#define CMLB_ALLOW_2TB_WARN 0x1
typedef struct cmlb_lun {
/* cylno is overloaded. used */
/* for starting block for EFI */
/*
* This is the HBAs current notion of the geometry of the drive,
* for HBAs that support the "geometry" property.
*/
/*
* This is the geometry of the device as reported by the MODE SENSE,
* command, Page 3 (Format Device Page) and Page 4 (Rigid Disk Drive
* Geometry Page), assuming MODE SENSE is supported by the target.
*/
/* label type based on which minor nodes were created last */
/* indicates whether vtoc label is read from media */
int cl_sys_blocksize;
/* the following are passed in at attach time */
int cl_is_removable; /* 1 is removable */
int cl_is_hotpluggable; /* 1 is hotpluggable */
int cl_alter_behavior;
char *cl_node_type; /* DDI_NT_... */
int cl_device_type; /* DTYPE_DIRECT,.. */
int cl_reserved; /* reserved efi partition # */
/*
* Flag indicating whether extended partition nodes should be created
* or not. Is set in cmlb_attach. After creating nodes in
* cmlb_read_fdisk, it will be unset.
*/
#endif /* __i386 || __amd64 */
/* certain log messages */
} cmlb_lun_t;
#ifdef __cplusplus
}
#endif
#endif /* _SYS_CMLB_IMPL_H */