Update of /cvsroot/linux-mips/linux/arch/mips/cobalt
In directory usw-pr-cvs1:/tmp/cvs-serv24166
Modified Files:
pci_ops.c
Log Message:
Nice fixes to the new pci code.
Index: pci_ops.c
===================================================================
RCS file: /cvsroot/linux-mips/linux/arch/mips/cobalt/pci_ops.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- pci_ops.c 2001/10/25 21:39:48 1.5
+++ pci_ops.c 2001/10/30 00:50:06 1.6
@@ -117,8 +117,8 @@
|| ((PCI_SLOT (dev->devfn) > 6)
&& (PCI_SLOT (dev->devfn) <= 12)))) {
/* OK device number */
+ PCI_CFG_SET(dev, where);
if (access_type == PCI_ACCESS_READ) {
- PCI_CFG_SET(dev, (where & ~0x3));
*data = *PCI_CFG_DATA;
} else
*PCI_CFG_DATA = *data;
@@ -132,7 +132,7 @@
{
u32 data = 0;
- if (config_access(PCI_ACCESS_READ, dev, where, &data)) {
+ if (config_access(PCI_ACCESS_READ, dev, (where & ~0x3), &data)) {
*val = 0xff;
return PCIBIOS_DEVICE_NOT_FOUND;
}
@@ -151,7 +151,7 @@
if (where & 0x1)
return PCIBIOS_BAD_REGISTER_NUMBER;
- if (config_access(PCI_ACCESS_READ, dev, where, &data)) {
+ if (config_access(PCI_ACCESS_READ, dev, (where & ~0x3), &data)) {
*val = 0xffff;
return PCIBIOS_DEVICE_NOT_FOUND;
}
@@ -179,13 +179,12 @@
return PCIBIOS_SUCCESSFUL;
}
-
static int
write_config_byte (struct pci_dev *dev, int where, u8 val)
{
u32 data = 0;
- if (config_access(PCI_ACCESS_READ, dev, where, &data))
+ if (config_access(PCI_ACCESS_READ, dev, (where & ~0x3), &data))
return PCIBIOS_DEVICE_NOT_FOUND;
data = (data & ~(0xff << ((where & 3) << 3))) |
@@ -207,7 +206,7 @@
if (where & 0x1)
return PCIBIOS_BAD_REGISTER_NUMBER;
- if (config_access(PCI_ACCESS_READ, dev, where, &data))
+ if (config_access(PCI_ACCESS_READ, dev, (where & ~0x3), &data))
return PCIBIOS_DEVICE_NOT_FOUND;
data = (data & ~(0xffff << ((where & 3) << 3))) |
@@ -233,8 +232,6 @@
DBG("cfg write dword: bus %d dev_fn %x where %x: val %x\n",
dev->bus->number, dev->devfn, where, val);
- if (config_access(PCI_ACCESS_WRITE, dev, where, &val))
- return -1;
return PCIBIOS_SUCCESSFUL;
}
|