summaryrefslogtreecommitdiff
path: root/sys/dev/ipmi.c
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2005-10-18 23:08:25 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2005-10-18 23:08:25 +0000
commit8ed1e559b7016d26aeaf4f1b64bcb4db1fe0a9da (patch)
tree13d65d85c3f81f509f74fb306f23eb398765f3fb /sys/dev/ipmi.c
parent917fcc1f9729af7aa5b0168acffb905f92d6bf77 (diff)
Scan SMBIOS before calling config_attach() to prevent unnecessary kernel print.
Written with jordan@ help. ok deraadt@
Diffstat (limited to 'sys/dev/ipmi.c')
-rw-r--r--sys/dev/ipmi.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/sys/dev/ipmi.c b/sys/dev/ipmi.c
index 0b0bfc69318..5ba7912756a 100644
--- a/sys/dev/ipmi.c
+++ b/sys/dev/ipmi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipmi.c,v 1.4 2005/10/17 23:54:21 deraadt Exp $ */
+/* $OpenBSD: ipmi.c,v 1.5 2005/10/18 23:08:23 marco Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave
@@ -124,7 +124,7 @@ int ipmi_sendcmd(struct ipmi_softc *, int, int, int, int, int, const void*);
int ipmi_recvcmd(struct ipmi_softc *, int, int *, void *);
int ipmi_intr(void *);
-int ipmi_probe(struct device *, void *, void *);
+int ipmi_match(struct device *, void *, void *);
void ipmi_attach(struct device *, struct device *, void *);
long ipow(long, int);
@@ -678,7 +678,7 @@ typedef struct {
} ipmi_bmc_response_t;
struct cfattach ipmi_ca = {
- sizeof(struct ipmi_softc), ipmi_probe, ipmi_attach
+ sizeof(struct ipmi_softc), ipmi_match, ipmi_attach
};
struct cfdriver ipmi_cd = {
@@ -1473,26 +1473,40 @@ ipmi_unmap_regs(struct ipmi_softc *sc, struct ipmi_attach_args *ia)
}
int
-ipmi_probe(struct device *parent, void *match, void *aux)
+ipmi_probe(void *aux)
{
- struct ipmi_softc sc;
struct ipmi_attach_args *ia = aux;
- struct cfdata *cf = match;
-
- if (strcmp(ia->iaa_name, cf->cf_driver->cd_name))
- return (0);
if (scan_smbios(SMBIOS_TYPE_IPMI, smbios_ipmi_probe, ia) == 0) {
dmd_ipmi_t *pipmi;
pipmi = (dmd_ipmi_t *)scan_sig(0xC0000L, 0xFFFFFL, 16, 4,
"IPMI");
- if (pipmi == NULL)
+ if (pipmi == NULL) {
+ /* no IPMI found */
return (0);
+ }
+ /* we have an IPMI signature, fill in attach arg structure */
ia->iaa_if_type = pipmi->dmd_if_type;
ia->iaa_if_rev = pipmi->dmd_if_rev;
+
+ return (1);
}
+
+ return (1);
+}
+
+int
+ipmi_match(struct device *parent, void *match, void *aux)
+{
+ struct ipmi_softc sc;
+ struct ipmi_attach_args *ia = aux;
+ struct cfdata *cf = match;
+
+ if (strcmp(ia->iaa_name, cf->cf_driver->cd_name))
+ return (0);
+
/* Map registers */
if (ipmi_map_regs(&sc, ia) == 0) {
sc.sc_if->probe(&sc);