Clean up something in config(8) that has annoyed me for ages. Remove

the need to specify the unit number of unwired devices.  ie: instead
of saying "device fxp0" we can say "device fxp" which is much closer
to what it actually means.  The former (fxp0) implied something about
reserving the 0th unit, but it does not and never did - it was a
figment of config(8)'s imagination that we had to work around..
"device fxp0" simply means "compile in the fxp device driver", so we
may as well just write it as "device fxp" which is closer to what it
really means.

Doing this also saves us from filling up the ioconf.c tables with
meaningless entries.
This commit is contained in:
Peter Wemm 2000-01-23 12:01:08 +00:00
parent 1816634e49
commit 218f95f38b
2 changed files with 19 additions and 11 deletions

View File

@ -103,7 +103,6 @@ char errbuf[80];
int maxusers;
int seen_scbus;
int warned_controller;
#define ns(s) strdup(s)
@ -307,23 +306,21 @@ Dev:
;
Device_spec:
DEVICE Dev_name Dev_info
DEVICE Dev_spec
= { cur.d_type = DEVICE; } |
DISK Dev_name Dev_info
DISK Dev_spec
= {
warnx("line %d: Obsolete keyword 'disk' found - use 'device'", yyline);
cur.d_type = DEVICE;
} |
TAPE Dev_name Dev_info
TAPE Dev_spec
= {
warnx("line %d: Obsolete keyword 'tape' found - use 'device'", yyline);
cur.d_type = DEVICE;
} |
CONTROLLER Dev_name Dev_info
CONTROLLER Dev_spec
= {
if (warned_controller < 3)
warnx("line %d: Obsolete keyword 'controller' found - use 'device'", yyline);
warned_controller++;
warnx("line %d: Obsolete keyword 'controller' found - use 'device'", yyline);
cur.d_type = DEVICE;
} |
PSEUDO_DEVICE Init_dev Dev
@ -338,8 +335,15 @@ Device_spec:
cur.d_count = $4;
} ;
Dev_name:
Init_dev Dev NUMBER
Dev_spec:
Init_dev Dev
= {
cur.d_name = $2;
cur.d_unit = UNKNOWN;
if (eq($2, "scbus"))
seen_scbus = 1;
} |
Init_dev Dev NUMBER Dev_info
= {
cur.d_name = $2;
cur.d_unit = $3;
@ -377,7 +381,7 @@ Info_list:
;
Info:
BUS NUMBER /* controller scbus1 at ahc0 bus 1 - twin channel */
BUS NUMBER /* device scbus1 at ahc0 bus 1 - twin channel */
= { cur.d_bus = $2; } |
TARGET NUMBER
= { cur.d_target = $2; } |

View File

@ -140,6 +140,8 @@ write_all_device_resources(FILE *fp)
for (dp = dtab; dp != 0; dp = dp->d_next) {
if (dp->d_type != DEVICE)
continue;
if (dp->d_unit == UNKNOWN)
continue;
write_device_resources(fp, dp);
}
}
@ -158,6 +160,8 @@ write_devtab(FILE *fp)
char* n = devstr(dp);
if (dp->d_type != DEVICE)
continue;
if (dp->d_unit == UNKNOWN)
continue;
fprintf(fp, "\t{ \"%s\",\t%d,\t%s_count,\t%s_resources },\n",
dp->d_name, dp->d_unit, n, n);
count++;