summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>2001-06-05 21:01:46 +0000
committerjoerg <joerg@FreeBSD.org>2001-06-05 21:01:46 +0000
commitb58cdc4c790e70db83416ab57abf58b7237c6b30 (patch)
tree7cb6d765926dc84dc3faef2fe416d63db596f8b6
parent83c7edbffd98b6de5455fe826f09e22e514ce570 (diff)
downloadFreeBSD-src-b58cdc4c790e70db83416ab57abf58b7237c6b30.zip
FreeBSD-src-b58cdc4c790e70db83416ab57abf58b7237c6b30.tar.gz
Make the FDC (state machine) state an enum, as opposed to an int
abusing a bunch of #defines, for clarity and better debugging support.
-rw-r--r--sys/dev/fdc/fdc.c16
-rw-r--r--sys/isa/fd.c16
-rw-r--r--sys/isa/fdc.h18
3 files changed, 17 insertions, 33 deletions
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index 022f348..a0155b7 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.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[] =
{
diff --git a/sys/isa/fd.c b/sys/isa/fd.c
index 022f348..a0155b7 100644
--- a/sys/isa/fd.c
+++ b/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[] =
{
diff --git a/sys/isa/fdc.h b/sys/isa/fdc.h
index 90ec8da..db25e4d 100644
--- a/sys/isa/fdc.h
+++ b/sys/isa/fdc.h
@@ -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 */
OpenPOWER on IntegriCloud