diff options
author | phk <phk@FreeBSD.org> | 2003-09-05 10:40:16 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-09-05 10:40:16 +0000 |
commit | c5dc1fb629b7196373ecfcd1f58c90dc99bc0f0c (patch) | |
tree | 53bbbd3272194cca8de958cae691db47d3d00db9 /sys/dev | |
parent | 5ed65ab40c3df3af64ff43c812f082aa5f5fc475 (diff) | |
download | FreeBSD-src-c5dc1fb629b7196373ecfcd1f58c90dc99bc0f0c.zip FreeBSD-src-c5dc1fb629b7196373ecfcd1f58c90dc99bc0f0c.tar.gz |
Put the device cloning functions for disk-drivers under #ifndef BURN_BRIDGES.
For the floppy driver, use fdcontrol to manipulate density selection.
For the CD drivers, the 'a' and 'c' suffix is without actual effect and
any applications insisting on it can be satisfied with a symlink:
ln -s /dev/cd0 /dev/cd0a
Ongoing discussion may result in these pieces of code being removed before
the 5-stable branch as opposed to after.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ata/atapi-cd.c | 6 | ||||
-rw-r--r-- | sys/dev/fdc/fdc.c | 22 |
2 files changed, 25 insertions, 3 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index 2008515..a8a8b87 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -242,7 +242,9 @@ acd_detach(struct ata_device *atadev) free(entry, M_ACD); } destroy_dev(cdp->dev); +#ifndef BURN_BRIDGES EVENTHANDLER_DEREGISTER(dev_clone, cdp->clone_evh); +#endif devstat_remove_entry(cdp->stats); ata_prtdev(atadev, "WARNING - removed from configuration\n"); ata_free_name(atadev); @@ -273,6 +275,7 @@ acd_init_lun(struct ata_device *atadev) return cdp; } +#ifndef BURN_BRIDGES static void acd_clone(void *arg, char *name, int namelen, dev_t *dev) { @@ -289,6 +292,7 @@ acd_clone(void *arg, char *name, int namelen, dev_t *dev) if (unit == cdp->lun) *dev = makedev(acd_cdevsw.d_maj, cdp->lun); } +#endif static void acd_make_dev(struct acd_softc *cdp) @@ -300,7 +304,9 @@ acd_make_dev(struct acd_softc *cdp) dev->si_drv1 = cdp; cdp->dev = dev; cdp->device->flags |= ATA_D_MEDIA_CHANGED; +#ifndef BURN_BRIDGES cdp->clone_evh = EVENTHANDLER_REGISTER(dev_clone, acd_clone, cdp, 1000); +#endif acd_set_ioparm(cdp); } diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 5346144..aed1dac 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -316,9 +316,11 @@ struct fd_data { struct callout_handle toffhandle; struct callout_handle tohandle; struct devstat *device_stats; - eventhandler_tag clonetag; dev_t masterdev; +#ifndef BURN_BRIDGES + eventhandler_tag clonetag; dev_t clonedevs[NUMDENS - 1]; +#endif device_t dev; fdu_t fdu; }; @@ -386,7 +388,9 @@ static int fdc_detach(device_t dev); static void fdc_add_child(device_t, const char *, int); static int fdc_attach(device_t); static int fdc_print_child(device_t, device_t); +#ifndef BURN_BRIDGES static void fd_clone (void *, char *, int, dev_t *); +#endif static int fd_probe(device_t); static int fd_attach(device_t); static int fd_detach(device_t); @@ -1117,6 +1121,7 @@ DRIVER_MODULE(fdc, pccard, fdc_pccard_driver, fdc_devclass, 0, 0); #endif /* NCARD > 0 */ +#ifndef BURN_BRIDGES /* * Create a clone device upon request by devfs. */ @@ -1170,6 +1175,7 @@ fd_clone(void *arg, char *name, int namelen, dev_t *dev) } } } +#endif /* * Configuration/initialization, per drive. @@ -1323,14 +1329,20 @@ static int fd_attach(device_t dev) { struct fd_data *fd; - int i; fd = device_get_softc(dev); +#ifndef BURN_BRIDGES fd->clonetag = EVENTHANDLER_REGISTER(dev_clone, fd_clone, fd, 1000); +#endif fd->masterdev = make_dev(&fd_cdevsw, fd->fdu << 6, UID_ROOT, GID_OPERATOR, 0640, "fd%d", fd->fdu); +#ifndef BURN_BRIDGES + { + int i; for (i = 0; i < NUMDENS - 1; i++) fd->clonedevs[i] = NODEV; + } +#endif fd->device_stats = devstat_new_entry(device_get_name(dev), device_get_unit(dev), 0, DEVSTAT_NO_ORDERED_TAGS, DEVSTAT_TYPE_FLOPPY | DEVSTAT_TYPE_IF_OTHER, @@ -1342,16 +1354,20 @@ static int fd_detach(device_t dev) { struct fd_data *fd; - int i; fd = device_get_softc(dev); untimeout(fd_turnoff, fd, fd->toffhandle); devstat_remove_entry(fd->device_stats); destroy_dev(fd->masterdev); +#ifndef BURN_BRIDGES + { + int i; for (i = 0; i < NUMDENS - 1; i++) if (fd->clonedevs[i] != NODEV) destroy_dev(fd->clonedevs[i]); EVENTHANDLER_DEREGISTER(dev_clone, fd->clonetag); + } +#endif return (0); } |