Access pci devices' serial numbers programmatically

John Baldwin jhb at freebsd.org
Mon Jan 20 21:24:34 UTC 2014


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 <device>' 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


More information about the freebsd-hackers mailing list