4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_DKTP_CMDK_H
28 #define _SYS_DKTP_CMDK_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
37 #include <sys/dktp/tgdk.h>
39 #define CMDK_UNITSHF 6
40 #define CMDK_MAXPART (1 << CMDK_UNITSHF)
43 * Model number is 40 ASCII characters
44 * Serial number is 20 ASCII characters
46 #define CMDK_HWIDLEN (64)
49 /* set during probe */
52 struct tgdk_obj
*dk_tgobjp
; /* target disk object pointer */
54 /* set during attach */
55 cmlb_handle_t dk_cmlbhandle
;
58 kmutex_t dk_mutex
; /* mutex for cmdk struct */
61 uint64_t dk_open_reg
[OTYPCNT
]; /* bit per partition: 2^6 */
62 ulong_t dk_open_lyr
[CMDK_MAXPART
]; /* OTYP_LYR cnt/partition */
63 uint64_t dk_open_exl
; /* bit per partition: 2^6 */
65 struct bbh_obj dk_bbh_obj
;
69 * protected by dk_bbh_mutex
71 krwlock_t dk_bbh_mutex
; /* bbh mutex */
72 tgdk_iob_handle dk_alts_hdl
; /* iob for V_ALTSCTR */
73 uint32_t dk_altused
; /* num entries in V_ALTSCTR */
74 uint32_t *dk_slc_cnt
; /* entries per slice */
75 struct alts_ent
**dk_slc_ent
; /* link to remap data */
78 * for power management
81 kcondvar_t dk_suspend_cv
;
83 uint32_t dk_pm_is_enabled
;
87 * Power Management definitions
89 #define CMDK_SPINDLE_UNINIT ((uint_t)(-1))
90 #define CMDK_SPINDLE_OFF 0x0
91 #define CMDK_SPINDLE_ON 0x1
93 /* common disk flags definitions */
95 #define CMDK_SUSPEND 0x2
96 #define CMDK_TGDK_OPEN 0x4
98 #define CMDKUNIT(dev) (getminor((dev)) >> CMDK_UNITSHF)
99 #define CMDKPART(dev) (getminor((dev)) & (CMDK_MAXPART - 1))
105 #endif /* _SYS_DKTP_CMDK_H */