ignore_pci.c revision 119418
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: head/sys/dev/pci/ignore_pci.c 119418 2003-08-24 17:55:58Z obrien $"); 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> 3869783Smsmith#include <sys/bus.h> 3969783Smsmith 40119285Simp#include <dev/pci/pcivar.h> 4169783Smsmith 4269783Smsmithstatic int ignore_pci_probe(device_t dev); 4369783Smsmith 4469783Smsmithstatic device_method_t ignore_pci_methods[] = { 4569783Smsmith /* Device interface */ 4669783Smsmith DEVMETHOD(device_probe, ignore_pci_probe), 4769783Smsmith DEVMETHOD(device_attach, bus_generic_attach), 4869783Smsmith { 0, 0 } 4969783Smsmith}; 5069783Smsmith 5169783Smsmithstatic driver_t ignore_pci_driver = { 5269783Smsmith "ignore_pci", 5369783Smsmith ignore_pci_methods, 5469783Smsmith 0, 5569783Smsmith}; 5669783Smsmith 5769783Smsmithstatic devclass_t ignore_pci_devclass; 5869783Smsmith 5969783SmsmithDRIVER_MODULE(ignore_pci, pci, ignore_pci_driver, ignore_pci_devclass, 0, 0); 6069783Smsmith 6169783Smsmithstatic int 6269783Smsmithignore_pci_probe(device_t dev) 6369783Smsmith{ 6469783Smsmith switch (pci_get_devid(dev)) { 6569783Smsmith case 0x10001042ul: /* SMC 37C665 */ 6669783Smsmith device_set_desc(dev, "ignored"); 6769783Smsmith device_quiet(dev); 6869783Smsmith return(-10000); 6969783Smsmith } 7069783Smsmith return(ENXIO); 7169783Smsmith} 72