Switched from using devfs_add_sw() to using devfs_add_swf()

Reviewed by:	julian@freebsd.org
This commit is contained in:
scrappy 1996-03-28 14:29:52 +00:00
parent 4034f85083
commit 00f73c3d68
43 changed files with 335 additions and 424 deletions

View File

@ -1,5 +1,5 @@
/*-
* dgb.c $Id: dgb.c,v 1.14 1995/12/17 21:14:29 phk Exp $
* dgb.c $Id: dgb.c,v 1.15 1995/12/29 13:21:10 bde Exp $
*
* Digiboard driver.
*
@ -457,7 +457,6 @@ dgbattach(dev)
ushort *pstat;
int lowwater;
int nports=0;
char name[32];
if(sc->status!=ENABLED) {
DPRINT2("dbg%d: try to attach a disabled card\n",unit);
@ -855,25 +854,29 @@ dgbattach(dev)
port->it_out = port->it_in;
#ifdef DEVFS
/*XXX*/ /* fix the minor numbers */
sprintf(name,"dgb%d.%d",unit,i);
port->devfs_token.tty = devfs_add_devsw("/",name,
&dgb_cdevsw,(unit*32)+i, /*mytical number */
DV_CHR, 0, 0, 0600);
port->devfs_token.tty =
devfs_add_devswf(&dgb_cdevsw,
(unit*32)+i,/*mytical number*/
DV_CHR, 0, 0, 0600, "dgb%d.%d", unit,
i);
sprintf(name,"idgb%d.%d",unit,i);
port->devfs_token.tty = devfs_add_devsw("/",name,
&dgb_cdevsw,(unit*32)+i + 64, /*mytical number */
DV_CHR, 0, 0, 0600);
port->devfs_token.tty =
devfs_add_devswf(&dgb_cdevsw,
(unit*32)+i+64,/*mytical number*/
DV_CHR, 0, 0, 0600, idgb%d.%d", unit,
i);
sprintf(name,"ldgb%d.%d",unit,i);
port->devfs_token.tty = devfs_add_devsw("/",name,
&dgb_cdevsw,(unit*32)+i + 128, /*mytical number */
DV_CHR, 0, 0, 0600);
port->devfs_token.tty =
devfs_add_devswf(&dgb_cdevsw,
(unit*32)+i+128,/*mytical number*/
DV_CHR, 0, 0, 0600, "ldgb%d.%d", unit,
i);
sprintf(name,"dgbcua%d.%d",unit,i);
port->devfs_token.tty = devfs_add_devsw("/",name,
&dgb_cdevsw,(unit*32)+i + 192, /*mytical number */
DV_CHR, 0, 0, 0600);
port->devfs_token.tty =
devfs_add_devswf(&dgb_cdevsw,
(unit*32)+i+192,/*mytical number*/
DV_CHR, 0, 0, 0600, "dgbcua%d.%d",
unit, i);
#endif
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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 @@ siattach(id)
&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);
}

View File

@ -1,5 +1,5 @@
/*-
* dgb.c $Id: dgb.c,v 1.14 1995/12/17 21:14:29 phk Exp $
* dgb.c $Id: dgb.c,v 1.15 1995/12/29 13:21:10 bde Exp $
*
* Digiboard driver.
*
@ -457,7 +457,6 @@ dgbattach(dev)
ushort *pstat;
int lowwater;
int nports=0;
char name[32];
if(sc->status!=ENABLED) {
DPRINT2("dbg%d: try to attach a disabled card\n",unit);
@ -855,25 +854,29 @@ dgbattach(dev)
port->it_out = port->it_in;
#ifdef DEVFS
/*XXX*/ /* fix the minor numbers */
sprintf(name,"dgb%d.%d",unit,i);
port->devfs_token.tty = devfs_add_devsw("/",name,
&dgb_cdevsw,(unit*32)+i, /*mytical number */
DV_CHR, 0, 0, 0600);
port->devfs_token.tty =
devfs_add_devswf(&dgb_cdevsw,
(unit*32)+i,/*mytical number*/
DV_CHR, 0, 0, 0600, "dgb%d.%d", unit,
i);
sprintf(name,"idgb%d.%d",unit,i);
port->devfs_token.tty = devfs_add_devsw("/",name,
&dgb_cdevsw,(unit*32)+i + 64, /*mytical number */
DV_CHR, 0, 0, 0600);
port->devfs_token.tty =
devfs_add_devswf(&dgb_cdevsw,
(unit*32)+i+64,/*mytical number*/
DV_CHR, 0, 0, 0600, idgb%d.%d", unit,
i);
sprintf(name,"ldgb%d.%d",unit,i);
port->devfs_token.tty = devfs_add_devsw("/",name,
&dgb_cdevsw,(unit*32)+i + 128, /*mytical number */
DV_CHR, 0, 0, 0600);
port->devfs_token.tty =
devfs_add_devswf(&dgb_cdevsw,
(unit*32)+i+128,/*mytical number*/
DV_CHR, 0, 0, 0600, "ldgb%d.%d", unit,
i);
sprintf(name,"dgbcua%d.%d",unit,i);
port->devfs_token.tty = devfs_add_devsw("/",name,
&dgb_cdevsw,(unit*32)+i + 192, /*mytical number */
DV_CHR, 0, 0, 0600);
port->devfs_token.tty =
devfs_add_devswf(&dgb_cdevsw,
(unit*32)+i+192,/*mytical number*/
DV_CHR, 0, 0, 0600, "dgbcua%d.%d",
unit, i);
#endif
}

