Skip to content
Snippets Groups Projects
Select Git revision
  • 41017f0cac925e4a6bcf3359b75e5538112d4216
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

pci.c

Blame
  • pci.c 24.35 KiB
    /*
     *	$Id: pci.c,v 1.91 1999/01/21 13:34:01 davem Exp $
     *
     *	PCI Bus Services, see include/linux/pci.h for further explanation.
     *
     *	Copyright 1993 -- 1997 Drew Eckhardt, Frederic Potter,
     *	David Mosberger-Tang
     *
     *	Copyright 1997 -- 2000 Martin Mares <mj@ucw.cz>
     */
    
    #include <linux/kernel.h>
    #include <linux/delay.h>
    #include <linux/init.h>
    #include <linux/pci.h>
    #include <linux/module.h>
    #include <linux/spinlock.h>
    #include <linux/string.h>
    #include <asm/dma.h>	/* isa_dma_bridge_buggy */
    #include "pci.h"
    
    
    /**
     * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children
     * @bus: pointer to PCI bus structure to search
     *
     * Given a PCI bus, returns the highest PCI bus number present in the set
     * including the given PCI bus and its list of child PCI buses.
     */
    unsigned char __devinit
    pci_bus_max_busnr(struct pci_bus* bus)
    {
    	struct list_head *tmp;
    	unsigned char max, n;
    
    	max = bus->subordinate;
    	list_for_each(tmp, &bus->children) {
    		n = pci_bus_max_busnr(pci_bus_b(tmp));
    		if(n > max)
    			max = n;
    	}
    	return max;
    }
    EXPORT_SYMBOL_GPL(pci_bus_max_busnr);
    
    #if 0
    /**
     * pci_max_busnr - returns maximum PCI bus number
     *
     * Returns the highest PCI bus number present in the system global list of
     * PCI buses.
     */
    unsigned char __devinit
    pci_max_busnr(void)
    {
    	struct pci_bus *bus = NULL;
    	unsigned char max, n;
    
    	max = 0;
    	while ((bus = pci_find_next_bus(bus)) != NULL) {
    		n = pci_bus_max_busnr(bus);
    		if(n > max)
    			max = n;
    	}
    	return max;
    }
    
    #endif  /*  0  */
    
    static int __pci_find_next_cap(struct pci_bus *bus, unsigned int devfn, u8 pos, int cap)