From owner-cvs-all Mon Aug 9 14:15: 9 1999 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id A9076152FF; Mon, 9 Aug 1999 14:15:06 -0700 (PDT) (envelope-from wpaul@FreeBSD.org) Received: (from wpaul@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id OAA48853; Mon, 9 Aug 1999 14:12:19 -0700 (PDT) (envelope-from wpaul@FreeBSD.org) Message-Id: <199908092112.OAA48853@freefall.freebsd.org> From: Bill Paul Date: Mon, 9 Aug 1999 14:12:19 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/i386/isa pcibus.c Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk wpaul 1999/08/09 14:12:19 PDT Modified files: sys/i386/isa pcibus.c Log: Fix nexus_pcib_is_host_bridge() so that it detects my 486's PCI bus correctly. It has the following code: if (class != PCIC_BRIDGE || subclass != PCIS_BRIDGE_HOST) return NULL; My 486 has an Integrated Micro Solutions PCI bridge which identifies itself as subclass PCIS_BRIDGE_OTHER, not PCIS_BRIDGE_HOST. Consequently, it gets ignored. In my opinion, the correct test should be: if ((class != PCIC_BRIDGE) && (subclass != PCIS_BRIDGE_HOST)) return NULL; That way the test still succeeds because the chip's class is PCIC_BRIDGE. Clearly it's not reasonable to expect all host to PCI bridges to always have a subclass of PCIS_BRIDGE_HOST since I've got one that doesn't. This way the sanity test should remain relatively sane while still allowing some oddball yet correct hardware to work. If somebody has a better way to do it, go ahead and tweak the test, but be aware that class == PCIC_BRIDGE and subclass == PCIS_BRIDGE_OTHER is a valid case. While I was here, I also added an explicit ID string for the IMS chipset. I also dealt with a minor style nit: it's bad karma not to have a default case for your switch statements, but the one in this routine doesn't have one. The default string of "Host to PCI bridge" is now assigned in a default case of the switch statement instead of initializing "s" with the string before the switch and then not having any default case. Revision Changes Path 1.45 +9 -3 src/sys/i386/isa/pcibus.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message