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