diff options
author | phk <phk@FreeBSD.org> | 2004-10-12 21:23:33 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-10-12 21:23:33 +0000 |
commit | 8958bacd2b1d4b226ab5fd86f57b0fbcdbbb0acf (patch) | |
tree | 0d3d164502b02864cab1cb33e0dabbcde27cd6c4 /sys/dev | |
parent | 8dea3c151980075328b560d9890545216cb6bb1b (diff) | |
download | FreeBSD-src-8958bacd2b1d4b226ab5fd86f57b0fbcdbbb0acf.zip FreeBSD-src-8958bacd2b1d4b226ab5fd86f57b0fbcdbbb0acf.tar.gz |
Add a couple of XXX comments and fix a couple of fine points.
I have not tried to make this a "canonical tty driver".
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ofw/ofw_console.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c index 5b3b285..22bed0f 100644 --- a/sys/dev/ofw/ofw_console.c +++ b/sys/dev/ofw/ofw_console.c @@ -95,6 +95,10 @@ cn_drvinit(void *unused) OF_getprop(options, "output-device", output, sizeof(output)) == -1) return; + /* + * XXX: This is a hack and it may result in two /dev/ttya + * XXX: devices on platforms where the sab driver works. + */ dev = make_dev(&ofw_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "%s", output); make_dev_alias(dev, "ofwcons"); @@ -117,7 +121,15 @@ ofw_dev_open(struct cdev *dev, int flag, int mode, struct thread *td) setuptimeout = 0; unit = minor(dev); - tp = ofw_tp = dev->si_tty = ttymalloc(ofw_tp); + /* + * XXX: BAD, should happen at attach time + */ + if (dev->si_tty == NULL) { + ofw_tp = ttyalloc(); + dev->si_tty = ofw_tp; + ofw_tp->t_dev = dev; + } + tp = dev->si_tty; tp->t_oproc = ofw_tty_start; tp->t_param = ofw_tty_param; @@ -160,7 +172,7 @@ ofw_dev_close(struct cdev *dev, int flag, int mode, struct thread *td) struct tty *tp; unit = minor(dev); - tp = ofw_tp; + tp = dev->si_tty; if (unit != 0) { return (ENXIO); |