This source file includes following definitions.
- pcibmatch
- pcibattach
- pcib_callback
- pcib_print
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 #include <sys/param.h>
41 #include <sys/systm.h>
42 #include <sys/device.h>
43
44 #include <machine/bus.h>
45 #include <dev/isa/isavar.h>
46
47 #include <dev/pci/pcivar.h>
48 #include <dev/pci/pcireg.h>
49
50 #include <dev/pci/pcidevs.h>
51
52 #include "isa.h"
53 #include "pcibios.h"
54 #if NPCIBIOS > 0
55 #include <i386/pci/pcibiosvar.h>
56 #endif
57
58 int pcibmatch(struct device *, void *, void *);
59 void pcibattach(struct device *, struct device *, void *);
60 void pcib_callback(struct device *);
61 int pcib_print(void *, const char *);
62
63 struct cfattach pcib_ca = {
64 sizeof(struct device), pcibmatch, pcibattach
65 };
66
67 struct cfdriver pcib_cd = {
68 NULL, "pcib", DV_DULL
69 };
70
71 int
72 pcibmatch(struct device *parent, void *match, void *aux)
73 {
74 struct pci_attach_args *pa = aux;
75
76 switch (PCI_VENDOR(pa->pa_id)) {
77 case PCI_VENDOR_INTEL:
78 switch (PCI_PRODUCT(pa->pa_id)) {
79 case PCI_PRODUCT_INTEL_SIO:
80 case PCI_PRODUCT_INTEL_82371MX:
81 case PCI_PRODUCT_INTEL_82371AB_ISA:
82 case PCI_PRODUCT_INTEL_82440MX_ISA:
83
84 return (1);
85 }
86 case PCI_VENDOR_SIS:
87 switch (PCI_PRODUCT(pa->pa_id)) {
88 case PCI_PRODUCT_SIS_85C503:
89
90 return (1);
91 }
92 case PCI_VENDOR_VIATECH:
93 switch (PCI_PRODUCT(pa->pa_id)) {
94 case PCI_PRODUCT_VIATECH_VT82C686A_SMB:
95
96 return (0);
97 }
98 }
99
100 if (PCI_CLASS(pa->pa_class) == PCI_CLASS_BRIDGE &&
101 PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_BRIDGE_ISA)
102 return (1);
103
104 return (0);
105 }
106
107 void
108 pcibattach(struct device *parent, struct device *self, void *aux)
109 {
110
111
112
113 printf("\n");
114
115 config_defer(self, pcib_callback);
116 }
117
118 void
119 pcib_callback(struct device *self)
120 {
121 struct isabus_attach_args iba;
122
123 #if NPCIBIOS > 0
124 pci_intr_post_fixup();
125 #endif
126
127
128
129
130 memset(&iba, 0, sizeof(iba));
131 iba.iba_busname = "isa";
132 iba.iba_iot = I386_BUS_SPACE_IO;
133 iba.iba_memt = I386_BUS_SPACE_MEM;
134 #if NISADMA > 0
135 iba.iba_dmat = &isa_bus_dma_tag;
136 #endif
137 config_found(self, &iba, pcib_print);
138 }
139
140 int
141 pcib_print(void *aux, const char *pnp)
142 {
143
144 if (pnp)
145 printf("isa at %s", pnp);
146 return (UNCONF);
147 }