1 /****************************************************************************
2 ****************************************************************************
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
10 ****************************************************************************
11 ****************************************************************************/
15 #include <linux/ioctl.h>
16 #include <linux/compiler.h>
18 struct floppy_struct {
25 #define FD_SWAPSIDES 2
26 #define FD_ZEROBASED 4
32 #define FD_SIZECODEMASK 0x38
33 #define FD_SIZECODE(floppy) (((((floppy)->rate&FD_SIZECODEMASK)>> 3)+ 2) %8)
34 #define FD_SECTSIZE(floppy) ( (floppy)->rate & FD_2M ? 512 : 128 << FD_SIZECODE(floppy) )
42 #define FDCLRPRM _IO(2, 0x41)
44 #define FDSETPRM _IOW(2, 0x42, struct floppy_struct)
45 #define FDSETMEDIAPRM FDSETPRM
47 #define FDDEFPRM _IOW(2, 0x43, struct floppy_struct)
48 #define FDGETPRM _IOR(2, 0x04, struct floppy_struct)
49 #define FDDEFMEDIAPRM FDDEFPRM
50 #define FDGETMEDIAPRM FDGETPRM
52 #define FDMSGON _IO(2,0x45)
53 #define FDMSGOFF _IO(2,0x46)
55 #define FD_FILL_BYTE 0xF6
58 unsigned int device,head,track;
61 #define FDFMTBEG _IO(2,0x47)
63 #define FDFMTTRK _IOW(2,0x48, struct format_descr)
65 #define FDFMTEND _IO(2,0x49)
67 struct floppy_max_errors {
78 #define FDSETEMSGTRESH _IO(2,0x4a)
80 #define FDFLUSH _IO(2,0x4b)
82 #define FDSETMAXERRS _IOW(2, 0x4c, struct floppy_max_errors)
83 #define FDGETMAXERRS _IOR(2, 0x0e, struct floppy_max_errors)
85 typedef char floppy_drive_name[16];
86 #define FDGETDRVTYP _IOR(2, 0x0f, floppy_drive_name)
88 struct floppy_drive_params {
91 unsigned long max_dtr;
97 unsigned long spindown;
98 unsigned char spindown_offset;
99 unsigned char select_delay;
101 unsigned char tracks;
102 unsigned long timeout;
104 unsigned char interleave_sect;
106 struct floppy_max_errors max_errors;
111 #define FD_BROKEN_DCL 0x20
112 #define FD_DEBUG 0x02
113 #define FD_SILENT_DCL_CLEAR 0x4
114 #define FD_INVERTED_DCL 0x80
127 FD_DISK_NEWCHANGE_BIT,
133 #define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)
134 #define FDGETDRVPRM _IOR(2, 0x11, struct floppy_drive_params)
136 struct floppy_drive_struct {
139 #define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_BIT)
140 #define FD_VERIFY (1 << FD_VERIFY_BIT)
141 #define FD_DISK_NEWCHANGE (1 << FD_DISK_NEWCHANGE_BIT)
142 #define FD_DISK_CHANGED (1 << FD_DISK_CHANGED_BIT)
143 #define FD_DISK_WRITABLE (1 << FD_DISK_WRITABLE_BIT)
145 unsigned long spinup_date;
146 unsigned long select_date;
147 unsigned long first_read_date;
158 unsigned long last_checked;
164 #define FDGETDRVSTAT _IOR(2, 0x12, struct floppy_drive_struct)
165 #define FDPOLLDRVSTAT _IOR(2, 0x13, struct floppy_drive_struct)
172 #define FDRESET _IO(2, 0x54)
174 struct floppy_fdc_state {
178 unsigned char version;
180 unsigned long address;
181 unsigned int rawcmd:2;
182 unsigned int reset:1;
183 unsigned int need_configure:1;
184 unsigned int perp_mode:2;
185 unsigned int has_fifo:1;
186 unsigned int driver_version;
187 #define FD_DRIVER_VERSION 0x100
189 unsigned char track[4];
193 #define FDGETFDCSTAT _IOR(2, 0x15, struct floppy_fdc_state)
195 struct floppy_write_errors {
197 unsigned int write_errors;
199 unsigned long first_error_sector;
200 int first_error_generation;
201 unsigned long last_error_sector;
202 int last_error_generation;
204 unsigned int badness;
207 #define FDWERRORCLR _IO(2, 0x56)
209 #define FDWERRORGET _IOR(2, 0x17, struct floppy_write_errors)
211 #define FDHAVEBATCHEDRAWCMD
213 struct floppy_raw_cmd {
215 #define FD_RAW_READ 1
216 #define FD_RAW_WRITE 2
217 #define FD_RAW_NO_MOTOR 4
218 #define FD_RAW_DISK_CHANGE 4
219 #define FD_RAW_INTR 8
220 #define FD_RAW_SPIN 0x10
221 #define FD_RAW_NO_MOTOR_AFTER 0x20
222 #define FD_RAW_NEED_DISK 0x40
223 #define FD_RAW_NEED_SEEK 0x80
225 #define FD_RAW_MORE 0x100
226 #define FD_RAW_STOP_IF_FAILURE 0x200
227 #define FD_RAW_STOP_IF_SUCCESS 0x400
228 #define FD_RAW_SOFTFAILURE 0x800
230 #define FD_RAW_FAILURE 0x10000
231 #define FD_RAW_HARDFAILURE 0x20000
235 struct floppy_raw_cmd *next;
241 unsigned char cmd_count;
242 unsigned char cmd[16];
243 unsigned char reply_count;
244 unsigned char reply[16];
252 #define FDRAWCMD _IO(2, 0x58)
254 #define FDTWADDLE _IO(2, 0x59)
256 #define FDEJECT _IO(2, 0x5a)