From owner-cvs-src@FreeBSD.ORG Thu Jul 8 04:59:48 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3CAAC16A4CE; Thu, 8 Jul 2004 04:59:48 +0000 (GMT) Received: from www.cryptography.com (li-22.members.linode.com [64.5.53.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id F40D143D55; Thu, 8 Jul 2004 04:59:47 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.5.50] (adsl-64-171-187-74.dsl.snfc21.pacbell.net [64.171.187.74]) by www.cryptography.com (8.12.8/8.12.8) with ESMTP id i684xjrb029864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 7 Jul 2004 21:59:46 -0700 Message-ID: <40ECD2F0.3070201@root.org> Date: Wed, 07 Jul 2004 21:52:00 -0700 From: Nate Lawson User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "M. Warner Losh" References: <40EC7A5A.3010303@root.org> <20040707.183145.79073073.imp@bsdimp.com> <40EC9698.4050201@root.org> <20040707.185814.113735786.imp@bsdimp.com> In-Reply-To: <20040707.185814.113735786.imp@bsdimp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: [src] cvs commit: src/sys/dev/fdc fdc.c fdc_isa.c fdc_pccard.c fdcvar.h src/sys/modules/fdc Makefile X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2004 04:59:48 -0000 M. Warner Losh wrote: > In message: <40EC9698.4050201@root.org> > Nate Lawson writes: > : The problem I've run into involves the question that when multiple > : drivers can claim a device, can you use anything in the device to pass > : info to the attach routine? I want to do a device_set_flags() to pass > : the PNP flag to isa_attach() iff the isa PNP routine wins the probe. Is > : this ok since device_probe will be called a second time on the winning > : driver? As long as I destructively set the flags, it seems this is ok. > > Generally this is considered bad form. The only reason we call probe > the second time is to get the device name correct. We may optimize > this away at some point, or we may call probe dozens of time in the > future. Generally, you put code into attach routine to cope. The > attach routine can call the get pnp id call in isa to find out if it > is plug and play and set the flags there. I can't work around this in attach. Both ACPI and ISA offer the ISA pnp probe method and need to set ISPNP if probing via PNP. Also, there will be the ACPI _FDE method. But the attach routine doesn't need to be any different. I had to add a stub attach for both ISA and ACPI that sets the PNP flag and then calls the common isa_attach. There was no other way to differentiate which probe succeeded without setting a flag somewhere. But this was poor. I think it should make sense that any flags you set in probe are the ones that are set in attach if you win the probe. Otherwise you'll end up duplicating probe in attach (another bad idea). > Normally drivers have a common alloc_resources, but the floppy disk > can have so many different allocations from the upper layers that I > think that we'll have problems having one for all the attachments. There's another hack we need. Some people have BIOSs that specify 0x3f2-0x3f5 for the data port (leaving out 0x3f0-0x3f1). So we'll need to say that if an incomplete range is specified, try adding the bottom end. I can't see how Windows works on that system except by hard-coding the port values. -- -Nate