From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 20 21:24:34 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEFA9EC6 for ; Mon, 20 Jan 2014 21:24:34 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 949EC1D2E for ; Mon, 20 Jan 2014 21:24:34 +0000 (UTC) Received: from pippin.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A0B3CB918; Mon, 20 Jan 2014 16:24:33 -0500 (EST) From: John Baldwin To: Nomad Esst Subject: Re: Access pci devices' serial numbers programmatically Date: Mon, 20 Jan 2014 16:02:23 -0500 Message-ID: <37639448.Wf1F1apyVZ@pippin.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/11.0-CURRENT; KDE/4.10.5; amd64; ; ) In-Reply-To: <1389765959.45668.YahooMailNeo@web162702.mail.bf1.yahoo.com> References: <1389515545.51283.YahooMailNeo@web162704.mail.bf1.yahoo.com> <201401140824.03549.jhb@freebsd.org> <1389765959.45668.YahooMailNeo@web162702.mail.bf1.yahoo.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 20 Jan 2014 16:24:33 -0500 (EST) Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jan 2014 21:24:34 -0000 On Tuesday 14 January 2014 22:05:59 Nomad Esst wrote: > Yes I'm trying to get these information from user-land. Any ideas now? I just committed a change to HEAD to add a new flag to pciconf to dump VPD data. If you just need it in a shell script then 'pciconf -lV ' might be sufficient for you. If you want it programmatically, you can use the new ioctl I added to retrieve it from the kernel. If you need to do this on an older OS version where you can't backport my change (or upgrade to a version with this change), then you can use direct config register access to find the VPD capability and read the data directly using the VPD registers. -- John Baldwin