summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2000-01-23 12:01:08 +0000
committerpeter <peter@FreeBSD.org>2000-01-23 12:01:08 +0000
commita0551a9ac2773926a3ea020d0edbbdf2eac1d6b0 (patch)
tree144e8266c655695e08761765c57440b17acf235c /usr.sbin
parent38391cb38a0ee28053596d31acc69685f10d3b31 (diff)
downloadFreeBSD-src-a0551a9ac2773926a3ea020d0edbbdf2eac1d6b0.zip
FreeBSD-src-a0551a9ac2773926a3ea020d0edbbdf2eac1d6b0.tar.gz
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.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/config/config.y26
-rw-r--r--usr.sbin/config/mkioconf.c4
2 files changed, 19 insertions, 11 deletions
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; } |
diff --git a/usr.sbin/config/mkioconf.c b/usr.sbin/config/mkioconf.c
index c1ad796..5d19aa6 100644
--- a/usr.sbin/config/mkioconf.c
+++ b/usr.sbin/config/mkioconf.c
@@ -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++;
OpenPOWER on IntegriCloud