1*55098Storek /*
2*55098Storek  * Copyright (c) 1992 The Regents of the University of California.
3*55098Storek  * All rights reserved.
4*55098Storek  *
5*55098Storek  * This software was developed by the Computer Systems Engineering group
6*55098Storek  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7*55098Storek  * contributed to Berkeley.
8*55098Storek  *
9*55098Storek  * %sccs.include.redist.c%
10*55098Storek  *
11*55098Storek  *	@(#)sun_disklabel.h	7.1 (Berkeley) 07/13/92
12*55098Storek  *
13*55098Storek  * from: $Header: sun_disklabel.h,v 1.4 92/06/17 07:04:13 torek Exp $
14*55098Storek  */
15*55098Storek 
16*55098Storek /*
17*55098Storek  * SunOS disk label layout (only relevant portions discovered here).
18*55098Storek  */
19*55098Storek 
20*55098Storek #define	SUN_DKMAGIC	55998
21*55098Storek 
22*55098Storek /* These are the guys that Sun's dkinfo needs... */
23*55098Storek #define DKIOCGGEOM	_IOR('d', 2, struct sun_dkgeom)	/* geometry info */
24*55098Storek #define DKIOCINFO	_IOR('d', 8, struct sun_dkctlr)	/* controller info */
25*55098Storek #define DKIOCGPART	_IOR('d', 4, struct sun_dkpart)	/* partition info */
26*55098Storek 
27*55098Storek /* geometry info */
28*55098Storek struct sun_dkgeom {
29*55098Storek 	u_short	sdkc_ncylinders;	/* data cylinders */
30*55098Storek 	u_short	sdkc_acylinders;	/* alternate cylinders */
31*55098Storek 	u_short	sdkc_xxx1;
32*55098Storek 	u_short	sdkc_ntracks;		/* tracks per cylinder */
33*55098Storek 	u_short	sdkc_xxx2;
34*55098Storek 	u_short	sdkc_nsectors;		/* sectors per track */
35*55098Storek 	u_short	sdkc_interleave;	/* interleave factor */
36*55098Storek 	u_short	sdkc_xxx3;
37*55098Storek 	u_short	sdkc_xxx4;
38*55098Storek 	u_short	sdkc_sparespercyl;	/* spare sectors per cylinder */
39*55098Storek 	u_short	sdkc_rpm;		/* rotational speed */
40*55098Storek 	u_short	sdkc_pcylinders;	/* physical cylinders */
41*55098Storek 	u_short	sdkc_xxx5[7];
42*55098Storek };
43*55098Storek 
44*55098Storek /* controller info */
45*55098Storek struct sun_dkctlr {
46*55098Storek 	int	sdkc_addr;		/* controller address */
47*55098Storek 	short	sdkc_unit;		/* unit (slave) address */
48*55098Storek 	short	sdkc_type;		/* controller type */
49*55098Storek 	short	sdkc_flags;		/* flags */
50*55098Storek };
51*55098Storek 
52*55098Storek /* partition info */
53*55098Storek struct sun_dkpart {
54*55098Storek 	long	sdkp_cyloffset;		/* starting cylinder */
55*55098Storek 	long	sdkp_nsectors;		/* number of sectors */
56*55098Storek };
57*55098Storek 
58*55098Storek struct sun_disklabel {			/* total size = 512 bytes */
59*55098Storek 	char	sl_text[128];
60*55098Storek 	char	sl_xxx1[292];
61*55098Storek 	u_short sl_rpm;			/* rotational speed */
62*55098Storek 	char	sl_xxx2[2];
63*55098Storek 	u_short sl_sparespercyl;	/* spare sectors per cylinder */
64*55098Storek 	char	sl_xxx3[4];
65*55098Storek 	u_short sl_interleave;		/* interleave factor */
66*55098Storek 	u_short	sl_ncylinders;		/* data cylinders */
67*55098Storek 	u_short	sl_acylinders;		/* alternate cylinders */
68*55098Storek 	u_short	sl_ntracks;		/* tracks per cylinder */
69*55098Storek 	u_short	sl_nsectors;		/* sectors per track */
70*55098Storek 	char	sl_xxx4[4];
71*55098Storek 	struct sun_dkpart sl_part[8];	/* partition layout */
72*55098Storek 	u_short	sl_magic;		/* == SUN_DKMAGIC */
73*55098Storek 	u_short	sl_cksum;		/* xor checksum of all shorts */
74*55098Storek };
75*55098Storek 
76*55098Storek #ifdef KERNEL
77*55098Storek /* reads sun label in sector at [cp..cp+511] and sets *lp to BSD label */
78*55098Storek int	sun_disklabel __P((caddr_t, struct disklabel *)); /* true on success */
79*55098Storek 
80*55098Storek /* compatability dk ioctl's */
81*55098Storek int	sun_dkioctl __P((struct dkdevice *, int, caddr_t, int));
82*55098Storek #endif
83