155098Storek /*
2*63325Sbostic  * Copyright (c) 1992, 1993
3*63325Sbostic  *	The Regents of the University of California.  All rights reserved.
455098Storek  *
555098Storek  * This software was developed by the Computer Systems Engineering group
655098Storek  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
755098Storek  * contributed to Berkeley.
855098Storek  *
955505Sbostic  * All advertising materials mentioning features or use of this software
1055505Sbostic  * must display the following acknowledgement:
1155505Sbostic  *	This product includes software developed by the University of
1258992Storek  *	California, Lawrence Berkeley Laboratory.
1355505Sbostic  *
1455098Storek  * %sccs.include.redist.c%
1555098Storek  *
16*63325Sbostic  *	@(#)sun_disklabel.h	8.1 (Berkeley) 06/11/93
1755098Storek  *
1855098Storek  * from: $Header: sun_disklabel.h,v 1.4 92/06/17 07:04:13 torek Exp $
1955098Storek  */
2055098Storek 
2155098Storek /*
2255098Storek  * SunOS disk label layout (only relevant portions discovered here).
2355098Storek  */
2455098Storek 
2555098Storek #define	SUN_DKMAGIC	55998
2655098Storek 
2755098Storek /* These are the guys that Sun's dkinfo needs... */
2855098Storek #define DKIOCGGEOM	_IOR('d', 2, struct sun_dkgeom)	/* geometry info */
2955098Storek #define DKIOCINFO	_IOR('d', 8, struct sun_dkctlr)	/* controller info */
3055098Storek #define DKIOCGPART	_IOR('d', 4, struct sun_dkpart)	/* partition info */
3155098Storek 
3255098Storek /* geometry info */
3355098Storek struct sun_dkgeom {
3455098Storek 	u_short	sdkc_ncylinders;	/* data cylinders */
3555098Storek 	u_short	sdkc_acylinders;	/* alternate cylinders */
3655098Storek 	u_short	sdkc_xxx1;
3755098Storek 	u_short	sdkc_ntracks;		/* tracks per cylinder */
3855098Storek 	u_short	sdkc_xxx2;
3955098Storek 	u_short	sdkc_nsectors;		/* sectors per track */
4055098Storek 	u_short	sdkc_interleave;	/* interleave factor */
4155098Storek 	u_short	sdkc_xxx3;
4255098Storek 	u_short	sdkc_xxx4;
4355098Storek 	u_short	sdkc_sparespercyl;	/* spare sectors per cylinder */
4455098Storek 	u_short	sdkc_rpm;		/* rotational speed */
4555098Storek 	u_short	sdkc_pcylinders;	/* physical cylinders */
4655098Storek 	u_short	sdkc_xxx5[7];
4755098Storek };
4855098Storek 
4955098Storek /* controller info */
5055098Storek struct sun_dkctlr {
5155098Storek 	int	sdkc_addr;		/* controller address */
5255098Storek 	short	sdkc_unit;		/* unit (slave) address */
5355098Storek 	short	sdkc_type;		/* controller type */
5455098Storek 	short	sdkc_flags;		/* flags */
5555098Storek };
5655098Storek 
5755098Storek /* partition info */
5855098Storek struct sun_dkpart {
5955098Storek 	long	sdkp_cyloffset;		/* starting cylinder */
6055098Storek 	long	sdkp_nsectors;		/* number of sectors */
6155098Storek };
6255098Storek 
6355098Storek struct sun_disklabel {			/* total size = 512 bytes */
6455098Storek 	char	sl_text[128];
6555098Storek 	char	sl_xxx1[292];
6655098Storek 	u_short sl_rpm;			/* rotational speed */
6755098Storek 	char	sl_xxx2[2];
6855098Storek 	u_short sl_sparespercyl;	/* spare sectors per cylinder */
6955098Storek 	char	sl_xxx3[4];
7055098Storek 	u_short sl_interleave;		/* interleave factor */
7155098Storek 	u_short	sl_ncylinders;		/* data cylinders */
7255098Storek 	u_short	sl_acylinders;		/* alternate cylinders */
7355098Storek 	u_short	sl_ntracks;		/* tracks per cylinder */
7455098Storek 	u_short	sl_nsectors;		/* sectors per track */
7555098Storek 	char	sl_xxx4[4];
7655098Storek 	struct sun_dkpart sl_part[8];	/* partition layout */
7755098Storek 	u_short	sl_magic;		/* == SUN_DKMAGIC */
7855098Storek 	u_short	sl_cksum;		/* xor checksum of all shorts */
7955098Storek };
8055098Storek 
8155098Storek #ifdef KERNEL
8255098Storek /* reads sun label in sector at [cp..cp+511] and sets *lp to BSD label */
8355098Storek int	sun_disklabel __P((caddr_t, struct disklabel *)); /* true on success */
8455098Storek 
8555098Storek /* compatability dk ioctl's */
8655098Storek int	sun_dkioctl __P((struct dkdevice *, int, caddr_t, int));
8755098Storek #endif
88