From owner-p4-projects@FreeBSD.ORG Sat Jun 23 12:02:55 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 867C616A475; Sat, 23 Jun 2007 12:02:55 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05F6C16A46C for ; Sat, 23 Jun 2007 12:02:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id E621213C4B8 for ; Sat, 23 Jun 2007 12:02:54 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l5NC2sA8033878 for ; Sat, 23 Jun 2007 12:02:54 GMT (envelope-from sephe@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l5NC2sv1033875 for perforce@freebsd.org; Sat, 23 Jun 2007 12:02:54 GMT (envelope-from sephe@FreeBSD.org) Date: Sat, 23 Jun 2007 12:02:54 GMT Message-Id: <200706231202.l5NC2sv1033875@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau To: Perforce Change Reviews Cc: Subject: PERFORCE change 122200 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2007 12:02:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=122200 Change 122200 by sephe@sephe_enigma:sam_wifi on 2007/06/23 12:02:41 Filter atapci device on Intel PRO/1000 PM (a NIC). This makes my installed system boot, when I plug this funny NIC in. Affected files ... .. //depot/projects/wifi/sys/dev/ata/ata-pci.c#17 edit Differences ... ==== //depot/projects/wifi/sys/dev/ata/ata-pci.c#17 (text+ko) ==== @@ -56,6 +56,17 @@ #define IOMASK 0xfffffffc #define ATA_PROBE_OK -10 +static const struct none_atapci { + uint16_t vendor; + uint16_t device; + uint16_t subvendor; + uint16_t subdevice; +} none_atapci_table[] = { + /* Appears on Intel PRO/1000 PM */ + { ATA_INTEL_ID, 0x108d, ATA_INTEL_ID, 0x0000 }, + { 0xffff, 0, 0, 0 } +}; + int ata_legacy(device_t dev) { @@ -173,6 +184,19 @@ /* unknown chipset, try generic DMA if it seems possible */ if ((pci_get_class(dev) == PCIC_STORAGE) && (pci_get_subclass(dev) == PCIS_STORAGE_IDE)) { + uint16_t vendor, device, subvendor, subdevice; + const struct none_atapci *e; + + vendor = pci_get_vendor(dev); + device = pci_get_device(dev); + subvendor = pci_get_subvendor(dev); + subdevice = pci_get_subdevice(dev); + for (e = none_atapci_table; e->vendor != 0xffff; ++e) { + if (e->vendor == vendor && e->device == device && + e->subvendor == subvendor && e->subdevice == subdevice) + return ENXIO; + } + if (!ata_generic_ident(dev)) return ATA_PROBE_OK; }