summaryrefslogtreecommitdiffstats
path: root/sys/isa
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-09-05 10:40:16 +0000
committerphk <phk@FreeBSD.org>2003-09-05 10:40:16 +0000
commitc5dc1fb629b7196373ecfcd1f58c90dc99bc0f0c (patch)
tree53bbbd3272194cca8de958cae691db47d3d00db9 /sys/isa
parent5ed65ab40c3df3af64ff43c812f082aa5f5fc475 (diff)
downloadFreeBSD-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/isa')
-rw-r--r--sys/isa/fd.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/sys/isa/fd.c b/sys/isa/fd.c
index 5346144..aed1dac 100644
--- a/sys/isa/fd.c
+++ b/sys/isa/fd.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);
}
OpenPOWER on IntegriCloud