1994-11-04 09:40:11 +03:00
|
|
|
/* $NetBSD: subr_autoconf.c,v 1.16 1994/11/04 06:40:11 mycroft Exp $ */
|
1994-06-29 10:29:24 +04:00
|
|
|
|
1993-08-13 17:19:41 +04:00
|
|
|
/*
|
1994-05-20 08:15:04 +04:00
|
|
|
* Copyright (c) 1992, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
1993-08-13 17:19:41 +04:00
|
|
|
*
|
|
|
|
* This software was developed by the Computer Systems Engineering group
|
|
|
|
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
|
|
|
* contributed to Berkeley.
|
|
|
|
*
|
|
|
|
* All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
* California, Lawrence Berkeley Laboratories.
|
|
|
|
*
|
1994-05-20 08:15:04 +04:00
|
|
|
* 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, 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. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
* California, Berkeley and its contributors.
|
|
|
|
* 4. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
1993-08-13 17:19:41 +04:00
|
|
|
*
|
1994-05-20 08:15:04 +04:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
1993-08-13 17:19:41 +04:00
|
|
|
*
|
1994-05-20 08:15:04 +04:00
|
|
|
* from: Header: subr_autoconf.c,v 1.12 93/02/01 19:31:48 torek Exp (LBL)
|
1994-06-29 10:29:24 +04:00
|
|
|
*
|
|
|
|
* @(#)subr_autoconf.c 8.1 (Berkeley) 6/10/93
|
1993-08-13 17:19:41 +04:00
|
|
|
*/
|
|
|
|
|
1993-12-18 06:59:02 +03:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/device.h>
|
|
|
|
#include <sys/malloc.h>
|
1994-10-31 00:43:03 +03:00
|
|
|
#include <lib/libkern/libkern.h>
|
1994-11-04 09:40:11 +03:00
|
|
|
#include <machine/limits.h>
|
1993-08-13 17:19:41 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Autoconfiguration subroutines.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ioconf.c exports exactly two names: cfdata and cfroots. All system
|
|
|
|
* devices and drivers are found via these tables.
|
|
|
|
*/
|
|
|
|
extern struct cfdata cfdata[];
|
|
|
|
extern short cfroots[];
|
|
|
|
|
|
|
|
#define ROOT ((struct device *)NULL)
|
|
|
|
|
1994-11-04 03:14:04 +03:00
|
|
|
struct device *config_make_softc __P((struct device *, struct cfdata *));
|
1994-11-04 01:01:09 +03:00
|
|
|
|
1994-11-04 09:40:11 +03:00
|
|
|
struct matchinfo {
|
|
|
|
cfmatch_t fn;
|
|
|
|
struct device *parent;
|
|
|
|
void *match, *aux;
|
|
|
|
int indirect, pri;
|
|
|
|
};
|
|
|
|
|
1993-08-13 17:19:41 +04:00
|
|
|
/*
|
|
|
|
* Apply the matching function and choose the best. This is used
|
|
|
|
* a few times and we want to keep the code small.
|
|
|
|
*/
|
1994-11-04 09:40:11 +03:00
|
|
|
static void
|
|
|
|
mapply(m, cf)
|
1993-08-13 17:19:41 +04:00
|
|
|
register struct matchinfo *m;
|
|
|
|
register struct cfdata *cf;
|
|
|
|
{
|
|
|
|
register int pri;
|
1994-11-04 01:01:09 +03:00
|
|
|
void *match;
|
|
|
|
|
1994-11-04 09:40:11 +03:00
|
|
|
if (m->indirect)
|
1994-11-04 03:14:04 +03:00
|
|
|
match = config_make_softc(m->parent, cf);
|
1994-11-04 09:40:11 +03:00
|
|
|
else
|
1994-11-04 01:01:09 +03:00
|
|
|
match = cf;
|
1993-08-13 17:19:41 +04:00
|
|
|
|
|
|
|
if (m->fn != NULL)
|
1994-11-04 01:01:09 +03:00
|
|
|
pri = (*m->fn)(m->parent, match, m->aux);
|
1993-08-16 03:01:58 +04:00
|
|
|
else {
|
1994-05-20 08:15:04 +04:00
|
|
|
if (cf->cf_driver->cd_match == NULL) {
|
1994-11-04 09:40:11 +03:00
|
|
|
panic("mapply: no match function for '%s' device\n",
|
1994-11-04 01:01:09 +03:00
|
|
|
cf->cf_driver->cd_name);
|
1993-08-16 03:01:58 +04:00
|
|
|
}
|
1994-11-04 01:01:09 +03:00
|
|
|
pri = (*cf->cf_driver->cd_match)(m->parent, match, m->aux);
|
1993-08-16 03:01:58 +04:00
|
|
|
}
|
1994-11-04 01:01:09 +03:00
|
|
|
|
1993-08-13 17:19:41 +04:00
|
|
|
if (pri > m->pri) {
|
1994-11-04 06:07:17 +03:00
|
|
|
if (m->indirect && m->match)
|
1994-11-04 01:01:09 +03:00
|
|
|
free(m->match, M_DEVBUF);
|
|
|
|
m->match = match;
|
1993-08-13 17:19:41 +04:00
|
|
|
m->pri = pri;
|
1994-11-04 01:01:09 +03:00
|
|
|
} else {
|
1994-11-04 06:07:17 +03:00
|
|
|
if (m->indirect)
|
1994-11-04 01:01:09 +03:00
|
|
|
free(match, M_DEVBUF);
|
1993-08-13 17:19:41 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Iterate over all potential children of some device, calling the given
|
|
|
|
* function (default being the child's match function) for each one.
|
|
|
|
* Nonzero returns are matches; the highest value returned is considered
|
|
|
|
* the best match. Return the `found child' if we got a match, or NULL
|
|
|
|
* otherwise. The `aux' pointer is simply passed on through.
|
|
|
|
*
|
|
|
|
* Note that this function is designed so that it can be used to apply
|
|
|
|
* an arbitrary function to all potential children (its return value
|
|
|
|
* can be ignored).
|
|
|
|
*/
|
1994-11-04 01:01:09 +03:00
|
|
|
void *
|
1993-08-13 17:19:41 +04:00
|
|
|
config_search(fn, parent, aux)
|
|
|
|
cfmatch_t fn;
|
|
|
|
register struct device *parent;
|
|
|
|
void *aux;
|
|
|
|
{
|
|
|
|
register struct cfdata *cf;
|
|
|
|
register short *p;
|
|
|
|
struct matchinfo m;
|
|
|
|
|
|
|
|
m.fn = fn;
|
|
|
|
m.parent = parent;
|
|
|
|
m.match = NULL;
|
1994-11-04 06:07:17 +03:00
|
|
|
m.aux = aux;
|
|
|
|
m.indirect = parent && parent->dv_cfdata->cf_driver->cd_indirect;
|
1993-08-13 17:19:41 +04:00
|
|
|
m.pri = 0;
|
|
|
|
for (cf = cfdata; cf->cf_driver; cf++) {
|
|
|
|
/*
|
|
|
|
* Skip cf if no longer eligible, otherwise scan through
|
|
|
|
* parents for one matching `parent', and try match function.
|
|
|
|
*/
|
|
|
|
if (cf->cf_fstate == FSTATE_FOUND)
|
|
|
|
continue;
|
|
|
|
for (p = cf->cf_parents; *p >= 0; p++)
|
|
|
|
if (parent->dv_cfdata == &cfdata[*p])
|
1994-11-04 09:40:11 +03:00
|
|
|
mapply(&m, cf);
|
1993-08-13 17:19:41 +04:00
|
|
|
}
|
|
|
|
return (m.match);
|
|
|
|
}
|
|
|
|
|
1994-11-04 09:40:11 +03:00
|
|
|
/*
|
|
|
|
* Iterate over all potential children of some device, calling the given
|
|
|
|
* function for each one.
|
|
|
|
*
|
|
|
|
* Note that this function is designed so that it can be used to apply
|
|
|
|
* an arbitrary function to all potential children (its return value
|
|
|
|
* can be ignored).
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
config_scan(fn, parent)
|
|
|
|
cfscan_t fn;
|
|
|
|
register struct device *parent;
|
|
|
|
{
|
|
|
|
register struct cfdata *cf;
|
|
|
|
register short *p;
|
|
|
|
void *match;
|
|
|
|
int indirect;
|
|
|
|
|
|
|
|
indirect = parent && parent->dv_cfdata->cf_driver->cd_indirect;
|
|
|
|
for (cf = cfdata; cf->cf_driver; cf++) {
|
|
|
|
/*
|
|
|
|
* Skip cf if no longer eligible, otherwise scan through
|
|
|
|
* parents for one matching `parent', and try match function.
|
|
|
|
*/
|
|
|
|
if (cf->cf_fstate == FSTATE_FOUND)
|
|
|
|
continue;
|
|
|
|
for (p = cf->cf_parents; *p >= 0; p++)
|
|
|
|
if (parent->dv_cfdata == &cfdata[*p]) {
|
|
|
|
if (indirect)
|
|
|
|
match = config_make_softc(parent, cf);
|
|
|
|
else
|
|
|
|
match = cf;
|
|
|
|
(*fn)(parent, match);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1993-08-13 17:19:41 +04:00
|
|
|
/*
|
|
|
|
* Find the given root device.
|
|
|
|
* This is much like config_search, but there is no parent.
|
|
|
|
*/
|
1994-11-04 01:01:09 +03:00
|
|
|
void *
|
1993-08-13 17:19:41 +04:00
|
|
|
config_rootsearch(fn, rootname, aux)
|
|
|
|
register cfmatch_t fn;
|
|
|
|
register char *rootname;
|
|
|
|
register void *aux;
|
|
|
|
{
|
|
|
|
register struct cfdata *cf;
|
|
|
|
register short *p;
|
|
|
|
struct matchinfo m;
|
|
|
|
|
|
|
|
m.fn = fn;
|
|
|
|
m.parent = ROOT;
|
|
|
|
m.match = NULL;
|
1994-11-04 06:07:17 +03:00
|
|
|
m.aux = aux;
|
|
|
|
m.indirect = 0;
|
1993-08-13 17:19:41 +04:00
|
|
|
m.pri = 0;
|
|
|
|
/*
|
|
|
|
* Look at root entries for matching name. We do not bother
|
|
|
|
* with found-state here since only one root should ever be
|
|
|
|
* searched (and it must be done first).
|
|
|
|
*/
|
|
|
|
for (p = cfroots; *p >= 0; p++) {
|
|
|
|
cf = &cfdata[*p];
|
|
|
|
if (strcmp(cf->cf_driver->cd_name, rootname) == 0)
|
1994-11-04 09:40:11 +03:00
|
|
|
mapply(&m, cf);
|
1993-08-13 17:19:41 +04:00
|
|
|
}
|
|
|
|
return (m.match);
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *msgs[3] = { "", " not configured\n", " unsupported\n" };
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The given `aux' argument describes a device that has been found
|
|
|
|
* on the given parent, but not necessarily configured. Locate the
|
|
|
|
* configuration data for that device (using the cd_match configuration
|
|
|
|
* driver function) and attach it, and return true. If the device was
|
|
|
|
* not configured, call the given `print' function and return 0.
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
config_found(parent, aux, print)
|
|
|
|
struct device *parent;
|
|
|
|
void *aux;
|
|
|
|
cfprint_t print;
|
|
|
|
{
|
1994-11-04 01:01:09 +03:00
|
|
|
void *match;
|
1993-08-13 17:19:41 +04:00
|
|
|
|
1994-11-04 01:01:09 +03:00
|
|
|
if ((match = config_search((cfmatch_t)NULL, parent, aux)) != NULL) {
|
|
|
|
config_attach(parent, match, aux, print);
|
1993-08-13 17:19:41 +04:00
|
|
|
return (1);
|
|
|
|
}
|
1993-08-16 03:01:58 +04:00
|
|
|
if (print)
|
1994-11-04 01:01:09 +03:00
|
|
|
printf(msgs[(*print)(aux, parent->dv_xname)]);
|
1993-08-13 17:19:41 +04:00
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* As above, but for root devices.
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
config_rootfound(rootname, aux)
|
|
|
|
char *rootname;
|
|
|
|
void *aux;
|
|
|
|
{
|
1994-11-04 01:01:09 +03:00
|
|
|
void *match;
|
1993-08-13 17:19:41 +04:00
|
|
|
|
1994-11-04 01:01:09 +03:00
|
|
|
if ((match = config_rootsearch((cfmatch_t)NULL, rootname, aux))
|
|
|
|
!= NULL) {
|
|
|
|
config_attach(ROOT, match, aux, (cfprint_t)NULL);
|
1993-08-13 17:19:41 +04:00
|
|
|
return (1);
|
|
|
|
}
|
|
|
|
printf("root device %s not configured\n", rootname);
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* just like sprintf(buf, "%d") except that it works from the end */
|
|
|
|
static char *
|
|
|
|
number(ep, n)
|
|
|
|
register char *ep;
|
|
|
|
register int n;
|
|
|
|
{
|
|
|
|
|
|
|
|
*--ep = 0;
|
|
|
|
while (n >= 10) {
|
|
|
|
*--ep = (n % 10) + '0';
|
|
|
|
n /= 10;
|
|
|
|
}
|
|
|
|
*--ep = n + '0';
|
|
|
|
return (ep);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Attach a found device. Allocates memory for device variables.
|
|
|
|
*/
|
|
|
|
void
|
1994-11-04 01:01:09 +03:00
|
|
|
config_attach(parent, match, aux, print)
|
1993-08-13 17:19:41 +04:00
|
|
|
register struct device *parent;
|
1994-11-04 01:01:09 +03:00
|
|
|
void *match;
|
1993-08-13 17:19:41 +04:00
|
|
|
register void *aux;
|
|
|
|
cfprint_t print;
|
1994-11-04 01:01:09 +03:00
|
|
|
{
|
|
|
|
register struct cfdata *cf;
|
|
|
|
register struct device *dev;
|
1994-11-04 03:14:04 +03:00
|
|
|
register struct cfdriver *cd;
|
1994-11-04 01:01:09 +03:00
|
|
|
static struct device **nextp = &alldevs;
|
|
|
|
|
1994-11-04 03:14:04 +03:00
|
|
|
if (parent && parent->dv_cfdata->cf_driver->cd_indirect) {
|
1994-11-04 01:01:09 +03:00
|
|
|
dev = match;
|
|
|
|
cf = dev->dv_cfdata;
|
|
|
|
} else {
|
|
|
|
cf = match;
|
1994-11-04 03:14:04 +03:00
|
|
|
dev = config_make_softc(parent, cf);
|
1994-11-04 01:01:09 +03:00
|
|
|
}
|
|
|
|
|
1994-11-04 03:14:04 +03:00
|
|
|
cd = cf->cf_driver;
|
|
|
|
cd->cd_devs[cf->cf_unit] = dev;
|
1994-11-04 01:01:09 +03:00
|
|
|
|
|
|
|
if (cf->cf_fstate == FSTATE_STAR)
|
|
|
|
cf->cf_unit++;
|
|
|
|
else
|
|
|
|
cf->cf_fstate = FSTATE_FOUND;
|
|
|
|
|
|
|
|
*nextp = dev; /* link up */
|
|
|
|
nextp = &dev->dv_next;
|
|
|
|
|
|
|
|
if (parent == ROOT)
|
|
|
|
printf("%s (root)", dev->dv_xname);
|
|
|
|
else {
|
|
|
|
printf("%s at %s", dev->dv_xname, parent->dv_xname);
|
|
|
|
if (print)
|
|
|
|
(void) (*print)(aux, (char *)0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Before attaching, clobber any unfound devices that are
|
|
|
|
* otherwise identical.
|
|
|
|
*/
|
|
|
|
for (cf = cfdata; cf->cf_driver; cf++)
|
|
|
|
if (cf->cf_driver == cd && cf->cf_unit == dev->dv_unit &&
|
|
|
|
cf->cf_fstate == FSTATE_NOTFOUND)
|
|
|
|
cf->cf_fstate = FSTATE_FOUND;
|
|
|
|
(*cd->cd_attach)(parent, dev, aux);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct device *
|
1994-11-04 03:14:04 +03:00
|
|
|
config_make_softc(parent, cf)
|
|
|
|
struct device *parent;
|
1994-11-04 01:01:09 +03:00
|
|
|
struct cfdata *cf;
|
1993-08-13 17:19:41 +04:00
|
|
|
{
|
|
|
|
register struct device *dev;
|
|
|
|
register struct cfdriver *cd;
|
|
|
|
register size_t lname, lunit;
|
|
|
|
register char *xunit;
|
|
|
|
char num[10];
|
|
|
|
|
|
|
|
cd = cf->cf_driver;
|
|
|
|
if (cd->cd_devsize < sizeof(struct device))
|
1994-11-04 01:01:09 +03:00
|
|
|
panic("config_make_softc");
|
1993-08-13 17:19:41 +04:00
|
|
|
|
|
|
|
/* compute length of name and decimal expansion of unit number */
|
|
|
|
lname = strlen(cd->cd_name);
|
1994-11-04 01:01:09 +03:00
|
|
|
xunit = number(&num[sizeof num], cf->cf_unit);
|
1993-08-13 17:19:41 +04:00
|
|
|
lunit = &num[sizeof num] - xunit;
|
|
|
|
if (lname + lunit >= sizeof(dev->dv_xname))
|
|
|
|
panic("config_attach: device name too long");
|
|
|
|
|
|
|
|
/* get memory for all device vars */
|
1993-08-16 03:01:58 +04:00
|
|
|
dev = (struct device *)malloc(cd->cd_devsize, M_DEVBUF, M_NOWAIT);
|
|
|
|
if (!dev)
|
|
|
|
panic("config_attach: memory allocation for device softc failed");
|
1993-08-13 17:19:41 +04:00
|
|
|
bzero(dev, cd->cd_devsize);
|
|
|
|
dev->dv_class = cd->cd_class;
|
|
|
|
dev->dv_cfdata = cf;
|
1994-11-04 01:01:09 +03:00
|
|
|
dev->dv_unit = cf->cf_unit;
|
1993-08-13 17:19:41 +04:00
|
|
|
bcopy(cd->cd_name, dev->dv_xname, lname);
|
|
|
|
bcopy(xunit, dev->dv_xname + lname, lunit);
|
|
|
|
dev->dv_parent = parent;
|
|
|
|
|
|
|
|
/* put this device in the devices array */
|
|
|
|
if (dev->dv_unit >= cd->cd_ndevs) {
|
|
|
|
/*
|
|
|
|
* Need to expand the array.
|
|
|
|
*/
|
1994-10-07 12:07:56 +03:00
|
|
|
int old = cd->cd_ndevs, new;
|
1993-08-13 17:19:41 +04:00
|
|
|
void **nsp;
|
|
|
|
|
1994-10-07 12:07:56 +03:00
|
|
|
if (old == 0)
|
|
|
|
new = MINALLOCSIZE / sizeof(void *);
|
|
|
|
else
|
|
|
|
new = old * 2;
|
|
|
|
while (new <= dev->dv_unit)
|
|
|
|
new *= 2;
|
|
|
|
cd->cd_ndevs = new;
|
|
|
|
nsp = malloc(new * sizeof(void *), M_DEVBUF, M_NOWAIT);
|
|
|
|
if (nsp == 0)
|
|
|
|
panic("config_attach: %sing dev array",
|
|
|
|
old != 0 ? "expand" : "creat");
|
|
|
|
bzero(nsp + old, (new - old) * sizeof(void *));
|
|
|
|
if (old != 0) {
|
|
|
|
bcopy(cd->cd_devs, nsp, old * sizeof(void *));
|
1993-08-13 17:19:41 +04:00
|
|
|
free(cd->cd_devs, M_DEVBUF);
|
|
|
|
}
|
|
|
|
cd->cd_devs = nsp;
|
|
|
|
}
|
|
|
|
if (cd->cd_devs[dev->dv_unit])
|
|
|
|
panic("config_attach: duplicate %s", dev->dv_xname);
|
|
|
|
|
1994-11-04 01:01:09 +03:00
|
|
|
return (dev);
|
1993-08-13 17:19:41 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Attach an event. These must come from initially-zero space (see
|
|
|
|
* commented-out assignments below), but that occurs naturally for
|
|
|
|
* device instance variables.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
evcnt_attach(dev, name, ev)
|
|
|
|
struct device *dev;
|
|
|
|
const char *name;
|
|
|
|
struct evcnt *ev;
|
|
|
|
{
|
|
|
|
static struct evcnt **nextp = &allevents;
|
|
|
|
|
|
|
|
#ifdef DIAGNOSTIC
|
|
|
|
if (strlen(name) >= sizeof(ev->ev_name))
|
|
|
|
panic("evcnt_attach");
|
|
|
|
#endif
|
|
|
|
/* ev->ev_next = NULL; */
|
|
|
|
ev->ev_dev = dev;
|
|
|
|
/* ev->ev_count = 0; */
|
|
|
|
strcpy(ev->ev_name, name);
|
|
|
|
*nextp = ev;
|
|
|
|
nextp = &ev->ev_next;
|
|
|
|
}
|