diff options
author | scrappy <scrappy@FreeBSD.org> | 1996-03-28 14:29:52 +0000 |
---|---|---|
committer | scrappy <scrappy@FreeBSD.org> | 1996-03-28 14:29:52 +0000 |
commit | 415585985cb93ec4bd441c45c7bbd43c2529256d (patch) | |
tree | a799d7ab93b91102069e46ed96392e309b7b469f /sys/i386 | |
parent | f55298f39fa39052b4a4bb6f1f3a18aa12d6b771 (diff) | |
download | FreeBSD-src-415585985cb93ec4bd441c45c7bbd43c2529256d.zip FreeBSD-src-415585985cb93ec4bd441c45c7bbd43c2529256d.tar.gz |
Switched from using devfs_add_sw() to using devfs_add_swf()
Reviewed by: julian@freebsd.org
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/apm/apm.c | 8 | ||||
-rw-r--r-- | sys/i386/bios/apm.c | 8 | ||||
-rw-r--r-- | sys/i386/i386/cons.c | 14 | ||||
-rw-r--r-- | sys/i386/isa/asc.c | 34 | ||||
-rw-r--r-- | sys/i386/isa/b004.c | 29 | ||||
-rw-r--r-- | sys/i386/isa/ctx.c | 9 | ||||
-rw-r--r-- | sys/i386/isa/fd.c | 17 | ||||
-rw-r--r-- | sys/i386/isa/gpib.c | 4 | ||||
-rw-r--r-- | sys/i386/isa/gsc.c | 29 | ||||
-rw-r--r-- | sys/i386/isa/if_cx.c | 13 | ||||
-rw-r--r-- | sys/i386/isa/joy.c | 8 | ||||
-rw-r--r-- | sys/i386/isa/labpc.c | 11 | ||||
-rw-r--r-- | sys/i386/isa/lpt.c | 10 | ||||
-rw-r--r-- | sys/i386/isa/matcd/matcd.c | 41 | ||||
-rw-r--r-- | sys/i386/isa/mcd.c | 34 | ||||
-rw-r--r-- | sys/i386/isa/mse.c | 19 | ||||
-rw-r--r-- | sys/i386/isa/pcaudio.c | 15 | ||||
-rw-r--r-- | sys/i386/isa/psm.c | 17 | ||||
-rw-r--r-- | sys/i386/isa/qcam.c | 9 | ||||
-rw-r--r-- | sys/i386/isa/rc.c | 10 | ||||
-rw-r--r-- | sys/i386/isa/scd.c | 34 | ||||
-rw-r--r-- | sys/i386/isa/si.c | 8 | ||||
-rw-r--r-- | sys/i386/isa/spigot.c | 9 | ||||
-rw-r--r-- | sys/i386/isa/tw.c | 8 | ||||
-rw-r--r-- | sys/i386/isa/wcd.c | 32 | ||||
-rw-r--r-- | sys/i386/isa/wt.c | 17 |
26 files changed, 190 insertions, 257 deletions
diff --git a/sys/i386/apm/apm.c b/sys/i386/apm/apm.c index 855a670..1448949 100644 --- a/sys/i386/apm/apm.c +++ b/sys/i386/apm/apm.c @@ -13,7 +13,7 @@ * * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: apm.c,v 1.35 1996/03/19 16:48:38 nate Exp $ + * $Id: apm.c,v 1.36 1996/03/19 16:56:56 nate Exp $ */ #include "apm.h" @@ -62,7 +62,9 @@ struct apm_softc { u_int intversion; struct apmhook sc_suspend; struct apmhook sc_resume; +#ifdef DEVFS void *sc_devfs_token; +#endif }; static struct kern_devconf kdc_apm = { @@ -809,8 +811,8 @@ apmattach(struct isa_device *dvp) sc->initialized = 1; #ifdef DEVFS - sc->sc_devfs_token = devfs_add_devsw( - "/", "apm", &apm_cdevsw, 0, DV_CHR, 0, 0, 0600); + sc->sc_devfs_token = + devfs_add_devswf(&apm_cdevsw, 0, DV_CHR, 0, 0, 0600, "apm"); #endif return 0; } diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index 855a670..1448949 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -13,7 +13,7 @@ * * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: apm.c,v 1.35 1996/03/19 16:48:38 nate Exp $ + * $Id: apm.c,v 1.36 1996/03/19 16:56:56 nate Exp $ */ #include "apm.h" @@ -62,7 +62,9 @@ struct apm_softc { u_int intversion; struct apmhook sc_suspend; struct apmhook sc_resume; +#ifdef DEVFS void *sc_devfs_token; +#endif }; static struct kern_devconf kdc_apm = { @@ -809,8 +811,8 @@ apmattach(struct isa_device *dvp) sc->initialized = 1; #ifdef DEVFS - sc->sc_devfs_token = devfs_add_devsw( - "/", "apm", &apm_cdevsw, 0, DV_CHR, 0, 0, 0600); + sc->sc_devfs_token = + devfs_add_devswf(&apm_cdevsw, 0, DV_CHR, 0, 0, 0600, "apm"); #endif return 0; } diff --git a/sys/i386/i386/cons.c b/sys/i386/i386/cons.c index 9ab77a1..289e5c8 100644 --- a/sys/i386/i386/cons.c +++ b/sys/i386/i386/cons.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)cons.c 7.2 (Berkeley) 5/9/91 - * $Id: cons.c,v 1.42 1996/03/27 18:55:19 bde Exp $ + * $Id: cons.c,v 1.43 1996/03/27 19:04:54 bde Exp $ */ #include <sys/param.h> @@ -327,15 +327,9 @@ cn_drvinit(void *unused) cdevsw_add(&dev,&cn_cdevsw,NULL); cn_devsw_installed = 1; #ifdef DEVFS - cn_devfs_token = devfs_add_devsw( - "/", - "console", - &cn_cdevsw, - 0, - DV_CHR, - 0, - 0, - 0640); + cn_devfs_token = + devfs_add_devswf(&cn_cdevsw, 0, DV_CHR, 0, 0, + 0640, "console"); #endif } } diff --git a/sys/i386/isa/asc.c b/sys/i386/isa/asc.c index 1ddb8c9..a6eca29 100644 --- a/sys/i386/isa/asc.c +++ b/sys/i386/isa/asc.c @@ -34,7 +34,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * $Id: asc.c,v 1.15 1996/01/13 20:43:08 bde Exp $ + * $Id: asc.c,v 1.16 1996/01/27 00:53:55 bde Exp $ */ #include "asc.h" @@ -438,9 +438,6 @@ ascattach(struct isa_device *isdp) { int unit = isdp->id_unit; struct asc_unit *scu = unittab + unit; -#ifdef DEVFS - char name[32]; -#endif scu->flags |= FLAG_DEBUG; printf("asc%d: [GI1904/Trust Ami-Scan Grey, type S2]\n", unit); @@ -484,22 +481,19 @@ ascattach(struct isa_device *isdp) #ifdef DEVFS #define ASC_UID 0 #define ASC_GID 13 - sprintf(name,"asc%d",unit); -/* path name devsw minor type uid gid perm*/ - scu->devfs_asc = devfs_add_devsw("/", name, &asc_cdevsw, unit<<6, - DV_CHR, ASC_UID, ASC_GID, 0666); - sprintf(name,"asc%dp",unit); - scu->devfs_ascp = devfs_add_devsw("/", name, &asc_cdevsw, - ((unit<<6) + FRMT_PBM), - DV_CHR, ASC_UID, ASC_GID, 0666); - sprintf(name,"asc%dd",unit); - scu->devfs_ascd = devfs_add_devsw("/", name, &asc_cdevsw, - ((unit<<6) + DBUG_MASK), - DV_CHR, ASC_UID, ASC_GID, 0666); - sprintf(name,"asc%dpd",unit); - scu->devfs_ascpd = devfs_add_devsw("/", name, &asc_cdevsw, - ((unit<<6) + DBUG_MASK + FRMT_PBM), - DV_CHR, ASC_UID, ASC_GID, 0666); + scu->devfs_asc = + devfs_add_devswf(&asc_cdevsw, unit<<6, DV_CHR, ASC_UID, + ASC_GID, 0666, "asc%d", unit); + scu->devfs_ascp = + devfs_add_devswf(&asc_cdevsw, ((unit<<6) + FRMT_PBM), DV_CHR, + ASC_UID, ASC_GID, 0666, "asc%dp", unit); + scu->devfs_ascd = + devfs_add_devswf(&asc_cdevsw, ((unit<<6) + DBUG_MASK), DV_CHR, + ASC_UID, ASC_GID, 0666, "asc%dd", unit); + scu->devfs_ascpd = + devfs_add_devswf(&asc_cdevsw, ((unit<<6) + DBUG_MASK+FRMT_PBM), + DV_CHR, ASC_UID, ASC_GID, 0666, "asc%dpd", + unit); #endif /*DEVFS*/ return ATTACH_SUCCESS; } diff --git a/sys/i386/isa/b004.c b/sys/i386/isa/b004.c index ff2a3f2..5b56a34 100644 --- a/sys/i386/isa/b004.c +++ b/sys/i386/isa/b004.c @@ -558,7 +558,6 @@ bquattach(struct isa_device *idp) { int unit = idp->id_unit; struct b004_struct *bp; - char name[32]; int i; kdc_bqu[unit].kdc_state = DC_IDLE; @@ -572,22 +571,18 @@ bquattach(struct isa_device *idp) #ifdef NOTYET /* if (we've done all the ports found) break; */ #endif - sprintf(name,"ttyba%d" ,i); - bp->devfs_token[i][0]=devfs_add_devsw( - "/", name, &bqu_cdevsw, i, DV_CHR, - BQU_UID, BQU_GID, BQU_PERM); - sprintf(name,"ttybd%d" ,i); - bp->devfs_token[i][0]=devfs_add_devsw( - "/", name, &bqu_cdevsw, i+64, DV_CHR, - BQU_UID, BQU_GID, BQU_PERM); - sprintf(name,"ttybc%d" ,i); - bp->devfs_token[i][0]=devfs_add_devsw( - "/", name, &bqu_cdevsw, i+128, DV_CHR, - BQU_UID, BQU_GID, BQU_PERM); - sprintf(name,"ttybd%d" ,i); - bp->devfs_token[i][0]=devfs_add_devsw( - "/", name, &bqu_cdevsw, i+192, DV_CHR, - BQU_UID, BQU_GID, BQU_PERM); + bp->devfs_token[i][0]= + devfs_add_devswf(&bqu_cdevsw, i, DV_CHR, BQU_UID, + BQU_GID, BQU_PERM, "ttyba%d", i); + bp->devfs_token[i][0]= + devfs_add_devswf(&bqu_cdevsw, i+64, DV_CHR, BQU_UID, + BQU_GID, BQU_PERM, "ttybb%d", i); + bp->devfs_token[i][0]= + devfs_add_devswf(&bqu_cdevsw, i+128, DV_CHR, BQU_UID, + BQU_GID, BQU_PERM, "ttybc%d", i); + bp->devfs_token[i][0]= + devfs_add_devswf(&bqu_cdevsw, i+192, DV_CHR, BQU_UID, + BQU_GID, BQU_PERM, "ttybd%d", unit); } #endif return 1; diff --git a/sys/i386/isa/ctx.c b/sys/i386/isa/ctx.c index 4a80d1d..b56a1f8 100644 --- a/sys/i386/isa/ctx.c +++ b/sys/i386/isa/ctx.c @@ -8,7 +8,7 @@ * of this software, nor does the author assume any responsibility * for damages incurred with its use. * - * $Id: ctx.c,v 1.15 1995/12/15 00:29:28 bde Exp $ + * $Id: ctx.c,v 1.16 1995/12/15 00:53:55 bde Exp $ */ /* @@ -214,7 +214,6 @@ static int ctxattach(struct isa_device * devp) { struct ctx_soft_registers *sr; - char name[32]; sr = &(ctx_sr[devp->id_unit]); sr->cp0 = 0; /* zero out the shadow registers */ @@ -226,9 +225,9 @@ ctxattach(struct isa_device * devp) kdc_ctx[devp->id_unit].kdc_state = DC_IDLE; return (1); #ifdef DEVFS - sprintf(name,"ctx%d",devp->id_unit); - sr->devfs_token = devfs_add_devsw( "/", name, &ctx_cdevsw, 0, - DV_CHR, 0, 0, 0600); + sr->devfs_token = + devfs_add_devswf(&ctx_cdevsw, 0, DV_CHR, 0, 0, 0600, + "ctx%d", devp->id_unit); #endif /* DEVFS */ } diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c index f62c6ba..3c666a6 100644 --- a/sys/i386/isa/fd.c +++ b/sys/i386/isa/fd.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.79 1996/01/27 04:17:50 bde Exp $ + * $Id: fd.c,v 1.80 1996/02/25 21:01:31 bde Exp $ * */ @@ -767,13 +767,14 @@ fdattach(struct isa_device *dev) kdc_fd[fdu].kdc_state = DC_IDLE; #ifdef DEVFS mynor = 8 * fdu; - fd->bdev = devfs_add_devsw("/", name + 1, &fd_bdevsw, mynor, - DV_BLK, 0, 0, 0640); - fd->cdev = devfs_add_devsw("/", name, &fd_cdevsw, mynor, - DV_CHR, 0, 0, 0640); - sprintf(name, "rfd%d", fdu); - dev_link("/", name + 1, fd->bdev); - dev_link("/", name, fd->cdev); + fd->bdev = + devfs_add_devswf(&fd_bdevsw, mynor, DV_BLK, 0, 0, + 0640, name + 1); + fd->cdev = + devfs_add_devswf(&fd_cdevsw, mynor, + DV_CHR, 0, 0, 0640, name); + dev_link(fd->bdev, "fd%d", fdu); + dev_link(fd->cdev, "rfd%d", fdu); #endif /* DEVFS */ if (dk_ndrive < DK_NDRIVE) { sprintf(dk_names[dk_ndrive], "fd%d", fdu); diff --git a/sys/i386/isa/gpib.c b/sys/i386/isa/gpib.c index 2b4f1ac..39bc76e 100644 --- a/sys/i386/isa/gpib.c +++ b/sys/i386/isa/gpib.c @@ -145,8 +145,8 @@ gpattach(isdp) sc->sc_flags |=ATTACHED; #ifdef DEVFS - sc->devfs_token = devfs_add_devsw( "/", "gp", &gp_cdevsw, 0, - DV_CHR, 0, 0, 0600); + sc->devfs_token = + devfs_add_devswf(&gp_cdevsw, 0, DV_CHR, 0, 0, 0600, "gp"); #endif return (1); } diff --git a/sys/i386/isa/gsc.c b/sys/i386/isa/gsc.c index 29f812a..3478f84 100644 --- a/sys/i386/isa/gsc.c +++ b/sys/i386/isa/gsc.c @@ -522,22 +522,19 @@ gscattach(struct isa_device *isdp) #ifdef DEVFS #define GSC_UID 0 #define GSC_GID 13 - sprintf(name,"gsc%d",unit); -/* path name devsw minor type uid gid perm*/ - scu->devfs_gsc = devfs_add_devsw("/", name, &gsc_cdevsw, unit<<6, - DV_CHR, GSC_UID, GSC_GID, 0666); - sprintf(name,"gsc%dp",unit); - scu->devfs_gscp = devfs_add_devsw("/", name, &gsc_cdevsw, - ((unit<<6) + FRMT_PBM), - DV_CHR, GSC_UID, GSC_GID, 0666); - sprintf(name,"gsc%dd",unit); - scu->devfs_gscd = devfs_add_devsw("/", name, &gsc_cdevsw, - ((unit<<6) + DBUG_MASK), - DV_CHR, GSC_UID, GSC_GID, 0666); - sprintf(name,"gsc%dpd",unit); - scu->devfs_gscpd = devfs_add_devsw("/", name, &gsc_cdevsw, - ((unit<<6) + DBUG_MASK + FRMT_PBM), - DV_CHR, GSC_UID, GSC_GID, 0666); + scu->devfs_gsc = + devfs_add_devswf(&gsc_cdevsw, unit<<6, DV_CHR, GSC_UID, GSC_GID, + 0666, "gsc%d", unit); + scu->devfs_gscp = + devfs_add_devswf(&gsc_cdevsw, ((unit<<6) + FRMT_PBM), DV_CHR, + GSC_UID, GSC_GID, 0666, "gsc%dp", unit); + scu->devfs_gscd = + devfs_add_devswf(&gsc_cdevsw, ((unit<<6) + DBUG_MASK), DV_CHR, + GSC_UID, GSC_GID, 0666, "gsc%dd", unit); + scu->devfs_gscpd = + devfs_add_devswf(&gsc_cdevsw, ((unit<<6) + DBUG_MASK+FRMT_PBM), + DV_CHR, GSC_UID, GSC_GID, 0666, "gsc%dpd", + unit); #endif /*DEVFS*/ return ATTACH_SUCCESS; diff --git a/sys/i386/isa/if_cx.c b/sys/i386/isa/if_cx.c index bdbdef1..c1114c7 100644 --- a/sys/i386/isa/if_cx.c +++ b/sys/i386/isa/if_cx.c @@ -218,6 +218,11 @@ cxprobe (struct isa_device *id) /* * The adapter is present, initialize the driver structures. */ + +#ifdef DEVFS +static void *cx_devfs_token; +#endif + static int cxattach (struct isa_device *id) { @@ -302,12 +307,8 @@ cxattach (struct isa_device *id) dev_attach (&kdc_cx[unit]); printf ("cx%d: <Cronyx-%s>\n", unit, b->name); #ifdef DEVFS - { - void *x; - x=devfs_add_devsw( -/* path name devsw minor type uid gid perm*/ - "/", "cx", &cx_cdevsw, 0, DV_CHR, 0, 0, 0600); - } + cx_devfs_token = + devfs_add_devswf(&cx_cdevsw, 0, DV_CHR, 0, 0, 0600, "cx"); #endif return (1); } diff --git a/sys/i386/isa/joy.c b/sys/i386/isa/joy.c index ffb615d..350d784 100644 --- a/sys/i386/isa/joy.c +++ b/sys/i386/isa/joy.c @@ -115,16 +115,14 @@ static int joyattach (struct isa_device *dev) { int unit = dev->id_unit; - char name[32]; joy[unit].port = dev->id_iobase; joy[unit].timeout[0] = joy[unit].timeout[1] = 0; printf("joy%d: joystick\n", unit); #ifdef DEVFS - sprintf(name, "joy%d", unit); - joy[dev->id_unit].devfs_token = devfs_add_devsw( "/", "joy", - &joy_cdevsw, 0, - DV_CHR, 0, 0, 0600); + joy[dev->id_unit].devfs_token = + devfs_add_devswf(&joy_cdevsw, 0, DV_CHR, 0, 0, + 0600, "joy%d", unit); #endif return 1; } diff --git a/sys/i386/isa/labpc.c b/sys/i386/isa/labpc.c index 7185088..2e139d9 100644 --- a/sys/i386/isa/labpc.c +++ b/sys/i386/isa/labpc.c @@ -507,7 +507,6 @@ static int labpcattach(struct isa_device *dev) { struct ctlr *ctlr = labpcs[dev->id_unit]; - char name[32]; ctlr->sample_us = (1000000.0 / (double)LABPC_DEFAULT_HERZ) + .50; reset(ctlr); @@ -520,11 +519,11 @@ labpcattach(struct isa_device *dev) loutb(DCR(ctlr), ctlr->dcr_val); #ifdef DEVFS - sprintf(name, "labpc%d",dev->id_unit); - /* path name devsw minor */ - ctlr->devfs_token = devfs_add_devsw( "/", name, &labpc_cdevsw, 0, - /* what UID GID PERM */ - DV_CHR, 0, 0, 0600); + ctlr->devfs_token = + devfs_add_devswf(&labpc_cdevsw, 0, DV_CHR, + /* what UID GID PERM */ + 0, 0, 0600, + "labpc%d", dev->id_unit); #endif return 1; } diff --git a/sys/i386/isa/lpt.c b/sys/i386/isa/lpt.c index ab9744c..867afec 100644 --- a/sys/i386/isa/lpt.c +++ b/sys/i386/isa/lpt.c @@ -46,7 +46,7 @@ * SUCH DAMAGE. * * from: unknown origin, 386BSD 0.1 - * $Id: lpt.c,v 1.49 1996/02/06 18:50:52 wollman Exp $ + * $Id: lpt.c,v 1.50 1996/03/04 15:58:25 phk Exp $ */ /* @@ -453,7 +453,6 @@ lptattach(struct isa_device *isdp) { struct lpt_softc *sc; int unit; - char name[32]; unit = isdp->id_unit; sc = lpt_sc + unit; @@ -479,10 +478,9 @@ lptattach(struct isa_device *isdp) #ifdef DEVFS /* XXX */ /* what to do about the flags in the minor number? */ - sprintf(name,"lpt%d",unit); - /* path name devsw minor type uid gid perm*/ - sc->devfs_token = devfs_add_devsw( "/", name, &lpt_cdevsw, unit, - DV_CHR, 0, 0, 0600); + sc->devfs_token = + devfs_add_devswf(&lpt_cdevsw, unit, DV_CHR, 0, 0, 0600, + "lpt%d", unit); #endif return (1); } diff --git a/sys/i386/isa/matcd/matcd.c b/sys/i386/isa/matcd/matcd.c index 8c43fd7..da32789 100644 --- a/sys/i386/isa/matcd/matcd.c +++ b/sys/i386/isa/matcd/matcd.c @@ -337,7 +337,7 @@ static char MATCDVERSION[]="Version 1(26) 18-Oct-95"; static char MATCDCOPYRIGHT[] = "Matsushita CD-ROM driver, Copr. 1994,1995 Frank Durda IV"; /* The proceeding strings may not be changed*/ -/* $Id: matcd.c,v 1.13 1995/12/10 13:40:42 phk Exp $ */ +/* $Id: matcd.c,v 1.14 1995/12/10 19:52:36 bde Exp $ */ /*--------------------------------------------------------------------------- Include declarations @@ -1460,9 +1460,6 @@ matcd_attach(struct isa_device *dev) unsigned char data[12]; struct matcd_data *cd; int port = dev->id_iobase; /*Take port ID selected in probe()*/ -#ifdef DEVFS - char name[32]; -#endif #ifdef DIAGPORT DIAGOUT(DIAGPORT,0x70); /*Show where we are*/ @@ -1516,25 +1513,23 @@ matcd_attach(struct isa_device *dev) #ifdef DEVFS #define MATCD_UID 0 #define MATCD_GID 13 - sprintf(name, "rmatcd%da",i); - cd->ra_devfs_token = devfs_add_devsw( - "/", name, &matcd_cdevsw, 0, - DV_CHR, MATCD_UID, MATCD_GID, 0600); - - sprintf(name, "rmatcd%dc",i); - cd->rc_devfs_token = devfs_add_devsw( - "/", name, &matcd_cdevsw, RAW_PART, - DV_CHR, MATCD_UID, MATCD_GID, 0600); - - sprintf(name, "matcd%da",i); - cd->a_devfs_token = devfs_add_devsw( - "/", name, &matcd_bdevsw, 0, - DV_BLK, MATCD_UID, MATCD_GID, 0600); - - sprintf(name, "matcd%dc",i); - cd->c_devfs_token = devfs_add_devsw( - "/", name, &matcd_bdevsw, RAW_PART, - DV_BLK, MATCD_UID, MATCD_GID, 0600); + cd->ra_devfs_token = + devfs_add_devswf(&matcd_cdevsw, 0, DV_CHR, + MATCD_UID, MATCD_GID, 0600, + "rmatcd%da", i); + cd->rc_devfs_token = + devfs_add_devswf(&matcd_cdevsw, RAW_PART, + DV_CHR, MATCD_UID, MATCD_GID, + 0600, "rmatcd%dc", i); + cd->a_devfs_token = + devfs_add_devswf(&matcd_bdevsw, 0, DV_BLK, + MATCD_UID, MATCD_GID, 0600, + "matcd%da", i); + + cd->c_devfs_token = + devfs_add_devswf(&matcd_bdevsw, RAW_PART, + DV_BLK, MATCD_UID, MATCD_GID, + 0600, "matcd%dc", i); #endif } } diff --git a/sys/i386/isa/mcd.c b/sys/i386/isa/mcd.c index 645a7eb..a364c04 100644 --- a/sys/i386/isa/mcd.c +++ b/sys/i386/isa/mcd.c @@ -40,7 +40,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: mcd.c,v 1.73 1996/02/27 19:08:39 ache Exp $ + * $Id: mcd.c,v 1.74 1996/03/17 13:33:42 ache Exp $ */ static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; @@ -275,7 +275,6 @@ int mcd_attach(struct isa_device *dev) { int unit = dev->id_unit; struct mcd_data *cd = mcd_data + unit; - char name[32]; cd->iobase = dev->id_iobase; cd->flags |= MCDINIT; @@ -291,25 +290,18 @@ int mcd_attach(struct isa_device *dev) #ifdef DEVFS #define MCD_UID 0 #define MCD_GID 13 - sprintf(name, "rmcd%da",unit); - cd->ra_devfs_token = devfs_add_devsw( - "/", name, &mcd_cdevsw, (unit * 8 ) + 0, - DV_CHR, MCD_UID, MCD_GID, 0600); - - sprintf(name, "rmcd%dc",unit); - cd->rc_devfs_token = devfs_add_devsw( - "/", name, &mcd_cdevsw, (unit * 8 ) + RAW_PART, - DV_CHR, MCD_UID, MCD_GID, 0600); - - sprintf(name, "mcd%da",unit); - cd->a_devfs_token = devfs_add_devsw( - "/", name, &mcd_bdevsw, (unit * 8 ) + 0, - DV_BLK, MCD_UID, MCD_GID, 0600); - - sprintf(name, "mcd%dc",unit); - cd->c_devfs_token = devfs_add_devsw( - "/", name, &mcd_bdevsw, (unit * 8 ) + RAW_PART, - DV_BLK, MCD_UID, MCD_GID, 0600); + cd->ra_devfs_token = + devfs_add_devswf(&mcd_cdevsw, (unit * 8 ) + 0, DV_CHR, MCD_UID, + MCD_GID, 0600, "rmcd%da", unit); + cd->rc_devfs_token = + devfs_add_devswf(&mcd_cdevsw, (unit * 8 ) + RAW_PART, DV_CHR, + MCD_UID, MCD_GID, 0600, "rmcd%dc", unit); + cd->a_devfs_token = + devfs_add_devswf(&mcd_bdevsw, (unit * 8 ) + 0, DV_BLK, MCD_UID, + MCD_GID, 0600, "mcd%da", unit); + cd->c_devfs_token = + devfs_add_devswf(&mcd_bdevsw, (unit * 8 ) + RAW_PART, DV_BLK, + MCD_UID, MCD_GID, 0600, "mcd%dc", unit); #endif return 1; } diff --git a/sys/i386/isa/mse.c b/sys/i386/isa/mse.c index 01df850..efa3065 100644 --- a/sys/i386/isa/mse.c +++ b/sys/i386/isa/mse.c @@ -11,7 +11,7 @@ * this software for any purpose. It is provided "as is" * without express or implied warranty. * - * $Id: mse.c,v 1.23 1995/12/15 00:29:30 bde Exp $ + * $Id: mse.c,v 1.24 1995/12/15 00:54:25 bde Exp $ */ /* * Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and @@ -257,23 +257,18 @@ int mseattach(idp) struct isa_device *idp; { - char name[32]; int unit = idp->id_unit; struct mse_softc *sc = &mse_sc[unit]; sc->sc_port = idp->id_iobase; kdc_mse[unit].kdc_state = DC_IDLE; #ifdef DEVFS - sprintf(name,"mse%d", unit); - /* path name devsw minor */ - sc->devfs_token = devfs_add_devsw( "/", name, &mse_cdevsw, unit << 1, - /*type uid gid perm*/ - DV_CHR, 0, 0, 0600); - sprintf(name,"nmse%d", unit); - /* path name devsw minor */ - sc->n_devfs_token = devfs_add_devsw("/", name, &mse_cdevsw, (unit<<1)+1, - /*type uid gid perm*/ - DV_CHR, 0, 0, 0600); + sc->devfs_token = + devfs_add_devswf(&mse_cdevsw, unit << 1, DV_CHR, 0, 0, + 0600, "mse%d", unit); + sc->n_devfs_token = + devfs_add_devswf(&mse_cdevsw, (unit<<1)+1, DV_CHR,0, 0, + 0600, "nmse%d", unit); #endif return (1); } diff --git a/sys/i386/isa/pcaudio.c b/sys/i386/isa/pcaudio.c index fda6a24..5ede8f0 100644 --- a/sys/i386/isa/pcaudio.c +++ b/sys/i386/isa/pcaudio.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pcaudio.c,v 1.25 1995/12/15 00:54:29 bde Exp $ + * $Id: pcaudio.c,v 1.26 1995/12/22 15:27:48 bde Exp $ */ #include "pca.h" @@ -81,8 +81,11 @@ static char buffer1[BUF_SIZE]; static char buffer2[BUF_SIZE]; static char volume_table[256]; +#ifdef DEVFS static void *pca_devfs_token; static void *pcac_devfs_token; +#endif + static int pca_sleep = 0; static int pca_initialized = 0; @@ -271,11 +274,11 @@ pcaattach(struct isa_device *dvp) pca_init(); pca_registerdev(dvp); #ifdef DEVFS - /* path, name, devsw, minor, type, uid, gid, perm */ - pca_devfs_token = devfs_add_devsw("/", "pcaudio", &pca_cdevsw, 0, - DV_CHR, 0, 0, 0600); - pcac_devfs_token = devfs_add_devsw("/", "pcaudioctl", &pca_cdevsw, 128, - DV_CHR, 0, 0, 0600); + pca_devfs_token = + devfs_add_devswf(&pca_cdevsw, 0, DV_CHR, 0, 0, 0600, "pcaudio"); + pcac_devfs_token = + devfs_add_devswf(&pca_cdevsw, 128, DV_CHR, 0, 0, 0600, + "pcaudioctl"); #endif /*DEVFS*/ return 1; diff --git a/sys/i386/isa/psm.c b/sys/i386/isa/psm.c index 1febc6c..8783459 100644 --- a/sys/i386/isa/psm.c +++ b/sys/i386/isa/psm.c @@ -224,7 +224,6 @@ psmopen(dev_t dev, int flag, int fmt, struct proc *p) int unit = PSMUNIT(dev); struct psm_softc *sc; int ioport; - char name[32]; /* Validate unit number */ @@ -269,16 +268,12 @@ psmopen(dev_t dev, int flag, int fmt, struct proc *p) /* Successful open */ #ifdef DEVFS - sprintf(name,"psm%d", unit); - /* path name devsw minor */ - sc->devfs_token = devfs_add_devsw( "/", name, &psm_cdevsw, unit << 1, - /*type uid gid perm*/ - DV_CHR, 0, 0, 0666); - sprintf(name,"npsm%d", unit); - /* path name devsw minor */ - sc->n_devfs_token = devfs_add_devsw("/", name, &psm_cdevsw, (unit<<1)+1, - /*type uid gid perm*/ - DV_CHR, 0, 0, 0666); + sc->devfs_token = + devfs_add_devswf(&psm_cdevsw, unit << 1, DV_CHR, 0, 0, 0666, + "psm%d", unit); + sc->n_devfs_token = + devfs_add_devswf(&psm_cdevsw, (unit<<1)+1, DV_CHR,0, 0, 0666, + "npsm%d", unit); #endif return(0); diff --git a/sys/i386/isa/qcam.c b/sys/i386/isa/qcam.c index dd360f9..e0b076d 100644 --- a/sys/i386/isa/qcam.c +++ b/sys/i386/isa/qcam.c @@ -176,12 +176,9 @@ qcam_attach (struct isa_device *devp) qs->unit, qs->flags & QC_BIDIR_HW ? "bi" : "uni"); #ifdef DEVFS -{ - char name[32]; - sprintf(name,"qcam%d", qs->unit); - qs->devfs_token = devfs_add_devsw("/", name, &qcam_cdevsw, qs->unit, - DV_CHR, 0, 0, 0600); -} + qs->devfs_token = + devfs_add_devswf(&qcam_cdevsw, qs->unit, DV_CHR, 0, 0, 0600, + "qcam%d", qs->unit); #endif return 1; } diff --git a/sys/i386/isa/rc.c b/sys/i386/isa/rc.c index 7844e4d..d05b423 100644 --- a/sys/i386/isa/rc.c +++ b/sys/i386/isa/rc.c @@ -263,7 +263,6 @@ rcattach(dvp) struct rc_chans *rc = &rc_chans[dvp->id_unit * CD180_NCHAN]; static int rc_wakeup_started = 0; struct tty *tp; - char name[32]; /* Thorooughly test the device */ if (rcb->rcb_probed != RC_PROBED) @@ -296,10 +295,11 @@ rcattach(dvp) tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; #ifdef DEVFS /* FIX THIS to reflect real devices */ - sprintf(name,"rc%d.%d",dvp->id_unit,chan); - rc->devfs_token = devfs_add_devsw( "/", name, - &rc_cdevsw,(dvp->id_unit * CD180_NCHAN) + chan , - DV_CHR, 0, 0, 0600); + rc->devfs_token = + devfs_add_devswf(&rc_cdevsw, + (dvp->id_unit * CD180_NCHAN) + chan, + DV_CHR, 0, 0, 0600, "rc%d.%d", + dvp->id_unit, chan); #endif } rcb->rcb_probed = RC_ATTACHED; diff --git a/sys/i386/isa/scd.c b/sys/i386/isa/scd.c index b313491..e8a6982 100644 --- a/sys/i386/isa/scd.c +++ b/sys/i386/isa/scd.c @@ -41,7 +41,7 @@ */ -/* $Id: scd.c,v 1.16 1995/12/10 20:10:23 bde Exp $ */ +/* $Id: scd.c,v 1.17 1996/01/15 10:28:32 phk Exp $ */ /* Please send any comments to micke@dynas.se */ @@ -232,7 +232,6 @@ int scd_attach(struct isa_device *dev) { int unit = dev->id_unit; struct scd_data *cd = scd_data + unit; - char name[32]; cd->iobase = dev->id_iobase; /* Already set by probe, but ... */ @@ -249,25 +248,18 @@ int scd_attach(struct isa_device *dev) #ifdef DEVFS #define SCD_UID 0 #define SCD_GID 13 - sprintf(name, "rscd%da",unit); - cd->ra_devfs_token = devfs_add_devsw( - "/", name, &scd_cdevsw, (unit * 8 ) + 0, - DV_CHR, SCD_UID, SCD_GID, 0600); - - sprintf(name, "rscd%dc",unit); - cd->rc_devfs_token = devfs_add_devsw( - "/", name, &scd_cdevsw, (unit * 8 ) + RAW_PART, - DV_CHR, SCD_UID, SCD_GID, 0600); - - sprintf(name, "scd%da",unit); - cd->a_devfs_token = devfs_add_devsw( - "/", name, &scd_bdevsw, (unit * 8 ) + 0, - DV_BLK, SCD_UID, SCD_GID, 0600); - - sprintf(name, "scd%dc",unit); - cd->c_devfs_token = devfs_add_devsw( - "/", name, &scd_bdevsw, (unit * 8 ) + RAW_PART, - DV_BLK, SCD_UID, SCD_GID, 0600); + cd->ra_devfs_token = + devfs_add_devswf(&scd_cdevsw, (unit * 8 ) + 0, DV_CHR, SCD_UID, + SCD_GID, 0600, "rscd%da", unit); + cd->rc_devfs_token = + devfs_add_devswf(&scd_cdevsw, (unit * 8 ) + RAW_PART, DV_CHR, + SCD_UID, SCD_GID, 0600, "rscd%dc", unit); + cd->a_devfs_token = + devfs_add_devswf(&scd_bdevsw, (unit * 8 ) + 0, DV_BLK, SCD_UID, + SCD_GID, 0600, "scd%da", unit); + cd->c_devfs_token = + devfs_add_devswf(&scd_bdevsw, (unit * 8 ) + RAW_PART, DV_BLK, + SCD_UID, SCD_GID, 0600, "scd%dc", unit); #endif return 1; } diff --git a/sys/i386/isa/si.c b/sys/i386/isa/si.c index 8be544f..faef542 100644 --- a/sys/i386/isa/si.c +++ b/sys/i386/isa/si.c @@ -30,7 +30,7 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHORS BE LIABLE. * - * $Id: si.c,v 1.35 1996/01/16 18:13:18 phk Exp $ + * $Id: si.c,v 1.36 1996/01/25 07:21:33 phk Exp $ */ #ifndef lint @@ -710,9 +710,9 @@ mem_fail: &si_cdevsw, x + 0x20000, DV_CHR, 0, 0, 0600, "ttylA%02d", y); } - sc->control_token = devfs_add_devsw("/", "si_control", - &si_cdevsw, 0x40000, - DV_CHR, 0, 0, 0600); + sc->control_token = + devfs_add_devswf(&si_cdevsw, 0x40000, DV_CHR, 0, 0, 0600, + "si_control"); #endif return (1); } diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c index aec5093..be46e0e 100644 --- a/sys/i386/isa/spigot.c +++ b/sys/i386/isa/spigot.c @@ -168,7 +168,6 @@ struct spigot_softc *ss=(struct spigot_softc *)&spigot_softc[devp->id_unit]; static int spigot_attach(struct isa_device *devp) { - char name[32]; int unit; struct spigot_softc *ss= &spigot_softc[unit = devp->id_unit]; @@ -177,11 +176,9 @@ spigot_attach(struct isa_device *devp) ss->maddr = kvtop(devp->id_maddr); ss->irq = devp->id_irq; #ifdef DEVFS - sprintf(name,"spigot%d",unit); -/* path name devsw minor type uid gid perm*/ - ss->devfs_token = devfs_add_devsw( "/", name, - &spigot_cdevsw, unit, - DV_CHR, 0, 0, 0644); + ss->devfs_token = + devfs_add_devswf(&spigot_cdevsw, unit, DV_CHR, 0, 0, 0644, + "spigot%d", unit); #endif return 1; diff --git a/sys/i386/isa/tw.c b/sys/i386/isa/tw.c index 0120189..ace3a30 100644 --- a/sys/i386/isa/tw.c +++ b/sys/i386/isa/tw.c @@ -360,7 +360,6 @@ twattach(idp) struct isa_device *idp; { struct tw_sc *sc; - char name[32]; int unit; sc = &tw_sc[unit = idp->id_unit]; @@ -368,10 +367,9 @@ twattach(idp) sc->sc_state = 0; #ifdef DEVFS -/* path name devsw minor type uid gid perm*/ - sprintf(name,"tw%d", unit); - sc->devfs_token = devfs_add_devsw( "/", name, &tw_cdevsw, unit, - DV_CHR, 0, 0, 0600); + sc->devfs_token = + devfs_add_devswf(&tw_cdevsw, unit, DV_CHR, 0, 0, + 0600, "tw%d", unit); #endif return (1); diff --git a/sys/i386/isa/wcd.c b/sys/i386/isa/wcd.c index 5b8efc7..b95a3a0 100644 --- a/sys/i386/isa/wcd.c +++ b/sys/i386/isa/wcd.c @@ -290,7 +290,6 @@ wcdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug, struct wcd *t; struct atapires result; int lun; - char name[32]; if (wcdnlun >= NUNIT) { printf ("wcd: too many units\n"); @@ -357,25 +356,18 @@ wcdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug, #ifdef DEVFS #define WDC_UID 0 #define WDC_GID 13 - sprintf(name, "rwcd%da",lun); - t->ra_devfs_token = devfs_add_devsw( - "/", name, &wcd_cdevsw, (lun * 8), - DV_CHR, WDC_UID, WDC_GID, 0600); - - sprintf(name, "rwcd%dc",lun); - t->rc_devfs_token = devfs_add_devsw( - "/", name, &wcd_cdevsw, (lun * 8) + RAW_PART, - DV_CHR, WDC_UID, WDC_GID, 0600); - - sprintf(name, "wcd%da",lun); - t->a_devfs_token = devfs_add_devsw( - "/", name, &wcd_bdevsw, (lun * 8), - DV_BLK, WDC_UID, WDC_GID, 0600); - - sprintf(name, "wcd%dc",lun); - t->c_devfs_token = devfs_add_devsw( - "/", name, &wcd_bdevsw, (lun * 8) + RAW_PART, - DV_BLK, WDC_UID, WDC_GID, 0600); + t->ra_devfs_token = + devfs_add_devswf(&wcd_cdevsw, (lun * 8), DV_CHR, WDC_UID, + WDC_GID, 0600, "rwcd%da", lun); + t->rc_devfs_token = + devfs_add_devswf(&wcd_cdevsw, (lun * 8) + RAW_PART, DV_CHR, + WDC_UID, WDC_GID, 0600, "rwcd%dc", lun); + t->a_devfs_token = + devfs_add_devswf(&wcd_bdevsw, (lun * 8), DV_BLK, WDC_UID, + WDC_GID, 0600, "wcd%da", lun); + t->c_devfs_token = + devfs_add_devswf(&wcd_bdevsw, (lun * 8) + RAW_PART, DV_BLK, + WDC_UID, WDC_GID, 0600, "wcd%dc", lun); #endif return (1); } diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c index ff7b52b..26b3af6 100644 --- a/sys/i386/isa/wt.c +++ b/sys/i386/isa/wt.c @@ -20,7 +20,7 @@ * the original CMU copyright notice. * * Version 1.3, Thu Nov 11 12:09:13 MSK 1993 - * $Id: wt.c,v 1.29 1996/01/27 02:33:37 bde Exp $ + * $Id: wt.c,v 1.30 1996/02/22 00:31:48 joerg Exp $ * */ @@ -285,7 +285,6 @@ static int wtattach (struct isa_device *id) { wtinfo_t *t = wttab + id->id_unit; - char name[32]; if (t->type == ARCHIVE) { printf ("wt%d: type <Archive>\n", t->unit); @@ -298,14 +297,12 @@ wtattach (struct isa_device *id) isa_dmainit(t->chan, 1024); #ifdef DEVFS - sprintf(name,"rwt%d",id->id_unit); - t->devfs_token_r = devfs_add_devsw( - "/", name, &wt_cdevsw, id->id_unit, - DV_CHR, 0, 0, 0600); - sprintf(name,"wt%d",id->id_unit); - t->devfs_token = devfs_add_devsw( - "/", name, &wt_bdevsw, id->id_unit, - DV_BLK, 0, 0, 0600); + t->devfs_token_r = + devfs_add_devswf(&wt_cdevsw, id->id_unit, DV_CHR, 0, 0, + 0600, "rwt%d", id->id_unit); + t->devfs_token = + devfs_add_devswf(&wt_bdevsw, id->id_unit, DV_BLK, 0, 0, + 0600, "wt%d", id->id_unit); #endif return (1); } |