summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-03-26 15:19:55 +0000
committerache <ache@FreeBSD.org>1997-03-26 15:19:55 +0000
commite27bac84c505d7a1b656909477bf094d65e7096b (patch)
tree5521706a357a2ce41f886f0afbd9ab09b0c11619 /usr.sbin/config
parent9e4ff703f5c19f141c6b5645ada102c9d24e0838 (diff)
downloadFreeBSD-src-e27bac84c505d7a1b656909477bf094d65e7096b.zip
FreeBSD-src-e27bac84c505d7a1b656909477bf094d65e7096b.tar.gz
Add #define's for port "none" and "auto"
Now port ommiting is equal to port "none" not to port 0
Diffstat (limited to 'usr.sbin/config')
-rw-r--r--usr.sbin/config/config.h2
-rw-r--r--usr.sbin/config/config.y6
-rw-r--r--usr.sbin/config/mkioconf.c4
3 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h
index 6c524f5..e0504cc 100644
--- a/usr.sbin/config/config.h
+++ b/usr.sbin/config/config.h
@@ -125,6 +125,8 @@ struct device {
int d_disabled; /* nonzero to skip probe/attach */
char *d_port; /* io port base manifest constant */
int d_portn; /* io port base (if number not manifest) */
+#define PORT_AUTO -1 /* automatically configured */
+#define PORT_NONE -2 /* no port */
char *d_mask; /* interrupt mask */
int d_maddr; /* io memory base */
int d_msize; /* io memory size */
diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y
index c35127c..fc396b7 100644
--- a/usr.sbin/config/config.y
+++ b/usr.sbin/config/config.y
@@ -618,9 +618,9 @@ Info:
PORT NUMBER
= { cur.d_portn = $2; } |
PORT AUTO
- = { cur.d_portn = -1; } |
+ = { cur.d_portn = PORT_AUTO; } |
PORT NONE
- = { cur.d_portn = -2; } |
+ = { cur.d_portn = PORT_NONE; } |
TTY
= { cur.d_mask = "tty"; } |
BIO
@@ -907,7 +907,7 @@ init_dev(dp)
dp->d_pri = -1;
dp->d_slave = dp->d_lun = dp->d_target = dp->d_drive = dp->d_unit = UNKNOWN;
dp->d_port = (char *)0;
- dp->d_portn = 0;
+ dp->d_portn = PORT_NONE;
dp->d_irq = -1;
dp->d_drq = -1;
dp->d_maddr = 0;
diff --git a/usr.sbin/config/mkioconf.c b/usr.sbin/config/mkioconf.c
index ac55546..03eb77f 100644
--- a/usr.sbin/config/mkioconf.c
+++ b/usr.sbin/config/mkioconf.c
@@ -757,8 +757,8 @@ isa_devtab(fp, table, dev_idp)
fprintf(fp, "{ %2d, &%3sdriver,", (*dev_idp)++, dp->d_name);
if (dp->d_port)
fprintf(fp, " %8s,", dp->d_port);
- else if (dp->d_portn == -1 || dp->d_portn == -2)
- fprintf(fp, " %2d,", dp->d_portn);
+ else if (dp->d_portn == PORT_AUTO || dp->d_portn == PORT_NONE)
+ fprintf(fp, " %d,", dp->d_portn);
else
fprintf(fp, " 0x%04x,", dp->d_portn);
fprintf(fp, "%6s, %2d, C 0x%05X, %5d, %8s, %3d, 0x%04X, 0, 0, 0, 0, %6d, %8d, 0 },\n",
OpenPOWER on IntegriCloud