/* Read/write access functions for various sizes of values in config space. Return all 1's for disallowed accesses for a kludgy but adequate simulation of master aborts.  */
static int bcm1480_pcibios_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
/* Read/write access functions for various sizes of values in config space. Return all 1's for disallowed accesses for a kludgy but adequate simulation of master aborts.  */
static int bcm1480_pcibios_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
{
	u32 data = 0;
	if ((size == 2) && (where & 1))
		return PCIBIOS_BAD_REGISTER_NUMBER;
	else if ((size == 4) && (where & 3))
		return PCIBIOS_BAD_REGISTER_NUMBER;
	if (bcm1480_pci_can_access(bus, devfn))
		data = READCFG32(CFGADDR(bus, devfn, where));
	else
		data = 0xFFFFFFFF;
	if (size == 1)
		*val = (data >> ((where & 3) << 3)) & 0xff;
	else if (size == 2)
		*val = (data >> ((where & 3) << 3)) & 0xffff;
	else
		*val = data;
	return PCIBIOS_SUCCESSFUL;
}