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:
Joerg Wunsch 2001-06-05 21:01:46 +00:00
parent 357dfe502a
commit 7998b1245d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=77788
3 changed files with 17 additions and 33 deletions

View file

@ -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[] =
{

View file

@ -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[] =
{

View file

@ -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 */