/*
- * $Id: generic.c,v 1.1 1999/01/22 21:05:24 mj Exp $
+ * $Id: generic.c,v 1.7 2002/03/30 15:39:25 mj Exp $
*
* The PCI Library -- Generic Direct Access Functions
*
- * Copyright (c) 1997--1999 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
+ * Copyright (c) 1997--2000 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
#include "internal.h"
-static void
+void
pci_generic_scan_bus(struct pci_access *a, byte *busmap, int bus)
{
int dev, multi, ht;
pci_generic_scan_bus(a, busmap, pci_read_byte(t, PCI_SECONDARY_BUS));
break;
default:
- a->debug("Device %02x:%02x.%d has unknown header type %02x.\n", d->bus, d->dev, d->func);
+ a->debug("Device %02x:%02x.%d has unknown header type %02x.\n", d->bus, d->dev, d->func, ht);
}
if (!multi)
break;
pci_generic_scan_bus(a, busmap, 0);
}
-void
+int
pci_generic_fill_info(struct pci_dev *d, int flags)
{
struct pci_access *a = d->access;
d->base_addr[i] = x;
if (x & PCI_BASE_ADDRESS_SPACE_IO)
{
- if (!(cmd & PCI_COMMAND_IO))
+ if (!a->buscentric && !(cmd & PCI_COMMAND_IO))
d->base_addr[i] = 0;
}
- else if (cmd & PCI_COMMAND_MEMORY)
+ else if (a->buscentric || (cmd & PCI_COMMAND_MEMORY))
{
if ((x & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == PCI_BASE_ADDRESS_MEM_TYPE_64)
{
else
{
u32 y = pci_read_long(d, PCI_BASE_ADDRESS_0 + (++i)*4);
-#ifdef HAVE_64BIT_LONG_INT
- d->base_addr[i-1] |= ((unsigned long) y) << 32;
+#ifdef HAVE_64BIT_ADDRESS
+ d->base_addr[i-1] |= ((pciaddr_t) y) << 32;
#else
if (y)
{
d->rom_base_addr = a;
}
}
+ return flags & ~PCI_FILL_SIZES;
}
static int