rem: val = in32(CONFIG_DATA_PORT + reg);
add: if ((reg & 3) == 0) val = in32(CONFIG_DATA_PORT); else { val = EINVAL; dprintf("ERROR: read_pci_config: can't read 4 bytes at reg %d (offset != 0)!\n",reg); }
context: static uint32 read_pci_config(uchar bus, uchar device, uchar function, uchar reg, uchar size){	int cpu_status;	uint32 val = 0;	PCI_LOCK_CONFIG(cpu_status);	if (pci_mode == 1) {		/* write request details */		out32(CONFIG_ADDR_1(bus, device, function, reg), CONFIG_REQ_PORT);			/* 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:				val = in8 (CONFIG_DATA_PORT + (reg & 3));				break;			case 2:				val = in16(CONFIG_DATA_PORT + (reg & 2));				break;			case 4:				val = in32(CONFIG_DATA_PORT + reg);				break;			default:				dprintf("ERROR: mech #1: read_pci_config: called for %d bytes!!\n", size);		}	} else if (pci_mode == 2) {		if (!(device & 0x10)) {			out8((uint8)(0xF0 | (function << 1)), 0xCF8);			out8(bus, 0xCFA);					switch (size) {				case 1:					val = in8 (CONFIG_ADDR_2(device, reg));					break;				case 2:					val = in16(CONFIG_ADDR_2(device, reg));					break;				case 4:					val = in32(CONFIG_ADDR_2(device, reg));					break;				default:					dprintf("ERROR: mech #2: read_pci_config: called for %d bytes!!\n", size);			}			out8(0, 0xCF8);		} else 			val = EINVAL;	} else		dprintf("PCI: Config Mechanism %d isn't known!\n", pci_mode);	PCI_UNLOCK_CONFIG(cpu_status);	return val;}