badsec.h (7c478bd9) badsec.h (342440ec)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
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.
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance 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/*
7 *
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.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21
22/*
24 * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
26 *
27 * copyright (c) 1990, 1991 UNIX System Laboratories, Inc.
28 * copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T
29 * All Rights Reserved
30 */
31
32#ifndef _BADSEC_H
33#define _BADSEC_H
34
24 * Use is subject to license terms.
25 *
26 * copyright (c) 1990, 1991 UNIX System Laboratories, Inc.
27 * copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T
28 * All Rights Reserved
29 */
30
31#ifndef _BADSEC_H
32#define _BADSEC_H
33
35#pragma ident "%Z%%M% %I% %E% SMI"
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41#define BADSECFILE "/etc/scsi/badsec"
42#define FAILURE 1
43#define SUCCESS 0
44
45#define MAXBLENT 4
46struct badsec_lst {
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38#define BADSECFILE "/etc/scsi/badsec"
39#define FAILURE 1
40#define SUCCESS 0
41
42#define MAXBLENT 4
43struct badsec_lst {
47 int bl_cnt;
44 uint_t bl_cnt;
48 struct badsec_lst *bl_nxt;
45 struct badsec_lst *bl_nxt;
49 int bl_sec[MAXBLENT];
46 uint_t bl_sec[MAXBLENT];
50};
51
52#define BADSLSZ sizeof (struct badsec_lst)
53#define BFI_FORMAT 0
54#define ATA_FORMAT 1
55
56#define ALTS_ADDPART 0x1 /* add alternate partition */
57struct alts_mempart { /* incore alts partition info */
58 int ap_flag; /* flag for alternate partition */
59 struct alts_parttbl *ap_tblp; /* alts partition table */
47};
48
49#define BADSLSZ sizeof (struct badsec_lst)
50#define BFI_FORMAT 0
51#define ATA_FORMAT 1
52
53#define ALTS_ADDPART 0x1 /* add alternate partition */
54struct alts_mempart { /* incore alts partition info */
55 int ap_flag; /* flag for alternate partition */
56 struct alts_parttbl *ap_tblp; /* alts partition table */
60 int ap_tbl_secsiz; /* alts parttbl sector size */
57 uint_t ap_tbl_secsiz; /* alts parttbl sector size */
61 uchar_t *ap_memmapp; /* incore alternate sector map */
62 uchar_t *ap_mapp; /* alternate sector map */
58 uchar_t *ap_memmapp; /* incore alternate sector map */
59 uchar_t *ap_mapp; /* alternate sector map */
63 int ap_map_secsiz; /* alts partmap sector size */
64 int ap_map_sectot; /* alts partmap # sector */
60 uint_t ap_map_secsiz; /* alts partmap sector size */
61 uint_t ap_map_sectot; /* alts partmap # sector */
65 struct alts_ent *ap_entp; /* alternate sector entry table */
62 struct alts_ent *ap_entp; /* alternate sector entry table */
66 int ap_ent_secsiz; /* alts entry sector size */
63 uint_t ap_ent_secsiz; /* alts entry sector size */
67 struct alts_ent *ap_gbadp; /* growing badsec entry table */
64 struct alts_ent *ap_gbadp; /* growing badsec entry table */
68 int ap_gbadcnt; /* growing bad sector count */
69 struct partition part; /* alts partition configuration */
65 uint_t ap_gbadcnt; /* growing bad sector count */
66 struct dkl_partition part; /* alts partition configuration */
70};
71
72/* size of incore alternate partition memory structure */
73#define ALTS_MEMPART_SIZE sizeof (struct alts_mempart)
74
75struct altsectbl { /* working alts info */
76 struct alts_ent *ast_entp; /* alternate sector entry table */
67};
68
69/* size of incore alternate partition memory structure */
70#define ALTS_MEMPART_SIZE sizeof (struct alts_mempart)
71
72struct altsectbl { /* working alts info */
73 struct alts_ent *ast_entp; /* alternate sector entry table */
77 int ast_entused; /* entry used */
74 uint_t ast_entused; /* entry used */
78 struct alt_info *ast_alttblp; /* alts info */
75 struct alt_info *ast_alttblp; /* alts info */
79 int ast_altsiz; /* size of alts info */
76 uint_t ast_altsiz; /* size of alts info */
80 struct alts_ent *ast_gbadp; /* growing bad sector entry ptr */
77 struct alts_ent *ast_gbadp; /* growing bad sector entry ptr */
81 int ast_gbadcnt; /* growing bad sector entry cnt */
78 uint_t ast_gbadcnt; /* growing bad sector entry cnt */
82};
83/* size of incore alternate partition memory structure */
84#define ALTSECTBL_SIZE sizeof (struct altsectbl)
85
86/* macro definitions */
79};
80/* size of incore alternate partition memory structure */
81#define ALTSECTBL_SIZE sizeof (struct altsectbl)
82
83/* macro definitions */
87#define byte_to_secsiz(APSIZE, BPS) (daddr_t) \
84#define byte_to_secsiz(APSIZE, BPS) (uint_t) \
88 ((((APSIZE) + (BPS) - 1) \
89 / (uint_t)(BPS)) * (BPS))
90
91#ifdef __cplusplus
92}
93#endif
94
95#endif /* _BADSEC_H */
85 ((((APSIZE) + (BPS) - 1) \
86 / (uint_t)(BPS)) * (BPS))
87
88#ifdef __cplusplus
89}
90#endif
91
92#endif /* _BADSEC_H */