linux/include/uapi/linux/fdreg.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _LINUX_FDREG_H
#define _LINUX_FDREG_H
/*
 * This file contains some defines for the floppy disk controller.
 * Various sources. Mostly "IBM Microcomputers: A Programmers
 * Handbook", Sanches and Canton.
 */

/* 82077's auxiliary status registers A & B (R) */
#define FD_SRA
#define FD_SRB

/* Digital Output Register */
#define FD_DOR

/* 82077's tape drive register (R/W) */
#define FD_TDR

/* 82077's data rate select register (W) */
#define FD_DSR

/* Fd controller regs. S&C, about page 340 */
#define FD_STATUS
#define FD_DATA

/* Digital Input Register (read) */
#define FD_DIR

/* Diskette Control Register (write)*/
#define FD_DCR

/* Bits of main status register */
#define STATUS_BUSYMASK
#define STATUS_BUSY
#define STATUS_DMA
#define STATUS_DIR
#define STATUS_READY

/* Bits of FD_ST0 */
#define ST0_DS
#define ST0_HA
#define ST0_NR
#define ST0_ECE
#define ST0_SE
#define ST0_INTR

/* Bits of FD_ST1 */
#define ST1_MAM
#define ST1_WP
#define ST1_ND
#define ST1_OR
#define ST1_CRC
#define ST1_EOC

/* Bits of FD_ST2 */
#define ST2_MAM
#define ST2_BC
#define ST2_SNS
#define ST2_SEH
#define ST2_WC
#define ST2_CRC
#define ST2_CM

/* Bits of FD_ST3 */
#define ST3_HA
#define ST3_DS
#define ST3_TZ
#define ST3_RY
#define ST3_WP
#define ST3_FT

/* Values for FD_COMMAND */
#define FD_RECALIBRATE
#define FD_SEEK
#define FD_READ
#define FD_WRITE
#define FD_SENSEI
#define FD_SPECIFY
#define FD_FORMAT
#define FD_VERSION
#define FD_CONFIGURE
#define FD_PERPENDICULAR
#define FD_GETSTATUS
#define FD_DUMPREGS
#define FD_READID
#define FD_UNLOCK
#define FD_LOCK
#define FD_RSEEK_OUT
#define FD_RSEEK_IN

/* the following commands are new in the 82078. They are not used in the
 * floppy driver, except the first three. These commands may be useful for apps
 * which use the FDRAWCMD interface. For doc, get the 82078 spec sheets at
 * http://www.intel.com/design/archives/periphrl/docs/29046803.htm */

#define FD_PARTID
#define FD_SAVE
#define FD_DRIVESPEC

#define FD_RESTORE
#define FD_POWERDOWN
#define FD_FORMAT_N_WRITE
#define FD_OPTION

/* DMA commands */
#define DMA_READ
#define DMA_WRITE

/* FDC version return types */
#define FDC_NONE
#define FDC_UNKNOWN
#define FDC_8272A
#define FDC_765ED
#define FDC_82072
#define FDC_82072A
#define FDC_82077_ORIG
#define FDC_82077
#define FDC_82078_UNKN
#define FDC_82078
#define FDC_82078_1
#define FDC_S82078B
#define FDC_87306

/*
 * Beware: the fdc type list is roughly sorted by increasing features.
 * Presence of features is tested by comparing the FDC version id with the
 * "oldest" version that has the needed feature.
 * If during FDC detection, an obscure test fails late in the sequence, don't
 * assign FDC_UNKNOWN. Else the FDC will be treated as a dumb 8272a, or worse.
 * This is especially true if the tests are unneeded.
 */

#define FD_RESET_DELAY
#endif