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