FreeBSD/sys/dev/pci/pci.c
/* read configuration header into pcicfgregs structure */
read configuration header into pcicfgregs structure
read configuration header into pcicfgregs structure
struct pci_devinfo *
pci_read_device(device_t pcib, device_t bus, int d, int b, int s, int f)
{
#define	REG(n, w)	PCIB_READ_CONFIG(pcib, b, s, f, n, w)
	uint16_t vid, did;
	vid = REG(PCIR_VENDOR, 2);
	did = REG(PCIR_DEVICE, 2);
	if (vid != 0xffff)
		return (pci_fill_devinfo(pcib, bus, d, b, s, f, vid, did));
	return (NULL);
}
struct pci_devinfo * pci_read_device ( device_t pcib , device_t bus , int d , int b , int s , int f ) { #define REG ( n , w ) 	PCIB_READ_CONFIG(pcib, b, s, f, n, w) uint16_t vid , did ; vid = REG ( PCIR_VENDOR , 2 ) ; did = REG ( PCIR_DEVICE , 2 ) ; if ( vid != 0xffff ) return ( pci_fill_devinfo ( pcib , bus , d , b , s , f , vid , did ) ) ; return ( NULL ) ; }
read configuration header into pcicfgregs structure
read configuration header into pcicfgregs structure