root/compat/linux/linux_fdio.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


    1 /*      $OpenBSD: linux_fdio.h,v 1.1 2001/04/09 06:53:44 tholo Exp $    */
    2 /*      $NetBSD: linux_fdio.h,v 1.1 2000/12/10 14:12:16 fvdl Exp $      */
    3 
    4 /*
    5  * Copyright (c) 2000 Wasabi Systems, Inc.
    6  * All rights reserved.
    7  *
    8  * Written by Frank van der Linden for Wasabi Systems, Inc.
    9  *
   10  * Redistribution and use in source and binary forms, with or without
   11  * modification, are permitted provided that the following conditions
   12  * are met:
   13  * 1. Redistributions of source code must retain the above copyright
   14  *    notice, this list of conditions and the following disclaimer.
   15  * 2. Redistributions in binary form must reproduce the above copyright
   16  *    notice, this list of conditions and the following disclaimer in the
   17  *    documentation and/or other materials provided with the distribution.
   18  * 3. All advertising materials mentioning features or use of this software
   19  *    must display the following acknowledgement:
   20  *      This product includes software developed for the NetBSD Project by
   21  *      Wasabi Systems, Inc.
   22  * 4. The name of Wasabi Systems, Inc. may not be used to endorse
   23  *    or promote products derived from this software without specific prior
   24  *    written permission.
   25  *
   26  * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
   27  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   28  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   29  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
   30  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   32  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   33  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   34  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   36  * POSSIBILITY OF SUCH DAMAGE.
   37  */
   38 
   39 #ifndef _LINUX_FDIO_H
   40 #define _LINUX_FDIO_H
   41 
   42 /*
   43  * Linux floppy ioctl call structures and defines.
   44  */
   45 
   46 struct linux_floppy_struct {
   47         u_int size;
   48         u_int sect;
   49         u_int head;
   50         u_int track;
   51         u_int stretch;
   52         u_char gap;
   53         u_char rate;
   54         u_char spec1;
   55         u_char fmt_gap;
   56         const char *name;
   57 };
   58 
   59 struct linux_floppy_max_errors {
   60         u_int abort;
   61         u_int read_track;
   62         u_int reset;
   63         u_int recal;
   64         u_int reporting;
   65 };
   66 
   67 struct linux_floppy_drive_params {
   68         char cmos;
   69         u_long max_dtr;
   70         u_long hlt;
   71         u_long hut;
   72         u_long srt;
   73         u_long spinup;
   74         u_long spindown;
   75         u_char spindown_offset;
   76         u_char select_delay;
   77         u_char rps;
   78         u_char tracks;
   79         u_long timeout;
   80         u_char interleave_sect;
   81         struct linux_floppy_max_errors max_errors;
   82         char flags;
   83         char read_track;
   84         short autodetect[8];
   85         int checkfreq;
   86         int native_format;
   87 };
   88 
   89 struct linux_floppy_drive_struct {
   90         u_long flags;
   91         u_long spinup_date;
   92         u_long select_date;
   93         u_long first_read_date;
   94         short probed_format;
   95         short track;
   96         short maxblock;
   97         short maxtrack;
   98         int generation;
   99         int keep_data;
  100         int fd_ref;
  101         int fd_device;
  102         u_long last_checked;
  103         char *dmabuf;
  104         int bufblocks;
  105 };
  106 
  107 #define LINUX_FD_NEED_TWADDLE   0x01
  108 #define LINUX_FD_VERIFY         0x02
  109 #define LINUX_FD_DISK_NEWCHANGE 0x04
  110 #define LINUX_FD_DISK_CHANGED   0x10
  111 #define LINUX_FD_DISK_WRITABLE  0x20
  112 
  113 
  114 struct linux_floppy_fdc_state {       
  115         int spec1;
  116         int spec2;
  117         int dtr;
  118         u_char version;
  119         u_char dor;
  120         u_long address;
  121         u_int rawcmd:2;
  122         u_int reset:1;
  123         u_int need_configure:1;
  124         u_int perp_mode:2;
  125         u_int has_fifo:1;
  126         u_int driver_version;
  127         u_char track[4];
  128 };
  129 
  130 struct linux_floppy_write_errors {
  131         u_int write_errors;
  132         u_long first_error_sector;
  133         u_int first_error_generation;
  134         u_long last_error_sector;
  135         u_int last_error_generation;
  136         u_int badness;
  137 };
  138 
  139 struct linux_floppy_raw_cmd {
  140         u_int flags;
  141         void *data;
  142         caddr_t kernel_data;
  143         struct floppy_raw_cmd *next;
  144         long length;
  145         long phys_length;
  146         int buffer_length;
  147         u_char rate;
  148         u_char cmd_count;
  149         u_char cmd[16];
  150         u_char reply_count;
  151         u_char reply[16];
  152         int track;
  153         int resultcode;
  154         int reserved1;
  155         int reserved2;
  156 };
  157 
  158 struct linux_format_descr {
  159         u_int device;
  160         u_int head;
  161         u_int track;
  162 };
  163 
  164 typedef char linux_floppy_drive_name[16];
  165 
  166 #define LINUX_FDCLRPRM          _LINUX_IO(2, 0x41)
  167 #define LINUX_FDSETPRM          _LINUX_IOW(2, 0x42, struct linux_floppy_struct)
  168 #define LINUX_FDDEFPRM          _LINUX_IOW(2, 0x43, struct linux_floppy_struct)
  169 #define LINUX_FDGETPRM          _LINUX_IOR(2, 0x04, struct linux_floppy_struct)
  170 #define LINUX_FDMSGON           _LINUX_IO(2, 0x45)
  171 #define LINUX_FDMSGOFF          _LINUX_IO(2, 0x46)
  172 #define LINUX_FDFMTBEG          _LINUX_IO(2, 0x47)
  173 #define LINUX_FDFMTTRK          _LINUX_IOW(2, 0x48, struct linux_format_descr)
  174 #define LINUX_FDFMTEND          _LINUX_IO(2, 0x49)
  175 #define LINUX_FDSETEMSGTRESH    _LINUX_IO(2, 0x4a)
  176 #define LINUX_FDFLUSH           _LINUX_IO(2, 0x4b)
  177 #define LINUX_FDSETMAXERRS \
  178         _LINUX_IOW(2, 0x4c, struct linux_floppy_max_errors)
  179 #define LINUX_FDGETMAXERRS \
  180         _LINUX_IOR(2, 0x0e, struct linux_floppy_max_errors)
  181 #define LINUX_FDGETDRVTYP       _LINUX_IOR(2, 0x0f, linux_floppy_drive_name)
  182 /* 0x90 is not a typo, that's how it's listed in the Linux include file */
  183 #define LINUX_FDSETDRVPRM \
  184         _LINUX_IOW(2, 0x90, struct linux_floppy_drive_params)
  185 #define LINUX_FDGETDRVPRM \
  186         _LINUX_IOR(2, 0x11, struct linux_floppy_drive_params)
  187 #define LINUX_FDGETDRVSTAT \
  188         _LINUX_IOR(2, 0x12, struct linux_floppy_drive_struct)
  189 #define LINUX_FDPOLLDRVSTAT \
  190         _LINUX_IOR(2, 0x13, struct linux_floppy_drive_struct)
  191 #define LINUX_FDRESET           _LINUX_IO(2, 0x54)
  192 #define LINUX_FDGETFDCSTAT \
  193         _LINUX_IOR(2, 0x15, struct linux_floppy_fdc_state)
  194 #define LINUX_FDWERRORCLR       _LINUX_IO(2, 0x56)
  195 #define LINUX_FDWERRORGET \
  196         _LINUX_IOR(2, 0x17, struct linux_floppy_write_errors)
  197 #define LINUX_FDRAWCMD          _LINUX_IO(2, 0x58)
  198 #define LINUX_FDTWADDLE         _LINUX_IO(2, 0x59)
  199 #define LINUX_FDEJECT           _LINUX_IO(2, 0x5a)
  200 
  201 #endif /* _LINUX_FDIO_H */

/* [<][>][^][v][top][bottom][index][help] */