summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/mkheaders.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2000-01-08 15:57:22 +0000
committerpeter <peter@FreeBSD.org>2000-01-08 15:57:22 +0000
commit4dc1a88de3c124d01cb486042b1fd6ba88f3abe8 (patch)
treeebf9dbc0011a3e7752a87c51eaba2001375e535e /usr.sbin/config/mkheaders.c
parent56c26012ce83d84970d82e62757ffefc7048ea0d (diff)
downloadFreeBSD-src-4dc1a88de3c124d01cb486042b1fd6ba88f3abe8.zip
FreeBSD-src-4dc1a88de3c124d01cb486042b1fd6ba88f3abe8.tar.gz
Apply the axe to some more cruft in config(8). In particular:
- redo the "at" configuration system so that it just syntax checks to make sure the device you're configuring something "at" appears to exist. Nuke a bunch of complexity that was responsible for creating "clones" of wildcard devices and some wierd stuff in a few places including the scbus config tables etc. - merge "controller" and "device" - there is no difference as far as the kernel is concernend, it's just something there to make life difficult for config file writers. "controller" is now an alias for "device". - emit full scsi config into the resource tables. We could trivially change cam to use that rather than it's own "special" table for wiring and static configuration. ATA could use this too for static wiring. - try and emulate some of the quirks of the old system where it made sense. Some were too strange though and I'd be very suprised if they were features and not outright bugs. nexus handling is still strange. One thing in particular is that some of the wierd entries in the newbus devtables is now gone as it was a quirk side effect of the wildcard/question-mark cloning above. GENERIC and LINT still build etc.
Diffstat (limited to 'usr.sbin/config/mkheaders.c')
-rw-r--r--usr.sbin/config/mkheaders.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/usr.sbin/config/mkheaders.c b/usr.sbin/config/mkheaders.c
index 636cce7..8bbcfbf 100644
--- a/usr.sbin/config/mkheaders.c
+++ b/usr.sbin/config/mkheaders.c
@@ -69,22 +69,11 @@ headers()
if (!(dp->d_type & DEVDONE))
printf("Warning: pseudo-device \"%s\" is unknown\n",
dp->d_name);
- else
- dp->d_type &= TYPEMASK;
}
if ((dp->d_type & TYPEMASK) == DEVICE) {
if (!(dp->d_type & DEVDONE))
printf("Warning: device \"%s\" is unknown\n",
dp->d_name);
- else
- dp->d_type &= TYPEMASK;
- }
- if ((dp->d_type & TYPEMASK) == CONTROLLER) {
- if (!(dp->d_type & DEVDONE))
- printf("Warning: controller \"%s\" is unknown\n",
- dp->d_name);
- else
- dp->d_type &= TYPEMASK;
}
}
}
@@ -98,23 +87,24 @@ do_count(dev, hname, search)
register char *dev, *hname;
int search;
{
- register struct device *dp, *mp;
+ register struct device *dp;
register int count, hicount;
+ char *mp;
/*
* After this loop, "count" will be the actual number of units,
* and "hicount" will be the highest unit declared. do_header()
* must use this higher of these values.
*/
- for (hicount = count = 0, dp = dtab; dp != 0; dp = dp->d_next) {
+ for (dp = dtab; dp != 0; dp = dp->d_next) {
if (eq(dp->d_name, dev)) {
if ((dp->d_type & TYPEMASK) == PSEUDO_DEVICE)
dp->d_type |= DEVDONE;
else if ((dp->d_type & TYPEMASK) == DEVICE)
dp->d_type |= DEVDONE;
- else if ((dp->d_type & TYPEMASK) == CONTROLLER)
- dp->d_type |= DEVDONE;
}
+ }
+ for (hicount = count = 0, dp = dtab; dp != 0; dp = dp->d_next) {
if (dp->d_unit != -1 && eq(dp->d_name, dev)) {
if ((dp->d_type & TYPEMASK) == PSEUDO_DEVICE) {
count =
@@ -131,9 +121,12 @@ do_count(dev, hname, search)
hicount = dp->d_unit + 1;
if (search) {
mp = dp->d_conn;
- if (mp != 0 && mp != TO_NEXUS &&
- mp->d_conn != 0 && mp->d_conn != TO_NEXUS) {
- do_count(mp->d_name, hname, 0);
+ if (mp != 0 && dp->d_connunit < 0)
+ mp = 0;
+ if (mp != 0 && eq(mp, "nexus"))
+ mp = 0;
+ if (mp != 0) {
+ do_count(mp, hname, 0);
search = 0;
}
}
OpenPOWER on IntegriCloud