From a0551a9ac2773926a3ea020d0edbbdf2eac1d6b0 Mon Sep 17 00:00:00 2001 From: peter Date: Sun, 23 Jan 2000 12:01:08 +0000 Subject: 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. --- usr.sbin/config/config.y | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'usr.sbin/config/config.y') diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y index bc894b4..45fe648 100644 --- a/usr.sbin/config/config.y +++ b/usr.sbin/config/config.y @@ -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; } | -- cgit v1.1