summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/mkheaders.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-12-06 15:52:18 +0000
committerpeter <peter@FreeBSD.org>1999-12-06 15:52:18 +0000
commita5a19afa34a6e816121b0d3717b69cc33de82554 (patch)
treed9563dd78d4cf0a72ca2101c34dc8ac3d2b7c885 /usr.sbin/config/mkheaders.c
parentec77c8ed3330a9d2f21fbecb3d2e0d35ef038c13 (diff)
downloadFreeBSD-src-a5a19afa34a6e816121b0d3717b69cc33de82554.zip
FreeBSD-src-a5a19afa34a6e816121b0d3717b69cc33de82554.tar.gz
Fix another quirk in the unknown device detection, and also deal with
unknown 'controller' lines.
Diffstat (limited to 'usr.sbin/config/mkheaders.c')
-rw-r--r--usr.sbin/config/mkheaders.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/usr.sbin/config/mkheaders.c b/usr.sbin/config/mkheaders.c
index 2d98583..636cce7 100644
--- a/usr.sbin/config/mkheaders.c
+++ b/usr.sbin/config/mkheaders.c
@@ -79,6 +79,13 @@ headers()
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;
+ }
}
}
@@ -99,16 +106,21 @@ do_count(dev, hname, search)
* 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 (hicount = count = 0, 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;
+ }
if (dp->d_unit != -1 && eq(dp->d_name, dev)) {
if ((dp->d_type & TYPEMASK) == PSEUDO_DEVICE) {
count =
dp->d_count != UNKNOWN ? dp->d_count : 1;
- dp->d_type |= DEVDONE;
break;
}
- if ((dp->d_type & TYPEMASK) == DEVICE)
- dp->d_type |= DEVDONE;
count++;
/*
* Allow holes in unit numbering,
@@ -126,6 +138,7 @@ do_count(dev, hname, search)
}
}
}
+ }
do_header(dev, hname, count > hicount ? count : hicount);
}
OpenPOWER on IntegriCloud