blob: 0b97bc2f764c3f20545f21e08bcf761d27b99bc9 [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 {
Tao Baod7db5942015-01-28 10:07:51 -080025 unsigned int size, sect, head, track, stretch;
Ben Cheng655a7c02013-10-16 16:09:24 -070026#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 */
Tao Baod7db5942015-01-28 10:07:51 -080034 unsigned char gap, rate,
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define FD_2M 0x4
36#define FD_SIZECODEMASK 0x38
Tao Baod7db5942015-01-28 10:07:51 -080037#define FD_SIZECODE(floppy) (((((floppy)->rate & FD_SIZECODEMASK) >> 3) + 2) % 8)
Ben Cheng655a7c02013-10-16 16:09:24 -070038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080039#define FD_SECTSIZE(floppy) ((floppy)->rate & FD_2M ? 512 : 128 << FD_SIZECODE(floppy))
Ben Cheng655a7c02013-10-16 16:09:24 -070040#define FD_PERP 0x40
Tao Baod7db5942015-01-28 10:07:51 -080041 spec1, fmt_gap;
42 const char * name;
Ben Cheng655a7c02013-10-16 16:09:24 -070043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070044};
45#define FDCLRPRM _IO(2, 0x41)
Ben Cheng655a7c02013-10-16 16:09:24 -070046#define FDSETPRM _IOW(2, 0x42, struct floppy_struct)
47#define FDSETMEDIAPRM FDSETPRM
Tao Baod7db5942015-01-28 10:07:51 -080048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070049#define FDDEFPRM _IOW(2, 0x43, struct floppy_struct)
50#define FDGETPRM _IOR(2, 0x04, struct floppy_struct)
Ben Cheng655a7c02013-10-16 16:09:24 -070051#define FDDEFMEDIAPRM FDDEFPRM
52#define FDGETMEDIAPRM FDGETPRM
Ben Cheng655a7c02013-10-16 16:09:24 -070053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080054#define FDMSGON _IO(2, 0x45)
55#define FDMSGOFF _IO(2, 0x46)
Ben Cheng655a7c02013-10-16 16:09:24 -070056#define FD_FILL_BYTE 0xF6
57struct format_descr {
Ben Cheng655a7c02013-10-16 16:09:24 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080059 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)
Ben Cheng655a7c02013-10-16 16:09:24 -070065struct floppy_max_errors {
Tao Baod7db5942015-01-28 10:07:51 -080066 unsigned int abort, read_track, reset, recal, reporting;
Ben Cheng655a7c02013-10-16 16:09:24 -070067};
Ben Cheng655a7c02013-10-16 16:09:24 -070068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080069#define FDSETEMSGTRESH _IO(2, 0x4a)
70#define FDFLUSH _IO(2, 0x4b)
Ben Cheng655a7c02013-10-16 16:09:24 -070071#define FDSETMAXERRS _IOW(2, 0x4c, struct floppy_max_errors)
72#define FDGETMAXERRS _IOR(2, 0x0e, struct floppy_max_errors)
Ben Cheng655a7c02013-10-16 16:09:24 -070073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080074typedef char floppy_drive_name[16];
Ben Cheng655a7c02013-10-16 16:09:24 -070075#define FDGETDRVTYP _IOR(2, 0x0f, floppy_drive_name)
76struct floppy_drive_params {
Tao Baod7db5942015-01-28 10:07:51 -080077 signed char cmos;
Ben Cheng655a7c02013-10-16 16:09:24 -070078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080079 unsigned long max_dtr;
80 unsigned long hlt;
81 unsigned long hut;
82 unsigned long srt;
Ben Cheng655a7c02013-10-16 16:09:24 -070083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080084 unsigned long spinup;
85 unsigned long spindown;
86 unsigned char spindown_offset;
87 unsigned char select_delay;
Ben Cheng655a7c02013-10-16 16:09:24 -070088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080089 unsigned char rps;
90 unsigned char tracks;
91 unsigned long timeout;
92 unsigned char interleave_sect;
Ben Cheng655a7c02013-10-16 16:09:24 -070093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080094 struct floppy_max_errors max_errors;
95 char flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070096#define FTD_MSG 0x10
97#define FD_BROKEN_DCL 0x20
Ben Cheng655a7c02013-10-16 16:09:24 -070098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080099#define FD_DEBUG 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700100#define FD_SILENT_DCL_CLEAR 0x4
101#define FD_INVERTED_DCL 0x80
Tao Baod7db5942015-01-28 10:07:51 -0800102 char read_track;
Ben Cheng655a7c02013-10-16 16:09:24 -0700103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800104 short autodetect[8];
105 int checkfreq;
106 int native_format;
Ben Cheng655a7c02013-10-16 16:09:24 -0700107};
Tao Baod7db5942015-01-28 10:07:51 -0800108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700109enum {
Tao Baod7db5942015-01-28 10:07:51 -0800110 FD_NEED_TWADDLE_BIT,
111 FD_VERIFY_BIT,
112 FD_DISK_NEWCHANGE_BIT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800114 FD_UNUSED_BIT,
115 FD_DISK_CHANGED_BIT,
116 FD_DISK_WRITABLE_BIT,
117 FD_OPEN_SHOULD_FAIL_BIT
Ben Cheng655a7c02013-10-16 16:09:24 -0700118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700119};
Christopher Ferris38062f92014-07-09 15:33:25 -0700120#define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)
Ben Cheng655a7c02013-10-16 16:09:24 -0700121#define FDGETDRVPRM _IOR(2, 0x11, struct floppy_drive_params)
122struct floppy_drive_struct {
Ben Cheng655a7c02013-10-16 16:09:24 -0700123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800124 unsigned long flags;
Christopher Ferris38062f92014-07-09 15:33:25 -0700125#define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_BIT)
Ben Cheng655a7c02013-10-16 16:09:24 -0700126#define FD_VERIFY (1 << FD_VERIFY_BIT)
127#define FD_DISK_NEWCHANGE (1 << FD_DISK_NEWCHANGE_BIT)
Tao Baod7db5942015-01-28 10:07:51 -0800128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700129#define FD_DISK_CHANGED (1 << FD_DISK_CHANGED_BIT)
Christopher Ferris38062f92014-07-09 15:33:25 -0700130#define FD_DISK_WRITABLE (1 << FD_DISK_WRITABLE_BIT)
Tao Baod7db5942015-01-28 10:07:51 -0800131 unsigned long spinup_date;
132 unsigned long select_date;
Ben Cheng655a7c02013-10-16 16:09:24 -0700133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800134 unsigned long first_read_date;
135 short probed_format;
136 short track;
137 short maxblock;
Ben Cheng655a7c02013-10-16 16:09:24 -0700138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800139 short maxtrack;
140 int generation;
141 int keep_data;
142 int fd_ref;
Ben Cheng655a7c02013-10-16 16:09:24 -0700143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800144 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 */
Ben Cheng655a7c02013-10-16 16:09:24 -0700149};
Christopher Ferris38062f92014-07-09 15:33:25 -0700150#define FDGETDRVSTAT _IOR(2, 0x12, struct floppy_drive_struct)
Ben Cheng655a7c02013-10-16 16:09:24 -0700151#define FDPOLLDRVSTAT _IOR(2, 0x13, struct floppy_drive_struct)
152enum reset_mode {
Ben Cheng655a7c02013-10-16 16:09:24 -0700153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800154 FD_RESET_IF_NEEDED,
155 FD_RESET_IF_RAWCMD,
156 FD_RESET_ALWAYS
Ben Cheng655a7c02013-10-16 16:09:24 -0700157};
Tao Baod7db5942015-01-28 10:07:51 -0800158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700159#define FDRESET _IO(2, 0x54)
Christopher Ferris38062f92014-07-09 15:33:25 -0700160struct floppy_fdc_state {
Tao Baod7db5942015-01-28 10:07:51 -0800161 int spec1;
162 int spec2;
Ben Cheng655a7c02013-10-16 16:09:24 -0700163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800164 int dtr;
165 unsigned char version;
166 unsigned char dor;
167 unsigned long address;
Ben Cheng655a7c02013-10-16 16:09:24 -0700168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800169 unsigned int rawcmd : 2;
170 unsigned int reset : 1;
171 unsigned int need_configure : 1;
172 unsigned int perp_mode : 2;
Ben Cheng655a7c02013-10-16 16:09:24 -0700173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800174 unsigned int has_fifo : 1;
175 unsigned int driver_version;
Ben Cheng655a7c02013-10-16 16:09:24 -0700176#define FD_DRIVER_VERSION 0x100
Tao Baod7db5942015-01-28 10:07:51 -0800177 unsigned char track[4];
Ben Cheng655a7c02013-10-16 16:09:24 -0700178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800179};
Christopher Ferris38062f92014-07-09 15:33:25 -0700180#define FDGETFDCSTAT _IOR(2, 0x15, struct floppy_fdc_state)
Ben Cheng655a7c02013-10-16 16:09:24 -0700181struct floppy_write_errors {
Tao Baod7db5942015-01-28 10:07:51 -0800182 unsigned int write_errors;
Ben Cheng655a7c02013-10-16 16:09:24 -0700183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800184 unsigned long first_error_sector;
185 int first_error_generation;
186 unsigned long last_error_sector;
187 int last_error_generation;
Ben Cheng655a7c02013-10-16 16:09:24 -0700188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800189 unsigned int badness;
Christopher Ferris38062f92014-07-09 15:33:25 -0700190};
Ben Cheng655a7c02013-10-16 16:09:24 -0700191#define FDWERRORCLR _IO(2, 0x56)
192#define FDWERRORGET _IOR(2, 0x17, struct floppy_write_errors)
Tao Baod7db5942015-01-28 10:07:51 -0800193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700194#define FDHAVEBATCHEDRAWCMD
Christopher Ferris38062f92014-07-09 15:33:25 -0700195struct floppy_raw_cmd {
Tao Baod7db5942015-01-28 10:07:51 -0800196 unsigned int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700197#define FD_RAW_READ 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800199#define FD_RAW_WRITE 2
Christopher Ferris38062f92014-07-09 15:33:25 -0700200#define FD_RAW_NO_MOTOR 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700201#define FD_RAW_DISK_CHANGE 4
202#define FD_RAW_INTR 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800204#define FD_RAW_SPIN 0x10
Christopher Ferris38062f92014-07-09 15:33:25 -0700205#define FD_RAW_NO_MOTOR_AFTER 0x20
Ben Cheng655a7c02013-10-16 16:09:24 -0700206#define FD_RAW_NEED_DISK 0x40
207#define FD_RAW_NEED_SEEK 0x80
Ben Cheng655a7c02013-10-16 16:09:24 -0700208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800209#define FD_RAW_MORE 0x100
Christopher Ferris38062f92014-07-09 15:33:25 -0700210#define FD_RAW_STOP_IF_FAILURE 0x200
Ben Cheng655a7c02013-10-16 16:09:24 -0700211#define FD_RAW_STOP_IF_SUCCESS 0x400
212#define FD_RAW_SOFTFAILURE 0x800
Tao Baod7db5942015-01-28 10:07:51 -0800213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700214#define FD_RAW_FAILURE 0x10000
Christopher Ferris38062f92014-07-09 15:33:25 -0700215#define FD_RAW_HARDFAILURE 0x20000
Tao Baod7db5942015-01-28 10:07:51 -0800216 void __user * data;
217 char * kernel_data;
Ben Cheng655a7c02013-10-16 16:09:24 -0700218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800219 struct floppy_raw_cmd * next;
220 long length;
221 long phys_length;
222 int buffer_length;
Ben Cheng655a7c02013-10-16 16:09:24 -0700223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800224 unsigned char rate;
225 unsigned char cmd_count;
226 unsigned char cmd[16];
227 unsigned char reply_count;
Ben Cheng655a7c02013-10-16 16:09:24 -0700228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800229 unsigned char reply[16];
230 int track;
231 int resultcode;
232 int reserved1;
Ben Cheng655a7c02013-10-16 16:09:24 -0700233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800234 int reserved2;
Christopher Ferris38062f92014-07-09 15:33:25 -0700235};
Ben Cheng655a7c02013-10-16 16:09:24 -0700236#define FDRAWCMD _IO(2, 0x58)
237#define FDTWADDLE _IO(2, 0x59)
Ben Cheng655a7c02013-10-16 16:09:24 -0700238/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800239#define FDEJECT _IO(2, 0x5a)
Christopher Ferris38062f92014-07-09 15:33:25 -0700240#endif