Home | History | Annotate | Line # | Download | only in pci
pci_stub.c revision 1.1
      1  1.1  dyoung #include <sys/cdefs.h>
      2  1.1  dyoung __KERNEL_RCSID(0, "$NetBSD: pci_stub.c,v 1.1 2011/08/24 20:27:35 dyoung Exp $");
      3  1.1  dyoung 
      4  1.1  dyoung #include "opt_pci.h"
      5  1.1  dyoung 
      6  1.1  dyoung #include <sys/param.h>
      7  1.1  dyoung #include <sys/systm.h>
      8  1.1  dyoung 
      9  1.1  dyoung #include <dev/pci/pcireg.h>
     10  1.1  dyoung #include <dev/pci/pcivar.h>
     11  1.1  dyoung #include <dev/pci/pcidevs.h>
     12  1.1  dyoung 
     13  1.1  dyoung int default_pci_bus_devorder(pci_chipset_tag_t, int, uint8_t *, int);
     14  1.1  dyoung int default_pci_chipset_tag_create(pci_chipset_tag_t, uint64_t,
     15  1.1  dyoung     const struct pci_overrides *, void *, pci_chipset_tag_t *);
     16  1.1  dyoung void default_pci_chipset_tag_destroy(pci_chipset_tag_t);
     17  1.1  dyoung 
     18  1.1  dyoung __strict_weak_alias(pci_bus_devorder, default_pci_bus_devorder);
     19  1.1  dyoung __strict_weak_alias(pci_chipset_tag_create, default_pci_chipset_tag_create);
     20  1.1  dyoung __strict_weak_alias(pci_chipset_tag_destroy, default_pci_chipset_tag_destroy);
     21  1.1  dyoung 
     22  1.1  dyoung int
     23  1.1  dyoung default_pci_bus_devorder(pci_chipset_tag_t pc, int bus, uint8_t *devs,
     24  1.1  dyoung     int maxdevs)
     25  1.1  dyoung {
     26  1.1  dyoung 	int i, n;
     27  1.1  dyoung 
     28  1.1  dyoung 	n = MIN(pci_bus_maxdevs(pc, bus), maxdevs);
     29  1.1  dyoung 	for (i = 0; i < n; i++)
     30  1.1  dyoung 		devs[i] = i;
     31  1.1  dyoung 
     32  1.1  dyoung 	return n;
     33  1.1  dyoung }
     34  1.1  dyoung 
     35  1.1  dyoung void
     36  1.1  dyoung default_pci_chipset_tag_destroy(pci_chipset_tag_t pc)
     37  1.1  dyoung {
     38  1.1  dyoung }
     39  1.1  dyoung 
     40  1.1  dyoung int
     41  1.1  dyoung default_pci_chipset_tag_create(pci_chipset_tag_t opc, const uint64_t present,
     42  1.1  dyoung     const struct pci_overrides *ov, void *ctx, pci_chipset_tag_t *pcp)
     43  1.1  dyoung {
     44  1.1  dyoung 	return EOPNOTSUPP;
     45  1.1  dyoung }
     46