From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 23 23:30:28 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 444EE106566C for ; Fri, 23 Jul 2010 23:30:28 +0000 (UTC) (envelope-from neelnatu@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1E75E8FC13 for ; Fri, 23 Jul 2010 23:30:27 +0000 (UTC) Received: by pvh1 with SMTP id 1so4298204pvh.13 for ; Fri, 23 Jul 2010 16:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=oAU4bGL3YlWWixD/Axaw4Sr6imr5RE12KreSVZNYY7E=; b=Sz4k2qHq2ZKhanogdf6bv2AVgPMmP7U8Wp8LZphD6HOPRrVc2QqJLmbkDLyjkAKdRF nzJyhh2sY0JhUsjxAPCIlriZYt5/+8X7bDygxRneZ8GGqoNMVM8eEKDaQhf8FIaru19C kN2Q+BYtrn1DRvz0/Sc0oIh0AO2/bLEkLr5FM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=RbNYvk/dZJPn16tTtSSMFuN7VmzvzQN1cUWiwqMz2CIVDgw+2VowVMQnuvRtyJc/ck ZhLK21bJlW1KBCOK7NkpTAF7Wp2iLlxMQLTfT2LcEF+0C0GAFYHWrPxHWRo2/n9gauWK F/XvO7l/U+Yhx41gxhmv4mxifStXMgbK4RLRw= MIME-Version: 1.0 Received: by 10.142.172.15 with SMTP id u15mr4955950wfe.65.1279925936970; Fri, 23 Jul 2010 15:58:56 -0700 (PDT) Received: by 10.142.139.19 with HTTP; Fri, 23 Jul 2010 15:58:56 -0700 (PDT) Date: Fri, 23 Jul 2010 15:58:56 -0700 Message-ID: From: Neel Natu To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: PATCH: pciconf -a X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2010 23:30:28 -0000 Hi, This patch makes "pciconf -a" do the right thing as opposed to always failing with this message: pciconf: ioctl(PCIOCATTACHED): Inappropriate ioctl for device Any objections if I commit this? best Neel Index: sys/dev/pci/pci_user.c =================================================================== --- sys/dev/pci/pci_user.c (revision 210396) +++ sys/dev/pci/pci_user.c (working copy) @@ -735,6 +735,16 @@ bio->pbi_enabled = (value & PCIM_CMD_PORTEN) != 0; error = 0; break; + case PCIOCATTACHED: + error = 0; + io = (struct pci_io *)data; + pcidev = pci_find_dbsf(io->pi_sel.pc_domain, io->pi_sel.pc_bus, + io->pi_sel.pc_dev, io->pi_sel.pc_func); + if (pcidev != NULL) + io->pi_data = device_is_attached(pcidev); + else + error = ENODEV; + break; default: error = ENOTTY; break;