Main Page | Directories | File List | Globals

pcibus_devices.c

Go to the documentation of this file.
00001 /*
00002  * kernel_drivers/adi_buses/pci/pcibus_devices.c
00003  *
00004  * Copyright (c) 2003-2005 Lukasz Dembinski <dembol@nasa.com.pl>
00005  * All Rights Reserved
00006  * 
00007  * Date:        2005/01
00008  * Author:      Lukasz Dembinski
00009  * Info:        pcibus_devices.c core file
00010  * Contact:     mailto: <dembol@nasa.com.pl>
00011  *
00012  */
00013 
00014 #include <agnix/agnix.h>
00015 #include <agnix/init.h>
00016 #include <agnix/adi/adi.h>
00017 #include <agnix/console.h>
00018 
00019 #define MOD_NAME "PCI: \t"
00020 
00021 int adi_pcibus_device_init(struct adi_driver_pci_s *adi_driver_pci, struct adi_driver_id_s *adi_driver_id)
00022 {
00023     struct pcidev_s *pcidev;
00024     int idx = 0;
00025 
00026     do {
00027         if (adi_driver_id[idx].device_id == 0)
00028             return -1;
00029         
00030         if ((pcidev = pcibus_find_device_by_id(adi_driver_id[idx].vendor_id, adi_driver_id[idx].device_id))) {
00031             if (adi_driver_pci->adi_driver_probe) {
00032                 if (adi_driver_pci->adi_driver_probe(pcidev, &adi_driver_id[idx]) < 0)
00033                     printk(MOD_NAME "PCI driver probe failed for %s\n", pcidev->dev_name);
00034                 else
00035                     printk(MOD_NAME "PCI driver probe ok for %s\n", pcidev->dev_name);
00036             }
00037         }
00038         
00039         idx++;
00040     } while (adi_driver_id[idx].device_id);    
00041 
00042     return 0;
00043 }
Dokumentacje wygenerowano programem Doxygen 1.4.2 dla projektu Agnix