Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 15 → Rev 16

/shark/trunk/drivers/pci/pci_scan.c
3,17 → 3,15
#include <ll/i386/hw-arch.h>
#include <ll/i386/hw-io.h>
#include <ll/i386/cons.h>
#include <ll/i386/error.h>
#include <ll/i386/mem.h>
 
#include <ll/stdlib.h>
 
 
 
#include <drivers/llpci.h>
#include <drivers/pci.h>
#include <drivers/linuxpci.h>
#include <kernel/log.h>
 
//#define DEBUG_PCISCAN
 
static struct pci_dev pci_devs[N_MAX_DEVS];
 
static struct pci_bus pci_root;
146,7 → 144,9
*/
child = kmalloc(sizeof(*child), GFP_ATOMIC);
if(child==NULL) {
error(KERN_ERR "pci: out of memory for bridge.\n");
#ifdef DEBUG_PCISCAN
printk(KERN_ERR "pci: out of memory for bridge.\n");
#endif
continue;
}
memset(child, 0, sizeof(*child));
221,11 → 221,15
pcibios_init();
 
if (!pci_present()) {
error("PCI: No PCI bus detected\n");
#ifdef DEBUG_PCISCAN
printk("PCI: No PCI bus detected\n");
#endif
return;
}
 
error("PCI: Probing PCI hardware\n");
#ifdef DEBUG_PCISCAN
printk("PCI: Probing PCI hardware\n");
#endif
memset(&pci_root, 0, sizeof(pci_root));
pci_root.subordinate = pci_scan_bus(&pci_root);
}
/shark/trunk/drivers/pci/pci.c
3,15 → 3,13
#include <ll/i386/hw-arch.h>
#include <ll/i386/hw-io.h>
#include <ll/i386/cons.h>
 
#include <ll/stdlib.h>
 
 
 
#include <drivers/llpci.h>
#include <drivers/pci.h>
#include <drivers/linuxpci.h>
 
#include <kernel/log.h>
 
static int ndev = 0;
static struct pci_des pci_devs[N_MAX_DEVS];
 
108,7 → 106,10
{
 
if (pci_class(class_code, index, bus, dev) != NULL) {
cprintf("PCIBIOS_FIND_CLASS: found at bus %d, dev %d\n", *bus, *dev);
#ifdef DEBUG_PCI
printk(KERN_DEBUG "PCIBIOS_FIND_CLASS:"
"found at bus %d, dev %d\n", *bus, *dev);
#endif
return PCIBIOS_SUCCESSFUL;
} else {
return PCIBIOS_DEVICE_NOT_FOUND;
122,14 → 123,15
int i;
struct pci_regs *r;
 
cprintf(" DevLib PCI support\n\n");
cprintf(" PCI config type %d\n", pcibios_present());
cprintf(" %d PCI devices found:\n\n", ndev);
printk(KERN_INFO "DevLib PCI support\n\n");
printk(KERN_INFO "PCI config type %d\n", pcibios_present());
printk(KERN_INFO "%d PCI devices found:\n\n", ndev);
for(i = 0; i < ndev; i++) {
cprintf(" %d: bus %d dev %d\n",i , pci_devs[i].bus, pci_devs[i].dev);
r = (struct pci_regs *) pci_devs[i].mem;
cprintf(" Vendor: %s", pci_strvendor(r->VendorId));
cprintf(" Class: %s\n", pci_strclass(r->ClassCode << 8));
printk(KERN_INFO "%d: bus %d dev %d\n",
i, pci_devs[i].bus, pci_devs[i].dev);
printk(KERN_INFO "Vendor: %s", pci_strvendor(r->VendorId));
printk(KERN_INFO "Class: %s\n", pci_strclass(r->ClassCode << 8));
}
}