Access pci devices' serial numbers programmatically

Nomad Esst noname.esst at yahoo.com
Tue Jan 14 05:53:52 UTC 2014


Thank you. The thing is one of the input arguments of this function is device_t. How can I get this struct by device name so I can pass it to pci_get_vpd_readonly function?
Consider that I'm trying to read em's vpd, how can get em's related device_t struct by it's name? 
Something like:
device_t get_device_by_name(char dev_name)



On Monday, January 13, 2014 11:49 PM, John Baldwin <jhb at freebsd.org> wrote:
 
On Sunday, January 12, 2014 3:32:25 am Nomad Esst wrote:
>> Hi list
>> Any experiences on how to do so? Please tell me if you know how can I do 
>that?
>
>There are methods available to query VPD data in dev/pci/pcivar.h if the
>serial number is stored in VPD (specifically you can call 
>pci_get_vpd_readonly()).
>
>-- 
>John Baldwin
>_______________________________________________
>freebsd-hackers at freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
>
>To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org
>"
>
>
>


More information about the freebsd-drivers mailing list