View File

@ -1,6 +1,6 @@
static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.13 1995/12/08 23:19:29 phk Exp $";
static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.14 1995/12/17 21:14:34 phk Exp $";
/*******************************************************************************
* II - Version 0.1 $Revision: 1.13 $ $State: Exp $
* II - Version 0.1 $Revision: 1.14 $ $State: Exp $
*
* Copyright 1994 Dietmar Friede
*******************************************************************************
@ -10,6 +10,9 @@ static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.13 1995/12/08 23:19:29 phk
*
*******************************************************************************
* $Log: nic3008.c,v $
* Revision 1.14 1995/12/17 21:14:34 phk
* Staticize.
*
* Revision 1.13 1995/12/08 23:19:29 phk
* Julian forgot to make the *devsw structures static.
*
@ -265,7 +268,6 @@ nicattach(struct isa_device * is)
dpr_type *dpr;
int cn;
isdn_ctrl_t *ctrl0, *ctrl1;
char name[32];
sc = &nic_sc[is->id_unit];
dpr = sc->sc_dpr;
@ -298,9 +300,9 @@ nicattach(struct isa_device * is)
dpr->int_flg_pc = 0xff;
reset_req(sc, MBX_MU, 4);
#ifdef DEVFS
sprintf(name,"nic%d",is->id_unit);
sc->devfs_token = devfs_add_devsw( "/isdn", name,
&nic_cdevsw,is->id_unit, DV_CHR, 0, 0, 0600 );
sc->devfs_token =
devfs_add_devswf(&nic_cdevsw, is->id_unit, DV_CHR, 0, 0,
0600, "/isdn/nic%d", is->id_unit);
#endif
return (1);
}

View File

@ -1,6 +1,6 @@
static char nic39_id[] = "@(#)$Id: nic3009.c,v 1.13 1995/12/08 23:19:30 phk Exp $";
static char nic39_id[] = "@(#)$Id: nic3009.c,v 1.14 1995/12/17 21:14:36 phk Exp $";
/*******************************************************************************
* II - Version 0.1 $Revision: 1.13 $ $State: Exp $
* II - Version 0.1 $Revision: 1.14 $ $State: Exp $
*
* Copyright 1994 Dietmar Friede
*******************************************************************************
@ -10,6 +10,9 @@ static char nic39_id[] = "@(#)$Id: nic3009.c,v 1.13 1995/12/08 23:19:30 phk
*
*******************************************************************************
* $Log: nic3009.c,v $
* Revision 1.14 1995/12/17 21:14:36 phk
* Staticize.
*
* Revision 1.13 1995/12/08 23:19:30 phk
* Julian forgot to make the *devsw structures static.
*
@ -271,7 +274,6 @@ nnicattach(struct isa_device * is)
struct nnic_softc *sc;
int cn;
isdn_ctrl_t *ctrl0, *ctrl1;
char name[32];
sc = &nnic_sc[is->id_unit];
sc->sc_ctrl = -1;
@ -299,9 +301,9 @@ nnicattach(struct isa_device * is)
ctrl0->o_len = ctrl1->o_len = -1;
sc->sc_flags= LOAD_ENTITY;
#ifdef DEVFS
sprintf(name,"nnic%d",is->id_unit);
sc->devfs_token = devfs_add_devsw("/isdn",name,
&nnic_cdevsw, is->id_unit, DV_CHR, 0, 0, 0600 );
sc->devfs_token =
devfs_add_devswf(&nnic_cdevsw, is->id_unit, DV_CHR, 0, 0,
0600, "/isdn/nnic%d", is->id_unit);
#endif
return (1);

View File

@ -1,6 +1,6 @@
static char _ispyid[] = "@(#)$Id: iispy.c,v 1.9 1995/12/08 23:19:40 phk Exp $";
static char _ispyid[] = "@(#)$Id: iispy.c,v 1.10 1995/12/17 21:17:43 phk Exp $";
/*******************************************************************************
* II - Version 0.1 $Revision: 1.9 $ $State: Exp $
* II - Version 0.1 $Revision: 1.10 $ $State: Exp $
*
* Copyright 1994 Dietmar Friede
*******************************************************************************
@ -74,7 +74,6 @@ static struct cdevsw ispy_cdevsw =
int
ispyattach(int ap)
{
char name[32];
struct ispy_data *ispy;
if(next_if >= NISPY)
@ -83,9 +82,9 @@ ispyattach(int ap)
ispy->state= 0;
ispy_applnr= ap;
#ifdef DEVFS
sprintf(name,"ispy%d",next_if);
ispy->devfs_token =devfs_add_devsw("/isdn",name,&ispy_cdevsw,next_if,
DV_CHR, 0, 0, 0600);
ispy->devfs_token =
devfs_add_devswf(&ispy_cdevsw, next_if, DV_CHR, 0, 0,
0600, "isdn/ispy%d", next_if);
#endif
return(next_if++);
}

View File

@ -1,6 +1,6 @@
static char _itelid[] = "@(#)$Id: iitel.c,v 1.10 1995/12/08 23:19:42 phk Exp $";
static char _itelid[] = "@(#)$Id: iitel.c,v 1.11 1995/12/17 21:17:44 phk Exp $";
/*******************************************************************************
* II - Version 0.1 $Revision: 1.10 $ $State: Exp $
* II - Version 0.1 $Revision: 1.11 $ $State: Exp $
*
* Copyright 1994 Dietmar Friede
*******************************************************************************
@ -67,7 +67,6 @@ int
itelattach(int ap)
{
struct itel_data *itel;
char name[32];
if(next_if >= NITEL)
return(-1);
@ -76,9 +75,9 @@ itelattach(int ap)
itel->state= 0;
applnr[next_if]= ap;
#ifdef DEVFS
sprintf(name,"itel%d",next_if);
itel->devfs_token = devfs_add_devsw("/isdn",name,&itel_cdevsw,next_if,
DV_CHR, 0, 0, 0600);
itel->devfs_token =
devfs_add_devswf(&itel_cdevsw, next_if, DV_CHR, 0, 0,
0600, "isdn/itel%d", next_if);
#endif
return(next_if++);
}

View File

@ -1,6 +1,6 @@
static char _ittyid[] = "@(#)$Id: iitty.c,v 1.18 1995/12/10 15:54:13 bde Exp $";
static char _ittyid[] = "@(#)$Id: iitty.c,v 1.19 1995/12/17 21:17:47 phk Exp $";
/*******************************************************************************
* II - Version 0.1 $Revision: 1.18 $ $State: Exp $
* II - Version 0.1 $Revision: 1.19 $ $State: Exp $
*
* Copyright 1994 Dietmar Friede
*******************************************************************************
@ -66,18 +66,17 @@ static void *devfs_token_out[NITY];
int
ityattach(int ap)
{
char name[32];
if(next_if >= NITY)
return(-1);
applnr[next_if]= ap;
#ifdef DEVFS
sprintf(name,"ity%d",next_if);
devfs_token[next_if] = devfs_add_devsw("/isdn",name,
&ity_cdevsw,next_if, DV_CHR, 0, 0, 0600);
sprintf(name,"Oity%d",next_if); /* XXX find out real name */
devfs_token[next_if] = devfs_add_devsw("/isdn",name,
&ity_cdevsw,(next_if | 0x80), DV_CHR, 0, 0, 0600);
devfs_token[next_if] =
devfs_add_devswf(&ity_cdevsw, next_if, DV_CHR, 0, 0,
0600, "isdn/ity%d", next_if);
devfs_token[next_if] =
devfs_add_devswf(&ity_cdevsw,(next_if | 0x80), DV_CHR, 0, 0,
0600, "isdn/Oity%d", next_if);
#endif
return(next_if++);
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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
}
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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 */
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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);
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);
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->c_devfs_token =
devfs_add_devswf(&matcd_bdevsw, RAW_PART,
DV_BLK, MATCD_UID, MATCD_GID,
0600, "matcd%dc", i);
#endif
}
}

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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;

View File

@ -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);

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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 @@ siattach(id)
&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);
}

View File

@ -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;

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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
}
}