1 /**************************************************************************** 2 **************************************************************************** 3 *** 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. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _LINUX_FD_H 20 #define _LINUX_FD_H 21 #include <linux/ioctl.h> 22 #include <linux/compiler.h> 23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24 struct floppy_struct { 25 unsigned int size, 26 sect, 27 head, 28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29 track, 30 stretch; 31 #define FD_STRETCH 1 32 #define FD_SWAPSIDES 2 33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34 #define FD_ZEROBASED 4 35 unsigned char gap, 36 rate, 37 #define FD_2M 0x4 38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39 #define FD_SIZECODEMASK 0x38 40 #define FD_SIZECODE(floppy) (((((floppy)->rate&FD_SIZECODEMASK)>> 3)+ 2) %8) 41 #define FD_SECTSIZE(floppy) ( (floppy)->rate & FD_2M ? 512 : 128 << FD_SIZECODE(floppy) ) 42 #define FD_PERP 0x40 43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44 spec1, 45 fmt_gap; 46 const char * name; 47 }; 48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49 #define FDCLRPRM _IO(2, 0x41) 50 #define FDSETPRM _IOW(2, 0x42, struct floppy_struct) 51 #define FDSETMEDIAPRM FDSETPRM 52 #define FDDEFPRM _IOW(2, 0x43, struct floppy_struct) 53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 54 #define FDGETPRM _IOR(2, 0x04, struct floppy_struct) 55 #define FDDEFMEDIAPRM FDDEFPRM 56 #define FDGETMEDIAPRM FDGETPRM 57 #define FDMSGON _IO(2,0x45) 58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 59 #define FDMSGOFF _IO(2,0x46) 60 #define FD_FILL_BYTE 0xF6 61 struct format_descr { 62 unsigned int device,head,track; 63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 64 }; 65 #define FDFMTBEG _IO(2,0x47) 66 #define FDFMTTRK _IOW(2,0x48, struct format_descr) 67 #define FDFMTEND _IO(2,0x49) 68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 69 struct floppy_max_errors { 70 unsigned int 71 abort, 72 read_track, 73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 74 reset, 75 recal, 76 reporting; 77 }; 78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 79 #define FDSETEMSGTRESH _IO(2,0x4a) 80 #define FDFLUSH _IO(2,0x4b) 81 #define FDSETMAXERRS _IOW(2, 0x4c, struct floppy_max_errors) 82 #define FDGETMAXERRS _IOR(2, 0x0e, struct floppy_max_errors) 83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 84 typedef char floppy_drive_name[16]; 85 #define FDGETDRVTYP _IOR(2, 0x0f, floppy_drive_name) 86 struct floppy_drive_params { 87 signed char cmos; 88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 89 unsigned long max_dtr; 90 unsigned long hlt; 91 unsigned long hut; 92 unsigned long srt; 93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 94 unsigned long spinup; 95 unsigned long spindown; 96 unsigned char spindown_offset; 97 unsigned char select_delay; 98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 99 unsigned char rps; 100 unsigned char tracks; 101 unsigned long timeout; 102 unsigned char interleave_sect; 103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 104 struct floppy_max_errors max_errors; 105 char flags; 106 #define FTD_MSG 0x10 107 #define FD_BROKEN_DCL 0x20 108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 109 #define FD_DEBUG 0x02 110 #define FD_SILENT_DCL_CLEAR 0x4 111 #define FD_INVERTED_DCL 0x80 112 char read_track; 113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 114 short autodetect[8]; 115 int checkfreq; 116 int native_format; 117 }; 118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 119 enum { 120 FD_NEED_TWADDLE_BIT, 121 FD_VERIFY_BIT, 122 FD_DISK_NEWCHANGE_BIT, 123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 124 FD_UNUSED_BIT, 125 FD_DISK_CHANGED_BIT, 126 FD_DISK_WRITABLE_BIT 127 }; 128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 129 #define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params) 130 #define FDGETDRVPRM _IOR(2, 0x11, struct floppy_drive_params) 131 struct floppy_drive_struct { 132 unsigned long flags; 133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 134 #define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_BIT) 135 #define FD_VERIFY (1 << FD_VERIFY_BIT) 136 #define FD_DISK_NEWCHANGE (1 << FD_DISK_NEWCHANGE_BIT) 137 #define FD_DISK_CHANGED (1 << FD_DISK_CHANGED_BIT) 138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 139 #define FD_DISK_WRITABLE (1 << FD_DISK_WRITABLE_BIT) 140 unsigned long spinup_date; 141 unsigned long select_date; 142 unsigned long first_read_date; 143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 144 short probed_format; 145 short track; 146 short maxblock; 147 short maxtrack; 148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 149 int generation; 150 int keep_data; 151 int fd_ref; 152 int fd_device; 153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 154 unsigned long last_checked; 155 char *dmabuf; 156 int bufblocks; 157 }; 158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 159 #define FDGETDRVSTAT _IOR(2, 0x12, struct floppy_drive_struct) 160 #define FDPOLLDRVSTAT _IOR(2, 0x13, struct floppy_drive_struct) 161 enum reset_mode { 162 FD_RESET_IF_NEEDED, 163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 164 FD_RESET_IF_RAWCMD, 165 FD_RESET_ALWAYS 166 }; 167 #define FDRESET _IO(2, 0x54) 168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 169 struct floppy_fdc_state { 170 int spec1; 171 int spec2; 172 int dtr; 173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 174 unsigned char version; 175 unsigned char dor; 176 unsigned long address; 177 unsigned int rawcmd:2; 178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 179 unsigned int reset:1; 180 unsigned int need_configure:1; 181 unsigned int perp_mode:2; 182 unsigned int has_fifo:1; 183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 184 unsigned int driver_version; 185 #define FD_DRIVER_VERSION 0x100 186 unsigned char track[4]; 187 }; 188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 189 #define FDGETFDCSTAT _IOR(2, 0x15, struct floppy_fdc_state) 190 struct floppy_write_errors { 191 unsigned int write_errors; 192 unsigned long first_error_sector; 193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 194 int first_error_generation; 195 unsigned long last_error_sector; 196 int last_error_generation; 197 unsigned int badness; 198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 199 }; 200 #define FDWERRORCLR _IO(2, 0x56) 201 #define FDWERRORGET _IOR(2, 0x17, struct floppy_write_errors) 202 #define FDHAVEBATCHEDRAWCMD 203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 204 struct floppy_raw_cmd { 205 unsigned int flags; 206 #define FD_RAW_READ 1 207 #define FD_RAW_WRITE 2 208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 209 #define FD_RAW_NO_MOTOR 4 210 #define FD_RAW_DISK_CHANGE 4 211 #define FD_RAW_INTR 8 212 #define FD_RAW_SPIN 0x10 213 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 214 #define FD_RAW_NO_MOTOR_AFTER 0x20 215 #define FD_RAW_NEED_DISK 0x40 216 #define FD_RAW_NEED_SEEK 0x80 217 #define FD_RAW_MORE 0x100 218 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 219 #define FD_RAW_STOP_IF_FAILURE 0x200 220 #define FD_RAW_STOP_IF_SUCCESS 0x400 221 #define FD_RAW_SOFTFAILURE 0x800 222 #define FD_RAW_FAILURE 0x10000 223 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 224 #define FD_RAW_HARDFAILURE 0x20000 225 void __user *data; 226 char *kernel_data; 227 struct floppy_raw_cmd *next; 228 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 229 long length; 230 long phys_length; 231 int buffer_length; 232 unsigned char rate; 233 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 234 unsigned char cmd_count; 235 unsigned char cmd[16]; 236 unsigned char reply_count; 237 unsigned char reply[16]; 238 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 239 int track; 240 int resultcode; 241 int reserved1; 242 int reserved2; 243 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 244 }; 245 #define FDRAWCMD _IO(2, 0x58) 246 #define FDTWADDLE _IO(2, 0x59) 247 #define FDEJECT _IO(2, 0x5a) 248 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 249 #endif 250