diff options
author | Jake Burkholder <jake@FreeBSD.org> | 2003-01-26 01:56:20 +0000 |
---|---|---|
committer | Jake Burkholder <jake@FreeBSD.org> | 2003-01-26 01:56:20 +0000 |
commit | 6c5b0e25a09d13c06fbbad94e6a1bbff8abd6a09 (patch) | |
tree | 7636643bd24aecf119d1ccf3d9234e699bcad115 | |
parent | 402062e80c9b1085362f38cc3973da90d4bed630 (diff) | |
download | src-6c5b0e25a09d13c06fbbad94e6a1bbff8abd6a09.tar.gz src-6c5b0e25a09d13c06fbbad94e6a1bbff8abd6a09.zip |
Allow defaulting the console to ttya when it sets to screen and keyboard
in the prom but no keyboard is plugged in.
Notes
Notes:
svn path=/head/; revision=109844
-rw-r--r-- | sys/dev/sab/sab.c | 13 | ||||
-rw-r--r-- | sys/dev/zs/zs_sbus.c | 13 |
2 files changed, 16 insertions, 10 deletions
diff --git a/sys/dev/sab/sab.c b/sys/dev/sab/sab.c index 46f0b3b71f78..2daf97b8b153 100644 --- a/sys/dev/sab/sab.c +++ b/sys/dev/sab/sab.c @@ -1268,12 +1268,15 @@ sabtty_console(device_t dev, char *mode, int len) OF_getprop(options, "input-device", input, sizeof(input)) == -1 || OF_getprop(options, "output-device", output, sizeof(output)) == -1) return (0); - if (ebus_get_node(parent) == OF_instance_to_package(stdin) && - ebus_get_node(parent) == OF_instance_to_package(stdout) && - strcmp(input, device_get_desc(dev)) == 0 && - strcmp(output, device_get_desc(dev)) == 0) { + if (ebus_get_node(parent) != OF_instance_to_package(stdin) || + ebus_get_node(parent) != OF_instance_to_package(stdout)) + return (0); + if ((strcmp(input, device_get_desc(dev)) == 0 && + strcmp(output, device_get_desc(dev)) == 0) || + (strcmp(input, "keyboard") == 0 && strcmp(output, "screen") == 0 && + (device_get_unit(dev) & 1) == 0)) { if (mode != NULL) { - sprintf(name, "%s-mode", input); + sprintf(name, "%s-mode", device_get_desc(dev)); return (OF_getprop(options, name, mode, len) != -1); } else return (1); diff --git a/sys/dev/zs/zs_sbus.c b/sys/dev/zs/zs_sbus.c index a3e3ddfcd880..01b76f370d8b 100644 --- a/sys/dev/zs/zs_sbus.c +++ b/sys/dev/zs/zs_sbus.c @@ -258,12 +258,15 @@ zstty_console(device_t dev, char *mode, int len) OF_getprop(options, "input-device", input, sizeof(input)) == -1 || OF_getprop(options, "output-device", output, sizeof(output)) == -1) return (0); - if (sbus_get_node(parent) == OF_instance_to_package(stdin) && - sbus_get_node(parent) == OF_instance_to_package(stdout) && - strcmp(input, device_get_desc(dev)) == 0 && - strcmp(output, device_get_desc(dev)) == 0) { + if (sbus_get_node(parent) != OF_instance_to_package(stdin) || + sbus_get_node(parent) != OF_instance_to_package(stdout)) + return (0); + if ((strcmp(input, device_get_desc(dev)) == 0 && + strcmp(output, device_get_desc(dev)) == 0) || + (strcmp(input, "keyboard") == 0 && strcmp(output, "screen") == 0 && + (device_get_unit(dev) & 1) == 0 && !zstty_keyboard(dev))) { if (mode != NULL) { - sprintf(name, "%s-mode", input); + sprintf(name, "%s-mode", device_get_desc(dev)); return (OF_getprop(options, name, mode, len) != -1); } else return (1); |