169783Smsmith/*-
269783Smsmith * Copyright (c) 2000 Michael Smith <msmith@freebsd.org>
369783Smsmith * Copyright (c) 2000 BSDi
469783Smsmith * All rights reserved.
569783Smsmith *
669783Smsmith * Redistribution and use in source and binary forms, with or without
769783Smsmith * modification, are permitted provided that the following conditions
869783Smsmith * are met:
969783Smsmith * 1. Redistributions of source code must retain the above copyright
1069783Smsmith *    notice, this list of conditions and the following disclaimer.
1169783Smsmith * 2. Redistributions in binary form must reproduce the above copyright
1269783Smsmith *    notice, this list of conditions and the following disclaimer in the
1369783Smsmith *    documentation and/or other materials provided with the distribution.
1469783Smsmith *
1569783Smsmith * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1669783Smsmith * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1769783Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1869783Smsmith * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1969783Smsmith * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2069783Smsmith * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2169783Smsmith * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2269783Smsmith * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2369783Smsmith * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2469783Smsmith * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2569783Smsmith * SUCH DAMAGE.
2669783Smsmith */
2769783Smsmith
28119418Sobrien#include <sys/cdefs.h>
29119418Sobrien__FBSDID("$FreeBSD$");
30119418Sobrien
3169783Smsmith/*
3269783Smsmith * 'Ignore' driver - eats devices that show up errnoeously on PCI
3369783Smsmith * but shouldn't ever be listed or handled by a driver.
3469783Smsmith */
3569783Smsmith
3669783Smsmith#include <sys/param.h>
3769783Smsmith#include <sys/kernel.h>
38129876Sphk#include <sys/module.h>
3969783Smsmith#include <sys/bus.h>
4069783Smsmith
41119285Simp#include <dev/pci/pcivar.h>
4269783Smsmith
4369783Smsmithstatic int	ignore_pci_probe(device_t dev);
4469783Smsmith
4569783Smsmithstatic device_method_t ignore_pci_methods[] = {
4669783Smsmith    /* Device interface */
4769783Smsmith    DEVMETHOD(device_probe,		ignore_pci_probe),
4869783Smsmith    DEVMETHOD(device_attach,		bus_generic_attach),
4969783Smsmith    { 0, 0 }
5069783Smsmith};
5169783Smsmith
5269783Smsmithstatic driver_t ignore_pci_driver = {
5369783Smsmith    "ignore_pci",
5469783Smsmith    ignore_pci_methods,
5569783Smsmith    0,
5669783Smsmith};
5769783Smsmith
5869783Smsmithstatic devclass_t ignore_pci_devclass;
5969783Smsmith
6069783SmsmithDRIVER_MODULE(ignore_pci, pci, ignore_pci_driver, ignore_pci_devclass, 0, 0);
6169783Smsmith
6269783Smsmithstatic int
6369783Smsmithignore_pci_probe(device_t dev)
6469783Smsmith{
6569783Smsmith    switch (pci_get_devid(dev)) {
6669783Smsmith    case 0x10001042ul:	/* SMC 37C665 */
6769783Smsmith	device_set_desc(dev, "ignored");
6869783Smsmith	device_quiet(dev);
69284086Smarcel	return(-10000);
7069783Smsmith    }
7169783Smsmith    return(ENXIO);
7269783Smsmith}
73