#sccs "@(#)uts/kern/sys:gdioctl.h 1.3" /* Convergent Technologies - System V - May 1983 */ #ifndef gdioctl_h #define gdioctl_h #include "sys/gdisk.h" /* * Ioctl control packet */ struct gdctl { unsigned short status; /* status */ struct gdswprt params; /* description of the disk */ short dsktyp; /* the type of disk */ }; #define GDIOCTYPE 0xff00 /* same as TTY IOCTYPE - identifies type as disk, returns GDIOC */ #define GDIOC ('G'<<8) #define GDGETA (GDIOC|1) /* get gdisk structure */ #define GDSETA (GDIOC|2) /* set gdisk structure */ #define GDFORMAT (GDIOC|3) /* format track command */ #define GDDISMNT (GDIOC|4) /* flush buffers ready for removing */ /* Also turn off floppy light */ #define GDRETRY (GDIOC|8) /* turn off/on floppy retries */ #define GDCMD (GDIOC|9) /* Direct access to controller */ #define GDLOCK (GDIOC|10) /* 1 = Lock floppy, 0 = Unlock floppy */ /* GDLOCK implicit when using GDCMD */ /* * Disk types */ #define GD_WIN HD /* Winchester */ #define GD_SYQ SY /* Second winchester */ #define GD_FLP FD /* Floppy */ /* * Status bits */ #define VALID_VHB F_CT_FMT /* valid vhb has been read */ #define DRV_READY F_READY /* the disk is on line */ #define PULLED F_PULLED /* the disk was removed without permission last time */ /* The fdrq structure is used by the GDCMD ioctl for "direct" access * to the 2797 by user programs. It sits at the head of the data * buffer used for the transfer. */ struct fdrq { char cmd; /* Command byte to 2797. * Recognized commands are: * * 100xxxxx Read sector * 101xxxxx Write sector * 1100xxxx Read address * 1110xxxx Read track * 1111xxxx Write track * * Fields marked x are not checked and should * be filled in by the caller according to * information in the WD2797 data sheet. */ char cyl; /* Cylinder to 2797. Note that on a double sided * floppy a cylinder has 2 tracks. Which of these * tracks is addressed is determined by the SS0 * bit in the command byte. * On return this byte holds the 2797 track register * contents after operation completion. */ char sec; /* Sector to 2797. * On return this byte holds the 2797 sector register * contents after operation completion. */ ushort count; /* Byte count for transfer. * The returned counts 14 low order bits holds * the 2s complement of the number of words left * to do of the dma transfer. Bits 15 and 14 are * indeterminate. This means that for a successful * transfer the value should be (xx11)fff. */ char stat; /* Status byte from 2797 */ }; #endif gdioctl_h