blob: cfc82a6e8855fe3771df1d14c3316f99961c1376 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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,
Christopher Ferris38062f92014-07-09 15:33:25 -0700130 FD_DISK_WRITABLE_BIT,
131 FD_OPEN_SHOULD_FAIL_BIT
Ben Cheng655a7c02013-10-16 16:09:24 -0700132};
Ben Cheng655a7c02013-10-16 16:09:24 -0700133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700134#define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)
Ben Cheng655a7c02013-10-16 16:09:24 -0700135#define FDGETDRVPRM _IOR(2, 0x11, struct floppy_drive_params)
136struct floppy_drive_struct {
137 unsigned long flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700139#define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_BIT)
Ben Cheng655a7c02013-10-16 16:09:24 -0700140#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)
Ben Cheng655a7c02013-10-16 16:09:24 -0700143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700144#define FD_DISK_WRITABLE (1 << FD_DISK_WRITABLE_BIT)
Ben Cheng655a7c02013-10-16 16:09:24 -0700145 unsigned long spinup_date;
146 unsigned long select_date;
147 unsigned long first_read_date;
Ben Cheng655a7c02013-10-16 16:09:24 -0700148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700149 short probed_format;
Ben Cheng655a7c02013-10-16 16:09:24 -0700150 short track;
151 short maxblock;
152 short maxtrack;
Ben Cheng655a7c02013-10-16 16:09:24 -0700153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700154 int generation;
Ben Cheng655a7c02013-10-16 16:09:24 -0700155 int keep_data;
156 int fd_ref;
157 int fd_device;
Ben Cheng655a7c02013-10-16 16:09:24 -0700158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700159 unsigned long last_checked;
Ben Cheng655a7c02013-10-16 16:09:24 -0700160 char *dmabuf;
161 int bufblocks;
162};
Ben Cheng655a7c02013-10-16 16:09:24 -0700163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700164#define FDGETDRVSTAT _IOR(2, 0x12, struct floppy_drive_struct)
Ben Cheng655a7c02013-10-16 16:09:24 -0700165#define FDPOLLDRVSTAT _IOR(2, 0x13, struct floppy_drive_struct)
166enum reset_mode {
167 FD_RESET_IF_NEEDED,
Ben Cheng655a7c02013-10-16 16:09:24 -0700168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700169 FD_RESET_IF_RAWCMD,
Ben Cheng655a7c02013-10-16 16:09:24 -0700170 FD_RESET_ALWAYS
171};
172#define FDRESET _IO(2, 0x54)
Ben Cheng655a7c02013-10-16 16:09:24 -0700173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700174struct floppy_fdc_state {
Ben Cheng655a7c02013-10-16 16:09:24 -0700175 int spec1;
176 int spec2;
177 int dtr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700179 unsigned char version;
Ben Cheng655a7c02013-10-16 16:09:24 -0700180 unsigned char dor;
181 unsigned long address;
182 unsigned int rawcmd:2;
Ben Cheng655a7c02013-10-16 16:09:24 -0700183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700184 unsigned int reset:1;
Ben Cheng655a7c02013-10-16 16:09:24 -0700185 unsigned int need_configure:1;
186 unsigned int perp_mode:2;
187 unsigned int has_fifo:1;
Ben Cheng655a7c02013-10-16 16:09:24 -0700188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700189 unsigned int driver_version;
Ben Cheng655a7c02013-10-16 16:09:24 -0700190#define FD_DRIVER_VERSION 0x100
191 unsigned char track[4];
192};
Ben Cheng655a7c02013-10-16 16:09:24 -0700193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700194#define FDGETFDCSTAT _IOR(2, 0x15, struct floppy_fdc_state)
Ben Cheng655a7c02013-10-16 16:09:24 -0700195struct floppy_write_errors {
196 unsigned int write_errors;
197 unsigned long first_error_sector;
Ben Cheng655a7c02013-10-16 16:09:24 -0700198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700199 int first_error_generation;
Ben Cheng655a7c02013-10-16 16:09:24 -0700200 unsigned long last_error_sector;
201 int last_error_generation;
202 unsigned int badness;
Ben Cheng655a7c02013-10-16 16:09:24 -0700203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700204};
Ben Cheng655a7c02013-10-16 16:09:24 -0700205#define FDWERRORCLR _IO(2, 0x56)
206#define FDWERRORGET _IOR(2, 0x17, struct floppy_write_errors)
207#define FDHAVEBATCHEDRAWCMD
Ben Cheng655a7c02013-10-16 16:09:24 -0700208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700209struct floppy_raw_cmd {
Ben Cheng655a7c02013-10-16 16:09:24 -0700210 unsigned int flags;
211#define FD_RAW_READ 1
212#define FD_RAW_WRITE 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700214#define FD_RAW_NO_MOTOR 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700215#define FD_RAW_DISK_CHANGE 4
216#define FD_RAW_INTR 8
217#define FD_RAW_SPIN 0x10
Ben Cheng655a7c02013-10-16 16:09:24 -0700218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700219#define FD_RAW_NO_MOTOR_AFTER 0x20
Ben Cheng655a7c02013-10-16 16:09:24 -0700220#define FD_RAW_NEED_DISK 0x40
221#define FD_RAW_NEED_SEEK 0x80
222#define FD_RAW_MORE 0x100
Ben Cheng655a7c02013-10-16 16:09:24 -0700223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700224#define FD_RAW_STOP_IF_FAILURE 0x200
Ben Cheng655a7c02013-10-16 16:09:24 -0700225#define FD_RAW_STOP_IF_SUCCESS 0x400
226#define FD_RAW_SOFTFAILURE 0x800
227#define FD_RAW_FAILURE 0x10000
Ben Cheng655a7c02013-10-16 16:09:24 -0700228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700229#define FD_RAW_HARDFAILURE 0x20000
Ben Cheng655a7c02013-10-16 16:09:24 -0700230 void __user *data;
231 char *kernel_data;
232 struct floppy_raw_cmd *next;
Ben Cheng655a7c02013-10-16 16:09:24 -0700233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700234 long length;
Ben Cheng655a7c02013-10-16 16:09:24 -0700235 long phys_length;
236 int buffer_length;
237 unsigned char rate;
Ben Cheng655a7c02013-10-16 16:09:24 -0700238/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700239 unsigned char cmd_count;
Ben Cheng655a7c02013-10-16 16:09:24 -0700240 unsigned char cmd[16];
241 unsigned char reply_count;
242 unsigned char reply[16];
Ben Cheng655a7c02013-10-16 16:09:24 -0700243/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700244 int track;
Ben Cheng655a7c02013-10-16 16:09:24 -0700245 int resultcode;
246 int reserved1;
247 int reserved2;
Ben Cheng655a7c02013-10-16 16:09:24 -0700248/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700249};
Ben Cheng655a7c02013-10-16 16:09:24 -0700250#define FDRAWCMD _IO(2, 0x58)
251#define FDTWADDLE _IO(2, 0x59)
252#define FDEJECT _IO(2, 0x5a)
Ben Cheng655a7c02013-10-16 16:09:24 -0700253/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700254#endif