Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Sep 2010 18:18:01 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r212329 - head/usr.sbin/pciconf
Message-ID:  <201009081818.o88II1af058972@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Sep  8 18:18:01 2010
New Revision: 212329
URL: http://svn.freebsd.org/changeset/base/212329

Log:
  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

Modified:
  head/usr.sbin/pciconf/pciconf.c

Modified: head/usr.sbin/pciconf/pciconf.c
==============================================================================
--- head/usr.sbin/pciconf/pciconf.c	Wed Sep  8 18:06:05 2010	(r212328)
+++ head/usr.sbin/pciconf/pciconf.c	Wed Sep  8 18:18:01 2010	(r212329)
@@ -75,7 +75,7 @@ static const char *guess_subclass(struct
 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 *re
 }
 
 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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009081818.o88II1af058972>