1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _AMIFD_H
3 #define _AMIFD_H
4 
5 /* Definitions for the Amiga floppy driver */
6 
7 #include <linux/fd.h>
8 
9 #define FD_MAX_UNITS    4	/* Max. Number of drives */
10 #define FLOPPY_MAX_SECTORS	22	/* Max. Number of sectors per track */
11 
12 #ifndef ASSEMBLER
13 
14 struct fd_data_type {
15     char *name;			/* description of data type */
16     int sects;			/* sectors per track */
17 #ifdef __STDC__
18     int (*read_fkt)(int);
19     void (*write_fkt)(int);
20 #else
21     int (*read_fkt)();		/* read whole track */
22     void (*write_fkt)();		/* write whole track */
23 #endif
24 };
25 
26 /*
27 ** Floppy type descriptions
28 */
29 
30 struct fd_drive_type {
31     unsigned long code;		/* code returned from drive */
32     char *name;			/* description of drive */
33     unsigned int tracks;	/* number of tracks */
34     unsigned int heads;		/* number of heads */
35     unsigned int read_size;	/* raw read size for one track */
36     unsigned int write_size;	/* raw write size for one track */
37     unsigned int sect_mult;	/* sectors and gap multiplier (HD = 2) */
38     unsigned int precomp1;	/* start track for precomp 1 */
39     unsigned int precomp2;	/* start track for precomp 2 */
40     unsigned int step_delay;	/* time (in ms) for delay after step */
41     unsigned int settle_time;	/* time to settle after dir change */
42     unsigned int side_time;	/* time needed to change sides */
43 };
44 
45 struct amiga_floppy_struct {
46     struct fd_drive_type *type;	/* type of floppy for this unit */
47     struct fd_data_type *dtype;	/* type of floppy for this unit */
48     int track;			/* current track (-1 == unknown) */
49     unsigned char *trackbuf;    /* current track (kmaloc()'d */
50 
51     int blocks;			/* total # blocks on disk */
52 
53     int changed;		/* true when not known */
54     int disk;			/* disk in drive (-1 == unknown) */
55     int motor;			/* true when motor is at speed */
56     int busy;			/* true when drive is active */
57     int dirty;			/* true when trackbuf is not on disk */
58     int status;			/* current error code for unit */
59     struct gendisk *gendisk;
60 };
61 #endif
62 
63 #endif
64