Date: Fri, 20 Mar 2020 23:26:37 +0000 (UTC) From: Scott Long <scottl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359187 - head/usr.sbin/pciconf Message-ID: <202003202326.02KNQbwH029971@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: scottl Date: Fri Mar 20 23:26:37 2020 New Revision: 359187 URL: https://svnweb.freebsd.org/changeset/base/359187 Log: When printing out the contents of the VSEC, include the contents of the headers. Device documentation often times give offsets relative to the start of the entire VSEC, not just the post-header data area, so this change makes it easier to correlate offsets. Modified: head/usr.sbin/pciconf/cap.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Fri Mar 20 21:43:08 2020 (r359186) +++ head/usr.sbin/pciconf/cap.c Fri Mar 20 23:26:37 2020 (r359187) @@ -898,13 +898,15 @@ ecap_vendor(int fd, struct pci_conf *p, uint16_t ptr, if ((ver < 1) || (cap_level <= 1)) return; for (i = 0; i < len; i += 4) { - val = read_config(fd, &p->pc_sel, ptr + PCIR_VSEC_DATA + i, 4); + val = read_config(fd, &p->pc_sel, ptr + i, 4); if ((i % 16) == 0) printf(" "); - printf("%02x %02x %02x %02x ", val & 0xff, (val >> 8) & 0xff, + printf("%02x %02x %02x %02x", val & 0xff, (val >> 8) & 0xff, (val >> 16) & 0xff, (val >> 24) & 0xff); if ((((i + 4) % 16) == 0 ) || ((i + 4) >= len)) printf("\n"); + else + printf(" "); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003202326.02KNQbwH029971>