summaryrefslogtreecommitdiff
path: root/sys/dev/ipmi.c
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2005-12-13 03:36:13 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2005-12-13 03:36:13 +0000
commit1fe7088dced4cc748d251d49bb103ae7f9adb929 (patch)
tree04d32d8b7d763ced9d9b0b85c500f7b7df207117 /sys/dev/ipmi.c
parent5683571cc4899d549f1ef435095f7a5cd23f47f9 (diff)
Don't continue to poke ipmi registers if the ID command fails.
ok jordan@
Diffstat (limited to 'sys/dev/ipmi.c')
-rw-r--r--sys/dev/ipmi.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/dev/ipmi.c b/sys/dev/ipmi.c
index 0d5ec42c72f..3d85af239ef 100644
--- a/sys/dev/ipmi.c
+++ b/sys/dev/ipmi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipmi.c,v 1.21 2005/11/30 18:02:53 deraadt Exp $ */
+/* $OpenBSD: ipmi.c,v 1.22 2005/12/13 03:36:12 marco Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave
@@ -1642,8 +1642,16 @@ ipmi_attach(struct device *parent, struct device *self, void *aux)
ipmi_map_regs(sc, ia);
/* Identify BMC device */
- ipmi_sendcmd(sc, BMC_SA, 0, APP_NETFN, APP_GET_DEVICE_ID, 0, NULL);
- ipmi_recvcmd(sc, sizeof(cmd), &len, cmd);
+ if (ipmi_sendcmd(sc, BMC_SA, 0, APP_NETFN, APP_GET_DEVICE_ID, 0, NULL)){
+ printf("%s: unable to send get device id command\n",
+ DEVNAME(sc));
+ return;
+ }
+ if (ipmi_recvcmd(sc, sizeof(cmd), &len, cmd)) {
+ printf("%s: unable to retrieve device id\n",
+ DEVNAME(sc));
+ return;
+ }
dbg_dump(1, "bmc data", len, cmd);
/* Scan SDRs, add sensors */