~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/linux/fd.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/uapi/linux/fd.h (Version linux-6.12-rc7) and /include/uapi/linux/fd.h (Version linux-4.11.12)


  1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux << 
  2 #ifndef _UAPI_LINUX_FD_H                            1 #ifndef _UAPI_LINUX_FD_H
  3 #define _UAPI_LINUX_FD_H                            2 #define _UAPI_LINUX_FD_H
  4                                                     3 
  5 #include <linux/ioctl.h>                            4 #include <linux/ioctl.h>
  6 #include <linux/compiler.h>                         5 #include <linux/compiler.h>
  7                                                     6 
  8 /* New file layout: Now the ioctl definitions       7 /* New file layout: Now the ioctl definitions immediately follow the
  9  * definitions of the structures that they use      8  * definitions of the structures that they use */
 10                                                     9 
 11 /*                                                 10 /*
 12  * Geometry                                        11  * Geometry
 13  */                                                12  */
 14 struct floppy_struct {                             13 struct floppy_struct {
 15         unsigned int    size,           /* nr      14         unsigned int    size,           /* nr of sectors total */
 16                         sect,           /* sec     15                         sect,           /* sectors per track */
 17                         head,           /* nr      16                         head,           /* nr of heads */
 18                         track,          /* nr      17                         track,          /* nr of tracks */
 19                         stretch;        /* bit     18                         stretch;        /* bit 0 !=0 means double track steps */
 20                                         /* bit     19                                         /* bit 1 != 0 means swap sides */
 21                                         /* bit     20                                         /* bits 2..9 give the first sector */
 22                                         /*  nu     21                                         /*  number (the LSB is flipped) */
 23 #define FD_STRETCH 1                               22 #define FD_STRETCH 1
 24 #define FD_SWAPSIDES 2                             23 #define FD_SWAPSIDES 2
 25 #define FD_ZEROBASED 4                             24 #define FD_ZEROBASED 4
 26 #define FD_SECTBASEMASK 0x3FC                      25 #define FD_SECTBASEMASK 0x3FC
 27 #define FD_MKSECTBASE(s) (((s) ^ 1) << 2)          26 #define FD_MKSECTBASE(s) (((s) ^ 1) << 2)
 28 #define FD_SECTBASE(floppy) ((((floppy)->stret     27 #define FD_SECTBASE(floppy) ((((floppy)->stretch & FD_SECTBASEMASK) >> 2) ^ 1)
 29                                                    28 
 30         unsigned char   gap,            /* gap     29         unsigned char   gap,            /* gap1 size */
 31                                                    30 
 32                         rate,           /* dat     31                         rate,           /* data rate. |= 0x40 for perpendicular */
 33 #define FD_2M 0x4                                  32 #define FD_2M 0x4
 34 #define FD_SIZECODEMASK 0x38                       33 #define FD_SIZECODEMASK 0x38
 35 #define FD_SIZECODE(floppy) (((((floppy)->rate     34 #define FD_SIZECODE(floppy) (((((floppy)->rate&FD_SIZECODEMASK)>> 3)+ 2) %8)
 36 #define FD_SECTSIZE(floppy) ( (floppy)->rate &     35 #define FD_SECTSIZE(floppy) ( (floppy)->rate & FD_2M ? \
 37                              512 : 128 << FD_S     36                              512 : 128 << FD_SIZECODE(floppy) )
 38 #define FD_PERP 0x40                               37 #define FD_PERP 0x40
 39                                                    38 
 40                         spec1,          /* ste     39                         spec1,          /* stepping rate, head unload time */
 41                         fmt_gap;        /* gap     40                         fmt_gap;        /* gap2 size */
 42         const char      * name; /* used only f     41         const char      * name; /* used only for predefined formats */
 43 };                                                 42 };
 44                                                    43 
 45                                                    44 
 46 /* commands needing write access have 0x40 set     45 /* commands needing write access have 0x40 set */
 47 /* commands needing super user access have 0x8     46 /* commands needing super user access have 0x80 set */
 48                                                    47 
 49 #define FDCLRPRM _IO(2, 0x41)                      48 #define FDCLRPRM _IO(2, 0x41)
 50 /* clear user-defined parameters */                49 /* clear user-defined parameters */
 51                                                    50 
 52 #define FDSETPRM _IOW(2, 0x42, struct floppy_s !!  51 #define FDSETPRM _IOW(2, 0x42, struct floppy_struct) 
 53 #define FDSETMEDIAPRM FDSETPRM                     52 #define FDSETMEDIAPRM FDSETPRM
 54 /* set user-defined parameters for current med     53 /* set user-defined parameters for current media */
 55                                                    54 
 56 #define FDDEFPRM _IOW(2, 0x43, struct floppy_s !!  55 #define FDDEFPRM _IOW(2, 0x43, struct floppy_struct) 
 57 #define FDGETPRM _IOR(2, 0x04, struct floppy_s     56 #define FDGETPRM _IOR(2, 0x04, struct floppy_struct)
 58 #define FDDEFMEDIAPRM FDDEFPRM                     57 #define FDDEFMEDIAPRM FDDEFPRM
 59 #define FDGETMEDIAPRM FDGETPRM                     58 #define FDGETMEDIAPRM FDGETPRM
 60 /* set/get disk parameters */                      59 /* set/get disk parameters */
 61                                                    60 
 62                                                    61 
 63 #define FDMSGON  _IO(2,0x45)                       62 #define FDMSGON  _IO(2,0x45)
 64 #define FDMSGOFF _IO(2,0x46)                       63 #define FDMSGOFF _IO(2,0x46)
 65 /* issue/don't issue kernel messages on media      64 /* issue/don't issue kernel messages on media type change */
 66                                                    65 
 67                                                    66 
 68 /*                                             !!  67 /* 
 69  * Formatting (obsolete)                           68  * Formatting (obsolete)
 70  */                                                69  */
 71 #define FD_FILL_BYTE 0xF6 /* format fill byte.     70 #define FD_FILL_BYTE 0xF6 /* format fill byte. */
 72                                                    71 
 73 struct format_descr {                              72 struct format_descr {
 74         unsigned int device,head,track;            73         unsigned int device,head,track;
 75 };                                                 74 };
 76                                                    75 
 77 #define FDFMTBEG _IO(2,0x47)                       76 #define FDFMTBEG _IO(2,0x47)
 78 /* begin formatting a disk */                      77 /* begin formatting a disk */
 79 #define FDFMTTRK _IOW(2,0x48, struct format_de     78 #define FDFMTTRK _IOW(2,0x48, struct format_descr)
 80 /* format the specified track */                   79 /* format the specified track */
 81 #define FDFMTEND _IO(2,0x49)                       80 #define FDFMTEND _IO(2,0x49)
 82 /* end formatting a disk */                        81 /* end formatting a disk */
 83                                                    82 
 84                                                    83 
 85 /*                                                 84 /*
 86  * Error thresholds                                85  * Error thresholds
 87  */                                                86  */
 88 struct floppy_max_errors {                         87 struct floppy_max_errors {
 89         unsigned int                               88         unsigned int
 90           abort,      /* number of errors to b     89           abort,      /* number of errors to be reached before aborting */
 91           read_track, /* maximal number of err     90           read_track, /* maximal number of errors permitted to read an
 92                        * entire track at once      91                        * entire track at once */
 93           reset,      /* maximal number of err     92           reset,      /* maximal number of errors before a reset is tried */
 94           recal,      /* maximal number of err     93           recal,      /* maximal number of errors before a recalibrate is
 95                        * tried */                  94                        * tried */
 96                                                    95 
 97           /*                                       96           /*
 98            * Threshold for reporting FDC error     97            * Threshold for reporting FDC errors to the console.
 99            * Setting this to zero may flood yo     98            * Setting this to zero may flood your screen when using
100            * ultra cheap floppies ;-)              99            * ultra cheap floppies ;-)
101            */                                     100            */
102           reporting;                              101           reporting;
103                                                   102 
104 };                                                103 };
105                                                   104 
106 #define FDSETEMSGTRESH  _IO(2,0x4a)               105 #define FDSETEMSGTRESH  _IO(2,0x4a)
107 /* set fdc error reporting threshold */           106 /* set fdc error reporting threshold */
108                                                   107 
109 #define FDFLUSH  _IO(2,0x4b)                      108 #define FDFLUSH  _IO(2,0x4b)
110 /* flush buffers for media; either for verifyi    109 /* flush buffers for media; either for verifying media, or for
111  * handling a media change without closing the    110  * handling a media change without closing the file descriptor */
112                                                   111 
113 #define FDSETMAXERRS _IOW(2, 0x4c, struct flop    112 #define FDSETMAXERRS _IOW(2, 0x4c, struct floppy_max_errors)
114 #define FDGETMAXERRS _IOR(2, 0x0e, struct flop    113 #define FDGETMAXERRS _IOR(2, 0x0e, struct floppy_max_errors)
115 /* set/get abortion and read_track threshold.     114 /* set/get abortion and read_track threshold. See also floppy_drive_params
116  * structure */                                   115  * structure */
117                                                   116 
118                                                   117 
119 typedef char floppy_drive_name[16];               118 typedef char floppy_drive_name[16];
120 #define FDGETDRVTYP _IOR(2, 0x0f, floppy_drive    119 #define FDGETDRVTYP _IOR(2, 0x0f, floppy_drive_name)
121 /* get drive type: 5 1/4 or 3 1/2 */              120 /* get drive type: 5 1/4 or 3 1/2 */
122                                                   121 
123                                                   122 
124 /*                                                123 /*
125  * Drive parameters (user modifiable)             124  * Drive parameters (user modifiable)
126  */                                               125  */
127 struct floppy_drive_params {                      126 struct floppy_drive_params {
128         signed char cmos;               /* CMO    127         signed char cmos;               /* CMOS type */
129                                                !! 128         
130         /* Spec2 is (HLD<<1 | ND), where HLD i !! 129         /* Spec2 is (HLD<<1 | ND), where HLD is head load time (1=2ms, 2=4 ms 
131          * etc) and ND is set means no DMA. Ha    130          * etc) and ND is set means no DMA. Hardcoded to 6 (HLD=6ms, use DMA).
132          */                                       131          */
133         unsigned long max_dtr;          /* Ste    132         unsigned long max_dtr;          /* Step rate, usec */
134         unsigned long hlt;              /* Hea    133         unsigned long hlt;              /* Head load/settle time, msec */
135         unsigned long hut;              /* Hea !! 134         unsigned long hut;              /* Head unload time (remnant of 
136                                          * 8"     135                                          * 8" drives) */
137         unsigned long srt;              /* Ste    136         unsigned long srt;              /* Step rate, usec */
138                                                   137 
139         unsigned long spinup;           /* tim    138         unsigned long spinup;           /* time needed for spinup (expressed
140                                          * in     139                                          * in jiffies) */
141         unsigned long spindown;         /* tim    140         unsigned long spindown;         /* timeout needed for spindown */
142         unsigned char spindown_offset;  /* dec    141         unsigned char spindown_offset;  /* decides in which position the disk
143                                          * wil    142                                          * will stop */
144         unsigned char select_delay;     /* del    143         unsigned char select_delay;     /* delay to wait after select */
145         unsigned char rps;              /* rot    144         unsigned char rps;              /* rotations per second */
146         unsigned char tracks;           /* max    145         unsigned char tracks;           /* maximum number of tracks */
147         unsigned long timeout;          /* tim    146         unsigned long timeout;          /* timeout for interrupt requests */
148                                                !! 147         
149         unsigned char interleave_sect;  /* if  !! 148         unsigned char interleave_sect;  /* if there are more sectors, use 
150                                          * int    149                                          * interleave */
151                                                !! 150         
152         struct floppy_max_errors max_errors;      151         struct floppy_max_errors max_errors;
153                                                !! 152         
154         char flags;                     /* var    153         char flags;                     /* various flags, including ftd_msg */
155 /*                                                154 /*
156  * Announce successful media type detection an    155  * Announce successful media type detection and media information loss after
157  * disk changes.                                  156  * disk changes.
158  * Also used to enable/disable printing of ove    157  * Also used to enable/disable printing of overrun warnings.
159  */                                               158  */
160                                                   159 
161 #define FTD_MSG 0x10                              160 #define FTD_MSG 0x10
162 #define FD_BROKEN_DCL 0x20                        161 #define FD_BROKEN_DCL 0x20
163 #define FD_DEBUG 0x02                             162 #define FD_DEBUG 0x02
164 #define FD_SILENT_DCL_CLEAR 0x4                   163 #define FD_SILENT_DCL_CLEAR 0x4
165 #define FD_INVERTED_DCL 0x80 /* must be 0x80,  !! 164 #define FD_INVERTED_DCL 0x80 /* must be 0x80, because of hardware 
166                                 considerations    165                                 considerations */
167                                                   166 
168         char read_track;                /* use    167         char read_track;                /* use readtrack during probing? */
169                                                   168 
170 /*                                                169 /*
171  * Auto-detection. Each drive type has eight f    170  * Auto-detection. Each drive type has eight formats which are
172  * used in succession to try to read the disk.    171  * used in succession to try to read the disk. If the FDC cannot lock onto
173  * the disk, the next format is tried. This us    172  * the disk, the next format is tried. This uses the variable 'probing'.
174  */                                               173  */
175                                                !! 174         short autodetect[8];            /* autodetected formats */
176 #define FD_AUTODETECT_SIZE 8                   !! 175         
177                                                !! 176         int checkfreq; /* how often should the drive be checked for disk 
178         short autodetect[FD_AUTODETECT_SIZE];  << 
179                                                << 
180         int checkfreq; /* how often should the << 
181                         * changes */              177                         * changes */
182         int native_format; /* native format of    178         int native_format; /* native format of this drive */
183 };                                                179 };
184                                                   180 
185 enum {                                            181 enum {
186         FD_NEED_TWADDLE_BIT,    /* more magic     182         FD_NEED_TWADDLE_BIT,    /* more magic */
187         FD_VERIFY_BIT,          /* inquire for    183         FD_VERIFY_BIT,          /* inquire for write protection */
188         FD_DISK_NEWCHANGE_BIT,  /* change dete    184         FD_DISK_NEWCHANGE_BIT,  /* change detected, and no action undertaken yet
189                                  * to clear me    185                                  * to clear media change status */
190         FD_UNUSED_BIT,                            186         FD_UNUSED_BIT,
191         FD_DISK_CHANGED_BIT,    /* disk has be    187         FD_DISK_CHANGED_BIT,    /* disk has been changed since last i/o */
192         FD_DISK_WRITABLE_BIT,   /* disk is wri    188         FD_DISK_WRITABLE_BIT,   /* disk is writable */
193         FD_OPEN_SHOULD_FAIL_BIT                   189         FD_OPEN_SHOULD_FAIL_BIT
194 };                                                190 };
195                                                   191 
196 #define FDSETDRVPRM _IOW(2, 0x90, struct flopp    192 #define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)
197 #define FDGETDRVPRM _IOR(2, 0x11, struct flopp    193 #define FDGETDRVPRM _IOR(2, 0x11, struct floppy_drive_params)
198 /* set/get drive parameters */                    194 /* set/get drive parameters */
199                                                   195 
200                                                   196 
201 /*                                                197 /*
202  * Current drive state (not directly modifiabl    198  * Current drive state (not directly modifiable by user, readonly)
203  */                                               199  */
204 struct floppy_drive_struct {                      200 struct floppy_drive_struct {
205         unsigned long flags;                      201         unsigned long flags;
206 /* values for these flags */                      202 /* values for these flags */
207 #define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_    203 #define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_BIT)
208 #define FD_VERIFY (1 << FD_VERIFY_BIT)            204 #define FD_VERIFY (1 << FD_VERIFY_BIT)
209 #define FD_DISK_NEWCHANGE (1 << FD_DISK_NEWCHA    205 #define FD_DISK_NEWCHANGE (1 << FD_DISK_NEWCHANGE_BIT)
210 #define FD_DISK_CHANGED (1 << FD_DISK_CHANGED_    206 #define FD_DISK_CHANGED (1 << FD_DISK_CHANGED_BIT)
211 #define FD_DISK_WRITABLE (1 << FD_DISK_WRITABL    207 #define FD_DISK_WRITABLE (1 << FD_DISK_WRITABLE_BIT)
212                                                   208 
213         unsigned long spinup_date;                209         unsigned long spinup_date;
214         unsigned long select_date;                210         unsigned long select_date;
215         unsigned long first_read_date;            211         unsigned long first_read_date;
216         short probed_format;                      212         short probed_format;
217         short track; /* current track */          213         short track; /* current track */
218         short maxblock; /* id of highest block    214         short maxblock; /* id of highest block read */
219         short maxtrack; /* id of highest half     215         short maxtrack; /* id of highest half track read */
220         int generation; /* how many diskchange    216         int generation; /* how many diskchanges? */
221                                                   217 
222 /*                                                218 /*
223  * (User-provided) media information is _not_     219  * (User-provided) media information is _not_ discarded after a media change
224  * if the corresponding keep_data flag is non-    220  * if the corresponding keep_data flag is non-zero. Positive values are
225  * decremented after each probe.                  221  * decremented after each probe.
226  */                                               222  */
227         int keep_data;                            223         int keep_data;
228                                                !! 224         
229         /* Prevent "aliased" accesses. */         225         /* Prevent "aliased" accesses. */
230         int fd_ref;                               226         int fd_ref;
231         int fd_device;                            227         int fd_device;
232         unsigned long last_checked; /* when wa !! 228         unsigned long last_checked; /* when was the drive last checked for a disk 
233                            * change? */           229                            * change? */
234                                                !! 230         
235         char *dmabuf;                             231         char *dmabuf;
236         int bufblocks;                            232         int bufblocks;
237 };                                                233 };
238                                                   234 
239 #define FDGETDRVSTAT _IOR(2, 0x12, struct flop    235 #define FDGETDRVSTAT _IOR(2, 0x12, struct floppy_drive_struct)
240 #define FDPOLLDRVSTAT _IOR(2, 0x13, struct flo    236 #define FDPOLLDRVSTAT _IOR(2, 0x13, struct floppy_drive_struct)
241 /* get drive state: GET returns the cached sta    237 /* get drive state: GET returns the cached state, POLL polls for new state */
242                                                   238 
243                                                   239 
244 /*                                                240 /*
245  * reset FDC                                      241  * reset FDC
246  */                                               242  */
247 enum reset_mode {                                 243 enum reset_mode {
248         FD_RESET_IF_NEEDED,     /* reset only     244         FD_RESET_IF_NEEDED,     /* reset only if the reset flags is set */
249         FD_RESET_IF_RAWCMD,     /* obsolete */    245         FD_RESET_IF_RAWCMD,     /* obsolete */
250         FD_RESET_ALWAYS         /* reset alway    246         FD_RESET_ALWAYS         /* reset always */
251 };                                                247 };
252 #define FDRESET _IO(2, 0x54)                      248 #define FDRESET _IO(2, 0x54)
253                                                   249 
254                                                   250 
255 /*                                                251 /*
256  * FDC state                                      252  * FDC state
257  */                                               253  */
258 struct floppy_fdc_state {                      !! 254 struct floppy_fdc_state {       
259         int spec1;              /* spec1 value    255         int spec1;              /* spec1 value last used */
260         int spec2;              /* spec2 value    256         int spec2;              /* spec2 value last used */
261         int dtr;                                  257         int dtr;
262         unsigned char version;  /* FDC version    258         unsigned char version;  /* FDC version code */
263         unsigned char dor;                        259         unsigned char dor;
264         unsigned long address;  /* io address     260         unsigned long address;  /* io address */
265         unsigned int rawcmd:2;                    261         unsigned int rawcmd:2;
266         unsigned int reset:1;                     262         unsigned int reset:1;
267         unsigned int need_configure:1;            263         unsigned int need_configure:1;
268         unsigned int perp_mode:2;                 264         unsigned int perp_mode:2;
269         unsigned int has_fifo:1;                  265         unsigned int has_fifo:1;
270         unsigned int driver_version;    /* ver    266         unsigned int driver_version;    /* version code for floppy driver */
271 #define FD_DRIVER_VERSION 0x100                   267 #define FD_DRIVER_VERSION 0x100
272 /* user programs using the floppy API should u    268 /* user programs using the floppy API should use floppy_fdc_state to
273  * get the version number of the floppy driver    269  * get the version number of the floppy driver that they are running
274  * on. If this version number is bigger than t    270  * on. If this version number is bigger than the one compiled into the
275  * user program (the FD_DRIVER_VERSION define)    271  * user program (the FD_DRIVER_VERSION define), it should be prepared
276  * to bigger structures                           272  * to bigger structures
277  */                                               273  */
278                                                   274 
279         unsigned char track[4];                   275         unsigned char track[4];
280         /* Position of the heads of the 4 unit    276         /* Position of the heads of the 4 units attached to this FDC,
281          * as stored on the FDC. In the future    277          * as stored on the FDC. In the future, the position as stored
282          * on the FDC might not agree with the    278          * on the FDC might not agree with the actual physical
283          * position of these drive heads. By a    279          * position of these drive heads. By allowing such
284          * disagreement, it will be possible t    280          * disagreement, it will be possible to reset the FDC without
285          * incurring the expensive cost of rep    281          * incurring the expensive cost of repositioning all heads.
286          * Right now, these positions are hard    282          * Right now, these positions are hard wired to 0. */
287                                                   283 
288 };                                                284 };
289                                                   285 
290 #define FDGETFDCSTAT _IOR(2, 0x15, struct flop    286 #define FDGETFDCSTAT _IOR(2, 0x15, struct floppy_fdc_state)
291                                                   287 
292                                                   288 
293 /*                                                289 /*
294  * Asynchronous Write error tracking              290  * Asynchronous Write error tracking
295  */                                               291  */
296 struct floppy_write_errors {                      292 struct floppy_write_errors {
297         /* Write error logging.                   293         /* Write error logging.
298          *                                        294          *
299          * These fields can be cleared with th    295          * These fields can be cleared with the FDWERRORCLR ioctl.
300          * Only writes that were attempted but    296          * Only writes that were attempted but failed due to a physical media
301          * error are logged.  write(2) calls t    297          * error are logged.  write(2) calls that fail and return an error code
302          * to the user process are not counted    298          * to the user process are not counted.
303          */                                       299          */
304                                                   300 
305         unsigned int write_errors;  /* number  !! 301         unsigned int write_errors;  /* number of physical write errors 
306                                      * encount    302                                      * encountered */
307                                                !! 303         
308         /* position of first and last write er    304         /* position of first and last write errors */
309         unsigned long first_error_sector;         305         unsigned long first_error_sector;
310         int           first_error_generation;     306         int           first_error_generation;
311         unsigned long last_error_sector;          307         unsigned long last_error_sector;
312         int           last_error_generation;      308         int           last_error_generation;
313                                                !! 309         
314         unsigned int badness; /* highest retry !! 310         unsigned int badness; /* highest retry count for a read or write 
315                                * operation */     311                                * operation */
316 };                                                312 };
317                                                   313 
318 #define FDWERRORCLR  _IO(2, 0x56)                 314 #define FDWERRORCLR  _IO(2, 0x56)
319 /* clear write error and badness information *    315 /* clear write error and badness information */
320 #define FDWERRORGET  _IOR(2, 0x17, struct flop    316 #define FDWERRORGET  _IOR(2, 0x17, struct floppy_write_errors)
321 /* get write error and badness information */     317 /* get write error and badness information */
322                                                   318 
323                                                   319 
324 /*                                                320 /*
325  * Raw commands                                   321  * Raw commands
326  */                                               322  */
327 /* new interface flag: now we can do them in b    323 /* new interface flag: now we can do them in batches */
328 #define FDHAVEBATCHEDRAWCMD                       324 #define FDHAVEBATCHEDRAWCMD
329                                                   325 
330 struct floppy_raw_cmd {                           326 struct floppy_raw_cmd {
331         unsigned int flags;                       327         unsigned int flags;
332 #define FD_RAW_READ 1                             328 #define FD_RAW_READ 1
333 #define FD_RAW_WRITE 2                            329 #define FD_RAW_WRITE 2
334 #define FD_RAW_NO_MOTOR 4                         330 #define FD_RAW_NO_MOTOR 4
335 #define FD_RAW_DISK_CHANGE 4 /* out: disk chan    331 #define FD_RAW_DISK_CHANGE 4 /* out: disk change flag was set */
336 #define FD_RAW_INTR 8    /* wait for an interr    332 #define FD_RAW_INTR 8    /* wait for an interrupt */
337 #define FD_RAW_SPIN 0x10 /* spin up the disk f    333 #define FD_RAW_SPIN 0x10 /* spin up the disk for this command */
338 #define FD_RAW_NO_MOTOR_AFTER 0x20 /* switch t !! 334 #define FD_RAW_NO_MOTOR_AFTER 0x20 /* switch the motor off after command 
339                                     * completi    335                                     * completion */
340 #define FD_RAW_NEED_DISK 0x40  /* this command    336 #define FD_RAW_NEED_DISK 0x40  /* this command needs a disk to be present */
341 #define FD_RAW_NEED_SEEK 0x80  /* this command    337 #define FD_RAW_NEED_SEEK 0x80  /* this command uses an implied seek (soft) */
342                                                   338 
343 /* more "in" flags */                             339 /* more "in" flags */
344 #define FD_RAW_MORE 0x100  /* more records fol    340 #define FD_RAW_MORE 0x100  /* more records follow */
345 #define FD_RAW_STOP_IF_FAILURE 0x200 /* stop i    341 #define FD_RAW_STOP_IF_FAILURE 0x200 /* stop if we encounter a failure */
346 #define FD_RAW_STOP_IF_SUCCESS 0x400 /* stop i    342 #define FD_RAW_STOP_IF_SUCCESS 0x400 /* stop if command successful */
347 #define FD_RAW_SOFTFAILURE 0x800 /* consider t    343 #define FD_RAW_SOFTFAILURE 0x800 /* consider the return value for failure
348                                   * detection     344                                   * detection too */
349                                                   345 
350 /* more "out" flags */                            346 /* more "out" flags */
351 #define FD_RAW_FAILURE 0x10000 /* command sent    347 #define FD_RAW_FAILURE 0x10000 /* command sent to fdc, fdc returned error */
352 #define FD_RAW_HARDFAILURE 0x20000 /* fdc had     348 #define FD_RAW_HARDFAILURE 0x20000 /* fdc had to be reset, or timed out */
353                                                   349 
354         void __user *data;                        350         void __user *data;
355         char *kernel_data; /* location of data    351         char *kernel_data; /* location of data buffer in the kernel */
356         struct floppy_raw_cmd *next; /* used f !! 352         struct floppy_raw_cmd *next; /* used for chaining of raw cmd's 
357                                       * within    353                                       * within the kernel */
358         long length; /* in: length of dma tran    354         long length; /* in: length of dma transfer. out: remaining bytes */
359         long phys_length; /* physical length,     355         long phys_length; /* physical length, if different from dma length */
360         int buffer_length; /* length of alloca    356         int buffer_length; /* length of allocated buffer */
361                                                   357 
362         unsigned char rate;                       358         unsigned char rate;
363                                                << 
364 #define FD_RAW_CMD_SIZE 16                     << 
365 #define FD_RAW_REPLY_SIZE 16                   << 
366 #define FD_RAW_CMD_FULLSIZE (FD_RAW_CMD_SIZE + << 
367                                                << 
368         /* The command may take up the space i << 
369          * and the reply count. Needed for lon << 
370          * which takes 17 command bytes.       << 
371          */                                    << 
372                                                << 
373         unsigned char cmd_count;                  359         unsigned char cmd_count;
374         union {                                !! 360         unsigned char cmd[16];
375                 struct {                       !! 361         unsigned char reply_count;
376                         unsigned char cmd[FD_R !! 362         unsigned char reply[16];
377                         unsigned char reply_co << 
378                         unsigned char reply[FD << 
379                 };                             << 
380                 unsigned char fullcmd[FD_RAW_C << 
381         };                                     << 
382         int track;                                363         int track;
383         int resultcode;                           364         int resultcode;
384                                                   365 
385         int reserved1;                            366         int reserved1;
386         int reserved2;                            367         int reserved2;
387 };                                                368 };
388                                                   369 
389 #define FDRAWCMD _IO(2, 0x58)                     370 #define FDRAWCMD _IO(2, 0x58)
390 /* send a raw command to the fdc. Structure si    371 /* send a raw command to the fdc. Structure size not included, because of
391  * batches */                                     372  * batches */
392                                                   373 
393 #define FDTWADDLE _IO(2, 0x59)                    374 #define FDTWADDLE _IO(2, 0x59)
394 /* flicker motor-on bit before reading a secto    375 /* flicker motor-on bit before reading a sector. Experimental */
395                                                   376 
396                                                   377 
397 #define FDEJECT _IO(2, 0x5a)                      378 #define FDEJECT _IO(2, 0x5a)
398 /* eject the disk */                              379 /* eject the disk */
399                                                   380 
400                                                   381 
401                                                   382 
402 #endif /* _UAPI_LINUX_FD_H */                     383 #endif /* _UAPI_LINUX_FD_H */
403                                                   384 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php