Merge commit '2cedd8f0ecbd2b29bf0aac72bb8b7413b0326938' into merges
[unleashed.git] / usr / src / cmd / format / ctlr_ata.h
blob38e3fcdc10fc9d3734866833855ee394dfba9f5a
1 /*
2 * CDDL HEADER START
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]
19 * CDDL HEADER END
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _CTLR_ATA_H
28 #define _CTLR_ATA_H
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
34 #include <sys/buf.h>
38 * Rounded parameter, as returned in Extended Sense information
40 #define ROUNDED_PARAMETER 0x37
44 * Convert a three-byte triplet into an int
46 #define TRIPLET(u, m, l) ((int)((((u))&0xff<<16) + \
47 (((m)&0xff)<<8) + (l&0xff)))
48 #if defined(i386)
49 diskaddr_t altsec_offset; /* Alternate sector offset */
50 #endif /* defined(i386) */
52 #ifdef __STDC__
54 * Local prototypes for ANSI C compilers
57 #if defined(i386)
58 int ata_rdwr(int, int, diskaddr_t, int, caddr_t, int, int *);
59 #else /* defined(i386) */
60 static int ata_rdwr(int, int, diskaddr_t, int, caddr_t, int, int *);
61 #endif /* defined(i386) */
63 int ata_ex_man(struct defect_list *);
64 int ata_ex_grown(struct defect_list *);
65 int ata_read_defect_data(struct defect_list *, int);
66 int apply_chg_list(int, int, uchar_t *, uchar_t *, struct chg_list *);
68 #else /* ! _STDC_ */
70 #if defined(i386)
71 int ata_rdwr();
72 int ata_ex_cur();
73 #else /* defined(i386) */
74 static int ata_rdwr();
75 static int ata_ex_cur();
76 #endif /* defined(i386) */
78 int ata_ck_format();
79 int ata_ex_man();
80 int ata_ex_grown();
81 int ata_read_defect_data();
82 int apply_chg_list();
84 #endif /* __STDC__ */
86 #ifdef __cplusplus
88 #endif
90 #endif /* _CTLR_ATA_H */