2009-03-04 04:28:35 +01:00
|
|
|
/****************************************************************************
|
|
|
|
****************************************************************************
|
|
|
|
***
|
|
|
|
*** This header was automatically generated from a Linux kernel header
|
|
|
|
*** of the same name, to make information necessary for userspace to
|
|
|
|
*** call into the kernel available to libc. It contains only constants,
|
|
|
|
*** structures, and macros generated from the original header, and thus,
|
|
|
|
*** contains no copyrightable information.
|
|
|
|
***
|
|
|
|
****************************************************************************
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef _LINUX_FD_H
|
|
|
|
#define _LINUX_FD_H
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#include <linux/ioctl.h>
|
|
|
|
#include <linux/compiler.h>
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
struct floppy_struct {
|
|
|
|
unsigned int size,
|
|
|
|
sect,
|
|
|
|
head,
|
|
|
|
track,
|
|
|
|
stretch;
|
|
|
|
#define FD_STRETCH 1
|
|
|
|
#define FD_SWAPSIDES 2
|
|
|
|
#define FD_ZEROBASED 4
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
unsigned char gap,
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
rate,
|
|
|
|
#define FD_2M 0x4
|
|
|
|
#define FD_SIZECODEMASK 0x38
|
|
|
|
#define FD_SIZECODE(floppy) (((((floppy)->rate&FD_SIZECODEMASK)>> 3)+ 2) %8)
|
|
|
|
#define FD_SECTSIZE(floppy) ( (floppy)->rate & FD_2M ? 512 : 128 << FD_SIZECODE(floppy) )
|
|
|
|
#define FD_PERP 0x40
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
spec1,
|
|
|
|
fmt_gap;
|
|
|
|
const char * name;
|
|
|
|
};
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDCLRPRM _IO(2, 0x41)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDSETPRM _IOW(2, 0x42, struct floppy_struct)
|
|
|
|
#define FDSETMEDIAPRM FDSETPRM
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDDEFPRM _IOW(2, 0x43, struct floppy_struct)
|
|
|
|
#define FDGETPRM _IOR(2, 0x04, struct floppy_struct)
|
|
|
|
#define FDDEFMEDIAPRM FDDEFPRM
|
|
|
|
#define FDGETMEDIAPRM FDGETPRM
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDMSGON _IO(2,0x45)
|
|
|
|
#define FDMSGOFF _IO(2,0x46)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FD_FILL_BYTE 0xF6
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
struct format_descr {
|
|
|
|
unsigned int device,head,track;
|
|
|
|
};
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDFMTBEG _IO(2,0x47)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDFMTTRK _IOW(2,0x48, struct format_descr)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDFMTEND _IO(2,0x49)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
struct floppy_max_errors {
|
|
|
|
unsigned int
|
|
|
|
abort,
|
|
|
|
read_track,
|
|
|
|
reset,
|
|
|
|
recal,
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
reporting;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
};
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDSETEMSGTRESH _IO(2,0x4a)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDFLUSH _IO(2,0x4b)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDSETMAXERRS _IOW(2, 0x4c, struct floppy_max_errors)
|
|
|
|
#define FDGETMAXERRS _IOR(2, 0x0e, struct floppy_max_errors)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
typedef char floppy_drive_name[16];
|
|
|
|
#define FDGETDRVTYP _IOR(2, 0x0f, floppy_drive_name)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
struct floppy_drive_params {
|
|
|
|
signed char cmos;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
unsigned long max_dtr;
|
|
|
|
unsigned long hlt;
|
|
|
|
unsigned long hut;
|
|
|
|
unsigned long srt;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
unsigned long spinup;
|
|
|
|
unsigned long spindown;
|
|
|
|
unsigned char spindown_offset;
|
|
|
|
unsigned char select_delay;
|
|
|
|
unsigned char rps;
|
|
|
|
unsigned char tracks;
|
|
|
|
unsigned long timeout;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
unsigned char interleave_sect;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
struct floppy_max_errors max_errors;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
char flags;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FTD_MSG 0x10
|
|
|
|
#define FD_BROKEN_DCL 0x20
|
|
|
|
#define FD_DEBUG 0x02
|
|
|
|
#define FD_SILENT_DCL_CLEAR 0x4
|
|
|
|
#define FD_INVERTED_DCL 0x80
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
char read_track;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
short autodetect[8];
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
int checkfreq;
|
|
|
|
int native_format;
|
|
|
|
};
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
enum {
|
|
|
|
FD_NEED_TWADDLE_BIT,
|
|
|
|
FD_VERIFY_BIT,
|
|
|
|
FD_DISK_NEWCHANGE_BIT,
|
|
|
|
FD_UNUSED_BIT,
|
|
|
|
FD_DISK_CHANGED_BIT,
|
|
|
|
FD_DISK_WRITABLE_BIT
|
|
|
|
};
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)
|
|
|
|
#define FDGETDRVPRM _IOR(2, 0x11, struct floppy_drive_params)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
struct floppy_drive_struct {
|
|
|
|
unsigned long flags;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_BIT)
|
|
|
|
#define FD_VERIFY (1 << FD_VERIFY_BIT)
|
|
|
|
#define FD_DISK_NEWCHANGE (1 << FD_DISK_NEWCHANGE_BIT)
|
|
|
|
#define FD_DISK_CHANGED (1 << FD_DISK_CHANGED_BIT)
|
|
|
|
#define FD_DISK_WRITABLE (1 << FD_DISK_WRITABLE_BIT)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
unsigned long spinup_date;
|
|
|
|
unsigned long select_date;
|
|
|
|
unsigned long first_read_date;
|
|
|
|
short probed_format;
|
|
|
|
short track;
|
|
|
|
short maxblock;
|
|
|
|
short maxtrack;
|
|
|
|
int generation;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
int keep_data;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
int fd_ref;
|
|
|
|
int fd_device;
|
|
|
|
unsigned long last_checked;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
char *dmabuf;
|
|
|
|
int bufblocks;
|
|
|
|
};
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDGETDRVSTAT _IOR(2, 0x12, struct floppy_drive_struct)
|
|
|
|
#define FDPOLLDRVSTAT _IOR(2, 0x13, struct floppy_drive_struct)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
enum reset_mode {
|
|
|
|
FD_RESET_IF_NEEDED,
|
|
|
|
FD_RESET_IF_RAWCMD,
|
|
|
|
FD_RESET_ALWAYS
|
|
|
|
};
|
|
|
|
#define FDRESET _IO(2, 0x54)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
struct floppy_fdc_state {
|
|
|
|
int spec1;
|
|
|
|
int spec2;
|
|
|
|
int dtr;
|
|
|
|
unsigned char version;
|
|
|
|
unsigned char dor;
|
|
|
|
unsigned long address;
|
|
|
|
unsigned int rawcmd:2;
|
|
|
|
unsigned int reset:1;
|
|
|
|
unsigned int need_configure:1;
|
|
|
|
unsigned int perp_mode:2;
|
|
|
|
unsigned int has_fifo:1;
|
|
|
|
unsigned int driver_version;
|
|
|
|
#define FD_DRIVER_VERSION 0x100
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
unsigned char track[4];
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
};
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDGETFDCSTAT _IOR(2, 0x15, struct floppy_fdc_state)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
struct floppy_write_errors {
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
unsigned int write_errors;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
unsigned long first_error_sector;
|
|
|
|
int first_error_generation;
|
|
|
|
unsigned long last_error_sector;
|
|
|
|
int last_error_generation;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
unsigned int badness;
|
|
|
|
};
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDWERRORCLR _IO(2, 0x56)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDWERRORGET _IOR(2, 0x17, struct floppy_write_errors)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDHAVEBATCHEDRAWCMD
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
struct floppy_raw_cmd {
|
|
|
|
unsigned int flags;
|
|
|
|
#define FD_RAW_READ 1
|
|
|
|
#define FD_RAW_WRITE 2
|
|
|
|
#define FD_RAW_NO_MOTOR 4
|
|
|
|
#define FD_RAW_DISK_CHANGE 4
|
|
|
|
#define FD_RAW_INTR 8
|
|
|
|
#define FD_RAW_SPIN 0x10
|
|
|
|
#define FD_RAW_NO_MOTOR_AFTER 0x20
|
|
|
|
#define FD_RAW_NEED_DISK 0x40
|
|
|
|
#define FD_RAW_NEED_SEEK 0x80
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FD_RAW_MORE 0x100
|
|
|
|
#define FD_RAW_STOP_IF_FAILURE 0x200
|
|
|
|
#define FD_RAW_STOP_IF_SUCCESS 0x400
|
|
|
|
#define FD_RAW_SOFTFAILURE 0x800
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FD_RAW_FAILURE 0x10000
|
|
|
|
#define FD_RAW_HARDFAILURE 0x20000
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
void __user *data;
|
|
|
|
char *kernel_data;
|
|
|
|
struct floppy_raw_cmd *next;
|
|
|
|
long length;
|
|
|
|
long phys_length;
|
|
|
|
int buffer_length;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
unsigned char rate;
|
|
|
|
unsigned char cmd_count;
|
|
|
|
unsigned char cmd[16];
|
|
|
|
unsigned char reply_count;
|
|
|
|
unsigned char reply[16];
|
|
|
|
int track;
|
|
|
|
int resultcode;
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
int reserved1;
|
|
|
|
int reserved2;
|
|
|
|
};
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDRAWCMD _IO(2, 0x58)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDTWADDLE _IO(2, 0x59)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#define FDEJECT _IO(2, 0x5a)
|
2012-03-08 01:14:53 +01:00
|
|
|
|
2009-03-04 04:28:35 +01:00
|
|
|
#endif
|