From owner-freebsd-hackers Mon Feb 24 17:47:59 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id RAA08913 for hackers-outgoing; Mon, 24 Feb 1997 17:47:59 -0800 (PST) Received: from helbig.informatik.ba-stuttgart.de (helbig.informatik.ba-stuttgart.de [141.31.166.22]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id RAA08882; Mon, 24 Feb 1997 17:47:43 -0800 (PST) Received: (from helbig@localhost) by helbig.informatik.ba-stuttgart.de (8.8.5/8.8.5) id CAA00172; Tue, 25 Feb 1997 02:47:35 +0100 (MET) From: Wolfgang Helbig Message-Id: <199702250147.CAA00172@helbig.informatik.ba-stuttgart.de> Subject: Re: CMD640b workaround - final(?) version In-Reply-To: <19970213004131.DV50639@x14.mi.uni-koeln.de> from Stefan Esser at "Feb 13, 97 00:41:31 am" To: se@freebsd.org (Stefan Esser) Date: Tue, 25 Feb 1997 02:47:34 +0100 (MET) Cc: hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL30 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi Stefan, I changed the code as you suggested. Now pci.c is clean again. I added a new source pci/wdc_p.c. It is telling wd.c, which pci-devices are probed, so wd.c can adapt to different devices. Up to now only to CMD640b. If there are other IDE-PCI-Chips that need special treatment, they can be easily detected in wd.c now and treated accordingly. I had to add a line in conf/files: pci/wdc_p.c optional wdc device-driver For review, I include the source of wdc_p.c. If you think it's okay now, I will post a diff-file for wd.c, so kern/2305 can be closed. Here is the source of /sys/pci/wdc_p.c /* * * Copyright (c) 1996 Wolfgang Helbig * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice immediately at the beginning of the file, without modification, * this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Absolutely no warranty of function or purpose is made by the author. * 4. Modifications may be freely made to this file if the above conditions * are met. * * $ID$ */ #include "pci.h" #if NPCI > 0 #include #include #include #include #include #include #include "wdc.h" extern char *wdc_pci __P((pcidi_t type)); static char* wdc_pci_probe __P((pcici_t tag, pcidi_t type)); static void wdc_pci_attach __P((pcici_t config_id, int unit)); static u_long wdc_pci_count = 0; static struct pci_device wdc_pci_driver = { "wdc", wdc_pci_probe, wdc_pci_attach, &wdc_pci_count, NULL }; DATA_SET (pcidevice_set, wdc_pci_driver); static char* wdc_pci_probe (pcici_t tag, pcidi_t type) { char *name; if (name = wdc_pci(type)) wdc_pci_count++; return name; } static void wdc_pci_attach(config_id, unit) pcici_t config_id; int unit; { return; } #endif /* NPCI > 0 */ TIA Wolfgang