Allow defaulting the console to ttya when it sets to screen and keyboard

in the prom but no keyboard is plugged in.
This commit is contained in:
Jake Burkholder 2003-01-26 01:56:20 +00:00
parent 402062e80c
commit 6c5b0e25a0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=109844
2 changed files with 16 additions and 10 deletions

View File

@ -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);

View File

@ -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);