summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2007-12-21 16:19:43 +0000
committerkettenis <kettenis@openbsd.org>2007-12-21 16:19:43 +0000
commit39ee68e07052a0a38c76b6d94bf1847cbebf5e83 (patch)
treec237d18cb620421be6128e82a61a5ccd5ce2f69b
parentDon't use getpropstring to get the CPU model name; it's evil. Instead, rely on (diff)
downloadwireguard-openbsd-39ee68e07052a0a38c76b6d94bf1847cbebf5e83.tar.xz
wireguard-openbsd-39ee68e07052a0a38c76b6d94bf1847cbebf5e83.zip
Add a hack to discover all devices on (some) K-class servers.
-rw-r--r--sys/arch/hppa/dev/uturn.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/arch/hppa/dev/uturn.c b/sys/arch/hppa/dev/uturn.c
index a64174973a3..2e37d5b4fea 100644
--- a/sys/arch/hppa/dev/uturn.c
+++ b/sys/arch/hppa/dev/uturn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uturn.c,v 1.3 2005/04/07 00:21:51 mickey Exp $ */
+/* $OpenBSD: uturn.c,v 1.4 2007/12/21 16:19:43 kettenis Exp $ */
/*
* Copyright (c) 2004 Michael Shalayeff
@@ -92,6 +92,7 @@ uturnattach(parent, self, aux)
struct confargs *ca = aux, nca;
struct uturn_softc *sc = (struct uturn_softc *)self;
bus_space_handle_t ioh;
+ hppa_hpa_t hpa;
if (bus_space_map(ca->ca_iot, ca->ca_hpa, IOMOD_HPASIZE, 0, &ioh)) {
printf(": can't map IO space\n");
@@ -109,4 +110,17 @@ uturnattach(parent, self, aux)
nca = *ca; /* clone from us */
nca.ca_hpamask = HPPA_IOBEGIN;
pdc_scanbus(self, &nca, MAXMODBUS, 0);
+
+ /* XXX On some machines, PDC doesn't tell us about all devices. */
+ switch (cpu_hvers) {
+ case HPPA_BOARD_HP809:
+ case HPPA_BOARD_HP819:
+ case HPPA_BOARD_HP839:
+ case HPPA_BOARD_HP859:
+ hpa = ((struct iomod *)ioh)->io_io_low << 16;
+ pdc_scanbus(self, &nca, MAXMODBUS, hpa);
+ break;
+ default:
+ break;
+ }
}