Subversion Repositories Kolibri OS

Rev

Rev 5271 | Rev 6321 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5271 Rev 6104
Line -... Line 1...
-
 
1
#define CONFIG_PCI
-
 
2
 
-
 
3
#include 
Line 1... Line 4...
1
#include 
4
 
2
#include 
5
#include 
3
#include 
6
#include 
4
#include 
7
#include 
-
 
8
#include 
-
 
9
#include 
5
#include 
10
 
6
#include 
-
 
-
 
11
#include 
Line 7... Line 12...
7
 
12
 
Line 8... Line 13...
8
extern int pci_scan_filter(u32 id, u32 busnr, u32 devfn);
13
 
Line 370... Line 375...
370
 
375
};
Line 371... Line 376...
371
 
376
 
372
 
377
 
373
 
378
 
Line 374... Line 379...
374
int pci_scan_slot(u32 bus, int devfn)
379
 
375
{
380
int _pci_scan_slot(u32 bus, int devfn)
Line 491... Line 496...
491
 
496
        return -1;
Line 492... Line 497...
492
    for(;bus <= last_bus; bus++)
497
 
493
    {
498
    for(;bus <= last_bus; bus++)
494
        for (devfn = 0; devfn < 0x100; devfn += 8)
499
    {
495
            pci_scan_slot(bus, devfn);
500
        for (devfn = 0; devfn < 0x100; devfn += 8)
Line 496... Line 501...
496
 
501
            _pci_scan_slot(bus, devfn);
497
 
502
 
498
    }
503
 
Line 569... Line 574...
569
    return NULL;
574
    }
570
};
575
    return NULL;
571
 
576
};
Line 572... Line 577...
572
 
577
 
573
struct pci_dev * pci_get_bus_and_slot(unsigned int bus, unsigned int devfn)
578
 
574
{
579
struct pci_dev * _pci_get_bus_and_slot(unsigned int bus, unsigned int devfn)
Line 575... Line 580...
575
    pci_dev_t *dev;
580
{
576
 
581
    pci_dev_t *dev;
Line 663... Line 668...
663
}
668
    IO_COND(addr, /* nothing */, iounmap(addr));
664
 
669
}
Line 665... Line 670...
665
 
670
 
666
static inline void
671
 
667
pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
672
static inline void
668
                         struct resource *res)
673
_pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
669
{
674
                         struct resource *res)
670
    region->start = res->start;
675
{
671
    region->end = res->end;
676
    region->start = res->start;
Line 680... Line 685...
680
 
685
    u32 rom_addr;
Line 681... Line 686...
681
    if (!res->flags)
686
 
682
            return -1;
687
    if (!res->flags)
Line 683... Line 688...
683
 
688
            return -1;
684
    pcibios_resource_to_bus(pdev, ®ion, res);
689
 
685
    pci_read_config_dword(pdev, pdev->rom_base_reg, &rom_addr);
690
    _pcibios_resource_to_bus(pdev, ®ion, res);
686
    rom_addr &= ~PCI_ROM_ADDRESS_MASK;
691
    pci_read_config_dword(pdev, pdev->rom_base_reg, &rom_addr);
687
    rom_addr |= region.start | PCI_ROM_ADDRESS_ENABLE;
692
    rom_addr &= ~PCI_ROM_ADDRESS_MASK;
688
    pci_write_config_dword(pdev, pdev->rom_base_reg, rom_addr);
693
    rom_addr |= region.start | PCI_ROM_ADDRESS_ENABLE;