Updating PCI vendors database

Garrett Cooper yanegomi at gmail.com
Mon Apr 4 15:51:04 UTC 2011


On Mon, Apr 4, 2011 at 7:57 AM, Philip Paeps <philip at freebsd.org> wrote:
> On 2011-04-04 17:39:22 (+0300), Andriy Gapon <avg at FreeBSD.org> wrote:
>> on 04/04/2011 17:10 Philip Paeps said the following:
>> > It looks like our /usr/share/misc/pci_vendors list (used only by pciconf as
>> > far as I can tell) has become rather stale.  We also appear to be tracking
>> > sources which no longer exist.
>> >
>> > Would anyone object if I updated this list to source the same database used by
>> > Linux distributions at http://pciids.sourceforge.net/v2.2/pci.ids?
>> >
>> > It helps that our pciconf looks to be compatible with that format.  We just
>> > ignore subvendor and subdevice, but it doesn't appear to matter that the file
>> > contains this information.
>> >
>> > I could cull the subvendor/subdevice from the list though.
>> >
>> > Any views?
>> >
>> > Reason I'm looking into this is because one of my customers would like their
>> > name to be correct when I import the driver I've been working on for them. :)
>>
>> This is just for your information:
>> http://thread.gmane.org/gmane.os.freebsd.current/127979/focus=128577
>> Maybe you'll find something useful there.
>
> Thanks.  I've just read through that discussion.  It doesn't look like there
> were any "serious" objections to pulling in the new list, other than verifying
> that the new list contains all the entries the current list contains.
>
> I am not entirely sure what the little side-discussion about using # instead
> of ; as a comment marker is about.  It looks to me like the pci.ids file "Just
> Works"[tm] with our pciconf(8).  Maybe Garrett can elaborate on that?

Well, close. You can substitute the hashes with semicolons, but you
need to get rid of subvendor / subdevice.

The format is:

vendor-id\040\040vendor-description
\011device-id\040\040device-description
\011\011subvendor-id\040subdevice-id\040\040subsystem-name

(it's also documented in the top of the file, but just to be pedantic
I noted it here)

pciconf already supports hash based comments:

        /*
         * Scan input lines from the database
         */
        for (;;) {
                if (fgets(buf, sizeof(buf), db) == NULL)
                        break;

                if ((ch = strchr(buf, '#')) != NULL)
                        *ch = '\0';

so no work needs to be done there.

Setting PCICONF_VENDOR_DATABASE to pci.ids worked, but all the items
on my box are different in the new file (all device descriptions, but
also some of the vendor descriptions dealing with my nVidia card,
Realtek NIC, and LSI card) [it would be interesting to see who's
correct in terms of corporation branding :)..]. So this definitely
isn't MFC-able :).

> I think we should just go with the new list, but I'll hold off for a bit to
> let others object. ;)

+1, just for the fact that our sources are becoming stale. I wonder
though what other OSes like NetBSD/OpenBSD/[Open]Solaris/IlluminOS use
however for tracking PCI IDs, as the sources for pci.ids aren't
necessarily the vendor itself and in some cases are end-users. I
thought some of our other sources were based on data provided by
vendors.

Thanks,
-Garrett
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pci-vendors.output
Type: application/octet-stream
Size: 11301 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20110404/756f5236/pci-vendors.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pci-ids.output
Type: application/octet-stream
Size: 11693 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20110404/756f5236/pci-ids.obj


More information about the freebsd-hackers mailing list