DKIO(4S) — DEVICES AND NETWORK INTERFACES
NAME
dkio − generic disk control operations
DESCRIPTION
All Sun disk drivers support a set of ioctl(2) requests for disk formatting and labeling operations. Basic to these ioctl() requests are the definitions in /usr/include/sun/dkio.h:
/∗
∗ Structures and definitions for disk I/O control commands
∗/
/∗ Controller and disk identification ∗/
struct dk_info {
intdki_ctlr;/∗ controller address ∗/
shortdki_unit;/∗ unit (slave) address ∗/
shortdki_ctype;/∗ controller type ∗/
shortdki_flags;/∗ flags ∗/
};
/∗ controller types ∗/
#define DKC_UNKNOWN0
#define DKC_DSD52155
#define DKC_XY4506
#define DKC_ACB40007
#define DKC_MD218
#define DKC_XD705311
#define DKC_CSS12
#define DKC_NEC76513/∗ floppy on Sun386i ∗/
#define DKC_INTEL8207214
/∗ flags ∗/
#defineDKI_BAD1440x01/∗ use DEC std 144 bad sector fwding ∗/
#defineDKI_MAPTRK0x02/∗ controller does track mapping ∗/
#defineDKI_FMTTRK0x04/∗ formats only full track at a time ∗/
#defineDKI_FMTVOL0x08/∗ formats only full volume at a time ∗/
/∗ Definition of a disk’s geometry ∗/
struct dk_geom {
unsigned shortdkg_ncyl;/∗ # of data cylinders ∗/
unsigned shortdkg_acyl;/∗ # of alternate cylinders ∗/
unsigned shortdkg_bcyl;/∗ cyl offset (for fixed head area) ∗/
unsigned shortdkg_nhead;/∗ # of heads ∗/
unsigned shortdkg_bhead;/∗ head offset (for Larks, etc.) ∗/
unsigned shortdkg_nsect;/∗ # of sectors per track ∗/
unsigned shortdkg_intrlv;/∗ interleave factor ∗/
unsigned shortdkg_gap1;/∗ gap 1 size ∗/
unsigned shortdkg_gap2;/∗ gap 2 size ∗/
unsigned shortdkg_apc;/∗ alternates per cyl (SCSI only) ∗/
unsigned shortdkg_extra[9];/∗ for compatible expansion ∗/
};
/∗ Partition map (part of dk_label) ∗/
struct dk_map {
longdkl_cylno;/∗ starting cylinder ∗/
longdkl_nblk;/∗ number of blocks ∗/
};
/∗ Floppy characteristics ∗/
struct fdk_char {
u_charmedium;/∗ medium type (scsi floppy only) ∗/
inttransfer_rate;/∗ transfer rate ∗/
intncyl;/∗ number of cylinders ∗/
intnhead;/∗ number of heads ∗/
intsec_size;/∗ sector size ∗/
intsecptrack;/∗ sectors per track ∗/
intsteps;/∗ number of steps per ∗/
};
/∗ Used by FDKGETCHANGE, returned state of the sense disk change bit. ∗/
#define FDKGC_HISTORY0x01/∗ disk has changed since last call ∗/
#define FDKGC_CURRENT0x02/∗ current state of disk change ∗/
/∗ disk I/O control commands ∗/
#defineDKIOCINFO_IOR(d, 8, struct dk_info)/∗ Get info ∗/
#defineDKIOCGGEOM_IOR(d, 2, struct dk_geom)/∗ Get geometry ∗/
#defineDKIOCSGEOM_IOW(d, 3, struct dk_geom)/∗ Set geometry ∗/
#defineDKIOCGPART_IOR(d, 4, struct dk_map)/∗ Get partition info ∗/
#defineDKIOCSPART_IOW(d, 5, struct dk_map)/∗ Set partition info ∗/
#defineDKIOCWCHK_IOWR(d, 115, int)/∗ Toggle write check ∗/
/∗ floppy I/O control commands ∗/
#defineFDKIOGCHAR_IOR(d, 114, struct fdk_char)/∗ Get floppy characteristics ∗/
#defineFDKEJECT_IO(d, 112)/∗ Eject floppy ∗/
#defineFDKGETCHANGE_IOR(d, 111, int)/∗ Get disk change status ∗/
The DKIOCINFO ioctl returns a dk_info structure which tells the type of the controller and attributes about how bad-block processing is done on the controller. The DKIOCGPART and DKIOCSPART get and set the controller’s current notion of the partition table for the disk (without changing the partition table on the disk itself), while the DKIOCGGEOM and DKIOCSGEOM ioctls do similar things for the per-drive geometry information. The DKIOCWCHK enables or disables a disk’s write check capabilities. The FDKIOGCHAR ioctl returns an fdk_char structure which gives the characteristics of the floppy diskette. The FDKEJECT ioctl ejects the floppy diskette. The FDKGETCHANGE returns the status of the diskette changed signal from the floppy interface.
FILES
/usr/include/sun/dkio.h
SEE ALSO
fd(4S), ip(4P), sd(4S), xd(4S), xy(4S), dkctl(8)
Sun Release 4.1 — Last change: 24 January 1990