Date: Tue, 03 Aug 2004 18:37:54 +0400 From: Roman Kurakin <rik@cronyx.ru> To: Mark Murray <mark@grondar.org> Cc: obrien@FreeBSD.ORG Subject: Re: cvs commit: src/sys/modules Makefile Message-ID: <410FA342.4030506@cronyx.ru> In-Reply-To: <200408021850.i72Io3JB028204@grimreaper.grondar.org> References: <200408021850.i72Io3JB028204@grimreaper.grondar.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 > > > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?410FA342.4030506>