From owner-svn-src-all@freebsd.org Sun Feb 18 23:16:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19793F0F2E4; Sun, 18 Feb 2018 23:16:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD5407222F; Sun, 18 Feb 2018 23:16:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B39161294C; Sun, 18 Feb 2018 23:16:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1INGGmf050802; Sun, 18 Feb 2018 23:16:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1INGGXE050801; Sun, 18 Feb 2018 23:16:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802182316.w1INGGXE050801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 18 Feb 2018 23:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329538 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 329538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Feb 2018 23:16:17 -0000 Author: imp Date: Sun Feb 18 23:16:16 2018 New Revision: 329538 URL: https://svnweb.freebsd.org/changeset/base/329538 Log: Print more info for -v runs and temp hack for usb vs uhub Despite best efforts to regularize, there's a few tables in the system that still report they are for bus usb when they are really for bus uhub (where usb devices attach). Add a temporary workaround for this until these places have been eliminated (likely my fault). Second, when running verbose, describe what we're doing when searching. This output can be quite long, but says exactly what's going on (this output is to stdout, so it's useless for scripting). Modified: head/sbin/devmatch/devmatch.c Modified: head/sbin/devmatch/devmatch.c ============================================================================== --- head/sbin/devmatch/devmatch.c Sun Feb 18 23:08:43 2018 (r329537) +++ head/sbin/devmatch/devmatch.c Sun Feb 18 23:16:16 2018 (r329538) @@ -284,6 +284,9 @@ search_hints(const char *bus, const char *dev, const c walker = hints; getint(&walker); found = 0; + if (verbose_flag) + printf("Searching bus %s dev %s for pnpinfo %s\n", + bus, dev, pnpinfo); while (walker < hints_end) { len = getint(&walker); ival = getint(&walker); @@ -293,7 +296,7 @@ search_hints(const char *bus, const char *dev, const c getstr(&ptr, val1); ival = getint(&ptr); getstr(&ptr, val2); - if (dump_flag) + if (dump_flag || verbose_flag) printf("Version: if %s.%d kmod %s\n", val1, ival, val2); break; case MDT_MODULE: @@ -302,7 +305,7 @@ search_hints(const char *bus, const char *dev, const c if (lastmod) free(lastmod); lastmod = strdup(val2); - if (dump_flag) + if (dump_flag || verbose_flag) printf("Module %s in %s\n", val1, val2); break; case MDT_PNP_INFO: @@ -311,12 +314,23 @@ search_hints(const char *bus, const char *dev, const c getstr(&ptr, val1); getstr(&ptr, val2); ents = getint(&ptr); - if (bus && strcmp(val1, bus) != 0) - break; - if (dump_flag) + if (dump_flag || verbose_flag) printf("PNP info for bus %s format %s %d entries (%s)\n", val1, val2, ents, lastmod); + if (strcmp(val1, "usb") == 0) { + if (verbose_flag) + printf("Treating usb as uhub -- bug in source table still?\n"); + strcpy(val1, "uhub"); + } + if (bus && strcmp(val1, bus) != 0) { + if (verbose_flag) + printf("Skipped because table for bus %s, looking for %s\n", + val1, bus); + break; + } for (i = 0; i < ents; i++) { + if (verbose_flag) + printf("---------- Entry %d ----------\n", i); if (dump_flag) printf(" "); cp = val2; @@ -339,6 +353,9 @@ search_hints(const char *bus, const char *dev, const c if (bit >= 0 && ((1 << bit) & mask) == 0) break; v = pnpval_as_int(cp + 2, pnpinfo); + if (verbose_flag) + printf("Matching %s (%c) table=%#x tomatch=%#x\n", + cp + 2, *cp, v, ival); switch (*cp) { case 'J': if (ival == -1)