rem: dprintf("PCI: Config Mechanism 2 not yet supported!\n");
add: uint32 rv = 0; if (device & 0x10) return EINVAL;  out8((uint8)(0xF0 | (function << 1)), 0xCF8); out8(bus, 0xCFA);  switch (size) { case 1: rv = in8 (CONFIG_ADDR_2(device, reg)); break; case 2: rv = in16(CONFIG_ADDR_2(device, reg)); break; case 4: rv = in32(CONFIG_ADDR_2(device, reg)); break; default: dprintf("ERROR: read_pci_config: called for %d bytes!!\n", size); } out8(0, 0xCF8); return rv;
context: static uint32 read_pci_config(uchar bus, uchar device, uchar function, uchar offset, uchar size){	if (pci_mode == 1) {		/* write request details */		out32(CONFIG_REQ(bus, device, function, offset), 0xCF8);			/* Now read data back from the data port...		 * offset for 1 byte can be 1,2 or 3		 * offset for 2 bytes can be 1 or 2		 */		switch (size) {			case 1:				return in8 (CONFIG_DATA_PORT + (offset & 3));			case 2:				return in16(CONFIG_DATA_PORT + (offset & 2));			case 4:				return in32(CONFIG_DATA_PORT + offset);			default:				dprintf("read_pci_config: called for %d bytes!!\n", size);		}	} else if (pci_mode == 2) {		dprintf("PCI: Config Mechanism 2 not yet supported!\n");	} else		dprintf("PCI: Config Mechanism %d isn't known!\n", pci_mode);	return 0;}