From owner-freebsd-hackers Wed Feb 12 12:34:15 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id MAA24780 for hackers-outgoing; Wed, 12 Feb 1997 12:34:15 -0800 (PST) Received: from Sisyphos.MI.Uni-Koeln.DE (Sisyphos.MI.Uni-Koeln.DE [134.95.212.10]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id MAA24771 for ; Wed, 12 Feb 1997 12:34:10 -0800 (PST) Received: from x14.mi.uni-koeln.de (annexr2-38.slip.Uni-Koeln.DE) by Sisyphos.MI.Uni-Koeln.DE with SMTP id AA06699 (5.67b/IDA-1.5 for ); Wed, 12 Feb 1997 21:34:04 +0100 Received: (from se@localhost) by x14.mi.uni-koeln.de (8.8.5/8.6.9) id VAA04184; Wed, 12 Feb 1997 21:33:18 +0100 (CET) Message-Id: <19970212213157.YA20116@x14.mi.uni-koeln.de> Date: Wed, 12 Feb 1997 21:31:57 +0100 From: se@freebsd.org (Stefan Esser) To: helbig@mx.ba-stuttgart.de (Wolfgang Helbig) Cc: hackers@freebsd.org Subject: Re: CMD640b workaround - final(?) version References: <199702112257.XAA01704@helbig.informatik.ba-stuttgart.de> X-Mailer: Mutt 0.60-PL0 Mime-Version: 1.0 In-Reply-To: <199702112257.XAA01704@helbig.informatik.ba-stuttgart.de>; from Wolfgang Helbig on Feb 11, 1997 23:57:44 +0100 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Feb 11, helbig@MX.BA-Stuttgart.De (Wolfgang Helbig) wrote: > If you use the > options "CMD640" > you also *have* to put > controller pci0 > into your configuration file! Maybe someone can put the right clauses > in /sys/conf/files to automaticly resoving this (ugly) dependency! Ahemm ? The CMD640 option obviously makes no sense on a system without a PCI bus. But I agree, that it violates the principle of least surprise, if this option causes a kernel build to fail for a non-PCI system (without the controller pci0 line). There are 2 possible workarounds: 1) Include pci.h into the wd driver, and #undef CMD640, if NCPI == 0. 2) Move the definition of "cmd640_detected" into wd.c, and make the PCI probe code use it as an *external* variable only if CMD640 is defined. BTW: I do heavily dislike the way you introduced the PCI ID of the CMD640 into pci.c, and will not accept it! There is NO device specific code in pci.c for a reason! Please take a look at if_ed_p.c for a trivial PCI probe and attach example. In fact, your atatch code will just be "return wd_attach (.., .., /* cmd640_present = */ 1)" and you will have to modify the attach function in wd.c to accept that additional parameter ... (In fact, I'd rather make it an "eide_implementation" parameter, which is an enumeration of all the chips that may be supported by this mechanism at a time :) Regards, STefan