summaryrefslogtreecommitdiff
path: root/sys/dev/hil/hilid.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-01-09 23:49:37 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-01-09 23:49:37 +0000
commitbfd6591ddaf23c5c5304ceaf411ccff7aa6d774f (patch)
tree639e377c947d8a6c625ea98de435264dddd875dd /sys/dev/hil/hilid.c
parente4a349ba16ee91528e81919960e13404a419b3ad (diff)
Allow send_hil{,dev}_cmd to return failure, and handle this where
applicable. During device probe, if a device does not answer commands, display a warning message. This apparently happens on hp300 when the console is configured as remote (i.e. serial console). Unplugging and replugging the device works fine afterwards...
Diffstat (limited to 'sys/dev/hil/hilid.c')
-rw-r--r--sys/dev/hil/hilid.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/hil/hilid.c b/sys/dev/hil/hilid.c
index 90ddbb22db5..ad65909d55d 100644
--- a/sys/dev/hil/hilid.c
+++ b/sys/dev/hil/hilid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hilid.c,v 1.3 2003/12/20 22:53:56 miod Exp $ */
+/* $OpenBSD: hilid.c,v 1.4 2005/01/09 23:49:36 miod Exp $ */
/*
* Copyright (c) 2003, Miodrag Vallat.
* All rights reserved.
@@ -85,14 +85,15 @@ hilidattach(struct device *parent, struct device *self, void *aux)
bzero(sc->sc_id, sizeof(sc->sc_id));
len = sizeof(sc->sc_id);
- send_hildev_cmd((struct hildev_softc *)sc,
- HIL_SECURITY, sc->sc_id, &len);
-
printf("%s: security code", self->dv_xname);
- for (i = 0; i < sizeof(sc->sc_id); i++)
- printf(" %02x", sc->sc_id[i]);
- printf("\n");
+ if (send_hildev_cmd((struct hildev_softc *)sc,
+ HIL_SECURITY, sc->sc_id, &len) == 0) {
+ for (i = 0; i < sizeof(sc->sc_id); i++)
+ printf(" %02x", sc->sc_id[i]);
+ printf("\n");
+ } else
+ printf(" unavailable\n");
}
int