From owner-cvs-src@FreeBSD.ORG Tue Aug 3 14:41:09 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 CE56C16A4CE for ; Tue, 3 Aug 2004 14:41:09 +0000 (GMT) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 07A3343D4C for ; Tue, 3 Aug 2004 14:41:09 +0000 (GMT) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru id i73Ec86x049765 for cvs-src@FreeBSD.ORG.checked; (8.12.8/vak/2.1) Tue, 3 Aug 2004 18:38:08 +0400 (MSD) (envelope-from rik@cronyx.ru) Received: from cronyx.ru (hi.cronyx.ru [144.206.181.94]) by hanoi.cronyx.ru with ESMTP id i73EbDGK049713; (8.12.8/vak/2.1) Tue, 3 Aug 2004 18:37:13 +0400 (MSD) (envelope-from rik@cronyx.ru) Message-ID: <410FA342.4030506@cronyx.ru> Date: Tue, 03 Aug 2004 18:37:54 +0400 From: Roman Kurakin User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031208 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mark Murray References: <200408021850.i72Io3JB028204@grimreaper.grondar.org> In-Reply-To: <200408021850.i72Io3JB028204@grimreaper.grondar.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit cc: cvs-src@FreeBSD.ORG cc: src-committers@FreeBSD.ORG cc: cvs-all@FreeBSD.ORG cc: obrien@FreeBSD.ORG Subject: Re: cvs commit: src/sys/modules 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: Tue, 03 Aug 2004 14:41:09 -0000 Mark Murray wrote: >"David O'Brien" writes: > > >>Please find a way for all your /dev KO's to detect if they are already >>active and not panic if loaded(initialized) twice. Many of the network >>and SCSI device KO's DTRT. Maybe you can copy their method of handling >>this. >> >> > >I am investigating. In the meanwhile, please back out this commit, and >keep it as a local patch if you feel that strongly about it. > > Take a look how ctau(4)/cx(4)/cp(4) solve this problem. I guess that you may use same technic: static int cp_modevent (module_t mod, int type, void *unused) { #if __FreeBSD_version >= 500000 struct cdev *dev; #else dev_t dev; #endif static int load_count = 0; struct cdevsw *cdsw; #if __FreeBSD_version >= 502117 dev = findcdev (makedev(CDEV_MAJOR, 0)); #elif __FreeBSD_version >= 502103 dev = udev2dev (makeudev(CDEV_MAJOR, 0)); #else dev = makedev (CDEV_MAJOR, 0); #endif switch (type) { case MOD_LOAD: #if __FreeBSD_version >= 502117 if (dev != NULL && #else if (dev != NODEV && #endif (cdsw = devsw (dev)) && cdsw->d_maj == CDEV_MAJOR) { printf ("Tau-PCI driver is already in system\n"); return (ENXIO); } rik >M >-- >Mark Murray >iumop ap!sdn w,I idlaH > > > >