PCI Subdevice ID

Dr. Rolf Jansen rj at cyclaero.com
Sat Jul 6 13:19:50 UTC 2013


Am 06.07.2013 um 08:03 schrieb "Cedric GROSS" <cg at cgross.info>:

> ... I'm looking for a kernel function like 'pci_get_device' but for subdevice

The pci_get_*** macros are defined in /usr/src/sys/dev/pci/pcivar.h below line 220.

The expanded macro for getting the sub-device number is:

static __inline uint16_t pci_get_subdevice(device_t dev)
{
	uintptr_t v;
	BUS_READ_IVAR(device_get_parent(dev), dev, PCI_IVAR_SUBDEVICE, &v);
	return ((uint16_t) v);
}

Best regards

Rolf


More information about the freebsd-drivers mailing list