ignore_pci.c revision 69783
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 * $FreeBSD: head/sys/dev/pci/ignore_pci.c 69783 2000-12-08 22:11:23Z msmith $ 2869783Smsmith */ 2969783Smsmith 3069783Smsmith/* 3169783Smsmith * 'Ignore' driver - eats devices that show up errnoeously on PCI 3269783Smsmith * but shouldn't ever be listed or handled by a driver. 3369783Smsmith */ 3469783Smsmith 3569783Smsmith#include <sys/param.h> 3669783Smsmith#include <sys/kernel.h> 3769783Smsmith#include <sys/bus.h> 3869783Smsmith 3969783Smsmith#include <pci/pcivar.h> 4069783Smsmith 4169783Smsmithstatic int ignore_pci_probe(device_t dev); 4269783Smsmith 4369783Smsmithstatic device_method_t ignore_pci_methods[] = { 4469783Smsmith /* Device interface */ 4569783Smsmith DEVMETHOD(device_probe, ignore_pci_probe), 4669783Smsmith DEVMETHOD(device_attach, bus_generic_attach), 4769783Smsmith { 0, 0 } 4869783Smsmith}; 4969783Smsmith 5069783Smsmithstatic driver_t ignore_pci_driver = { 5169783Smsmith "ignore_pci", 5269783Smsmith ignore_pci_methods, 5369783Smsmith 0, 5469783Smsmith}; 5569783Smsmith 5669783Smsmithstatic devclass_t ignore_pci_devclass; 5769783Smsmith 5869783SmsmithDRIVER_MODULE(ignore_pci, pci, ignore_pci_driver, ignore_pci_devclass, 0, 0); 5969783Smsmith 6069783Smsmithstatic int 6169783Smsmithignore_pci_probe(device_t dev) 6269783Smsmith{ 6369783Smsmith switch (pci_get_devid(dev)) { 6469783Smsmith case 0x10001042ul: /* SMC 37C665 */ 6569783Smsmith device_set_desc(dev, "ignored"); 6669783Smsmith device_quiet(dev); 6769783Smsmith return(-10000); 6869783Smsmith } 6969783Smsmith return(ENXIO); 7069783Smsmith} 71