1 /* $NetBSD: linux_fdio.h,v 1.3 2005/12/11 12:20:19 christos Exp $ */
4 * Copyright (c) 2000 Wasabi Systems, Inc.
7 * Written by Frank van der Linden for Wasabi Systems, Inc.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed for the NetBSD Project by
20 * Wasabi Systems, Inc.
21 * 4. The name of Wasabi Systems, Inc. may not be used to endorse
22 * or promote products derived from this software without specific prior
25 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
29 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
42 * Linux floppy ioctl call structures and defines.
45 struct linux_floppy_struct
{
58 struct linux_floppy_max_errors
{
66 struct linux_floppy_drive_params
{
74 u_char spindown_offset
;
79 u_char interleave_sect
;
80 struct linux_floppy_max_errors max_errors
;
88 struct linux_floppy_drive_struct
{
92 u_long first_read_date
;
106 #define LINUX_FD_NEED_TWADDLE 0x01
107 #define LINUX_FD_VERIFY 0x02
108 #define LINUX_FD_DISK_NEWCHANGE 0x04
109 #define LINUX_FD_DISK_CHANGED 0x10
110 #define LINUX_FD_DISK_WRITABLE 0x20
113 struct linux_floppy_fdc_state
{
122 u_int need_configure
:1;
125 u_int driver_version
;
129 struct linux_floppy_write_errors
{
131 u_long first_error_sector
;
132 u_int first_error_generation
;
133 u_long last_error_sector
;
134 u_int last_error_generation
;
138 struct linux_floppy_raw_cmd
{
142 struct floppy_raw_cmd
*next
;
157 struct linux_format_descr
{
163 typedef char linux_floppy_drive_name
[16];
165 #define LINUX_FDCLRPRM _LINUX_IO(2, 0x41)
166 #define LINUX_FDSETPRM _LINUX_IOW(2, 0x42, struct linux_floppy_struct)
167 #define LINUX_FDDEFPRM _LINUX_IOW(2, 0x43, struct linux_floppy_struct)
168 #define LINUX_FDGETPRM _LINUX_IOR(2, 0x04, struct linux_floppy_struct)
169 #define LINUX_FDMSGON _LINUX_IO(2, 0x45)
170 #define LINUX_FDMSGOFF _LINUX_IO(2, 0x46)
171 #define LINUX_FDFMTBEG _LINUX_IO(2, 0x47)
172 #define LINUX_FDFMTTRK _LINUX_IOW(2, 0x48, struct linux_format_descr)
173 #define LINUX_FDFMTEND _LINUX_IO(2, 0x49)
174 #define LINUX_FDSETEMSGTRESH _LINUX_IO(2, 0x4a)
175 #define LINUX_FDFLUSH _LINUX_IO(2, 0x4b)
176 #define LINUX_FDSETMAXERRS \
177 _LINUX_IOW(2, 0x4c, struct linux_floppy_max_errors)
178 #define LINUX_FDGETMAXERRS \
179 _LINUX_IOR(2, 0x0e, struct linux_floppy_max_errors)
180 #define LINUX_FDGETDRVTYP _LINUX_IOR(2, 0x0f, linux_floppy_drive_name)
181 /* 0x90 is not a typo, that's how it's listed in the Linux include file */
182 #define LINUX_FDSETDRVPRM \
183 _LINUX_IOW(2, 0x90, struct linux_floppy_drive_params)
184 #define LINUX_FDGETDRVPRM \
185 _LINUX_IOR(2, 0x11, struct linux_floppy_drive_params)
186 #define LINUX_FDGETDRVSTAT \
187 _LINUX_IOR(2, 0x12, struct linux_floppy_drive_struct)
188 #define LINUX_FDPOLLDRVSTAT \
189 _LINUX_IOR(2, 0x13, struct linux_floppy_drive_struct)
190 #define LINUX_FDRESET _LINUX_IO(2, 0x54)
191 #define LINUX_FDGETFDCSTAT \
192 _LINUX_IOR(2, 0x15, struct linux_floppy_fdc_state)
193 #define LINUX_FDWERRORCLR _LINUX_IO(2, 0x56)
194 #define LINUX_FDWERRORGET \
195 _LINUX_IOR(2, 0x17, struct linux_floppy_write_errors)
196 #define LINUX_FDRAWCMD _LINUX_IO(2, 0x58)
197 #define LINUX_FDTWADDLE _LINUX_IO(2, 0x59)
198 #define LINUX_FDEJECT _LINUX_IO(2, 0x5a)
200 #endif /* _LINUX_FDIO_H */