disk.h revision 139825
1139825Simp/*-
250565Sphk * ----------------------------------------------------------------------------
350565Sphk * "THE BEER-WARE LICENSE" (Revision 42):
450565Sphk * <phk@FreeBSD.ORG> wrote this file.  As long as you retain this notice you
550565Sphk * can do whatever you want with this stuff. If we meet some day, and you think
650565Sphk * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
750565Sphk * ----------------------------------------------------------------------------
850565Sphk *
950565Sphk * $FreeBSD: head/sys/sys/disk.h 139825 2005-01-07 02:29:27Z imp $
1050565Sphk *
1150565Sphk */
1250565Sphk
1350565Sphk#ifndef _SYS_DISK_H_
1450565Sphk#define	_SYS_DISK_H_
1550565Sphk
1694182Sphk#include <sys/ioccom.h>
1794182Sphk
1894182Sphk#ifdef _KERNEL
1950565Sphk
20110119Sphk#ifndef _SYS_CONF_H_
21110119Sphk#include <sys/conf.h>	/* XXX: temporary to avoid breakage */
22110119Sphk#endif
23110119Sphk
24112950Sphkstruct disk;
2592719Salfredstruct disk *disk_enumerate(struct disk *disk);
26103675Sphkvoid disk_err(struct bio *bp, const char *what, int blkdone, int nl);
2750565Sphk
2894182Sphk#endif
2994182Sphk
3094282Sphk#define DIOCGSECTORSIZE	_IOR('d', 128, u_int)
3194282Sphk	/*-
3294282Sphk	 * Get the sectorsize of the device in bytes.  The sectorsize is the
3394282Sphk	 * smallest unit of data which can be transfered from this device.
3494282Sphk	 * Usually this is a power of two but it may not be. (ie: CDROM audio)
3594282Sphk	 */
3694282Sphk
3794182Sphk#define DIOCGMEDIASIZE	_IOR('d', 129, off_t)	/* Get media size in bytes */
3894282Sphk	/*-
3994282Sphk	 * Get the size of the entire device in bytes.  This should be a
4094282Sphk	 * multiple of the sectorsize.
4194282Sphk	 */
4294282Sphk
4394182Sphk#define DIOCGFWSECTORS	_IOR('d', 130, u_int)	/* Get firmware sectorcount */
4494282Sphk	/*-
4594282Sphk	 * Get the firmwares notion of number of sectors per track.  This
4694282Sphk	 * value is mostly used for compatibility with various ill designed
4794282Sphk	 * disk label formats.  Don't use it unless you have to.
4894282Sphk	 */
4994282Sphk
5094182Sphk#define DIOCGFWHEADS	_IOR('d', 131, u_int)	/* Get firmware headcount */
5194282Sphk	/*-
5294282Sphk	 * Get the firmwares notion of number of heads per cylinder.  This
5394282Sphk	 * value is mostly used for compatibility with various ill designed
5494282Sphk	 * disk label formats.  Don't use it unless you have to.
5594282Sphk	 */
5694282Sphk
5794272Sphk#define DIOCSKERNELDUMP _IOW('d', 133, u_int)	/* Set/Clear kernel dumps */
5894282Sphk	/*-
5994282Sphk	 * Enable/Disable (the argument is boolean) the device for kernel
6094282Sphk	 * core dumps.
6194282Sphk	 */
6294282Sphk
6394287Sphk#define DIOCGFRONTSTUFF _IOR('d', 134, off_t)
6494287Sphk	/*-
6594287Sphk	 * Many disk formats have some amount of space reserved at the
6694287Sphk	 * start of the disk to hold bootblocks, various disklabels and
6794287Sphk	 * similar stuff.  This ioctl returns the number of such bytes
6894287Sphk	 * which may apply to the device.
6994287Sphk	 */
7094287Sphk
7150565Sphk#endif /* _SYS_DISK_H_ */
72