|
|
1.1 root 1: /*
2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7: * Reserved. This file contains Original Code and/or Modifications of
8: * Original Code as defined in and that are subject to the Apple Public
9: * Source License Version 1.1 (the "License"). You may not use this file
10: * except in compliance with the License. Please obtain a copy of the
11: * License at http://www.apple.com/publicsource and read it before using
12: * this file.
13: *
14: * The Original Code and all software distributed under the License are
15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19: * License for the specific language governing rights and limitations
20: * under the License.
21: *
22: * @APPLE_LICENSE_HEADER_END@
23: */
24:
25: /* @(#)fd_extern.h 2.0 01/25/90 (c) 1990 NeXT
26: *
27: * fd_vars.h -- Externally used data structures and constants for Floppy
28: * Disk driver
29: *
30: * KERNEL VERSION
31: *
32: * HISTORY
33: * 13-May-94 Dean Reece
34: * Added define and struct for FDIOCGCAPLIST to return possible
35: * format densities. Enables workspace to build a menu.
36: * 20-Mar-91 Doug Mitchell
37: * Made #importing pmap.h and vm_map.h dependent on #ifdef KERNEL.
38: * 25-Jan-90 Doug Mitchell at NeXT
39: * Created.
40: *
41: */
42:
43: #ifndef _FDEXTERN_
44: #define _FDEXTERN_
45:
46: #import <sys/types.h>
47: #import <sys/ioctl.h>
48: #import <mach/boolean.h>
49: #import <mach/vm_param.h>
50: #define FD_CMDSIZE 0x10 /* max size of command passed to
51: * controller */
52: #define FD_STATSIZE 0x10 /* max size of status array returned
53: * from controller */
54: #define FD_MAX_CAP_LIST 8
55:
56: typedef int fd_return_t; /* see FDR_xxx, below */
57:
58: struct fd_drive_stat {
59: u_char media_id:2, /* media type currently inserted. See
60: * FD_MID_xxx, below. */
61: motor_on:1, /* state of motor at I/O complete
62: * 1 = on; 0 = off */
63: write_prot:1, /* write protect 1 = Write Protected */
64: drive_present:1,
65: rsvd1:3; /* reserved */
66: };
67:
68: /*
69: * Format Capacity List struct. Returned by FDIOCGCAPLIST ioctl as a list
70: * of possible format capacities. Entries are possible capacities
71: * in 1k (1024) units. List is null terminated, so the useful size is
72: * (FD_MAX_CAP_LIST - 1).
73: */
74: struct fd_cap_list {
75: int capacity[FD_MAX_CAP_LIST];
76: };
77:
78: /*
79: * I/O request struct. Used in DKIOCREQ ioctl to specify one command sequence
80: * to be executed.
81: */
82: struct fd_ioreq {
83: /*
84: * inputs to driver:
85: */
86: u_char density; /* see FD_DENS_xxx, below */
87: int timeout; /* I/O timeout in milliseconds. Used
88: * in FDCMD_CMD_XFR commands only. */
89: int command; /* see FDCMD_xxx, below */
90: u_char cmd_blk[FD_CMDSIZE];
91: /* actual command bytes */
92: u_int num_cmd_bytes; /* expected # of bytes in cmd_blk[] to
93: * transfer */
94: caddr_t addrs; /* source/dest of data */
95: u_int byte_count; /* max # of data bytes to move */
96: u_char stat_blk[FD_STATSIZE];
97: /* status returned from controller */
98: u_int num_stat_bytes; /* number of status bytes to transfer
99: * to stat_blk[] */
100: int flags; /* see FD_IOF_xxx, below */
101:
102: /*
103: * outputs from driver:
104: */
105: fd_return_t status; /* FDR_SUCCESS, etc. */
106: u_int cmd_bytes_xfr; /* # of command bytes actually moved */
107: u_int bytes_xfr; /* # of data bytes actually moved */
108: u_int stat_bytes_xfr; /* # if status bytes moved to
109: * stat_blk[] */
110: struct fd_drive_stat drive_stat; /* media ID, etc. */
111:
112: /*
113: * used internally by driver
114: */
115: struct pmap *pmap; /* DMA is mapped by this */
116: struct vm_map *map; /* map of requestor's task */
117: u_char unit; /* drive # (relative to controller) */
118: };
119:
120: typedef struct fd_ioreq fdIoReq_t;
121: typedef struct fd_ioreq *fd_ioreq_t;
122:
123: /*
124: * fd_ioreq.command values
125: */
126: #define FDCMD_BAD 0x00 /* not used */
127: #define FDCMD_CMD_XFR 0x01 /* transfer command in fd_ioreq.cmd_blk
128: */
129: #define FDCMD_EJECT 0x02 /* eject disk */
130: #define FDCMD_MOTOR_ON 0x03 /* motor on */
131: #define FDCMD_MOTOR_OFF 0x04 /* motor off */
132: #define FDCMD_GET_STATUS 0x05 /* Get status (media ID, motor state,
133: * write protect) */
134:
135: /*
136: * fd_ioreq.density values. Some routines rely on these being in
137: * cardinal order...
138: */
139: #define FD_DENS_NONE 0 /* unformatted */
140: #define FD_DENS_1 1 /* 1 MByte/disk unformatted */
141: #define FD_DENS_2 2 /* 2 MByte/disk unformatted */
142: #define FD_DENS_4 3 /* 4 MByte/disk unformatted */
143:
144: #if i386
145: #define FD_DENS_DEFAULT FD_DENS_2
146: #else
147: #define FD_DENS_DEFAULT FD_DENS_4
148: #endif
149:
150: /*
151: * fd_ioreq.flags values
152: */
153: #define FD_IOF_DMA_DIR 0x00000002
154: #define FD_IOF_DMA_RD 0x00000002 /* DMA direction = device to
155: * host */
156: #define FD_IOF_DMA_WR 0x00000000 /* DMA direction = host to
157: * device */
158:
159: /*
160: * fdr_return_t values
161: */
162: #define FDR_SUCCESS 0 /* OK */
163: #define FDR_TIMEOUT 1 /* fd_ioreq.timeout exceeded */
164: #define FDR_MEMALLOC 2 /* couldn't allocate memory */
165: #define FDR_MEMFAIL 3 /* memory transfer error */
166: #define FDR_REJECT 4 /* bad field in fd_ioreq */
167: #define FDR_BADDRV 5 /* drive not present */
168: #define FDR_DATACRC 6 /* media error - data CRC */
169: #define FDR_HDRCRC 7 /* media error - header CRC */
170: #define FDR_MEDIA 8 /* misc. media error */
171: #define FDR_SEEK 9 /* seek error */
172: #define FDR_BADPHASE 10 /* controller changed phase
173: * unexpectedly */
174: #define FDR_DRIVE_FAIL 11 /* Basic Drive Failure */
175: #define FDR_NOHDR 12 /* Header Not Found */
176: #define FDR_WRTPROT 13 /* Disk Write Protected */
177: #define FDR_NO_ADDRS_MK 14 /* Missing Address Mark */
178: #define FDR_CNTRL_MK 15 /* Missing Control Mark */
179: #define FDR_NO_DATA_MK 16 /* Missing Data Mark */
180: #define FDR_CNTRL_REJECT 17 /* controller rejected command */
181: #define FDR_CNTRLR 18 /* Controller Handshake Error */
182: #define FDR_DMAOURUN 19 /* DMA Over/underrun */
183: #define FDR_VOLUNAVAIL 20 /* Requested Volume not available */
184: #define FDR_ALIGN 21 /* DMA alignment error */
185: #define FDR_DMA 22 /* DMA error */
186: #define FDR_SPURIOUS 23 /* spurious interrupt */
187:
188: /*
189: * fd_drive_stat.media_id values
190: */
191: #define FD_MID_NONE 0 /* no disk inserted */
192: #define FD_MID_1MB 3 /* 1 MByte unformatted */
193: #define FD_MID_2MB 2 /* 2 MByte unformatted */
194: #define FD_MID_4MB 1 /* 4 MBytes unformatted */
195:
196: #if i386 || hppa
197: #define FD_MID_DEFAULT FD_MID_2MB
198: #ifdef KERNEL /* Maximum Number of bytes of data
199: that can be transfered via DMA
200: using FDIOCREQ ioctl command
201: */
202:
203: #define FD_MAX_DMA_SIZE PAGE_SIZE
204: #else
205: #define FD_MAX_DMA_SIZE vm_page_size
206: #endif /* KERNEL */
207: #endif /* i386 || hppa */
208:
209: /*
210: * ioctl's specific to floppy disk
211: */
212: #define FDIOCREQ _IOWR('f', 0, struct fd_ioreq) /* cmd request */
213: #define FDIOCGFORM _IOR ('f', 1, struct fd_format_info)
214: /* get format */
215: #define FDIOCSDENS _IOW ('f', 2, int) /* set density */
216: #define FDIOCSSIZE _IOW ('f', 3, int) /* set sector size */
217: #define FDIOCSGAPL _IOW ('f', 4, int) /* set Gap 3 length */
218: #define FDIOCRRW _IOWR('f', 5, struct fd_rawio) /* raw read/write */
219: #define FDIOCSIRETRY _IOW ('f', 6, int) /* set inner retry loop
220: * count */
221: #define FDIOCGIRETRY _IOR ('f', 7, int) /* get inner retry loop
222: * count */
223: #define FDIOCSORETRY _IOW ('f', 8, int) /* set outer retry loop
224: * count */
225: #define FDIOCGORETRY _IOR ('f', 9, int) /* get outer retry loop
226: * count */
227: #define FDIOCGCAPLIST _IOR ('f', 10, struct fd_cap_list)
228: /* get list of possible format capacities */
229: /*
230: * software registers passed to controller during command sequences
231: */
232:
233: struct fd_rw_cmd {
234: /*
235: * 9 command bytes passed at start of read/write data
236: */
237:
238: #if __LITTLE_ENDIAN__
239:
240: u_char opcode:5,
241: sk:1, /* skip sectors with deleted AM */
242: mfm:1, /* MFM encoding */
243: mt:1; /* multi track */
244: u_char drive_sel:2, /* drive select */
245: hds:1, /* head select */
246: rsvd1:5; /* reserved */
247: u_char cylinder;
248: u_char head;
249: u_char sector;
250: u_char sector_size; /* 'n' in the Intel spec. */
251: u_char eot; /* sector # at end of track */
252: u_char gap_length; /* gap length */
253: u_char dtl; /* special sector size */
254:
255: #elif __BIG_ENDIAN__
256:
257: u_char mt:1, /* multitrack */
258: mfm:1, /* MFM encoding */
259: sk:1, /* skip sectors with deleted AM */
260: opcode:5;
261: u_char rsvd1:5, /* reserved */
262: hds:1, /* head select */
263: drive_sel:2; /* drive select */
264: u_char cylinder;
265: u_char head;
266: u_char sector;
267: u_char sector_size; /* 'n' in the Intel spec. */
268: u_char eot; /* sector # at end of track */
269: u_char gap_length; /* gap length */
270: u_char dtl; /* special sector size */
271:
272: #else
273: #error Floppy command / data structures are compiler sensitive
274: #endif
275: };
276:
277: #define SIZEOF_RW_CMD 9 /* compiler yields 9 as sizeof this
278: * struct */
279:
280: struct fd_rw_stat {
281: /*
282: * 7 status bytes passed at completion of read/write data
283: */
284:
285: u_char stat0;
286: u_char stat1;
287: u_char stat2;
288: u_char cylinder;
289: u_char head;
290: u_char sector;
291: u_char sector_size; /* 'n' in the Intel spec. */
292: };
293:
294: #define SIZEOF_RW_STAT 7
295:
296: struct fd_int_stat {
297: /*
298: * result of Sense Interrupt Status command
299: */
300: u_char stat0;
301: u_char pcn; /* present cylinder & */
302: };
303:
304: struct fd_seek_cmd {
305: /*
306: * Seek command. Uses Sense Interrupt Status to get results.
307: */
308:
309: #if __LITTLE_ENDIAN__
310:
311: u_char opcode:6, /* will be FCCMD_SEEK */
312: dir:1, /* 1 == towards spindle for
313: relative seek*/
314: relative:1; /* 1 = relative */
315: u_char drive_sel:2, /* drive select */
316: hds:1, /* head select */
317: rsvd1:5; /* reserved */
318: u_char cyl; /* cylinder # or offset */
319:
320: #elif __BIG_ENDIAN__
321:
322: u_char relative:1, /* 1 = relative */
323: dir:1, /* 1 == towards spindle */
324: opcode:6; /* will be FCCMD_SEEK */
325: u_char rsvd1:5, /* reserved */
326: hds:1, /* head select */
327: drive_sel:2; /* drive select */
328: u_char cyl; /* cylinder # or offset */
329:
330: #else
331: #error Floppy command / data structures are compiler sensitive
332: #endif
333: };
334:
335: #define SEEK_DIR_IN 1 /* seek towards spindle */
336: #define SEEK_DIR_OUT 0 /* seek away from spindle */
337:
338: #define SIZEOF_SEEK_CMD 3
339:
340: struct fd_recal_cmd {
341: /*
342: * Recalibrate command. Uses Sense Interrupt Status to get results.
343: */
344: u_char opcode; /* will be FCCMD_RECAL */
345:
346: #if __LITTLE_ENDIAN__
347:
348: u_char drive_sel:2, /* drive select */
349: rsvd1:6; /* reserved */
350:
351: #elif __BIG_ENDIAN__
352:
353: u_char rsvd1:6, /* reserved */
354: drive_sel:2; /* drive select */
355:
356: #else
357: #error Floppy command / data structures are compiler sensitive
358: #endif
359: };
360:
361: struct fd_configure_cmd {
362: /*
363: * configure command. No result bytes are returned.
364: */
365: u_char opcode; /* will be FCCMD_CONFIGURE */
366: u_char rsvd1; /* must be 0 */
367: u_char conf_2; /* EIS, EFIFO, etc. */
368: u_char pretrk; /* write precomp track # */
369: };
370:
371: /*
372: * configure command fields
373: */
374: #define CF2_EIS 0x40 /* enable implied seek */
375: #define CF2_EFIFO 0x20 /* enable FIFO. True Low. */
376: #define CF2_DPOLL 0x10 /* disable polling */
377: #define CF2_FIFO_DEFAULT 0x08 /* OUR default FIFO threshold */
378: #define CF_PRETRACK 0x00 /* OUR default precom track */
379: #define I82077_FIFO_SIZE 0x10 /* size of FIFO */
380:
381: struct fd_specify_cmd {
382: /*
383: * Specify command. No result bytes are returned.
384: */
385: u_char opcode; /* will be FCCMD_SPECIFY */
386:
387: #if __LITTLE_ENDIAN__
388:
389: u_char hut:4, /* head unload time */
390: srt:4; /* step rate */
391: u_char nd:1, /* Non-DMA mode */
392: hlt:7; /* head load time */
393:
394: #elif __BIG_ENDIAN__
395:
396: u_char srt:4, /* step rate */
397: hut:4; /* head unload time */
398: u_char hlt:7, /* head load time */
399: nd:1; /* Non-DMA mode */
400:
401: #else
402: #error Floppy command / data structures are compiler sensitive
403: #endif
404: };
405:
406: #define SIZEOF_SPECIFY_CMD 3
407:
408: struct fd_readid_cmd {
409: /*
410: * Read ID command. Returns status in an fd_rw_stat.
411: */
412:
413: #if __LITTLE_ENDIAN__
414:
415: u_char opcode:6, /* Will be FCCMD_READID */
416: mfm:1,
417: rsvd1:1;
418: u_char drive_sel:2, /* drive select */
419: hds:1, /* head select */
420: rsvd2:5; /* reserved */
421:
422: #elif __BIG_ENDIAN__
423:
424: u_char rsvd1:1,
425: mfm:1,
426: opcode:6; /* Will be FCCMD_READID */
427: u_char rsvd2:5, /* reserved */
428: hds:1, /* head select */
429: drive_sel:2; /* drive select */
430:
431: #else
432: #error Floppy command / data structures are compiler sensitive
433: #endif
434: };
435:
436: struct fd_perpendicular_cmd {
437: u_char opcode; /* will be FCCMD_PERPENDICULAR */
438:
439: #if __LITTLE_ENDIAN__
440:
441: u_char gap:1,
442: wgate:1,
443: rsvd1:6; /* must be 0 */
444:
445: #elif __BIG_ENDIAN__
446:
447: u_char rsvd1:6, /* must be 0 */
448: wgate:1,
449: gap:1;
450:
451: #else
452: #error Floppy command / data structures are compiler sensitive
453: #endif
454: };
455:
456: struct fd_format_cmd {
457: /*
458: * Format track command. Returns status in an fd_rw_stat
459: * (with undefined address fields).
460: */
461:
462: #if __LITTLE_ENDIAN__
463:
464: u_char opcode:6, /* will be FCCMD_FORMAT */
465: mfm:1,
466: rsvd1:1;
467: u_char drive_sel:2, /* drive select */
468: hds:1, /* head select */
469: rsvd2:5; /* reserved */
470:
471: #elif __BIG_ENDIAN__
472:
473: u_char rsvd1:1,
474: mfm:1,
475: opcode:6; /* will be FCCMD_FORMAT */
476: u_char rsvd2:5, /* reserved */
477: hds:1, /* head select */
478: drive_sel:2; /* drive select */
479:
480: #else
481: #error Floppy command / data structures are compiler sensitive
482: #endif
483: u_char n; /* sector size (2**n * 128 = sect_size)
484: */
485: u_char sects_per_trk;
486: u_char gap_length;
487: u_char filler_data; /* data field written with this byte */
488: };
489:
490: struct fd_sense_drive_status_cmd {
491: /*
492: * returns one result byte which is basically status register 3
493: */
494:
495: u_char opcode; /* will be FCCMD_DRIVE_STATUS */
496:
497: #if __LITTLE_ENDIAN__
498:
499: u_char drive_sel:2, /* drive select */
500: hds:1, /* head select */
501: resvd2:5; /* always zero */
502:
503: #elif __BIG_ENDIAN__
504:
505: u_char resvd2:5, /* always zero */
506: hds:1, /* head select */
507: drive_sel:2; /* drive select */
508:
509: #else
510: #error Floppy command / data structures are compiler sensitive
511: #endif
512: };
513:
514: /*
515: * software register values
516: */
517:
518: /*
519: * cmd (command byte). Not all of these opcodes are used with the fd_rw_cmd
520: * struct...
521: */
522: #define FCCMD_OPCODE_MASK 0x1F
523: #define FCCMD_MULTITRACK 0x80
524: #define FCCMD_MFM 0x40 /* MFM flag */
525: #define FCCMD_SK 0x20 /* skip flag */
526: #define FCCMD_READ 0x06
527: #define FCCMD_READ_DELETE 0x0C
528: #define FCCMD_WRITE 0x05
529: #define FCCMD_WRITE_DELETE 0x09
530: #define FCCMD_READ_TRACK 0x02
531: #define FCCMD_VERIFY 0x16
532: #define FCCMD_VERSION 0x10
533: #define FCCMD_FORMAT 0x0D
534: #define FCCMD_RECAL 0x07
535: #define FCCMD_INTSTAT 0x08 /* sense interrupt status */
536: #define FCCMD_SPECIFY 0x03
537: #define FCCMD_DRIVE_STATUS 0x04
538: #define FCCMD_SEEK 0x0F
539: #define FCCMD_CONFIGURE 0x13
540: #define FCCMD_DUMPREG 0x0E
541: #define FCCMD_READID 0x0A /* Read ID */
542: #define FCCMD_PERPENDICULAR 0x12 /* perpendicular recording mode
543: */
544: /*
545: * rws_stat0 (status register 0)
546: */
547: #define SR0_INTCODE 0xC0 /* interrupt code - see INTCODE_xxx */
548: #define INTCODE_COMPLETE 0x00 /* normal I/O complete */
549: #define INTCODE_ABNORMAL 0x40 /* abnormal termination */
550: #define INTCODE_INVALID 0x80 /* Invalid command */
551: #define INTCODE_POLL_TERM 0xC0 /* abnormal termination caused by
552: * polling */
553: #define SR0_SEEKEND 0x20 /* Seek End */
554: #define SR0_EQ_CHECK 0x10 /* Equipment check (recal failed,
555: * seek beyond track 0, etc.) */
556: #define SR0_HEAD 0x04 /* current head address */
557: #define SR0_DRVSEL 0x03
558: #define SR0_DRVSEL1 0x02 /* Drive Select 1 */
559: #define SR0_DRVSEL0 0x01 /* Drive Select 0 */
560:
561: /*
562: * rws_stat1 (status register 1)
563: */
564: #define SR1_EOCYL 0x80 /* end of cylinder */
565: #define SR1_CRCERR 0x20 /* data or ID CRC error */
566: #define SR1_OURUN 0x10 /* DMA over/underrun */
567: #define SR1_NOHDR 0x04 /* Header Not Found */
568: #define SR1_NOT_WRT 0x02 /* Not writable */
569: #define SR1_MISS_AM 0x01 /* Missing Address mark */
570:
571: /*
572: * rws_stat2 (status register 2)
573: */
574: #define SR2_CNTRL_MK 0x40 /* control mark */
575: #define SR2_DATACRC 0x20 /* Data CRC error */
576: #define SR2_WRONG_CYL 0x10 /* wrong cylinder */
577: #define SR2_BAD_CYL 0x02 /* Bad cylinder */
578: #define SR2_MISS_AM 0x01 /* missing data mark */
579:
580: /*
581: * rws_stat3 (status register 3)
582: */
583: #define SR3_WP 0x40 /* write protected */
584: #define SR3_TRACK0 0x10 /* Track 0 */
585: #define SR3_HEAD 0x04 /* Head # */
586: #define SR3_DRVSEL1 0x02 /* same as status register 0?? */
587: #define SR3_DEVSEL0 0x01
588:
589: /*
590: * disk info - maps media_id to tracks_per_cyl and num_cylinders.
591: */
592: struct fd_disk_info {
593: u_int media_id; /* FD_MID_1MB, etc. */
594: u_char tracks_per_cyl; /* # of heads */
595: u_int num_cylinders;
596: u_int max_density; /* maximum legal density.
597: * (FD_DENS_1, etc.) */
598: };
599:
600: /*
601: * sector size info - maps sector size to 82077 sector size code and
602: * gap3 length. Note that the controller must be programmed for different
603: * gap3 size when formatting as opposed to reading or writing. Since gap3
604: * sizes may be dependent on the actual disk hardware, the fmt gap is
605: * maintained here to avoid requiring the formatter to determine
606: * the disk device type.
607: */
608: struct fd_sectsize_info {
609: u_int sect_size; /* in bytes */
610: u_char n; /* 82077 sectsize code */
611: u_int sects_per_trk; /* physical sectors per trk */
612: u_char rw_gap_length; /* Gap 3 for rw cmds */
613: u_char fmt_gap_length; /* Gap 3 for fmt cmds */
614: };
615:
616: typedef struct fd_sectsize_info fd_sectsize_info_t;
617:
618: /*
619: * density info - maps density to capacity. Note that a disk may be formatted
620: * with a lower density than its max possible density.
621: */
622: struct fd_density_info {
623: u_int density; /* FD_DENS_1, etc. */
624: u_int capacity; /* in bytes */
625: boolean_t mfm; /* TRUE = MFM encoding */
626: };
627:
628: typedef struct fd_density_info fd_density_info_t;
629:
630: /*
631: * disk format info. Used with ioctl(FDIOCGFORM).
632: */
633: struct fd_format_info {
634: /*
635: * the disk_info struct is always valid as long as a disk is
636: * inserted.
637: */
638: struct fd_disk_info disk_info;
639:
640: int flags; /* See FFI_xxx, below */
641:
642: /*
643: * the remainder is only valid if (flags & FFI_FORMATTED) is true.
644: */
645: struct fd_density_info density_info;
646: struct fd_sectsize_info sectsize_info;
647: u_int total_sects; /* total # of sectors on
648: * disk */
649: };
650:
651: /*
652: * fd_format_info.flags fields
653: */
654: #define FFI_FORMATTED 0x00000001 /* known disk format */
655: #define FFI_LABELVALID 0x00000002 /* Valid NeXT file system label
656: * present */
657: #define FFI_WRITEPROTECT 0x00000004 /* disk is write protected */
658:
659: struct format_data {
660: /*
661: * one of these per sector. A Format command involves DMA'ing one of
662: * these for each sector on a track. The format command is executed
663: * with a FDIOCREQ ioctl.
664: */
665: u_char cylinder;
666: u_char head;
667: u_char sector;
668: u_char n; /* as in sector_size = 2**n * 128 */
669: };
670:
671: /*
672: * result of FCCMD_DUMPREG command
673: */
674: struct fd_82077_regs {
675: u_char pcn[4]; /* cylinder # for drives 0..3 */
676: u_char srt:4,
677: hut:4;
678: u_char hlt:7,
679: nd:1;
680: u_char sc_eot;
681: u_char rsvd1;
682: u_char rsvd2:1,
683: eis:1,
684: efifo:1,
685: poll:1,
686: fifothr:4;
687: u_char pretrk;
688: };
689:
690: /*
691: * Used for FDIOCRRW - raw disk I/O
692: * -- no bad block mapping
693: * -- no label required
694: * -- no front porch
695: * -- block size = physical sector size
696: */
697: struct fd_rawio {
698: /*
699: * Passed to driver
700: */
701: u_int sector;
702: u_int sector_count;
703: caddr_t dma_addrs;
704: boolean_t read; /* TRUE = read; FALSE = write */
705: /*
706: * Returned from driver
707: */
708: fd_return_t status; /* FDR_xxx (see above) */
709: u_int sects_xfr; /* sectors actually moved */
710: };
711:
712: /*
713: * misc. hardware constants
714: */
715: #define NUM_FD_HEADS 2 /* number of tracks/cylinder */
716: #define NUM_FD_CYL 80 /* cylinders/disk (is this actually a
717: * constant for all densities?) */
718: #define FD_PARK_TRACK 79 /* track to which to seek before
719: * eject */
720: #define NUM_UNITS 4 /* max # of drives per controller */
721:
722: #endif /* _FDEXTERN_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.