PCI Subdevice ID

Warner Losh imp at bsdimp.com
Sat Jul 6 15:46:11 UTC 2013


On Jul 6, 2013, at 5:03 AM, Cedric GROSS wrote:

>> -----Message d'origine-----
>> De : Dr. Rolf Jansen [mailto:rj at cyclaero.com]
>> Envoyé : samedi 6 juillet 2013 12:52
>> À : Cedric GROSS
>> Cc : freebsd-drivers at freebsd.org
>> Objet : Re: PCI Subdevice ID
>> 
>> Am 06.07.2013 um 07:38 schrieb Cedric GROSS <cg at cgross.info>:
>> 
>>> Hello everybody,
>>> 
>>> I'm currently working adapt iwn driver for my Centrino Wireless-N
>> 2230 Card.
>>> 
>>> As part of this tuff work, I asking me how to get subdevice id ? I
>>> didn't find anything about that.
>> 
>> Hello,
>> 
>> See here: http://pci-ids.ucw.cz
>> 
>> You could also install this pciid list by the way of the ports system:
>> 
>>   # /usr/ports/misc/pciids
>>   # make install clean
>> 
>> Then you would grep your device from that list:
>> 
>>   $ grep "Wireless-N 2230" /usr/local/share/pciids/pci.ids
>> 
> Thanks Rolf.
> But in fact my demand concern development.
> My fault. Please apologize I wasn't enough clear. I'm looking for a kernel
> function like 'pci_get_device' but for subdevice

pci_get_subdevice and pci_get_subvendor.

All the following are available:
PCI_ACCESSOR(subvendor,         SUBVENDOR,      uint16_t)
PCI_ACCESSOR(subdevice,         SUBDEVICE,      uint16_t)
PCI_ACCESSOR(vendor,            VENDOR,         uint16_t)
PCI_ACCESSOR(device,            DEVICE,         uint16_t)
PCI_ACCESSOR(devid,             DEVID,          uint32_t)
PCI_ACCESSOR(class,             CLASS,          uint8_t)
PCI_ACCESSOR(subclass,          SUBCLASS,       uint8_t)
PCI_ACCESSOR(progif,            PROGIF,         uint8_t)
PCI_ACCESSOR(revid,             REVID,          uint8_t)
PCI_ACCESSOR(intpin,            INTPIN,         uint8_t)
PCI_ACCESSOR(irq,               IRQ,            uint8_t)
PCI_ACCESSOR(domain,            DOMAIN,         uint32_t)
PCI_ACCESSOR(bus,               BUS,            uint8_t)
PCI_ACCESSOR(slot,              SLOT,           uint8_t)
PCI_ACCESSOR(function,          FUNCTION,       uint8_t)
PCI_ACCESSOR(ether,             ETHADDR,        uint8_t *)
PCI_ACCESSOR(cmdreg,            CMDREG,         uint8_t)
PCI_ACCESSOR(cachelnsz,         CACHELNSZ,      uint8_t)
PCI_ACCESSOR(mingnt,            MINGNT,         uint8_t)
PCI_ACCESSOR(maxlat,            MAXLAT,         uint8_t)
PCI_ACCESSOR(lattimer,          LATTIMER,       uint8_t)
    
Although ETHADDR is available only to cardbus cards.

Warner


More information about the freebsd-drivers mailing list