diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h index 6c524f5e8fe5..e0504cc87878 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 c35127c49cf8..fc396b744d1f 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 ac5554645536..03eb77f0acd7 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",