static void
xpt_periph_init(void)
{
- dev_ops_add(&xpt_ops, 0, 0);
make_dev(&xpt_ops, 0, UID_ROOT, GID_OPERATOR, 0600, "xpt0");
}
DEVSTAT_PRIORITY_OTHER);
/* Register the device */
- dev_ops_add(&ch_ops, -1, periph->unit_number);
make_dev(&ch_ops, periph->unit_number, UID_ROOT,
GID_OPERATOR, 0600, "%s%d", periph->periph_name,
periph->unit_number);
DEVSTAT_PRIORITY_PASS);
/* Register the device */
- dev_ops_add(&pass_ops, -1, periph->unit_number);
make_dev(&pass_ops, periph->unit_number, UID_ROOT,
GID_OPERATOR, 0600, "%s%d", periph->periph_name,
periph->unit_number);
SID_TYPE(&cgd->inq_data) | DEVSTAT_TYPE_IF_SCSI,
DEVSTAT_PRIORITY_OTHER);
- dev_ops_add(&pt_ops, -1, periph->unit_number);
make_dev(&pt_ops, periph->unit_number, UID_ROOT,
GID_OPERATOR, 0600, "%s%d", periph->periph_name,
periph->unit_number);
DEVSTAT_BS_UNAVAILABLE, SID_TYPE(&cgd->inq_data) |
DEVSTAT_TYPE_IF_SCSI, DEVSTAT_PRIORITY_TAPE);
- dev_ops_add(&sa_ops, SA_UNITMASK, SA_UNIT(periph->unit_number));
make_dev(&sa_ops, SAMINOR(SA_CTLDEV,
periph->unit_number, 0, SA_ATYPE_R), UID_ROOT, GID_OPERATOR,
0660, "%s%d.ctl", periph->periph_name, periph->unit_number);
cam_extend_set(sesperiphs, periph->unit_number, periph);
cam_periph_unlock(periph);
- dev_ops_add(&ses_ops, -1, periph->unit_number);
make_dev(&ses_ops, periph->unit_number,
UID_ROOT, GID_OPERATOR, 0600, "%s%d",
periph->periph_name, periph->unit_number);
struct fw_device *fw_noderesolve_eui64 (struct firewire_comm *, struct fw_eui64 *);
struct fw_bind *fw_bindlookup (struct firewire_comm *, u_int16_t, u_int32_t);
void fw_drain_txq (struct firewire_comm *);
-int fwdev_makedev (struct firewire_softc *);
int fwdev_destroydev (struct firewire_softc *);
void fwdev_clone (void *, char *, int, cdev_t *);
static int
iic_attach(device_t dev)
{
- dev_ops_add(&iic_ops, -1, device_get_unit(dev));
make_dev(&iic_ops, device_get_unit(dev), /* XXX cleanup */
UID_ROOT, GID_WHEEL,
0600, "iic%d", device_get_unit(dev));
#ifdef FB_INSTALL_CDEV
/* attach a virtual frame buffer device */
- dev_ops_add(&isavga_ops, VGA_MKMINOR(-1), VGA_MKMINOR(unit));
sc->devt = make_dev(&isavga_ops, VGA_MKMINOR(unit), 0, 0, 02660, "vga%x", VGA_MKMINOR(unit));
reference_dev(sc->devt);
error = fb_attach(sc->devt, sc->adp);
case MOD_LOAD:
STAILQ_INIT(&pci_devq);
pci_generation = 0;
- dev_ops_add(&pcic_ops, -1, 0);
pci_cdev = make_dev(&pcic_ops, 0, UID_ROOT, GID_WHEEL, 0644,
- "pci%d", 0);
+ "pci%d", 0);
pci_load_vendor_data();
break;
static int
smb_attach(device_t dev)
{
- dev_ops_add(&smb_ops, -1, device_get_unit(dev));
- make_dev(&smb_ops, device_get_unit(dev), /* XXX cleanup */
- UID_ROOT, GID_WHEEL,
- 0600, "smb%d", device_get_unit(dev));
+ make_dev(&smb_ops, device_get_unit(dev),
+ UID_ROOT, GID_WHEEL,
+ 0600, "smb%d", device_get_unit(dev));
return (0);
}
sc->sc_bus->use_polling--;
usb_create_event_thread(self);
- /* The per controller devices (used for usb_discover) */
- /* XXX This is redundant now, but old usbd's will want it */
- dev_ops_add(&usb_ops, -1, device_get_unit(self));
+
+ /*
+ * The per controller devices (used for usb_discover)
+ * XXX This is redundant now, but old usbd's will want it
+ */
tmp_dev = make_dev(&usb_ops, device_get_unit(self),
UID_ROOT, GID_OPERATOR, 0660,
"usb%d", device_get_unit(self));
sc->sc_usbdev = reference_dev(tmp_dev);
if (usb_ndevs++ == 0) {
/* The device spitting out events */
- dev_ops_add(&usb_ops, -1, USB_DEV_MINOR);
tmp_dev = make_dev(&usb_ops, USB_DEV_MINOR,
UID_ROOT, GID_OPERATOR, 0660, "usb");
usb_dev = reference_dev(tmp_dev);
}
release_dev(sc->sc_usbdev);
- dev_ops_add(&usb_ops, -1, device_get_unit(self));
if (--usb_ndevs == 0) {
int i;
error = iplattach();
if (error)
break;
- dev_ops_add(&ipl_ops, 0, 0);
c = NULL;
for(i=strlen(IPL_NAME); i>0; i--)
sc->acpi_sleep_disabled = 0;
/* Create the control device */
- dev_ops_add(&acpi_ops, 0, 0);
sc->acpi_dev_t = make_dev(&acpi_ops, 0, UID_ROOT, GID_WHEEL, 0644,
"acpi");
sc->acpi_dev_t->si_drv1 = sc;
TAILQ_INIT(&sc->as_memory);
sc->as_nextid = 1;
- dev_ops_add(&agp_ops, -1, device_get_unit(dev));
make_dev(&agp_ops, device_get_unit(dev), UID_ROOT, GID_WHEEL,
- 0600, "agpgart");
+ 0600, "agpgart");
return 0;
}
static void
ata_init(void)
{
- /* register controlling device */
- dev_ops_add(&ata_ops, 0, 0);
make_dev(&ata_ops, 0, UID_ROOT, GID_OPERATOR, 0600, "ata");
}
+
SYSINIT(atadev, SI_SUB_DRIVERS, SI_ORDER_SECOND, ata_init, NULL)
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_SEQUENTIAL | DEVSTAT_TYPE_IF_IDE,
DEVSTAT_PRIORITY_TAPE);
- dev_ops_add(&ast_ops, dkunitmask(), dkmakeunit(stp->lun));
dev = make_dev(&ast_ops, dkmakeminor(stp->lun, 0, 0),
UID_ROOT, GID_OPERATOR, 0640, "ast%d", stp->lun);
dev->si_drv1 = stp;
* whole-slice-part. If we did we would have to provide our
* own DIOCGPART ioctl.
*/
- dev_ops_add(&fd_ops,
- dkunitmask() | dkmakeslice(-1) | dkmakepart(128|64),
- dkmakeminor(fd->fdu, WHOLE_DISK_SLICE, 128));
make_dev(&fd_ops, dkmakeminor(fd->fdu, WHOLE_DISK_SLICE, 128 + 1),
UID_ROOT, GID_WHEEL, 0600, "fd%d.1720", fd->fdu);
make_dev(&fd_ops, dkmakeminor(fd->fdu, WHOLE_DISK_SLICE, 128 + 2),
/*
* Create device nodes
*/
- dev_ops_add(&isp_ops, -1, device_get_unit(isp->isp_dev));
make_dev(&isp_ops, device_get_unit(isp->isp_dev), UID_ROOT,
- GID_OPERATOR, 0600, "%s", device_get_nameunit(isp->isp_dev));
+ GID_OPERATOR, 0600, "%s", device_get_nameunit(isp->isp_dev));
if (isp->isp_role != ISP_ROLE_NONE) {
isp->isp_state = ISP_RUNSTATE;
switch (what) {
case MOD_LOAD:
/* register controlling device */
- dev_ops_add(&ata_ops, 0, 0);
atacdev = make_dev(&ata_ops, 0, UID_ROOT, GID_OPERATOR, 0600, "ata");
reference_dev(atacdev);
return 0;
cdev = disk_create(device_get_unit(dev), &cdp->disk, &acd_ops);
#if 0
- dev_ops_add(&acd_ops, dkunitmask(), dkmakeunit(device_get_unit(dev)));
cdev = make_dev(&acd_ops, dkmakeminor(device_get_unit(dev), 0, 0),
UID_ROOT, GID_OPERATOR, 0644, "acd%d",
device_get_unit(dev));
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_SEQUENTIAL | DEVSTAT_TYPE_IF_IDE,
DEVSTAT_PRIORITY_TAPE);
- dev_ops_add(&ast_ops, dkunitmask(), dkmakeunit(device_get_unit(dev)));
cdev = make_dev(&ast_ops, 2 * device_get_unit(dev), UID_ROOT, GID_OPERATOR,
0640, "ast%d", device_get_unit(dev));
reference_dev(cdev);
t->dens = -1; /* unknown density */
isa_dmainit(t->chan, 1024);
- dev_ops_add(&wt_ops, -1, id->id_unit);
make_dev(&wt_ops, id->id_unit, 0, 0, 0600, "rwt%d", id->id_unit);
return (1);
}
else
dev->device = kdev;
- dev_ops_add(&drm_cdevsw, -1, unit);
- dev->devnode = make_dev(&drm_cdevsw,
- unit,
- DRM_DEV_UID,
- DRM_DEV_GID,
- DRM_DEV_MODE,
- "dri/card%d", unit);
+ dev->devnode = make_dev(&drm_cdevsw, unit, DRM_DEV_UID, DRM_DEV_GID,
+ DRM_DEV_MODE, "dri/card%d", unit);
dev->pci_domain = 0;
dev->pci_bus = pci_get_bus(dev->device);
if (!sc || sc->dying)
return ENXIO;
- dev_ops_add(&cmx_ops, -1, device_get_unit(dev));
sc->cdev = make_dev(&cmx_ops, 0, UID_ROOT, GID_WHEEL, 0600,
"cmx%d", device_get_unit(dev));
if (!sc->cdev) {
{
int polltime;
-#ifdef __DragonFly__
- dev_ops_add(&dcons_ops, -1, 0);
-#endif
dcons_attach_port(DCONS_CON, "dcons", 0);
dcons_attach_port(DCONS_GDB, "dgdb", DC_GDB);
#if __FreeBSD_version < 500000
kprintf ("gp%d: type AT-GPIB chip NAT4882A\n",sc->sc_unit);
sc->sc_flags |=ATTACHED;
- dev_ops_add(&gp_ops, -1, sc->sc_unit);
make_dev(&gp_ops, sc->sc_unit, 0, 0, 0600, "gp");
return (1);
}
joy->bt = rman_get_bustag(res);
joy->port = rman_get_bushandle(res);
joy->timeout[0] = joy->timeout[1] = 0;
- dev_ops_add(&joy_ops, -1, unit);
make_dev(&joy_ops, unit, 0, 0, 0600, "joy%d", unit);
return 0;
}
if (keyboard[kbd->kb_index] != kbd)
return EINVAL;
- dev_ops_add(&kbd_ops, -1, kbd->kb_index);
dev = make_dev(&kbd_ops, kbd->kb_index, UID_ROOT, GID_WHEEL, 0600,
"kbd%r", kbd->kb_index);
if (dev->si_drv1 == NULL)
ctlr->dcr_is = 0x80;
loutb(DCR(ctlr), ctlr->dcr_val);
- dev_ops_add(&labpc_ops, -1, dev->id_unit);
make_dev(&labpc_ops, dev->id_unit, 0, 0, 0600,
- "labpc%d", dev->id_unit);
+ "labpc%d", dev->id_unit);
return 1;
}
lpt_release_ppbus(dev);
- dev_ops_add(&lpt_ops, LP_UNITMASK, unit);
- make_dev(&lpt_ops, unit,
- UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d", unit);
- make_dev(&lpt_ops, unit | LP_BYPASS,
- UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d.ctl", unit);
+ make_dev(&lpt_ops, unit, UID_ROOT, GID_WHEEL,
+ 0600, LPT_NAME "%d", unit);
+ make_dev(&lpt_ops, unit | LP_BYPASS, UID_ROOT, GID_WHEEL,
+ 0600, LPT_NAME "%d.ctl", unit);
return (0);
}
sc->mode.accelfactor = (flags & MSE_CONFIG_ACCEL) >> 4;
callout_init(&sc->sc_callout);
- dev_ops_add(&mse_ops, ~1, unit << 1);
make_dev(&mse_ops, unit << 1, 0, 0, 0600, "mse%d", unit);
make_dev(&mse_ops, (unit<<1)+1, 0, 0, 0600, "nmse%d", unit);
return;
pt = kmalloc(sizeof(*pt), M_NLMDM, M_WAITOK | M_ZERO);
- dev_ops_add(&nmdm_ops, ~1, n << 1);
pt->part1.dev = dev1 = make_dev(&nmdm_ops, n << 1,
- 0, 0, 0666, "nmdm%dA", n);
+ 0, 0, 0666, "nmdm%dA", n);
pt->part2.dev = dev2 = make_dev(&nmdm_ops, (n << 1) + 1,
- 0, 0, 0666, "nmdm%dB", n);
+ 0, 0, 0666, "nmdm%dB", n);
dev1->si_drv1 = dev2->si_drv1 = pt;
dev1->si_tty = &pt->part1.nm_tty;
unit = device_get_unit(dev);
- dev_ops_add(&pcfclock_ops, -1, unit);
make_dev(&pcfclock_ops, unit,
- UID_ROOT, GID_WHEEL, 0444, PCFCLOCK_NAME "%d", unit);
+ UID_ROOT, GID_WHEEL, 0444, PCFCLOCK_NAME "%d", unit);
return (0);
}
&zero, irq, irq, 1, RF_ACTIVE);
#endif /* PERIPH_1284 */
- dev_ops_add(&ppi_ops, -1, device_get_unit(dev));
make_dev(&ppi_ops, device_get_unit(dev), /* XXX cleanup */
UID_ROOT, GID_WHEEL,
0600, "ppi%d", device_get_unit(dev));
return (ENXIO);
unit = device_get_unit(ppsdev);
- dev_ops_add(&pps_ops, -1, unit);
- make_dev(&pps_ops, unit, UID_ROOT, GID_WHEEL, 0644,
- PPS_NAME "%d", unit);
+ make_dev(&pps_ops, unit, UID_ROOT, GID_WHEEL,
+ 0644, PPS_NAME "%d", unit);
return (0);
}
}
/* Done */
- dev_ops_add(&psm_ops, PSM_MKMINOR(-1, 0), PSM_MKMINOR(unit, 0));
make_dev(&psm_ops, PSM_MKMINOR(unit, FALSE), 0, 0, 0666, "psm%d", unit);
make_dev(&psm_ops, PSM_MKMINOR(unit, TRUE), 0, 0, 0666, "bpsm%d", unit);
spic_call1(sc, 0x92);
/* There can be only one */
- dev_ops_add(&spic_ops, -1, device_get_unit(dev));
make_dev(&spic_ops, device_get_unit(dev), 0, 0, 0600, "jogdial");
return 0;
devp->id_intr = (inthand2_t *)spigintr;
ss->maddr = kvtop(devp->id_maddr);
ss->irq = devp->id_irq;
- dev_ops_add(&spigot_ops, -1, unit);
make_dev(&spigot_ops, unit, 0, 0, 0644, "spigot%d", unit);
return 1;
}
(void *)(uintptr_t)unit, SHUTDOWN_PRI_DEFAULT);
/*
- * create devices. dev_ops_add() must be called to make devices under
- * this major number available to userland.
+ * create devices.
+ *
+ * The first vty already has struct tty and scr_stat initialized
+ * in scinit(). The other vtys will have these structs when
+ * first opened.
*/
- dev_ops_add(&sc_ops, ~(MAXCONS - 1), unit * MAXCONS);
-
- for (vc = 1; vc < sc->vtys; vc++) { //XXX: possibly breaks something, or even a lot
+ for (vc = 1; vc < sc->vtys; vc++) {
dev = make_dev(&sc_ops, vc + unit * MAXCONS,
- UID_ROOT, GID_WHEEL, 0600, "ttyv%r", vc + unit * MAXCONS);
+ UID_ROOT, GID_WHEEL,
+ 0600, "ttyv%r", vc + unit * MAXCONS);
sc->dev[vc] = dev;
- /*
- * The first vty already has struct tty and scr_stat initialized
- * in scinit(). The other vtys will have these structs when
- * first opened.
- */
}
-
- dev_ops_add(&sc_ops, -1, SC_CONSOLECTL); /* XXX */
cctl_dev = make_dev(&sc_ops, SC_CONSOLECTL,
UID_ROOT, GID_WHEEL, 0600, "consolectl");
cctl_dev->si_tty = sc_console_tty = ttymalloc(sc_console_tty);
{
cdev_t dev;
- dev_ops_add(&sm_ops, -1, SC_MOUSE);
- dev = make_dev(&sm_ops, SC_MOUSE, UID_ROOT, GID_WHEEL, 0600,
- "sysmouse");
+ dev = make_dev(&sm_ops, SC_MOUSE, UID_ROOT, GID_WHEEL,
+ 0600, "sysmouse");
/* sysmouse doesn't have scr_stat */
}
sc->sc_state = 0;
sc->sc_rcount = 0;
callout_init(&sc->abortrcv_ch);
- dev_ops_add(&tw_ops, -1, unit);
make_dev(&tw_ops, unit, 0, 0, 0600, "tw%d", unit);
return (1);
}
* Make the control device.
*/
unit = device_get_unit(sc->aac_dev);
- dev_ops_add(&aac_ops, -1, unit);
- sc->aac_dev_t = make_dev(&aac_ops, unit, UID_ROOT, GID_OPERATOR, 0640,
- "aac%d", unit);
+ sc->aac_dev_t = make_dev(&aac_ops, unit, UID_ROOT, GID_OPERATOR,
+ 0640, "aac%d", unit);
sc->aac_dev_t->si_drv1 = sc;
reference_dev(sc->aac_dev_t);
/*
* Create the control device.
*/
- dev_ops_add(&amr_ops, -1, device_get_unit(sc->amr_dev));
sc->amr_dev_t = make_dev(&amr_ops, device_get_unit(sc->amr_dev),
UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR,
"amr%d", device_get_unit(sc->amr_dev));
.d_ioctl = asr_ioctl,
};
-/*
- * Initialize the dynamic dev_ops hooks.
- */
-STATIC void
-asr_drvinit (void * unused)
-{
- static int asr_devsw_installed = 0;
-
- if (asr_devsw_installed) {
- return;
- }
- asr_devsw_installed++;
-
- /*
- * Adding the ops will dynamically assign a major number.
- */
- dev_ops_add(&asr_ops, 0, 0);
-} /* asr_drvinit */
-
-/* XXX Must initialize before CAM layer picks up our HBA driver */
-SYSINIT(asrdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,asr_drvinit,NULL)
-
/* I2O support routines */
#define defAlignLong(STRUCT,NAME) char NAME[sizeof(STRUCT)]
#define getAlignLong(STRUCT,NAME) ((STRUCT *)(NAME))
*/
ciss_periodic(sc);
- /*
+ /*
* Create the control device.
*/
- dev_ops_add(&ciss_ops, -1, device_get_unit(sc->ciss_dev));
sc->ciss_dev_t = make_dev(&ciss_ops, device_get_unit(sc->ciss_dev),
UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR,
"ciss%d", device_get_unit(sc->ciss_dev));
.d_ioctl = iir_ioctl,
};
-static int iir_devsw_installed = 0;
#ifndef SDEV_PER_HBA
static int sdev_made = 0;
#endif
return (0);
}
-static void
-iir_drvinit(void *unused)
-{
- GDT_DPRINTF(GDT_D_DEBUG, ("iir_drvinit()\n"));
-
- if (!iir_devsw_installed) {
- /* Add the I/O (data) channel */
- dev_ops_add(&iir_ops, 0, 0);
- iir_devsw_installed = 1;
- }
-}
-
-SYSINIT(iir_dev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE + CDEV_MAJOR, iir_drvinit, NULL)
"failed to initialize command buffers\n");
goto error;
}
- dev_ops_add(&ips_ops, -1, device_get_unit(sc->dev));
dev = make_dev(&ips_ops, device_get_unit(sc->dev),
- UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR,
- "ips%d", device_get_unit(sc->dev));
+ UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR,
+ "ips%d", device_get_unit(sc->dev));
dev->si_drv1 = sc;
ips_diskdev_init(sc);
callout_reset(&sc->timer, 10 * hz, ips_timeout, sc);
/*
* Create the control device.
*/
- dev_ops_add(&mlx_ops, -1, device_get_unit(sc->mlx_dev));
make_dev(&mlx_ops, device_get_unit(sc->mlx_dev),
- UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR,
- "mlx%d", device_get_unit(sc->mlx_dev));
+ UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR,
+ "mlx%d", device_get_unit(sc->mlx_dev));
/*
* Start the timeout routine.
/*
* Create the control device.
*/
- dev_ops_add(&mly_ops, -1, device_get_unit(sc->mly_dev));
sc->mly_dev_t = make_dev(&mly_ops, device_get_unit(sc->mly_dev),
- UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR,
- "mly%d", device_get_unit(sc->mly_dev));
+ UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR,
+ "mly%d", device_get_unit(sc->mly_dev));
sc->mly_dev_t->si_drv1 = sc;
/* enable interrupts now */
twa_describe_controller(sc);
/* Create the control device. */
- dev_ops_add(&twa_ops, -1, device_get_unit(sc->twa_bus_dev));
xdev = make_dev(&twa_ops, device_get_unit(sc->twa_bus_dev),
UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR,
"twa%d", device_get_unit(sc->twa_bus_dev));
/*
* Create the control device.
*/
- dev_ops_add(&twe_ops, -1, device_get_unit(sc->twe_dev));
sc->twe_dev_t = make_dev(&twe_ops, device_get_unit(sc->twe_dev),
- UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR, "twe%d",
- device_get_unit(sc->twe_dev));
+ UID_ROOT, GID_OPERATOR,
+ S_IRUSR | S_IWUSR, "twe%d",
+ device_get_unit(sc->twe_dev));
sc->twe_dev_t->si_drv1 = sc;
+
/*
- * Schedule ourselves to bring the controller up once interrupts are available.
- * This isn't strictly necessary, since we disable interrupts while probing the
- * controller, but it is more in keeping with common practice for other disk
- * devices.
+ * Schedule ourselves to bring the controller up once interrupts are
+ * available. This isn't strictly necessary, since we disable
+ * interrupts while probing the controller, but it is more in keeping
+ * with common practice for other disk devices.
*/
sc->twe_ich.ich_func = twe_intrhook;
sc->twe_ich.ich_arg = sc;
daemonq = NULL; /* initialize daemon's work queue */
dqend = NULL;
- dev_ops_add(&vinum_ops, 0, 0); /* add the ops entry */
+#if 0
+ dev_ops_add(&vinum_ops, 0, 0);
+#endif
vinum_conf.physbufs = nswbuf / 2 + 1; /* maximum amount of physical bufs */
sio_registered = TRUE;
}
minorbase = UNIT_TO_MINOR(unit);
- dev_ops_add(&sio_ops, UNIT_TO_MINOR(-1), minorbase);
make_dev(&sio_ops, minorbase,
UID_ROOT, GID_WHEEL, 0600, "ttyc%r%r", adapter,
unit % CY_MAX_PORTS);
else
shrinkmem = 0;
- dev_ops_add(&dgm_ops, DGM_UNITMASK, DGM_UNIT(sc->unit));
for (i = 0; i < sc->numports; i++, bc++) {
DPRINT3(DB_INFO, "dgm%d: Set up port %d\n", sc->unit, i);
port = &sc->ports[i];
}
rcb->rcb_probed = RC_ATTACHED;
if (!rc_started) {
- dev_ops_add(&rc_ops, -1, rcb->rcb_unit);
register_swi(SWI_TTY, rcpoll, NULL, "rcpoll", NULL);
callout_init(&rc_wakeup_ch);
rc_wakeup(NULL);
rp_addr(unit) = rp;
crit_exit();
- dev_ops_add(&rp_ops, 0xffff0000, (unit + 1) << 16);
for (i = 0 ; i < rp_num_ports[unit] ; i++) {
make_dev(&rp_ops, ((unit + 1) << 16) | i,
UID_ROOT, GID_WHEEL, 0666, "ttyR%c",
done_chartimes = 1;
}
- dev_ops_add(&si_ops, 0x7f, unit);
-/* path name devsw minor type uid gid perm*/
for (x = 0; x < sc->sc_nport; x++) {
/* sync with the manuals that start at 1 */
y = x + 1 + unit * (1 << SI_CARDSHIFT);
sio_registered = TRUE;
}
minorbase = UNIT_TO_MINOR(unit);
- dev_ops_add(&sio_ops, UNIT_TO_MINOR(-1), minorbase);
- //kprintf("sioattach: make_dev for ttyd%r\n", unit);
make_dev(&sio_ops, minorbase,
UID_ROOT, GID_WHEEL, 0600, "ttyd%r", unit);
make_dev(&sio_ops, minorbase | CONTROL_INIT_STATE,
/* register devices for DEVFS */
boardnr = brdp->brdnr;
- dev_ops_add(&stl_ops, 31, boardnr);
make_dev(&stl_ops, boardnr + 0x1000000, UID_ROOT, GID_WHEEL,
0600, "staliomem%d", boardnr);
kprintf("stli%d: %s (driver version %s), unit=%d nrpanels=%d "
"nrports=%d\n", brdp->unitid, stli_brdnames[brdp->brdtype],
stli_drvversion, brdp->brdnr, brdp->nrpanels, brdp->nrports);
- dev_ops_add(&stli_ops, -1, brdp->unitid);
return(0);
}
mixer_setrecsrc(m, SOUND_MASK_MIC);
unit = device_get_unit(dev);
- dev_ops_add(&mixer_cdevsw, -1, PCMMKMINOR(unit, SND_DEV_CTL, 0));
pdev = make_dev(&mixer_cdevsw, PCMMKMINOR(unit, SND_DEV_CTL, 0),
- UID_ROOT, GID_WHEEL, 0666, "mixer%d", unit);
+ UID_ROOT, GID_WHEEL, 0666, "mixer%d", unit);
reference_dev(pdev);
pdev->si_drv1 = m;
snddev = device_get_softc(dev);
{
lockinit(&sndstat_lock, "sndstat", 0, 0);
if (make_dev(&sndstat_cdevsw, SND_DEV_STATUS,
- UID_ROOT, GID_WHEEL, 0444, "sndstat") == NULL)
+ UID_ROOT, GID_WHEEL, 0444, "sndstat") == NULL) {
return ENXIO;
- dev_ops_add(&sndstat_cdevsw, -1, SND_DEV_STATUS);
-
+ }
return 0;
}
/*
* I will revisit these someday, and nuke it mercilessly..
*/
- dev_ops_add(&dsp_cdevsw,
- PCMMKMINOR(-1, -1, 0),
- PCMMKMINOR(device, SND_DEV_DSP, sce->chan_num));
sce->dsp_devt = make_dev(&dsp_cdevsw,
- PCMMKMINOR(device, SND_DEV_DSP, sce->chan_num),
- UID_ROOT, GID_WHEEL, 0666, "dsp%d.%d",
- device, sce->chan_num);
+ PCMMKMINOR(device, SND_DEV_DSP, sce->chan_num),
+ UID_ROOT, GID_WHEEL, 0666, "dsp%d.%d",
+ device, sce->chan_num);
reference_dev(sce->dsp_devt);
- dev_ops_add(&dsp_cdevsw,
- PCMMKMINOR(-1, -1, 0),
- PCMMKMINOR(device, SND_DEV_DSP16, sce->chan_num));
sce->dspW_devt = make_dev(&dsp_cdevsw,
- PCMMKMINOR(device, SND_DEV_DSP16, sce->chan_num),
- UID_ROOT, GID_WHEEL, 0666, "dspW%d.%d",
- device, sce->chan_num);
+ PCMMKMINOR(device, SND_DEV_DSP16, sce->chan_num),
+ UID_ROOT, GID_WHEEL, 0666, "dspW%d.%d",
+ device, sce->chan_num);
reference_dev(sce->dspW_devt);
- /*
- dev_ops_add(&dsp_cdevsw,
- PCMMKMINOR(-1, -1, 0),
- PCMMKMINOR(device, SND_DEV_DSP, sce->chan_num));
- sce->audio_devt = make_dev(&dsp_cdevsw,
- PCMMKMINOR(device, SND_DEV_DSP, sce->chan_num),
- UID_ROOT, GID_WHEEL, 0666, "audio%d.%d",
- device, sce->chan_num);
- */
sce->audio_devt = sce->dsp_devt;
reference_dev(sce->audio_devt);
if (ch->direction == PCMDIR_REC) {
- dev_ops_add(&dsp_cdevsw,
- PCMMKMINOR(-1, -1, 0),
- PCMMKMINOR(device, SND_DEV_DSPREC, sce->chan_num));
sce->dspr_devt = make_dev(&dsp_cdevsw,
- PCMMKMINOR(device, SND_DEV_DSPREC,
+ PCMMKMINOR(device, SND_DEV_DSPREC,
sce->chan_num), UID_ROOT, GID_WHEEL,
- 0666, "dspr%d.%d", device, sce->chan_num);
+ 0666, "dspr%d.%d", device, sce->chan_num);
reference_dev(sce->dspr_devt);
}
DPRINTF(("ucom_attach: make_dev: ucom%d\n", unit));
- dev_ops_add(&ucom_ops, UCOMUNIT_MASK, unit);
dev = make_dev(&ucom_ops, unit | UCOM_CALLOUT_MASK,
UID_UUCP, GID_DIALER, 0660,
"ucom%d", unit);
sc->sc_epaddr = edesc->bEndpointAddress;
/* XXX no error trapping, no storing of cdev_t */
- dev_ops_add(&ufm_ops, -1, device_get_unit(self));
make_dev(&ufm_ops, device_get_unit(self),
- UID_ROOT, GID_OPERATOR,
- 0644, "ufm%d", device_get_unit(self));
+ UID_ROOT, GID_OPERATOR,
+ 0644, "ufm%d", device_get_unit(self));
DPRINTFN(10, ("ufm_attach: %p\n", sc->sc_udev));
}
/* the main device, ctrl endpoint */
- dev_ops_add(&ugen_ops,
- UGENUNITMASK, UGENMINOR(device_get_unit(sc->sc_dev), 0));
make_dev(&ugen_ops, UGENMINOR(device_get_unit(sc->sc_dev), 0),
- UID_ROOT, GID_OPERATOR, 0644, "%s", device_get_nameunit(sc->sc_dev));
+ UID_ROOT, GID_OPERATOR, 0644,
+ "%s", device_get_nameunit(sc->sc_dev));
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, sc->sc_dev);
return 0;
sc->sc_repdesc = desc;
sc->sc_repdesc_size = size;
- dev_ops_add(&uhid_ops, -1, device_get_unit(self));
make_dev(&uhid_ops, device_get_unit(self),
- UID_ROOT, GID_OPERATOR,
- 0644, "uhid%d", device_get_unit(self));
+ UID_ROOT, GID_OPERATOR,
+ 0644, "uhid%d", device_get_unit(self));
return 0;
}
sc->sc_ifaceno = id->bInterfaceNumber;
sc->sc_udev = dev;
- dev_ops_add(&ulpt_ops, -1, device_get_unit(self));
make_dev(&ulpt_ops, device_get_unit(self),
- UID_ROOT, GID_OPERATOR, 0644, "ulpt%d", device_get_unit(self));
+ UID_ROOT, GID_OPERATOR, 0644,
+ "ulpt%d", device_get_unit(self));
make_dev(&ulpt_ops,
- device_get_unit(self)|ULPT_NOPRIME,
- UID_ROOT, GID_OPERATOR, 0644, "unlpt%d", device_get_unit(self));
+ device_get_unit(self)|ULPT_NOPRIME,
+ UID_ROOT, GID_OPERATOR, 0644,
+ "unlpt%d", device_get_unit(self));
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
sc->sc_dev);
sc->status.button = sc->status.obutton = 0;
sc->status.dx = sc->status.dy = sc->status.dz = 0;
- dev_ops_add(&ums_ops, -1, device_get_unit(self));
make_dev(&ums_ops, device_get_unit(self),
- UID_ROOT, GID_OPERATOR,
- 0644, "ums%d", device_get_unit(self));
+ UID_ROOT, GID_OPERATOR,
+ 0644, "ums%d", device_get_unit(self));
if (usbd_get_quirks(uaa->device)->uq_flags & UQ_SPUR_BUT_UP) {
DPRINTF(("%s: Spurious button up events\n",
goto nobulk;
}
- dev_ops_add(&urio_ops, -1, device_get_unit(self));
make_dev(&urio_ops, device_get_unit(self),
- UID_ROOT, GID_OPERATOR,
- 0644, "urio%d", device_get_unit(self));
+ UID_ROOT, GID_OPERATOR,
+ 0644, "urio%d", device_get_unit(self));
DPRINTFN(10, ("urio_attach: %p\n", sc->sc_udev));
sc->sc_bulkout = ed_bulkout->bEndpointAddress;
/* the main device, ctrl endpoint */
- dev_ops_add(&uscanner_ops, -1, device_get_unit(sc->sc_dev));
make_dev(&uscanner_ops, device_get_unit(sc->sc_dev),
- UID_ROOT, GID_OPERATOR, 0644, "%s", device_get_nameunit(sc->sc_dev));
+ UID_ROOT, GID_OPERATOR, 0644,
+ "%s", device_get_nameunit(sc->sc_dev));
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
sc->sc_dev);
common_bktr_attach( bktr, unit, fun, rev );
/* make the device entries */
- dev_ops_add(&bktr_ops, 0x0f, unit);
make_dev(&bktr_ops, unit, 0, 0, 0444, "bktr%d", unit);
make_dev(&bktr_ops, unit+16, 0, 0, 0444, "tuner%d", unit);
make_dev(&bktr_ops, unit+32, 0, 0, 0444, "vbi%d" , unit);
-
return 0;
fail:
sr->iobase = devp->id_iobase;
sr->maddr = devp->id_maddr;
sr->msize = devp->id_msize;
- dev_ops_add(&ctx_ops, -1, devp->id_unit);
make_dev(&ctx_ops, devp->id_unit, 0, 0, 0600,
- "ctx%d", devp->id_unit);
+ "ctx%d", devp->id_unit);
return (1);
}
/* make the device entries */
- dev_ops_add(&cxm_ops, -1, unit);
sc->cxm_dev_t = make_dev(&cxm_ops, unit,
- 0, 0, 0444, "cxm%d", unit);
+ 0, 0, 0444, "cxm%d", unit);
return 0;
scu->flags |= ATTACHED;
lprintf(("gsc%d.attach: ok\n", unit));
scu->flags &= ~FLAG_DEBUG;
+
#define GSC_UID 0
#define GSC_GID 13
- dev_ops_add(&gsc_ops, 0xc0, unit << 6);
make_dev(&gsc_ops, unit<<6, GSC_UID, GSC_GID, 0666, "gsc%d", unit);
make_dev(&gsc_ops, ((unit<<6) + FRMT_PBM),
- GSC_UID, GSC_GID, 0666, "gsc%dp", unit);
+ GSC_UID, GSC_GID, 0666, "gsc%dp", unit);
make_dev(&gsc_ops, ((unit<<6) + DBUG_MASK),
- GSC_UID, GSC_GID, 0666, "gsc%dd", unit);
+ GSC_UID, GSC_GID, 0666, "gsc%dd", unit);
make_dev(&gsc_ops, ((unit<<6) + DBUG_MASK+FRMT_PBM),
- GSC_UID, GSC_GID, 0666, "gsc%dpd", unit);
+ GSC_UID, GSC_GID, 0666, "gsc%dpd", unit);
return ATTACH_SUCCESS;
}
mtr->frames = 1; /* one frame */
mtr->flags |= METEOR_INITALIZED | METEOR_AUTOMODE | METEOR_DEV0 |
- METEOR_RGB16;
- dev_ops_add(&meteor_ops, -1, unit);
+ METEOR_RGB16;
make_dev(&meteor_ops, unit, 0, 0, 0644, "meteor");
}
/*
* Create an internal or external device.
*
- * Device majors can be overloaded and used directly by the kernel without
- * conflict, but userland will only see the particular device major that
- * has been installed with dev_ops_add().
- *
* This routine creates and returns an unreferenced ad-hoc entry for the
* device which will remain intact until the device is destroyed. If the
* caller intends to store the device pointer it must call reference_dev()
return (dev);
}
-cdev_t
-get_dev(int x, int y)
-{
- cdev_t dev;
- struct dev_ops *ops;
-
- if (x == NOUDEV)
- return(NULL);
- ops = dev_ops_get(x, y);
- if (ops == NULL)
- return(NULL);
- dev = hashdev(ops, x, y, TRUE);
- return(dev);
-}
-
/*
* destroy_dev() removes the adhoc association for a device and revectors
* its ops to &dead_dev_ops.
{
int hash;
- if (dev == NULL)
- return;
-
- devfs_debug(DEVFS_DEBUG_DEBUG, "destroy_dev called for %s\n", dev->si_name);
- devfs_destroy_dev(dev);
-
- return;
-
- if ((dev->si_flags & SI_ADHOC) == 0) {
- release_dev(dev);
- return;
- }
- if (dev_ref_debug) {
- kprintf("destroy dev %p %s(minor=%08x) refs=%d\n",
- dev, devtoname(dev), dev->si_uminor,
- dev->si_sysref.refcnt);
- }
- if (dev->si_sysref.refcnt < 2) {
- kprintf("destroy_dev(): too few references on device! "
- "%p %s(minor=%08x) refs=%d\n",
- dev, devtoname(dev), dev->si_uminor,
- dev->si_sysref.refcnt);
- }
- dev->si_flags &= ~SI_ADHOC;
- if (dev->si_flags & SI_HASHED) {
- hash = __devthash(dev->si_umajor, dev->si_uminor);
- LIST_REMOVE(dev, si_hash);
- dev->si_flags &= ~SI_HASHED;
+ if (dev) {
+ devfs_debug(DEVFS_DEBUG_DEBUG,
+ "destroy_dev called for %s\n",
+ dev->si_name);
+ devfs_destroy_dev(dev);
}
-
- /*
- * We have to release the ops reference before we replace the
- * device switch with dead_dev_ops.
- */
-
-
- if (dead_dev_ops.d_strategy == NULL)
- compile_dev_ops(&dead_dev_ops);
- if (dev->si_ops && dev->si_ops != &dead_dev_ops)
- dev_ops_release(dev->si_ops);
- dev->si_drv1 = NULL;
- dev->si_drv2 = NULL;
- dev->si_ops = &dead_dev_ops;
- sysref_put(&dev->si_sysref); /* release adhoc association */
-
- release_dev(dev); /* release callers reference */
}
/*
{
int fd;
- dev_ops_add(&fildesc_ops, 0, 0);
for (fd = 0; fd < NUMFDESC; fd++) {
make_dev(&fildesc_ops, fd,
- UID_BIN, GID_BIN, 0666, "fd/%d", fd);
+ UID_BIN, GID_BIN, 0666, "fd/%d", fd);
}
kprintf("fildesc_drvinit() building stdin, stdout, stderr: \n");
/*
* This makes a dev_ops entry visible to userland (e.g /dev/<blah>).
*
- * The kernel can overload a data space by making multiple dev_ops_add()
- * calls, but only the most recent one in the list matching the mask/match
- * will be visible to userland.
- *
- * make_dev() does not automatically call dev_ops_add() (nor do we want it
- * to, since partition-managed disk devices are overloaded on top of the
- * raw device).
- *
* Disk devices typically register their major, e.g. 'ad0', and then call
* into the disk label management code which overloads its own onto e.g. 'ad0'
* to support all the various slice and partition combinations.
struct dev_ops_rb_tree dev_ops_rbhead = RB_INITIALIZER(dev_ops_rbhead);
-int
-dev_ops_add(struct dev_ops *ops, u_int mask, u_int match)
-{
- return 0;
-
- static int next_maj = 256; /* first dynamic major number */
- struct dev_ops_maj *rbmaj;
- struct dev_ops_link *link;
-
- compile_dev_ops(ops);
- if (ops->head.maj < 0) {
- while (dev_ops_rb_tree_RB_LOOKUP(&dev_ops_rbhead, next_maj) != NULL) {
- if (++next_maj <= 0)
- next_maj = 256;
- }
- ops->head.maj = next_maj;
- }
- rbmaj = dev_ops_rb_tree_RB_LOOKUP(&dev_ops_rbhead, ops->head.maj);
- if (rbmaj == NULL) {
- rbmaj = kmalloc(sizeof(*rbmaj), M_DEVBUF, M_INTWAIT | M_ZERO);
- rbmaj->maj = ops->head.maj;
- dev_ops_rb_tree_RB_INSERT(&dev_ops_rbhead, rbmaj);
- }
- for (link = rbmaj->link; link; link = link->next) {
- /*
- * If we get an exact match we usurp the target, but we only print
- * a warning message if a different device switch is installed.
- */
- if (link->mask == mask && link->match == match) {
- if (link->ops != ops) {
- kprintf("WARNING: \"%s\" (%p) is usurping \"%s\"'s"
- " (%p)\n",
- ops->head.name, ops,
- link->ops->head.name, link->ops);
- link->ops = ops;
- ++ops->head.refs;
- }
- return(0);
- }
- /*
- * XXX add additional warnings for overlaps
- */
- }
-
- link = kmalloc(sizeof(struct dev_ops_link), M_DEVBUF, M_INTWAIT|M_ZERO);
- link->mask = mask;
- link->match = match;
- link->ops = ops;
- link->next = rbmaj->link;
- rbmaj->link = link;
- ++ops->head.refs;
- return(0);
-}
-
-/*
- * Should only be used by udev2dev().
- *
- * If the minor number is -1, we match the first ops we find for this
- * major. If the mask is not -1 then multiple minor numbers can match
- * the same ops.
- *
- * Note that this function will return NULL if the minor number is not within
- * the bounds of the installed mask(s).
- *
- * The specified minor number should NOT include any major bits.
- */
-struct dev_ops *
-dev_ops_get(int x, int y)
-{
- struct dev_ops_maj *rbmaj;
- struct dev_ops_link *link;
-
- return NULL;
-
- rbmaj = dev_ops_rb_tree_RB_LOOKUP(&dev_ops_rbhead, x);
- if (rbmaj == NULL)
- return(NULL);
- for (link = rbmaj->link; link; link = link->next) {
- if (y == -1 || (link->mask & y) == link->match)
- return(link->ops);
- }
- return(NULL);
-}
-
/*
* Remove all matching dev_ops entries from the dev_ops_array[] major
* array so no new user opens can be performed, and destroy all devices
* installed in the hash table that are associated with this dev_ops. (see
* destroy_all_devs()).
- *
- * The mask and match should match a previous call to dev_ops_add*().
*/
int
dev_ops_remove(struct dev_ops *ops, u_int mask, u_int match)
if (mem_range_softc.mr_op != NULL)
mem_range_softc.mr_op->init(&mem_range_softc);
- dev_ops_add(&mem_ops, 0xf0, 0);
make_dev(&mem_ops, 0, UID_ROOT, GID_KMEM, 0640, "mem");
make_dev(&mem_ops, 1, UID_ROOT, GID_KMEM, 0640, "kmem");
make_dev(&mem_ops, 2, UID_ROOT, GID_WHEEL, 0666, "null");
static void
devinit(void)
{
- dev_ops_add(&devctl_ops, -1, 0);
make_dev(&devctl_ops, 0, UID_ROOT, GID_WHEEL, 0600, "devctl");
lockinit(&devsoftc.lock, "dev mtx", 0, 0);
TAILQ_INIT(&devsoftc.devq);
static void
log_drvinit(void *unused)
{
- dev_ops_add(&log_ops, 0, 0);
make_dev(&log_ops, 0, UID_ROOT, GID_WHEEL, 0600, "klog");
}
static void
cn_drvinit(void *unused)
{
- dev_ops_add(&cn_ops, 0, 0);
cn_devfsdev = make_only_devfs_dev(&cn_ops, 0, UID_ROOT, GID_WHEEL,
- 0600, "console");
+ 0600, "console");
}
SYSINIT(cndev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,cn_drvinit,NULL)
ptc_drvinit(void *unused)
{
int i;
- dev_ops_add(&pts_ops, 0, 0);
- dev_ops_add(&ptc_ops, 0, 0);
devfs_clone_bitmap_init(&DEVFS_CLONE_BITMAP(pty));
devfs_clone_bitmap_init(&DEVFS_CLONE_BITMAP(pts));
static void
ctty_drvinit(void *unused __unused)
{
- dev_ops_add(&ctty_ops, 0, 0);
make_dev(&ctty_ops, 0, 0, 0, 0666, "tty");
}
static void
bpf_drvinit(void *unused)
{
- dev_ops_add(&bpf_ops, 0, 0);
make_dev(&bpf_ops, 0, 0, 0, 0600, "bpf");
devfs_clone_bitmap_init(&DEVFS_CLONE_BITMAP(bpf));
devfs_clone_handler_add("bpf", bpfclone);
#define PDEVSTATIC static
/*---------------------------------------------------------------------------*
- * initialization at kernel load time
- *---------------------------------------------------------------------------*/
-static void
-i4bctlinit(void *unused)
-{
- dev_ops_add(&i4bctl_ops, 0, 0);
-}
-
-SYSINIT(i4bctldev, SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR, &i4bctlinit, NULL);
-
-/*---------------------------------------------------------------------------*
* interface attach routine
*---------------------------------------------------------------------------*/
PDEVSTATIC void
*===========================================================================*/
/*---------------------------------------------------------------------------*
- * initialization at kernel load time
- *---------------------------------------------------------------------------*/
-static void
-i4brbchinit(void *unused)
-{
- dev_ops_add(&i4brbch_ops, 0, 0);
-}
-
-SYSINIT(i4brbchdev, SI_SUB_DRIVERS,
- SI_ORDER_MIDDLE+CDEV_MAJOR, &i4brbchinit, NULL);
-
-/*---------------------------------------------------------------------------*
* interface attach routine
*---------------------------------------------------------------------------*/
PDEVSTATIC void
*===========================================================================*/
/*---------------------------------------------------------------------------*
- * initialization at kernel load time
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-i4btelinit(void *unused)
-{
- dev_ops_add(&i4btel_ops, 0, 0);
-}
-
-SYSINIT(i4bteldev, SI_SUB_DRIVERS,
- SI_ORDER_MIDDLE+CDEV_MAJOR, &i4btelinit, NULL);
-
-/*---------------------------------------------------------------------------*
* interface attach routine
*---------------------------------------------------------------------------*/
PDEVSTATIC void
/*---------------------------------------------------------------------------*
* interface init routine
*---------------------------------------------------------------------------*/
-static void
-i4btrcinit(void *unused)
-{
- dev_ops_add(&i4btrc_ops, 0, 0);
-}
-
-SYSINIT(i4btrcdev, SI_SUB_DRIVERS,
- SI_ORDER_MIDDLE+CDEV_MAJOR, &i4btrcinit, NULL);
-
static void i4btrcattach(void *);
PSEUDO_SET(i4btrcattach, i4b_trace);
PDEVSTATIC void i4battach(void *);
PSEUDO_SET(i4battach, i4b_i4bdrv);
-static void
-i4b_drvinit(void *unused)
-{
- dev_ops_add(&i4b_ops, 0, 0);
-}
-
-SYSINIT(i4bdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,i4b_drvinit,NULL)
-
/*---------------------------------------------------------------------------*
* interface attach routine
*---------------------------------------------------------------------------*/
int error;
init_zone_var();
- error = dev_ops_add(&pf_ops, 0, 0);
- if (error)
- return (error);
pf_dev = make_dev(&pf_ops, 0, 0, 0, 0600, PF_NAME);
error = pfattach();
if (error) {
smb_iod_done();
error = smb_sm_done();
error = 0;
- //dev_ops_remove(&nsmb_ops, 0, 0);
dev_ops_remove_all(&nsmb_ops);
kprintf("netsmb_dev: unloaded\n");
break;
case MOD_LOAD:
if (bootverbose)
kprintf("crypto: <crypto device>\n");
- dev_ops_add(&crypto_ops, 0, 0);
make_dev(&crypto_ops, 0, UID_ROOT, GID_WHEEL,
- 0666, "crypto");
+ 0666, "crypto");
return 0;
case MOD_UNLOAD:
/*XXX disallow if active sessions */
static void
acpi_capm_init(struct acpi_softc *sc)
{
- dev_ops_add(&apm_ops, 0, 0);
make_dev(&apm_ops, 0, 0, 5, 0664, "apm");
make_dev(&apm_ops, 8, 0, 5, 0664, "apm");
kprintf("Warning: ACPI is disabling APM's device. You can't run both\n");
sc->initialized = 1;
- dev_ops_add(&apm_ops, 0, 0);
make_dev(&apm_ops, 0, UID_ROOT, GID_OPERATOR, 0660, "apm");
make_dev(&apm_ops, 8, UID_ROOT, GID_OPERATOR, 0660, "apmctl");
return 0;
if (elan_mmcr == NULL)
return;
kprintf("Elan-mmcr driver: MMCR at %p\n", elan_mmcr);
- dev_ops_add(&elan_ops, 0, 0);
make_dev(&elan_ops, 0, UID_ROOT, GID_WHEEL, 0600, "elan-mmcr");
- return;
}
SYSINIT(elan, SI_SUB_PSEUDO, SI_ORDER_MIDDLE+CDEV_MAJOR,elan_drvinit,NULL);
static void
perfmon_driver_init(void *unused __unused)
{
- dev_ops_add(&perfmon_ops, 0xf0, 32);
make_dev(&perfmon_ops, 32, UID_ROOT, GID_KMEM, 0640, "perfmon");
}
scu->selp.si_pid=(pid_t)0;
#define ASC_UID 0
#define ASC_GID 13
- dev_ops_add(&asc_ops, 0xc0, unit << 6);
make_dev(&asc_ops, unit<<6, ASC_UID, ASC_GID, 0666, "asc%d", unit);
make_dev(&asc_ops, ((unit<<6) + FRMT_PBM),
- ASC_UID, ASC_GID, 0666, "asc%dp", unit);
+ ASC_UID, ASC_GID, 0666, "asc%dp", unit);
make_dev(&asc_ops, ((unit<<6) + DBUG_MASK),
- ASC_UID, ASC_GID, 0666, "asc%dd", unit);
+ ASC_UID, ASC_GID, 0666, "asc%dd", unit);
make_dev(&asc_ops, ((unit<<6) + DBUG_MASK+FRMT_PBM),
- ASC_UID, ASC_GID, 0666, "asc%dpd", unit);
+ ASC_UID, ASC_GID, 0666, "asc%dpd", unit);
return ATTACH_SUCCESS;
}
static void
acpi_capm_init(struct acpi_softc *sc)
{
- dev_ops_add(&apm_ops, 0, 0);
make_dev(&apm_ops, 0, 0, 5, 0664, "apm");
make_dev(&apm_ops, 8, 0, 5, 0664, "apm");
kprintf("Warning: ACPI is disabling APM's device. You can't run both\n");
sc->initialized = 1;
- dev_ops_add(&apm_ops, 0, 0);
make_dev(&apm_ops, 0, UID_ROOT, GID_OPERATOR, 0660, "apm");
make_dev(&apm_ops, 8, UID_ROOT, GID_OPERATOR, 0660, "apmctl");
return 0;
scu->selp.si_pid=(pid_t)0;
#define ASC_UID 0
#define ASC_GID 13
- dev_ops_add(&asc_ops, 0xc0, unit << 6);
make_dev(&asc_ops, unit<<6, ASC_UID, ASC_GID, 0666, "asc%d", unit);
make_dev(&asc_ops, ((unit<<6) + FRMT_PBM),
- ASC_UID, ASC_GID, 0666, "asc%dp", unit);
+ ASC_UID, ASC_GID, 0666, "asc%dp", unit);
make_dev(&asc_ops, ((unit<<6) + DBUG_MASK),
- ASC_UID, ASC_GID, 0666, "asc%dd", unit);
+ ASC_UID, ASC_GID, 0666, "asc%dd", unit);
make_dev(&asc_ops, ((unit<<6) + DBUG_MASK+FRMT_PBM),
- ASC_UID, ASC_GID, 0666, "asc%dpd", unit);
+ ASC_UID, ASC_GID, 0666, "asc%dpd", unit);
return ATTACH_SUCCESS;
}
/*
* Implement ttyv0-ttyv7. At the moment ttyv1-7 are sink nulls.
*/
- dev_ops_add(&vcons_ops, -1 & ~7, 0);
for (i = 0; i < 8; ++i) {
kprintf("vconsinit_fini(): make_dev for ttyv%d\n", i);
dev = make_dev(&vcons_ops, i,
extern struct syslink_desc dev_clone_desc;
void compile_dev_ops(struct dev_ops *);
-int dev_ops_add(struct dev_ops *, u_int mask, u_int match);
int dev_ops_remove(struct dev_ops *, u_int mask, u_int match);
int dev_ops_remove_all(struct dev_ops *ops);
int dev_ops_remove_minor(struct dev_ops *ops, int minor);
void dev_ops_release(struct dev_ops *);
struct dev_ops *dev_ops_intercept(cdev_t, struct dev_ops *);
void dev_ops_restore(cdev_t, struct dev_ops *);
-struct dev_ops *dev_ops_get(int x, int y);
void destroy_all_devs(struct dev_ops *, u_int mask, u_int match);
cdev_t make_dev(struct dev_ops *ops, int minor, uid_t uid, gid_t gid,
devvp->v_type = VCHR;
dev = make_dev(&mfs_ops, minnum, UID_ROOT, GID_WHEEL, 0600,
- "MFS%d", minnum >> 16);
+ "MFS%d", minnum >> 16);
/* It is not clear that these will get initialized otherwise */
dev->si_bsize_phys = DEV_BSIZE;
dev->si_iosize_max = DFLTPHYS;
static int
mfs_init(struct vfsconf *vfsp)
{
- dev_ops_add(&mfs_ops, 0, 0);
return (0);
}