Main Page | Directories | File List | Globals

adi_drivers.c

Go to the documentation of this file.
00001 /*
00002  * kernel_drivers/adi_core/adi_drivers.c
00003  *
00004  * Copyright (c) 2003-2004 Lukasz Dembinski <dembol@nasa.com.pl>
00005  * All Rights Reserved
00006  * 
00007  * Date:        2004/01
00008  * Author:      Lukasz Dembinski
00009  * Info:        adi_drivers.c core file
00010  * Contact:     mailto: <dembol@nasa.com.pl>
00011  *
00012  */
00013 
00014 #include <agnix/agnix.h>
00015 #include <agnix/adi/adi.h>
00016 #include <agnix/list.h>
00017 #include <agnix/spinlock.h>
00018 
00019 struct list_head adi_pci_drivers_list;
00020 struct list_head adi_usb_drivers_list;
00021 struct list_head adi_isa_drivers_list;
00022 
00023 spinlock_t adi_pci_drivers_list_lock;
00024 spinlock_t adi_usb_drivers_list_lock;
00025 spinlock_t adi_isa_drivers_list_lock;
00026 
00027 int adi_register_pci_driver(struct adi_driver_s *adi_driver)
00028 {
00029     u32 flags;
00030 
00031     spin_lock_irqsave(&adi_pci_drivers_list_lock, flags);            
00032     list_add(&adi_driver->adi_driver_list, &adi_pci_drivers_list);
00033     spin_unlock_irqrestore(&adi_pci_drivers_list_lock, flags);            
00034 
00035     adi_pcibus_device_init(adi_driver->adi_driver_union.adi_driver_pci, adi_driver->adi_driver_id);
00036 
00037     return 0;
00038 }
00039 
00040 int adi_register_driver(struct adi_driver_s *adi_driver)
00041 {
00042     if (adi_driver->adi_driver_type == ADI_DRIVER_TYPE_PCI)
00043         adi_register_pci_driver(adi_driver);
00044 
00045     return 0;
00046 }
00047 
00048 int adi_drivers_data_init(void)
00049 {
00050     INIT_LIST_HEAD(&adi_pci_drivers_list);
00051     INIT_LIST_HEAD(&adi_usb_drivers_list);
00052     INIT_LIST_HEAD(&adi_isa_drivers_list);
00053 
00054     spin_lock_init(&adi_pci_drivers_list_lock);
00055     spin_lock_init(&adi_usb_drivers_list_lock);
00056     spin_lock_init(&adi_isa_drivers_list_lock);
00057 
00058     return 0;
00059 }
00060 
00061 int adi_drivers_init(void)
00062 {
00063     adi_drivers_data_init();
00064     adi_resources_init();
00065     adi_buses_init();
00066 #if CONFIG_DRIVERS_NET
00067     adi_netdrv_init();
00068 #endif
00069 #if CONFIG_DRIVERS_BLOCK
00070     adi_blkdrv_init();
00071 #endif
00072 #if CONFIG_DRIVERS_CHAR
00073     adi_chrdrv_init();
00074 #endif
00075 
00076     return 0;
00077 }
Dokumentacje wygenerowano programem Doxygen 1.4.2 dla projektu Agnix