Move the callout_reset into the critical section.
[dragonfly/netmp.git] / sys / i386 / include / ioctl_fd.h
blob6a35ccabf7eb4e591edad7d8739dba405d2cb3fa
1 /*
2 * Copyright (C) 1992-1994,2001 by Joerg Wunsch, Dresden
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
20 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
21 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
24 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
25 * DAMAGE.
27 * $FreeBSD: src/sys/i386/include/ioctl_fd.h,v 1.13.2.1 2001/07/19 13:16:54 joerg Exp $
28 * $DragonFly: src/sys/i386/include/Attic/ioctl_fd.h,v 1.2 2003/06/17 04:28:35 dillon Exp $
31 #ifndef _MACHINE_IOCTL_FD_H_
32 #define _MACHINE_IOCTL_FD_H_
34 #ifndef _KERNEL
35 #include <sys/types.h>
36 #endif
37 #include <sys/ioccom.h>
39 #define FD_FORMAT_VERSION 110 /* used to validate before formatting */
40 #define FD_MAX_NSEC 36 /* highest known number of spt - allow for */
41 /* 2.88 MB drives */
43 struct fd_formb {
44 int format_version; /* == FD_FORMAT_VERSION */
45 int cyl, head;
46 int transfer_rate; /* fdreg.h: FDC_???KBPS */
48 union {
49 struct fd_form_data {
51 * DO NOT CHANGE THE LAYOUT OF THIS STRUCTS
52 * it is hardware-dependent since it exactly
53 * matches the byte sequence to write to FDC
54 * during its `format track' operation
56 u_char secshift; /* 0 -> 128, ...; usually 2 -> 512 */
57 u_char nsecs; /* must be <= FD_MAX_NSEC */
58 u_char gaplen; /* GAP 3 length; usually 84 */
59 u_char fillbyte; /* usually 0xf6 */
60 struct fd_idfield_data {
62 * data to write into id fields;
63 * for obscure formats, they mustn't match
64 * the real values (but mostly do)
66 u_char cylno; /* 0 thru 79 (or 39) */
67 u_char headno; /* 0, or 1 */
68 u_char secno; /* starting at 1! */
69 u_char secsize; /* usually 2 */
70 } idfields[FD_MAX_NSEC]; /* 0 <= idx < nsecs used */
71 } structured;
72 u_char raw[1]; /* to have continuous indexed access */
73 } format_info;
76 /* make life easier */
77 # define fd_formb_secshift format_info.structured.secshift
78 # define fd_formb_nsecs format_info.structured.nsecs
79 # define fd_formb_gaplen format_info.structured.gaplen
80 # define fd_formb_fillbyte format_info.structured.fillbyte
81 /* these data must be filled in for(i = 0; i < fd_formb_nsecs; i++) */
82 # define fd_formb_cylno(i) format_info.structured.idfields[i].cylno
83 # define fd_formb_headno(i) format_info.structured.idfields[i].headno
84 # define fd_formb_secno(i) format_info.structured.idfields[i].secno
85 # define fd_formb_secsize(i) format_info.structured.idfields[i].secsize
87 struct fd_type {
88 int sectrac; /* sectors per track */
89 int secsize; /* size code for sectors */
90 int datalen; /* data len when secsize = 0 */
91 int gap; /* gap len between sectors */
92 int tracks; /* total num of tracks */
93 int size; /* size of disk in sectors */
94 int steptrac; /* steps per cylinder */
95 int trans; /* transfer speed code */
96 int heads; /* number of heads */
97 int f_gap; /* format gap len */
98 int f_inter; /* format interleave factor */
101 struct fdc_status {
102 u_int status[7];
105 #define FD_FORM _IOW('F', 61, struct fd_formb) /* format a track */
106 #define FD_GTYPE _IOR('F', 62, struct fd_type) /* get drive type */
107 #define FD_STYPE _IOW('F', 63, struct fd_type) /* set drive type */
109 #define FD_GOPTS _IOR('F', 64, int) /* drive options, see below */
110 #define FD_SOPTS _IOW('F', 65, int)
112 #define FD_DEBUG _IOW('F', 66, int)
115 * Obtain NE765 status registers. Only successful if there is
116 * a valid status stored in fdc->status[].
118 #define FD_GSTAT _IOR('F', 68, struct fdc_status)
120 /* Options for FD_GOPTS/FD_SOPTS, cleared on device close */
121 #define FDOPT_NORETRY 0x0001 /* no retries on failure */
122 #define FDOPT_NOERRLOG 0x002 /* no "hard error" kernel log messages */
125 * The following definitions duplicate those in sys/i386/isa/fdreg.h
126 * They are here since their values are to be used in the above
127 * structure when formatting a floppy. For very obvious reasons, both
128 * definitions must match ;-)
130 #ifndef FDC_500KBPS
131 #define FDC_500KBPS 0x00 /* 500KBPS MFM drive transfer rate */
132 #define FDC_300KBPS 0x01 /* 300KBPS MFM drive transfer rate */
133 #define FDC_250KBPS 0x02 /* 250KBPS MFM drive transfer rate */
134 #define FDC_125KBPS 0x03 /* 125KBPS FM drive transfer rate */
135 /* for some controllers 1MPBS instead */
136 #endif /* FDC_500KBPS */
138 #endif /* !_MACHINE_IOCTL_FD_H_ */