aboutsummaryrefslogtreecommitdiff
path: root/sbin/devmatch/devmatch.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2018-02-17 06:57:25 +0000
committerWarner Losh <imp@FreeBSD.org>2018-02-17 06:57:25 +0000
commitb9c40202d8b96dcfc62cb9caccbbd8f55747377a (patch)
tree9244510e728533042f8753984c41cc52b53e970d /sbin/devmatch/devmatch.c
parent7e1637e4912c6831fa019dec2caada6e0831ee15 (diff)
Notes
Diffstat (limited to 'sbin/devmatch/devmatch.c')
-rw-r--r--sbin/devmatch/devmatch.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sbin/devmatch/devmatch.c b/sbin/devmatch/devmatch.c
index ea284c6296e8..3d83d610519e 100644
--- a/sbin/devmatch/devmatch.c
+++ b/sbin/devmatch/devmatch.c
@@ -265,6 +265,7 @@ search_hints(const char *bus, const char *dev, const char *pnpinfo)
bit = -1;
do {
switch (*cp) {
+ /* All integer fields */
case 'I':
case 'J':
case 'G':
@@ -300,6 +301,7 @@ search_hints(const char *bus, const char *dev, const char *pnpinfo)
break;
}
break;
+ /* String fields */
case 'D':
case 'Z':
getstr(&ptr, val1);
@@ -313,6 +315,22 @@ search_hints(const char *bus, const char *dev, const char *pnpinfo)
if (strcmp(s, val1) != 0)
notme++;
break;
+ /* Key override fields, required to be last in the string */
+ case 'T':
+ /*
+ * This is imperfect and only does one key and will be redone
+ * to be more general for multiple keys. Currently, nothing
+ * does that.
+ */
+ if (dump_flag) /* No per-row data stored */
+ break;
+ if (cp[strlen(cp) - 1] == ';') /* Skip required ; at end */
+ cp[strlen(cp) - 1] = '\0'; /* in case it's not there */
+ if ((s = strstr(pnpinfo, cp + 2)) == NULL)
+ notme++;
+ else if (s > pnpinfo && s[-1] != ' ')
+ notme++;
+ break;
default:
fprintf(stderr, "Unknown field type %c\n:", *cp);
break;