Make the FDC (state machine) state an enum, as opposed to an int
abusing a bunch of #defines, for clarity and better debugging support.
This commit is contained in:
parent
357dfe502a
commit
7998b1245d
@ -215,22 +215,6 @@ static int enable_fifo(fdc_p fdc);
|
||||
|
||||
static int fifo_threshold = 8; /* XXX: should be accessible via sysctl */
|
||||
|
||||
|
||||
#define DEVIDLE 0
|
||||
#define FINDWORK 1
|
||||
#define DOSEEK 2
|
||||
#define SEEKCOMPLETE 3
|
||||
#define IOCOMPLETE 4
|
||||
#define RECALCOMPLETE 5
|
||||
#define STARTRECAL 6
|
||||
#define RESETCTLR 7
|
||||
#define SEEKWAIT 8
|
||||
#define RECALWAIT 9
|
||||
#define MOTORWAIT 10
|
||||
#define IOTIMEDOUT 11
|
||||
#define RESETCOMPLETE 12
|
||||
#define PIOREAD 13
|
||||
|
||||
#ifdef FDC_DEBUG
|
||||
static char const * const fdstates[] =
|
||||
{
|
||||
|
16
sys/isa/fd.c
16
sys/isa/fd.c
@ -215,22 +215,6 @@ static int enable_fifo(fdc_p fdc);
|
||||
|
||||
static int fifo_threshold = 8; /* XXX: should be accessible via sysctl */
|
||||
|
||||
|
||||
#define DEVIDLE 0
|
||||
#define FINDWORK 1
|
||||
#define DOSEEK 2
|
||||
#define SEEKCOMPLETE 3
|
||||
#define IOCOMPLETE 4
|
||||
#define RECALCOMPLETE 5
|
||||
#define STARTRECAL 6
|
||||
#define RESETCTLR 7
|
||||
#define SEEKWAIT 8
|
||||
#define RECALWAIT 9
|
||||
#define MOTORWAIT 10
|
||||
#define IOTIMEDOUT 11
|
||||
#define RESETCOMPLETE 12
|
||||
#define PIOREAD 13
|
||||
|
||||
#ifdef FDC_DEBUG
|
||||
static char const * const fdstates[] =
|
||||
{
|
||||
|
@ -40,6 +40,22 @@ enum fdc_type
|
||||
FDC_NE765, FDC_I82077, FDC_NE72065, FDC_UNKNOWN = -1
|
||||
};
|
||||
|
||||
enum fdc_states {
|
||||
DEVIDLE,
|
||||
FINDWORK,
|
||||
DOSEEK,
|
||||
SEEKCOMPLETE ,
|
||||
IOCOMPLETE,
|
||||
RECALCOMPLETE,
|
||||
STARTRECAL,
|
||||
RESETCTLR,
|
||||
SEEKWAIT,
|
||||
RECALWAIT,
|
||||
MOTORWAIT,
|
||||
IOTIMEDOUT,
|
||||
RESETCOMPLETE,
|
||||
PIOREAD
|
||||
};
|
||||
|
||||
/***********************************************************************\
|
||||
* Per controller structure. *
|
||||
@ -58,7 +74,7 @@ struct fdc_data
|
||||
#define FDC_ISPCMCIA 0x100
|
||||
struct fd_data *fd;
|
||||
int fdu; /* the active drive */
|
||||
int state;
|
||||
enum fdc_states state;
|
||||
int retry;
|
||||
int fdout; /* mirror of the w/o digital output reg */
|
||||
u_int status[7]; /* copy of the registers */
|
||||
|
Loading…
x
Reference in New Issue
Block a user