xref: /titanic_51/usr/src/uts/sun/sys/dada/impl/identify.h (revision 1e49577a7fcde812700ded04431b49d67cc57d6d)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_DADA_IMPL_IDENTIFY_H
28 #define	_SYS_DADA_IMPL_IDENTIFY_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * Implementation identify data.
38  */
39 struct	dcd_identify {
40 	ushort_t dcd_config;	/*	0  general configuration bits */
41 	ushort_t dcd_fixcyls;	/*	1  # of fixed cylinders  */
42 	ushort_t dcd_remcyls;	/*   2  # of removable cylinders */
43 	ushort_t dcd_heads;	/*   3  # of heads */
44 	ushort_t dcd_trksiz;	/*   4  # of unformatted bytes/track  */
45 	ushort_t dcd_secsiz;	/*   5  # of unformatted bytes/sector */
46 	ushort_t dcd_sectors;	/*   6  # of sectors/track */
47 	ushort_t dcd_resv1[3];	/*   7  "Vendor Unique" */
48 	char	 dcd_drvser[20];	/*  10  Serial number */
49 	ushort_t dcd_buftype;	/*  20  Buffer type */
50 	ushort_t dcd_bufsz;	/*  21  Buffer size in 512 byte incr */
51 	ushort_t dcd_ecc;	/*  22  # of ecc bytes avail on rd/wr */
52 	char	 dcd_fw[8];	/*  23  Firmware revision */
53 	char	 dcd_model[40];	/*  27  Model # */
54 	ushort_t dcd_mult1;	/*  47  Multiple command flags */
55 	ushort_t dcd_dwcap;	/*  48  Doubleword capabilities */
56 	ushort_t dcd_cap;	/*  49  Capabilities */
57 	ushort_t dcd_resv2;	/*  50  Reserved */
58 	ushort_t dcd_piomode;	/*  51  PIO timing mode */
59 	ushort_t dcd_dmamode;	/*  52  DMA timing mode */
60 	ushort_t dcd_validinfo;	/*  53  bit0: wds 54-58, bit1: 64-70 */
61 	ushort_t dcd_curcyls;	/*  54	# of current cylinders */
62 	ushort_t dcd_curheads;	/*  55  # of current heads */
63 	ushort_t dcd_cursectrk;	/*  56  # of current sectors/track */
64 	ushort_t dcd_cursccp[2];	/*  57  current sectors capacity */
65 	ushort_t dcd_mult2;	/*  59  multiple sectors info */
66 	ushort_t dcd_addrsec[2];	/*  60  LBA only: no of addr secs */
67 	ushort_t dcd_sworddma;	/*  62  single word dma modes */
68 	ushort_t dcd_dworddma;	/*  63  double word dma modes */
69 	ushort_t dcd_advpiomode;	/*  64  advanced PIO modes supported */
70 	ushort_t dcd_minmwdma;	/*  65  min multi-word dma cycle info    */
71 	ushort_t dcd_recmwdma;	/*  66  rec multi-word dma cycle info    */
72 	ushort_t dcd_minpio;	/*  67  min PIO cycle info */
73 	ushort_t dcd_minpioflow;	/*  68  min PIO cycle info w/flow ctl */
74 	ushort_t dcd_padding1[11];	/* 69 pad to 79 */
75 	ushort_t dcd_majvers;	/*  80  ATA major version supported */
76 	ushort_t dcd_padding2[4];	/* 81 pad to 84 */
77 	ushort_t dcd_features85;	/*  85  feature enabled bits */
78 	ushort_t dcd_padding3[2];	/* 86 pad to 87 */
79 	ushort_t dcd_ultra_dma;	/*  88	Ultra dma capability */
80 	ushort_t dcd_padding4[37];	/* 89 pad to 125 */
81 	ushort_t dcd_lastlun;	/* 126 last logical unit number */
82 	ushort_t dcd_padding5[129];	/* pad to 255 */
83 };
84 
85 
86 /*
87  * Indentify data size definition
88  */
89 
90 #define	SUN_IDENTSIZE	(sizeof (struct dcd_identify))
91 
92 /*
93  * The following are the bit for dcd_config field
94  */
95 #define	ATAPI_DEVICE  		(1 << 15)
96 #define	ATANON_REMOVABLE	(1 << 6)
97 
98 /*
99  * The following are the bit defined  word 64
100  */
101 #define	PIO_MODE4_MASK		0x02
102 #define	PIO_MODE3_MASK		0x01
103 
104 /*
105  * The following are bits for dcd_majvers, word 80
106  */
107 #define	IDENTIFY_80_ATAPI_4	0x0010
108 
109 /*
110  * The following are the bits for dcd_features85, word 85
111  */
112 #define	IDENTIFY_85_WCE		(1 << 5)
113 
114 #ifdef	__cplusplus
115 }
116 #endif
117 
118 #endif /* _SYS_DADA_IMPL_IDENTIFY_H */
119