summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pciconf
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2010-09-08 18:18:01 +0000
committerjhb <jhb@FreeBSD.org>2010-09-08 18:18:01 +0000
commitbf83c54a8b7761ce95badba7540472e79571222c (patch)
tree10a48972d6bb783d2c0561bfab35b628056fab10 /usr.sbin/pciconf
parent1ced550055bbbf1d777b684fca14e6885ab97da5 (diff)
downloadFreeBSD-src-bf83c54a8b7761ce95badba7540472e79571222c.zip
FreeBSD-src-bf83c54a8b7761ce95badba7540472e79571222c.tar.gz
Simplify chkattached(). The PCIOCATTACHED ioctl only needs the pi_sel
field populated, it ignores the rest of the 'pci_sel' structure. MFC after: 1 week
Diffstat (limited to 'usr.sbin/pciconf')
-rw-r--r--usr.sbin/pciconf/pciconf.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c
index 7d1da2d..bb19160 100644
--- a/usr.sbin/pciconf/pciconf.c
+++ b/usr.sbin/pciconf/pciconf.c
@@ -75,7 +75,7 @@ static const char *guess_subclass(struct pci_conf *p);
static int load_vendors(void);
static void readit(const char *, const char *, int);
static void writeit(const char *, const char *, const char *, int);
-static void chkattached(const char *, int);
+static void chkattached(const char *);
static int exitstatus = 0;
@@ -148,8 +148,7 @@ main(int argc, char **argv)
if (listmode) {
list_devs(verbose, bars, caps);
} else if (attachedmode) {
- chkattached(argv[optind],
- byte ? 1 : isshort ? 2 : 4);
+ chkattached(argv[optind]);
} else if (readmode) {
readit(argv[optind], argv[optind + 1],
byte ? 1 : isshort ? 2 : 4);
@@ -646,15 +645,12 @@ writeit(const char *name, const char *reg, const char *data, int width)
}
static void
-chkattached(const char *name, int width)
+chkattached(const char *name)
{
int fd;
struct pci_io pi;
pi.pi_sel = getsel(name);
- pi.pi_reg = 0;
- pi.pi_width = width;
- pi.pi_data = 0;
fd = open(_PATH_DEVPCI, O_RDWR, 0);
if (fd < 0)
OpenPOWER on IntegriCloud