Rename printf -> kprintf in sys/ and add some defines where necessary
[dragonfly.git] / sys / bus / pci / i386 / pcibus.c
1 /*
2  * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice unmodified, this list of conditions, and the following
10  *    disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  *
26  * $FreeBSD: src/sys/i386/isa/pcibus.c,v 1.57.2.12 2003/08/07 06:19:26 imp Exp $
27  * $DragonFly: src/sys/bus/pci/i386/pcibus.c,v 1.16 2006/12/22 23:12:17 swildner Exp $
28  *
29  */
30
31 #include <sys/param.h>
32 #include <sys/systm.h>
33 #include <sys/bus.h>
34 #include <sys/kernel.h>
35 #include <sys/malloc.h>
36
37 #include <bus/pci/pcivar.h>
38 #include <bus/pci/pcireg.h>
39 #include <bus/pci/i386/pcibus.h>
40 #include <bus/isa/isavar.h>
41 #include <bus/pci/i386/pci_cfgreg.h>
42 #include <machine/md_var.h>
43 #include <machine/nexusvar.h>
44
45 #include "pcib_if.h"
46
47 static u_int32_t nexus_pcib_read_config(device_t, int, int, int, int, int);
48
49 /*
50  * Figure out if a PCI entity is a host bridge, return its name or NULL.
51  */
52 static const char *
53 nexus_legacypci_is_host_bridge(int bus, int slot, int func,
54                           u_int32_t id, u_int8_t class, u_int8_t subclass,
55                           u_int8_t *busnum)
56 {
57         const char *s = NULL;
58         static u_int8_t pxb[4]; /* hack for 450nx */
59
60         *busnum = 0;
61
62         switch (id) {
63         case 0x12258086:
64                 s = "Intel 824?? host to PCI bridge";
65                 /* XXX This is a guess */
66                 /* *busnum = nexus_pcib_read_config(0, bus, slot, func, 0x41, 1); */
67                 *busnum = bus;
68                 break;
69         case 0x71208086:
70                 s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
71                 break;
72         case 0x71228086:
73                 s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
74                 break;
75         case 0x71248086:
76                 s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
77                 break;
78         case 0x71808086:
79                 s = "Intel 82443LX (440 LX) host to PCI bridge";
80                 break;
81         case 0x71908086:
82                 s = "Intel 82443BX (440 BX) host to PCI bridge";
83                 break;
84         case 0x71928086:
85                 s = "Intel 82443BX host to PCI bridge (AGP disabled)";
86                 break;
87         case 0x71948086:
88                 s = "Intel 82443MX host to PCI bridge";
89                 break;
90         case 0x71a08086:
91                 s = "Intel 82443GX host to PCI bridge";
92                 break;
93         case 0x71a18086:
94                 s = "Intel 82443GX host to AGP bridge";
95                 break;
96         case 0x71a28086:
97                 s = "Intel 82443GX host to PCI bridge (AGP disabled)";
98                 break;
99         case 0x84c48086:
100                 s = "Intel 82454KX/GX (Orion) host to PCI bridge";
101                 *busnum = nexus_pcib_read_config(0, bus, slot, func, 0x4a, 1);
102                 break;
103         case 0x84ca8086:
104                 /*
105                  * For the 450nx chipset, there is a whole bundle of
106                  * things pretending to be host bridges. The MIOC will 
107                  * be seen first and isn't really a pci bridge (the
108                  * actual busses are attached to the PXB's). We need to 
109                  * read the registers of the MIOC to figure out the
110                  * bus numbers for the PXB channels.
111                  *
112                  * Since the MIOC doesn't have a pci bus attached, we
113                  * pretend it wasn't there.
114                  */
115                 pxb[0] = nexus_pcib_read_config(0, bus, slot, func,
116                                                 0xd0, 1); /* BUSNO[0] */
117                 pxb[1] = nexus_pcib_read_config(0, bus, slot, func,
118                                                 0xd1, 1) + 1;   /* SUBA[0]+1 */
119                 pxb[2] = nexus_pcib_read_config(0, bus, slot, func,
120                                                 0xd3, 1); /* BUSNO[1] */
121                 pxb[3] = nexus_pcib_read_config(0, bus, slot, func,
122                                                 0xd4, 1) + 1;   /* SUBA[1]+1 */
123                 return NULL;
124         case 0x84cb8086:
125                 switch (slot) {
126                 case 0x12:
127                         s = "Intel 82454NX PXB#0, Bus#A";
128                         *busnum = pxb[0];
129                         break;
130                 case 0x13:
131                         s = "Intel 82454NX PXB#0, Bus#B";
132                         *busnum = pxb[1];
133                         break;
134                 case 0x14:
135                         s = "Intel 82454NX PXB#1, Bus#A";
136                         *busnum = pxb[2];
137                         break;
138                 case 0x15:
139                         s = "Intel 82454NX PXB#1, Bus#B";
140                         *busnum = pxb[3];
141                         break;
142                 }
143                 break;
144         case 0x1A308086:
145                 s = "Intel 82845 Host to PCI bridge";
146                 break;
147
148                 /* AMD -- vendor 0x1022 */
149         case 0x30001022:
150                 s = "AMD Elan SC520 host to PCI bridge";
151 #ifdef CPU_ELAN
152                 init_AMD_Elan_sc520();
153 #else
154                 kprintf("*** WARNING: kernel option CPU_ELAN missing");
155                 kprintf("-- timekeeping may be wrong\n");
156 #endif
157                 break;
158         case 0x70061022:
159                 s = "AMD-751 host to PCI bridge";
160                 break;
161         case 0x700e1022:
162                 s = "AMD-761 host to PCI bridge";
163                 break;
164
165                 /* SiS -- vendor 0x1039 */
166         case 0x04961039:
167                 s = "SiS 85c496";
168                 break;
169         case 0x04061039:
170                 s = "SiS 85c501";
171                 break;
172         case 0x06011039:
173                 s = "SiS 85c601";
174                 break;
175         case 0x55911039:
176                 s = "SiS 5591 host to PCI bridge";
177                 break;
178         case 0x00011039:
179                 s = "SiS 5591 host to AGP bridge";
180                 break;
181
182                 /* VLSI -- vendor 0x1004 */
183         case 0x00051004:
184                 s = "VLSI 82C592 Host to PCI bridge";
185                 break;
186
187                 /* XXX Here is MVP3, I got the datasheet but NO M/B to test it  */
188                 /* totally. Please let me know if anything wrong.            -F */
189                 /* XXX need info on the MVP3 -- any takers? */
190         case 0x05981106:
191                 s = "VIA 82C598MVP (Apollo MVP3) host bridge";
192                 break;
193
194                 /* AcerLabs -- vendor 0x10b9 */
195                 /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
196                 /* id is '10b9" but the register always shows "10b9". -Foxfair  */
197         case 0x154110b9:
198                 s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
199                 break;
200
201                 /* OPTi -- vendor 0x1045 */
202         case 0xc7011045:
203                 s = "OPTi 82C700 host to PCI bridge";
204                 break;
205         case 0xc8221045:
206                 s = "OPTi 82C822 host to PCI Bridge";
207                 break;
208
209                 /* ServerWorks -- vendor 0x1166 */
210         case 0x00051166:
211                 s = "ServerWorks NB6536 2.0HE host to PCI bridge";
212                 *busnum = nexus_pcib_read_config(0, bus, slot, func, 0x44, 1);
213                 break;
214         
215         case 0x00061166:
216                 /* FALLTHROUGH */
217         case 0x00081166:
218                 /* FALLTHROUGH */
219         case 0x02011166:
220                 /* FALLTHROUGH */
221         case 0x010f1014: /* IBM re-badged ServerWorks chipset */
222                 /* FALLTHROUGH */
223                 s = "ServerWorks host to PCI bridge";
224                 *busnum = nexus_pcib_read_config(0, bus, slot, func, 0x44, 1);
225                 break;
226
227         case 0x00091166:
228                 s = "ServerWorks NB6635 3.0LE host to PCI bridge";
229                 *busnum = nexus_pcib_read_config(0, bus, slot, func, 0x44, 1);
230                 break;
231
232         case 0x00101166:
233                 s = "ServerWorks CIOB30 host to PCI bridge";
234                 *busnum = nexus_pcib_read_config(0, bus, slot, func, 0x44, 1);
235                 break;
236
237         case 0x00111166:
238                 /* FALLTHROUGH */
239         case 0x03021014: /* IBM re-badged ServerWorks chipset */
240                 s = "ServerWorks CMIC-HE host to PCI-X bridge";
241                 *busnum = nexus_pcib_read_config(0, bus, slot, func, 0x44, 1);
242                 break;
243
244                 /* XXX unknown chipset, but working */
245         case 0x00171166:
246                 /* FALLTHROUGH */
247         case 0x01011166:
248                 s = "ServerWorks host to PCI bridge(unknown chipset)";
249                 *busnum = nexus_pcib_read_config(0, bus, slot, func, 0x44, 1);
250                 break;
251
252                 /* Integrated Micro Solutions -- vendor 0x10e0 */
253         case 0x884910e0:
254                 s = "Integrated Micro Solutions VL Bridge";
255                 break;
256
257         default:
258                 if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
259                         s = "Host to PCI bridge";
260                 break;
261         }
262
263         return s;
264 }
265
266 /*
267  * Identify the existance of the first pci bus and install a child to
268  * nexus if we find it.  Use an order of 1 so it gets probed after
269  * any ACPI device installed under nexus.  To avoid boot-time confusion,
270  * we do not install any 'pcib' devices at this time.
271  *
272  * The identify method coupled with the driver spec of the same name
273  * automatically installs it under the nexus.
274  */
275 static int
276 nexus_legacypci_identify(driver_t *driver, device_t parent)
277 {
278         /*
279          * Basically a static device, there's no point reinstalling it
280          * on rescan.
281          */
282         if (device_get_state(parent) == DS_ATTACHED)
283                 return (0);
284
285         if (pci_cfgregopen() == 0)
286                 return (ENXIO);
287
288         BUS_ADD_CHILD(parent, parent, 100, "legacypci", 0);
289         return (0);
290 }
291
292 /*
293  * Scan the first pci bus for host-pci bridges and add pcib instances
294  * to the nexus for each bridge.
295  */
296 static int
297 nexus_legacypci_probe(device_t dev)
298 {
299         int bus, slot, func;
300         u_int8_t  hdrtype;
301         int found = 0;
302         int pcifunchigh;
303         int found824xx = 0;
304         device_t child;
305
306         /*
307          * Do not install any pci busses ('pcib' devices) if the PCI
308          * subsystem has already been claimed by someone else.
309          */
310         if (pcib_owner != NULL) {
311                 device_printf(dev, "PCI subsystem owned by %s, skipping scan\n",
312                               pcib_owner);
313                 return (ENXIO);
314         }
315         pcib_owner = "legacypci";
316
317         if (pci_cfgregopen() == 0)
318                 return (ENXIO);
319
320         /*
321          * Scan away!
322          */
323         bus = 0;
324  retry:
325         for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
326                 func = 0;
327                 hdrtype = nexus_pcib_read_config(0, bus, slot, func,
328                                                  PCIR_HDRTYPE, 1);
329                 if ((hdrtype & ~PCIM_MFDEV) > 2)
330                         continue;
331                 if (hdrtype & PCIM_MFDEV)
332                         pcifunchigh = 7;
333                 else
334                         pcifunchigh = 0;
335                 for (func = 0; func <= pcifunchigh; func++) {
336                         /*
337                          * Read the IDs and class from the device.
338                          */
339                         u_int32_t id;
340                         u_int8_t class, subclass, busnum;
341                         const char *s;
342                         device_t *devs;
343                         int ndevs, i;
344
345                         id = nexus_pcib_read_config(0, bus, slot, func,
346                                                     PCIR_DEVVENDOR, 4);
347                         if (id == -1)
348                                 continue;
349                         class = nexus_pcib_read_config(0, bus, slot, func,
350                                                        PCIR_CLASS, 1);
351                         subclass = nexus_pcib_read_config(0, bus, slot, func,
352                                                           PCIR_SUBCLASS, 1);
353
354                         s = nexus_legacypci_is_host_bridge(bus, slot, func,
355                                                       id, class, subclass,
356                                                       &busnum);
357                         if (s == NULL)
358                                 continue;
359
360                         /*
361                          * Check to see if the physical bus has already
362                          * been seen. Eg: hybrid 32 and 64 bit host
363                          * bridges to the same logical bus.
364                          */
365                         if (device_get_children(dev, &devs, &ndevs) == 0) {
366                                 for (i = 0; s != NULL && i < ndevs; i++) {
367                                         if (strcmp(device_get_name(devs[i]),
368                                             "pcib") != 0)
369                                                 continue;
370                                         kprintf("compare %d\n", nexus_get_pcibus(devs[i]));
371                                         if (nexus_get_pcibus(devs[i]) == busnum)
372                                                 s = NULL;
373                                 }
374                                 kfree(devs, M_TEMP);
375                         }
376
377                         if (s == NULL)
378                                 continue;
379                         /*
380                          * Add at priority 100+busnum to keep the scanning
381                          * order sane in the boot dmesg output.
382                          */
383                         child = BUS_ADD_CHILD(dev, dev, 100 + busnum, 
384                                               "pcib", busnum);
385                         device_set_desc(child, s);
386                         nexus_set_pcibus(child, busnum);
387
388                         found = 1;
389                         if (id == 0x12258086)
390                                 found824xx = 1;
391                 }
392         }
393         if (found824xx && bus == 0) {
394                 bus++;
395                 goto retry;
396         }
397
398 #if 0
399         /*
400          * Now that we have installed the main PCI bridges, go
401          * probe and attach each one.
402          */
403         bus_generic_attach(dev);
404 #endif
405
406         /*
407          * Make sure we add at least one bridge since some old
408          * hardware doesn't actually have a host-pci bridge device.
409          * Note that pci_cfgregopen() thinks we have PCI devices..
410          */
411         if (!found) {
412                 if (bootverbose) {
413                         kprintf("nexus_pcib_identify: no bridge found, "
414                                "adding pcib0 anyway\n");
415                 }
416                 child = BUS_ADD_CHILD(dev, dev, 100, "pcib", 0);
417                 nexus_set_pcibus(child, 0);
418         }
419         return (0);
420 }
421
422 static int
423 nexus_legacypci_attach(device_t dev)
424 {
425         bus_generic_attach(dev);
426         return (0);
427 }
428
429 static device_method_t legacypci_methods[] = {
430         /* Device interface */
431         DEVMETHOD(device_identify,      nexus_legacypci_identify),
432         DEVMETHOD(device_probe,         nexus_legacypci_probe),
433         DEVMETHOD(device_attach,        nexus_legacypci_attach),
434         DEVMETHOD(device_shutdown,      bus_generic_shutdown),
435         DEVMETHOD(device_suspend,       bus_generic_suspend),
436         DEVMETHOD(device_resume,        bus_generic_resume),
437
438         /*
439          * Bus interface - propogate through to the nexus.  Note that
440          * this means devices under us will have nexus ivars.
441          */
442         DEVMETHOD(bus_add_child,        bus_generic_add_child),
443         DEVMETHOD(bus_print_child,      bus_generic_print_child),
444         DEVMETHOD(bus_read_ivar,        bus_generic_read_ivar),
445         DEVMETHOD(bus_write_ivar,       bus_generic_write_ivar),
446         DEVMETHOD(bus_alloc_resource,   bus_generic_alloc_resource),
447         DEVMETHOD(bus_release_resource, bus_generic_release_resource),
448         DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
449         DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
450         DEVMETHOD(bus_setup_intr,       bus_generic_setup_intr),
451         DEVMETHOD(bus_teardown_intr,    bus_generic_teardown_intr),
452         DEVMETHOD(bus_set_resource,     bus_generic_set_resource),
453         DEVMETHOD(bus_get_resource,     bus_generic_get_resource),
454         DEVMETHOD(bus_delete_resource,  bus_generic_delete_resource),
455         { 0, 0 }
456 };
457
458 static driver_t legacypci_driver = {
459         "legacypci",
460         legacypci_methods,
461         1,
462 };
463
464 static devclass_t legacypci_devclass;
465
466 DRIVER_MODULE(legacypci, nexus, legacypci_driver, legacypci_devclass, 0, 0);
467
468 /*
469  * Legacypci Host-Bridge PCI BUS support.  The underlying pcib devices
470  * will only exist if we actually control the PCI bus.  The actual PCI
471  * bus driver is attached in our attach routine.
472  *
473  * There is no identify function because the legacypci placeholder will
474  * have already scanned and added PCIB devices for the host-bridges found.
475  */
476 static int
477 nexus_pcib_maxslots(device_t dev)
478 {
479         return 31;
480 }
481
482 /*
483  * Read configuration space register.
484  */
485 static u_int32_t
486 nexus_pcib_read_config(device_t dev, int bus, int slot, int func,
487                        int reg, int bytes)
488 {
489         return (pci_cfgregread(bus, slot, func, reg, bytes));
490 }
491
492 /*
493  * Write configuration space register.
494  */
495 static void
496 nexus_pcib_write_config(device_t dev, int bus, int slot, int func,
497                         int reg, u_int32_t data, int bytes)
498 {
499         pci_cfgregwrite(bus, slot, func, reg, data, bytes);
500 }
501
502 /*
503  * Stack a pci device on top of the pci bridge bus device.
504  */
505 static int
506 nexus_pcib_probe(device_t dev)
507 {
508         BUS_ADD_CHILD(dev, dev, 0, "pci", device_get_unit(dev));
509         return (0);
510 }
511
512 static int
513 nexus_pcib_attach(device_t dev)
514 {
515         int error;
516
517         error = bus_generic_attach(dev);
518         return (error);
519 }
520
521 /* route interrupt */
522
523 static int
524 nexus_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
525 {
526         return(pci_cfgintr(pci_get_bus(dev), pci_get_slot(dev), pin, 
527                            pci_get_irq(dev)));
528 }
529
530 static device_method_t nexus_pcib_methods[] = {
531         /* Device interface */
532         DEVMETHOD(device_probe,         nexus_pcib_probe),
533         DEVMETHOD(device_attach,        nexus_pcib_attach),
534         DEVMETHOD(device_shutdown,      bus_generic_shutdown),
535         DEVMETHOD(device_suspend,       bus_generic_suspend),
536         DEVMETHOD(device_resume,        bus_generic_resume),
537
538         /*
539          * Bus interface - propogate through to the nexus.  Note
540          * that this means we will get nexus-managed ivars.
541          */
542         DEVMETHOD(bus_add_child,        bus_generic_add_child),
543         DEVMETHOD(bus_print_child,      bus_generic_print_child),
544         DEVMETHOD(bus_read_ivar,        bus_generic_read_ivar),
545         DEVMETHOD(bus_write_ivar,       bus_generic_write_ivar),
546         DEVMETHOD(bus_alloc_resource,   bus_generic_alloc_resource),
547         DEVMETHOD(bus_release_resource, bus_generic_release_resource),
548         DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
549         DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
550         DEVMETHOD(bus_setup_intr,       bus_generic_setup_intr),
551         DEVMETHOD(bus_teardown_intr,    bus_generic_teardown_intr),
552
553         /* pcib interface */
554         DEVMETHOD(pcib_maxslots,        nexus_pcib_maxslots),
555         DEVMETHOD(pcib_read_config,     nexus_pcib_read_config),
556         DEVMETHOD(pcib_write_config,    nexus_pcib_write_config),
557         DEVMETHOD(pcib_route_interrupt, nexus_pcib_route_interrupt),
558
559         { 0, 0 }
560 };
561
562 static driver_t nexus_pcib_driver = {
563         "pcib",
564         nexus_pcib_methods,
565         1,
566 };
567
568 static devclass_t       pcib_devclass;
569
570 DRIVER_MODULE(pcib, legacypci, nexus_pcib_driver, pcib_devclass, 0, 0);
571
572
573 /*
574  * Provide a device to "eat" the host->pci bridges that we dug up above
575  * and stop them showing up twice on the probes.  This also stops them
576  * showing up as 'none' in pciconf -l.
577  *
578  * Return an ultra-low priority so other devices can attach the bus before
579  * our dummy attach.
580  *
581  * XXX may have to disable the registration entirely to support module-loaded
582  * bridges such as agp.ko.
583  */
584 static int
585 pci_hostb_probe(device_t dev)
586 {
587         if (pci_get_class(dev) == PCIC_BRIDGE &&
588             pci_get_subclass(dev) == PCIS_BRIDGE_HOST) {
589                 device_set_desc(dev, "Host to PCI bridge");
590                 device_quiet(dev);
591                 return -10000;
592         }
593         return (ENXIO);
594 }
595
596 static int
597 pci_hostb_attach(device_t dev)
598 {
599         return (0);
600 }
601
602 static device_method_t pci_hostb_methods[] = {
603         /* Device interface */
604         DEVMETHOD(device_probe,         pci_hostb_probe),
605         DEVMETHOD(device_attach,        pci_hostb_attach),
606         DEVMETHOD(device_shutdown,      bus_generic_shutdown),
607         DEVMETHOD(device_suspend,       bus_generic_suspend),
608         DEVMETHOD(device_resume,        bus_generic_resume),
609
610         { 0, 0 }
611 };
612 static driver_t pci_hostb_driver = {
613         "hostb",
614         pci_hostb_methods,
615         1,
616 };
617 static devclass_t pci_hostb_devclass;
618
619 DRIVER_MODULE(hostb, pci, pci_hostb_driver, pci_hostb_devclass, 0, 0);
620
621
622 /*
623  * Install placeholder to claim the resources owned by the
624  * PCI bus interface.  This could be used to extract the 
625  * config space registers in the extreme case where the PnP
626  * ID is available and the PCI BIOS isn't, but for now we just
627  * eat the PnP ID and do nothing else.
628  *
629  * XXX we should silence this probe, as it will generally confuse 
630  * people.
631  */
632 static struct isa_pnp_id pcibus_pnp_ids[] = {
633         { 0x030ad041 /* PNP030A */, "PCI Bus" },
634         { 0 }
635 };
636
637 static int
638 pcibus_pnp_probe(device_t dev)
639 {
640         int result;
641         
642         if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
643                 device_quiet(dev);
644         return (result);
645 }
646
647 static int
648 pcibus_pnp_attach(device_t dev)
649 {
650         return(0);
651 }
652
653 static device_method_t pcibus_pnp_methods[] = {
654         /* Device interface */
655         DEVMETHOD(device_probe,         pcibus_pnp_probe),
656         DEVMETHOD(device_attach,        pcibus_pnp_attach),
657         DEVMETHOD(device_detach,        bus_generic_detach),
658         DEVMETHOD(device_shutdown,      bus_generic_shutdown),
659         DEVMETHOD(device_suspend,       bus_generic_suspend),
660         DEVMETHOD(device_resume,        bus_generic_resume),
661         { 0, 0 }
662 };
663
664 static driver_t pcibus_pnp_driver = {
665         "pcibus_pnp",
666         pcibus_pnp_methods,
667         1,              /* no softc */
668 };
669
670 static devclass_t pcibus_pnp_devclass;
671
672 DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
673