Index: stable/9/sys/dev/ipmi/ipmi_isa.c =================================================================== --- stable/9/sys/dev/ipmi/ipmi_isa.c (revision 287433) +++ stable/9/sys/dev/ipmi/ipmi_isa.c (revision 287434) @@ -1,286 +1,286 @@ /*- * Copyright (c) 2006 IronPort Systems Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include #include #include #ifdef LOCAL_MODULE #include #include #else #include #include #endif static void ipmi_isa_identify(driver_t *driver, device_t parent) { struct ipmi_get_info info; uint32_t devid; if (ipmi_smbios_identify(&info) && info.iface_type != SSIF_MODE && device_find_child(parent, "ipmi", -1) == NULL) { /* * XXX: Hack alert. On some broken systems, the IPMI * interface is described via SMBIOS, but the actual * IO resource is in a PCI device BAR, so we have to let * the PCI device attach ipmi instead. In that case don't * create an isa ipmi device. For now we hardcode the list * of bus, device, function tuples. */ devid = pci_cfgregread(0, 4, 2, PCIR_DEVVENDOR, 4); if (devid != 0xffffffff && ipmi_pci_match(devid & 0xffff, devid >> 16) != NULL) return; BUS_ADD_CHILD(parent, 0, "ipmi", -1); } } static int ipmi_isa_probe(device_t dev) { + /* + * Give other drivers precedence. Unfortunately, this doesn't + * work if we have an SMBIOS table that duplicates a PCI device + * that's later on the bus than the PCI-ISA bridge. + */ + if (ipmi_attached) + return (ENXIO); + /* Skip any PNP devices. */ if (isa_get_logicalid(dev) != 0) return (ENXIO); device_set_desc(dev, "IPMI System Interface"); return (BUS_PROBE_DEFAULT); } static int ipmi_hint_identify(device_t dev, struct ipmi_get_info *info) { const char *mode, *name; int i, unit, val; /* We require at least a "mode" hint. */ name = device_get_name(dev); unit = device_get_unit(dev); if (resource_string_value(name, unit, "mode", &mode) != 0) return (0); /* Set the mode and default I/O resources for each mode. */ bzero(info, sizeof(struct ipmi_get_info)); if (strcasecmp(mode, "KCS") == 0) { info->iface_type = KCS_MODE; info->address = 0xca2; info->io_mode = 1; info->offset = 1; } else if (strcasecmp(mode, "SMIC") == 0) { info->iface_type = SMIC_MODE; info->address = 0xca9; info->io_mode = 1; info->offset = 1; } else if (strcasecmp(mode, "BT") == 0) { info->iface_type = BT_MODE; info->address = 0xe4; info->io_mode = 1; info->offset = 1; } else { device_printf(dev, "Invalid mode %s\n", mode); return (0); } /* * Kill any resources that isahint.c might have setup for us * since it will conflict with how we do resources. */ for (i = 0; i < 2; i++) { bus_delete_resource(dev, SYS_RES_MEMORY, i); bus_delete_resource(dev, SYS_RES_IOPORT, i); } /* Allow the I/O address to be overriden via hints. */ if (resource_int_value(name, unit, "port", &val) == 0 && val != 0) { info->address = val; info->io_mode = 1; } else if (resource_int_value(name, unit, "maddr", &val) == 0 && val != 0) { info->address = val; info->io_mode = 0; } /* Allow the spacing to be overriden. */ if (resource_int_value(name, unit, "spacing", &val) == 0) { switch (val) { case 8: info->offset = 1; break; case 16: info->offset = 2; break; case 32: info->offset = 4; break; default: device_printf(dev, "Invalid register spacing\n"); return (0); } } return (1); } static int ipmi_isa_attach(device_t dev) { struct ipmi_softc *sc = device_get_softc(dev); struct ipmi_get_info info; const char *mode; int count, error, i, type; /* * Pull info out of the SMBIOS table. If that doesn't work, use * hints to enumerate a device. */ if (!ipmi_smbios_identify(&info) && !ipmi_hint_identify(dev, &info)) return (ENXIO); - - /* - * Give other drivers precedence. Unfortunately, this doesn't - * work if we have an SMBIOS table that duplicates a PCI device - * that's later on the bus than the PCI-ISA bridge. - */ - if (ipmi_attached) - return (EBUSY); switch (info.iface_type) { case KCS_MODE: count = 2; mode = "KCS"; break; case SMIC_MODE: count = 3; mode = "SMIC"; break; case BT_MODE: device_printf(dev, "BT mode is unsupported\n"); return (ENXIO); default: return (ENXIO); } error = 0; sc->ipmi_dev = dev; device_printf(dev, "%s mode found at %s 0x%jx alignment 0x%x on %s\n", mode, info.io_mode ? "io" : "mem", (uintmax_t)info.address, info.offset, device_get_name(device_get_parent(dev))); if (info.io_mode) type = SYS_RES_IOPORT; else type = SYS_RES_MEMORY; sc->ipmi_io_type = type; sc->ipmi_io_spacing = info.offset; if (info.offset == 1) { sc->ipmi_io_rid = 0; sc->ipmi_io_res[0] = bus_alloc_resource(dev, type, &sc->ipmi_io_rid, info.address, info.address + count - 1, count, RF_ACTIVE); if (sc->ipmi_io_res[0] == NULL) { device_printf(dev, "couldn't configure I/O resource\n"); return (ENXIO); } } else { for (i = 0; i < count; i++) { sc->ipmi_io_rid = i; sc->ipmi_io_res[i] = bus_alloc_resource(dev, type, &sc->ipmi_io_rid, info.address + i * info.offset, info.address + i * info.offset, 1, RF_ACTIVE); if (sc->ipmi_io_res[i] == NULL) { device_printf(dev, "couldn't configure I/O resource\n"); error = ENXIO; sc->ipmi_io_rid = 0; goto bad; } } sc->ipmi_io_rid = 0; } if (info.irq != 0) { sc->ipmi_irq_rid = 0; sc->ipmi_irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->ipmi_irq_rid, info.irq, info.irq, 1, RF_SHAREABLE | RF_ACTIVE); } switch (info.iface_type) { case KCS_MODE: error = ipmi_kcs_attach(sc); if (error) goto bad; break; case SMIC_MODE: error = ipmi_smic_attach(sc); if (error) goto bad; break; } error = ipmi_attach(dev); if (error) goto bad; return (0); bad: ipmi_release_resources(dev); return (error); } static device_method_t ipmi_methods[] = { /* Device interface */ DEVMETHOD(device_identify, ipmi_isa_identify), DEVMETHOD(device_probe, ipmi_isa_probe), DEVMETHOD(device_attach, ipmi_isa_attach), DEVMETHOD(device_detach, ipmi_detach), { 0, 0 } }; static driver_t ipmi_isa_driver = { "ipmi", ipmi_methods, sizeof(struct ipmi_softc), }; DRIVER_MODULE(ipmi_isa, isa, ipmi_isa_driver, ipmi_devclass, 0, 0); Index: stable/9/sys/dev/ipmi/ipmi_kcs.c =================================================================== --- stable/9/sys/dev/ipmi/ipmi_kcs.c (revision 287433) +++ stable/9/sys/dev/ipmi/ipmi_kcs.c (revision 287434) @@ -1,640 +1,642 @@ /*- * Copyright (c) 2006 IronPort Systems Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include #ifdef LOCAL_MODULE #include #include #else #include #include #endif static void kcs_clear_obf(struct ipmi_softc *, int); static void kcs_error(struct ipmi_softc *); static int kcs_wait_for_ibf(struct ipmi_softc *, int); static int kcs_wait_for_obf(struct ipmi_softc *, int); static int kcs_wait_for_ibf(struct ipmi_softc *sc, int state) { int status, start = ticks; status = INB(sc, KCS_CTL_STS); if (state == 0) { /* WAIT FOR IBF = 0 */ while (ticks - start < MAX_TIMEOUT && status & KCS_STATUS_IBF) { DELAY(100); status = INB(sc, KCS_CTL_STS); } } else { /* WAIT FOR IBF = 1 */ while (ticks - start < MAX_TIMEOUT && !(status & KCS_STATUS_IBF)) { DELAY(100); status = INB(sc, KCS_CTL_STS); } } return (status); } static int kcs_wait_for_obf(struct ipmi_softc *sc, int state) { int status, start = ticks; status = INB(sc, KCS_CTL_STS); if (state == 0) { /* WAIT FOR OBF = 0 */ while (ticks - start < MAX_TIMEOUT && status & KCS_STATUS_OBF) { DELAY(100); status = INB(sc, KCS_CTL_STS); } } else { /* WAIT FOR OBF = 1 */ while (ticks - start < MAX_TIMEOUT && !(status & KCS_STATUS_OBF)) { DELAY(100); status = INB(sc, KCS_CTL_STS); } } return (status); } static void kcs_clear_obf(struct ipmi_softc *sc, int status) { int data; /* Clear OBF */ if (status & KCS_STATUS_OBF) { data = INB(sc, KCS_DATA); } } static void kcs_error(struct ipmi_softc *sc) { int retry, status; u_char data; for (retry = 0; retry < 2; retry++) { /* Wait for IBF = 0 */ status = kcs_wait_for_ibf(sc, 0); /* ABORT */ OUTB(sc, KCS_CTL_STS, KCS_CONTROL_GET_STATUS_ABORT); /* Wait for IBF = 0 */ status = kcs_wait_for_ibf(sc, 0); /* Clear OBF */ kcs_clear_obf(sc, status); if (status & KCS_STATUS_OBF) { data = INB(sc, KCS_DATA); if (data != 0) device_printf(sc->ipmi_dev, "KCS Error Data %02x\n", data); } /* 0x00 to DATA_IN */ OUTB(sc, KCS_DATA, 0x00); /* Wait for IBF = 0 */ status = kcs_wait_for_ibf(sc, 0); if (KCS_STATUS_STATE(status) == KCS_STATUS_STATE_READ) { /* Wait for OBF = 1 */ status = kcs_wait_for_obf(sc, 1); /* Read error status */ data = INB(sc, KCS_DATA); if (data != 0) device_printf(sc->ipmi_dev, "KCS error: %02x\n", data); /* Write READ into Data_in */ OUTB(sc, KCS_DATA, KCS_DATA_IN_READ); /* Wait for IBF = 0 */ status = kcs_wait_for_ibf(sc, 0); } /* IDLE STATE */ if (KCS_STATUS_STATE(status) == KCS_STATUS_STATE_IDLE) { /* Wait for OBF = 1 */ status = kcs_wait_for_obf(sc, 1); /* Clear OBF */ kcs_clear_obf(sc, status); return; } } device_printf(sc->ipmi_dev, "KCS: Error retry exhausted\n"); } /* * Start to write a request. Waits for IBF to clear and then sends the * WR_START command. */ static int kcs_start_write(struct ipmi_softc *sc) { int retry, status; for (retry = 0; retry < 10; retry++) { /* Wait for IBF = 0 */ status = kcs_wait_for_ibf(sc, 0); if (status & KCS_STATUS_IBF) return (0); /* Clear OBF */ kcs_clear_obf(sc, status); /* Write start to command */ OUTB(sc, KCS_CTL_STS, KCS_CONTROL_WRITE_START); /* Wait for IBF = 0 */ status = kcs_wait_for_ibf(sc, 0); if (status & KCS_STATUS_IBF) return (0); if (KCS_STATUS_STATE(status) == KCS_STATUS_STATE_WRITE) break; DELAY(1000000); } if (KCS_STATUS_STATE(status) != KCS_STATUS_STATE_WRITE) /* error state */ return (0); /* Clear OBF */ kcs_clear_obf(sc, status); return (1); } /* * Write a byte of the request message, excluding the last byte of the * message which requires special handling. */ static int kcs_write_byte(struct ipmi_softc *sc, u_char data) { int status; /* Data to Data */ OUTB(sc, KCS_DATA, data); /* Wait for IBF = 0 */ status = kcs_wait_for_ibf(sc, 0); if (status & KCS_STATUS_IBF) return (0); if (KCS_STATUS_STATE(status) != KCS_STATUS_STATE_WRITE) return (0); /* Clear OBF */ kcs_clear_obf(sc, status); return (1); } /* * Write the last byte of a request message. */ static int kcs_write_last_byte(struct ipmi_softc *sc, u_char data) { int status; /* Write end to command */ OUTB(sc, KCS_CTL_STS, KCS_CONTROL_WRITE_END); /* Wait for IBF = 0 */ status = kcs_wait_for_ibf(sc, 0); if (status & KCS_STATUS_IBF) return (0); if (KCS_STATUS_STATE(status) != KCS_STATUS_STATE_WRITE) /* error state */ return (0); /* Clear OBF */ kcs_clear_obf(sc, status); /* Send data byte to DATA. */ OUTB(sc, KCS_DATA, data); return (1); } /* * Read one byte of the reply message. */ static int kcs_read_byte(struct ipmi_softc *sc, u_char *data) { int status; u_char dummy; /* Wait for IBF = 0 */ status = kcs_wait_for_ibf(sc, 0); /* Read State */ if (KCS_STATUS_STATE(status) == KCS_STATUS_STATE_READ) { /* Wait for OBF = 1 */ status = kcs_wait_for_obf(sc, 1); if ((status & KCS_STATUS_OBF) == 0) return (0); /* Read Data_out */ *data = INB(sc, KCS_DATA); /* Write READ into Data_in */ OUTB(sc, KCS_DATA, KCS_DATA_IN_READ); return (1); } /* Idle State */ if (KCS_STATUS_STATE(status) == KCS_STATUS_STATE_IDLE) { /* Wait for OBF = 1*/ status = kcs_wait_for_obf(sc, 1); if ((status & KCS_STATUS_OBF) == 0) return (0); /* Read Dummy */ dummy = INB(sc, KCS_DATA); return (2); } /* Error State */ return (0); } /* * Send a request message and collect the reply. Returns true if we * succeed. */ static int kcs_polled_request(struct ipmi_softc *sc, struct ipmi_request *req) { u_char *cp, data; int i, state; IPMI_IO_LOCK(sc); /* Send the request. */ if (!kcs_start_write(sc)) { device_printf(sc->ipmi_dev, "KCS: Failed to start write\n"); goto fail; } #ifdef KCS_DEBUG device_printf(sc->ipmi_dev, "KCS: WRITE_START... ok\n"); #endif if (!kcs_write_byte(sc, req->ir_addr)) { device_printf(sc->ipmi_dev, "KCS: Failed to write address\n"); goto fail; } #ifdef KCS_DEBUG device_printf(sc->ipmi_dev, "KCS: Wrote address: %02x\n", req->ir_addr); #endif if (req->ir_requestlen == 0) { if (!kcs_write_last_byte(sc, req->ir_command)) { device_printf(sc->ipmi_dev, "KCS: Failed to write command\n"); goto fail; } #ifdef KCS_DEBUG device_printf(sc->ipmi_dev, "KCS: Wrote command: %02x\n", req->ir_command); #endif } else { if (!kcs_write_byte(sc, req->ir_command)) { device_printf(sc->ipmi_dev, "KCS: Failed to write command\n"); goto fail; } #ifdef KCS_DEBUG device_printf(sc->ipmi_dev, "KCS: Wrote command: %02x\n", req->ir_command); #endif cp = req->ir_request; for (i = 0; i < req->ir_requestlen - 1; i++) { if (!kcs_write_byte(sc, *cp++)) { device_printf(sc->ipmi_dev, "KCS: Failed to write data byte %d\n", i + 1); goto fail; } #ifdef KCS_DEBUG device_printf(sc->ipmi_dev, "KCS: Wrote data: %02x\n", cp[-1]); #endif } if (!kcs_write_last_byte(sc, *cp)) { device_printf(sc->ipmi_dev, "KCS: Failed to write last dta byte\n"); goto fail; } #ifdef KCS_DEBUG device_printf(sc->ipmi_dev, "KCS: Wrote last data: %02x\n", *cp); #endif } /* Read the reply. First, read the NetFn/LUN. */ if (kcs_read_byte(sc, &data) != 1) { device_printf(sc->ipmi_dev, "KCS: Failed to read address\n"); goto fail; } #ifdef KCS_DEBUG device_printf(sc->ipmi_dev, "KCS: Read address: %02x\n", data); #endif if (data != IPMI_REPLY_ADDR(req->ir_addr)) { device_printf(sc->ipmi_dev, "KCS: Reply address mismatch\n"); goto fail; } /* Next we read the command. */ if (kcs_read_byte(sc, &data) != 1) { device_printf(sc->ipmi_dev, "KCS: Failed to read command\n"); goto fail; } #ifdef KCS_DEBUG device_printf(sc->ipmi_dev, "KCS: Read command: %02x\n", data); #endif if (data != req->ir_command) { device_printf(sc->ipmi_dev, "KCS: Command mismatch\n"); goto fail; } /* Next we read the completion code. */ if (kcs_read_byte(sc, &req->ir_compcode) != 1) { device_printf(sc->ipmi_dev, "KCS: Failed to read completion code\n"); goto fail; } #ifdef KCS_DEBUG device_printf(sc->ipmi_dev, "KCS: Read completion code: %02x\n", req->ir_compcode); #endif /* Finally, read the reply from the BMC. */ i = 0; for (;;) { state = kcs_read_byte(sc, &data); if (state == 0) { device_printf(sc->ipmi_dev, "KCS: Read failed on byte %d\n", i + 1); goto fail; } if (state == 2) break; if (i < req->ir_replybuflen) { req->ir_reply[i] = data; #ifdef KCS_DEBUG device_printf(sc->ipmi_dev, "KCS: Read data %02x\n", data); } else { device_printf(sc->ipmi_dev, "KCS: Read short %02x byte %d\n", data, i + 1); #endif } i++; } IPMI_IO_UNLOCK(sc); req->ir_replylen = i; #ifdef KCS_DEBUG device_printf(sc->ipmi_dev, "KCS: READ finished (%d bytes)\n", i); if (req->ir_replybuflen < i) #else if (req->ir_replybuflen < i && req->ir_replybuflen != 0) #endif device_printf(sc->ipmi_dev, "KCS: Read short: %zd buffer, %d actual\n", req->ir_replybuflen, i); return (1); fail: kcs_error(sc); IPMI_IO_UNLOCK(sc); return (0); } static void kcs_loop(void *arg) { struct ipmi_softc *sc = arg; struct ipmi_request *req; int i, ok; IPMI_LOCK(sc); while ((req = ipmi_dequeue_request(sc)) != NULL) { + IPMI_UNLOCK(sc); ok = 0; for (i = 0; i < 3 && !ok; i++) ok = kcs_polled_request(sc, req); if (ok) req->ir_error = 0; else req->ir_error = EIO; + IPMI_LOCK(sc); ipmi_complete_request(sc, req); } IPMI_UNLOCK(sc); kproc_exit(0); } static int kcs_startup(struct ipmi_softc *sc) { return (kproc_create(kcs_loop, sc, &sc->ipmi_kthread, 0, 0, "%s: kcs", device_get_nameunit(sc->ipmi_dev))); } static int kcs_driver_request(struct ipmi_softc *sc, struct ipmi_request *req, int timo) { int i, ok; ok = 0; for (i = 0; i < 3 && !ok; i++) ok = kcs_polled_request(sc, req); if (ok) req->ir_error = 0; else req->ir_error = EIO; return (req->ir_error); } int ipmi_kcs_attach(struct ipmi_softc *sc) { int status; /* Setup function pointers. */ sc->ipmi_startup = kcs_startup; sc->ipmi_enqueue_request = ipmi_polled_enqueue_request; sc->ipmi_driver_request = kcs_driver_request; /* See if we can talk to the controller. */ status = INB(sc, KCS_CTL_STS); if (status == 0xff) { device_printf(sc->ipmi_dev, "couldn't find it\n"); return (ENXIO); } #ifdef KCS_DEBUG device_printf(sc->ipmi_dev, "KCS: initial state: %02x\n", status); #endif if (status & KCS_STATUS_OBF || KCS_STATUS_STATE(status) != KCS_STATUS_STATE_IDLE) kcs_error(sc); return (0); } /* * Determine the alignment automatically for a PCI attachment. In this case, * any unused bytes will return 0x00 when read. We make use of the C/D bit * in the CTL_STS register to try to start a GET_STATUS transaction. When * we write the command, that bit should be set, so we should get a non-zero * value back when we read CTL_STS if the offset we are testing is the CTL_STS * register. */ int ipmi_kcs_probe_align(struct ipmi_softc *sc) { int data, status; sc->ipmi_io_spacing = 1; retry: #ifdef KCS_DEBUG device_printf(sc->ipmi_dev, "Trying KCS align %d... ", sc->ipmi_io_spacing); #endif /* Wait for IBF = 0 */ status = INB(sc, KCS_CTL_STS); while (status & KCS_STATUS_IBF) { DELAY(100); status = INB(sc, KCS_CTL_STS); } OUTB(sc, KCS_CTL_STS, KCS_CONTROL_GET_STATUS_ABORT); /* Wait for IBF = 0 */ status = INB(sc, KCS_CTL_STS); while (status & KCS_STATUS_IBF) { DELAY(100); status = INB(sc, KCS_CTL_STS); } /* If we got 0x00 back, then this must not be the CTL_STS register. */ if (status == 0) { #ifdef KCS_DEBUG printf("failed\n"); #endif sc->ipmi_io_spacing <<= 1; if (sc->ipmi_io_spacing > 4) return (0); goto retry; } #ifdef KCS_DEBUG printf("ok\n"); #endif /* Finish out the transaction. */ /* Clear OBF */ if (status & KCS_STATUS_OBF) data = INB(sc, KCS_DATA); /* 0x00 to DATA_IN */ OUTB(sc, KCS_DATA, 0); /* Wait for IBF = 0 */ status = INB(sc, KCS_CTL_STS); while (status & KCS_STATUS_IBF) { DELAY(100); status = INB(sc, KCS_CTL_STS); } if (KCS_STATUS_STATE(status) == KCS_STATUS_STATE_READ) { /* Wait for IBF = 1 */ while (!(status & KCS_STATUS_OBF)) { DELAY(100); status = INB(sc, KCS_CTL_STS); } /* Read error status. */ data = INB(sc, KCS_DATA); /* Write dummy READ to DATA_IN. */ OUTB(sc, KCS_DATA, KCS_DATA_IN_READ); /* Wait for IBF = 0 */ status = INB(sc, KCS_CTL_STS); while (status & KCS_STATUS_IBF) { DELAY(100); status = INB(sc, KCS_CTL_STS); } } if (KCS_STATUS_STATE(status) == KCS_STATUS_STATE_IDLE) { /* Wait for IBF = 1 */ while (!(status & KCS_STATUS_OBF)) { DELAY(100); status = INB(sc, KCS_CTL_STS); } /* Clear OBF */ if (status & KCS_STATUS_OBF) data = INB(sc, KCS_DATA); } else device_printf(sc->ipmi_dev, "KCS probe: end state %x\n", KCS_STATUS_STATE(status)); return (1); } Index: stable/9/sys/dev/ipmi/ipmi_smic.c =================================================================== --- stable/9/sys/dev/ipmi/ipmi_smic.c (revision 287433) +++ stable/9/sys/dev/ipmi/ipmi_smic.c (revision 287434) @@ -1,429 +1,431 @@ /*- * Copyright (c) 2006 IronPort Systems Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include #include #ifdef LOCAL_MODULE #include #include #else #include #include #endif static void smic_wait_for_tx_okay(struct ipmi_softc *); static void smic_wait_for_rx_okay(struct ipmi_softc *); static void smic_wait_for_not_busy(struct ipmi_softc *); static void smic_set_busy(struct ipmi_softc *); static void smic_wait_for_tx_okay(struct ipmi_softc *sc) { int flags; do { flags = INB(sc, SMIC_FLAGS); } while (!(flags & SMIC_STATUS_TX_RDY)); } static void smic_wait_for_rx_okay(struct ipmi_softc *sc) { int flags; do { flags = INB(sc, SMIC_FLAGS); } while (!(flags & SMIC_STATUS_RX_RDY)); } static void smic_wait_for_not_busy(struct ipmi_softc *sc) { int flags; do { flags = INB(sc, SMIC_FLAGS); } while (flags & SMIC_STATUS_BUSY); } static void smic_set_busy(struct ipmi_softc *sc) { int flags; flags = INB(sc, SMIC_FLAGS); flags |= SMIC_STATUS_BUSY; flags &= ~SMIC_STATUS_RESERVED; OUTB(sc, SMIC_FLAGS, flags); } /* * Start a transfer with a WR_START transaction that sends the NetFn/LUN * address. */ static int smic_start_write(struct ipmi_softc *sc, u_char data) { u_char error, status; smic_wait_for_not_busy(sc); OUTB(sc, SMIC_CTL_STS, SMIC_CC_SMS_WR_START); OUTB(sc, SMIC_DATA, data); smic_set_busy(sc); smic_wait_for_not_busy(sc); status = INB(sc, SMIC_CTL_STS); if (status != SMIC_SC_SMS_WR_START) { error = INB(sc, SMIC_DATA); device_printf(sc->ipmi_dev, "SMIC: Write did not start %02x\n", error); return (0); } return (1); } /* * Write a byte in the middle of the message (either the command or one of * the data bytes) using a WR_NEXT transaction. */ static int smic_write_next(struct ipmi_softc *sc, u_char data) { u_char error, status; smic_wait_for_tx_okay(sc); OUTB(sc, SMIC_CTL_STS, SMIC_CC_SMS_WR_NEXT); OUTB(sc, SMIC_DATA, data); smic_set_busy(sc); smic_wait_for_not_busy(sc); status = INB(sc, SMIC_CTL_STS); if (status != SMIC_SC_SMS_WR_NEXT) { error = INB(sc, SMIC_DATA); device_printf(sc->ipmi_dev, "SMIC: Write did not next %02x\n", error); return (0); } return (1); } /* * Write the last byte of a transfer to end the write phase via a WR_END * transaction. */ static int smic_write_last(struct ipmi_softc *sc, u_char data) { u_char error, status; smic_wait_for_tx_okay(sc); OUTB(sc, SMIC_CTL_STS, SMIC_CC_SMS_WR_END); OUTB(sc, SMIC_DATA, data); smic_set_busy(sc); smic_wait_for_not_busy(sc); status = INB(sc, SMIC_CTL_STS); if (status != SMIC_SC_SMS_WR_END) { error = INB(sc, SMIC_DATA); device_printf(sc->ipmi_dev, "SMIC: Write did not end %02x\n", error); return (0); } return (1); } /* * Start the read phase of a transfer with a RD_START transaction. */ static int smic_start_read(struct ipmi_softc *sc, u_char *data) { u_char error, status; smic_wait_for_not_busy(sc); smic_wait_for_rx_okay(sc); OUTB(sc, SMIC_CTL_STS, SMIC_CC_SMS_RD_START); smic_set_busy(sc); smic_wait_for_not_busy(sc); status = INB(sc, SMIC_CTL_STS); if (status != SMIC_SC_SMS_RD_START) { error = INB(sc, SMIC_DATA); device_printf(sc->ipmi_dev, "SMIC: Read did not start %02x\n", error); return (0); } *data = INB(sc, SMIC_DATA); return (1); } /* * Read a byte via a RD_NEXT transaction. If this was the last byte, return * 2 rather than 1. */ static int smic_read_byte(struct ipmi_softc *sc, u_char *data) { u_char error, status; smic_wait_for_rx_okay(sc); OUTB(sc, SMIC_CTL_STS, SMIC_SC_SMS_RD_NEXT); smic_set_busy(sc); smic_wait_for_not_busy(sc); status = INB(sc, SMIC_CTL_STS); if (status != SMIC_SC_SMS_RD_NEXT && status != SMIC_SC_SMS_RD_END) { error = INB(sc, SMIC_DATA); device_printf(sc->ipmi_dev, "SMIC: Read did not next %02x\n", error); return (0); } *data = INB(sc, SMIC_DATA); if (status == SMIC_SC_SMS_RD_NEXT) return (1); else return (2); } /* Complete a transfer via a RD_END transaction after reading the last byte. */ static int smic_read_end(struct ipmi_softc *sc) { u_char error, status; OUTB(sc, SMIC_CTL_STS, SMIC_CC_SMS_RD_END); smic_set_busy(sc); smic_wait_for_not_busy(sc); status = INB(sc, SMIC_CTL_STS); if (status != SMIC_SC_SMS_RDY) { error = INB(sc, SMIC_DATA); device_printf(sc->ipmi_dev, "SMIC: Read did not end %02x\n", error); return (0); } return (1); } static int smic_polled_request(struct ipmi_softc *sc, struct ipmi_request *req) { u_char *cp, data; int i, state; /* First, start the message with the address. */ if (!smic_start_write(sc, req->ir_addr)) return (0); #ifdef SMIC_DEBUG device_printf(sc->ipmi_dev, "SMIC: WRITE_START address: %02x\n", req->ir_addr); #endif if (req->ir_requestlen == 0) { /* Send the command as the last byte. */ if (!smic_write_last(sc, req->ir_command)) return (0); #ifdef SMIC_DEBUG device_printf(sc->ipmi_dev, "SMIC: Wrote command: %02x\n", req->ir_command); #endif } else { /* Send the command. */ if (!smic_write_next(sc, req->ir_command)) return (0); #ifdef SMIC_DEBUG device_printf(sc->ipmi_dev, "SMIC: Wrote command: %02x\n", req->ir_command); #endif /* Send the payload. */ cp = req->ir_request; for (i = 0; i < req->ir_requestlen - 1; i++) { if (!smic_write_next(sc, *cp++)) return (0); #ifdef SMIC_DEBUG device_printf(sc->ipmi_dev, "SMIC: Wrote data: %02x\n", cp[-1]); #endif } if (!smic_write_last(sc, *cp)) return (0); #ifdef SMIC_DEBUG device_printf(sc->ipmi_dev, "SMIC: Write last data: %02x\n", *cp); #endif } /* Start the read phase by reading the NetFn/LUN. */ if (smic_start_read(sc, &data) != 1) return (0); #ifdef SMIC_DEBUG device_printf(sc->ipmi_dev, "SMIC: Read address: %02x\n", data); #endif if (data != IPMI_REPLY_ADDR(req->ir_addr)) { device_printf(sc->ipmi_dev, "SMIC: Reply address mismatch\n"); return (0); } /* Read the command. */ if (smic_read_byte(sc, &data) != 1) return (0); #ifdef SMIC_DEBUG device_printf(sc->ipmi_dev, "SMIC: Read command: %02x\n", data); #endif if (data != req->ir_command) { device_printf(sc->ipmi_dev, "SMIC: Command mismatch\n"); return (0); } /* Read the completion code. */ state = smic_read_byte(sc, &req->ir_compcode); if (state == 0) return (0); #ifdef SMIC_DEBUG device_printf(sc->ipmi_dev, "SMIC: Read completion code: %02x\n", req->ir_compcode); #endif /* Finally, read the reply from the BMC. */ i = 0; while (state == 1) { state = smic_read_byte(sc, &data); if (state == 0) return (0); if (i < req->ir_replybuflen) { req->ir_reply[i] = data; #ifdef SMIC_DEBUG device_printf(sc->ipmi_dev, "SMIC: Read data: %02x\n", data); } else { device_printf(sc->ipmi_dev, "SMIC: Read short %02x byte %d\n", data, i + 1); #endif } i++; } /* Terminate the transfer. */ if (!smic_read_end(sc)) return (0); req->ir_replylen = i; #ifdef SMIC_DEBUG device_printf(sc->ipmi_dev, "SMIC: READ finished (%d bytes)\n", i); if (req->ir_replybuflen < i) #else if (req->ir_replybuflen < i && req->ir_replybuflen != 0) #endif device_printf(sc->ipmi_dev, "SMIC: Read short: %zd buffer, %d actual\n", req->ir_replybuflen, i); return (1); } static void smic_loop(void *arg) { struct ipmi_softc *sc = arg; struct ipmi_request *req; int i, ok; IPMI_LOCK(sc); while ((req = ipmi_dequeue_request(sc)) != NULL) { + IPMI_UNLOCK(sc); ok = 0; for (i = 0; i < 3 && !ok; i++) { IPMI_IO_LOCK(sc); ok = smic_polled_request(sc, req); IPMI_IO_UNLOCK(sc); } if (ok) req->ir_error = 0; else req->ir_error = EIO; + IPMI_LOCK(sc); ipmi_complete_request(sc, req); } IPMI_UNLOCK(sc); kproc_exit(0); } static int smic_startup(struct ipmi_softc *sc) { return (kproc_create(smic_loop, sc, &sc->ipmi_kthread, 0, 0, "%s: smic", device_get_nameunit(sc->ipmi_dev))); } static int smic_driver_request(struct ipmi_softc *sc, struct ipmi_request *req, int timo) { int i, ok; ok = 0; for (i = 0; i < 3 && !ok; i++) { IPMI_IO_LOCK(sc); ok = smic_polled_request(sc, req); IPMI_IO_UNLOCK(sc); } if (ok) req->ir_error = 0; else req->ir_error = EIO; return (req->ir_error); } int ipmi_smic_attach(struct ipmi_softc *sc) { int flags; /* Setup function pointers. */ sc->ipmi_startup = smic_startup; sc->ipmi_enqueue_request = ipmi_polled_enqueue_request; sc->ipmi_driver_request = smic_driver_request; /* See if we can talk to the controller. */ flags = INB(sc, SMIC_FLAGS); if (flags == 0xff) { device_printf(sc->ipmi_dev, "couldn't find it\n"); return (ENXIO); } #ifdef SMIC_DEBUG device_printf(sc->ipmi_dev, "SMIC: initial state: %02x\n", flags); #endif return (0); } Index: stable/9/sys/dev/ipmi/ipmivars.h =================================================================== --- stable/9/sys/dev/ipmi/ipmivars.h (revision 287433) +++ stable/9/sys/dev/ipmi/ipmivars.h (revision 287434) @@ -1,260 +1,260 @@ /*- * Copyright (c) 2006 IronPort Systems Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef __IPMIVARS_H__ #define __IPMIVARS_H__ struct ipmi_get_info { int iface_type; uint64_t address; int offset; int io_mode; int irq; }; struct ipmi_device; struct ipmi_request { TAILQ_ENTRY(ipmi_request) ir_link; struct ipmi_device *ir_owner; /* Driver uses NULL. */ u_char *ir_request; /* Request is data to send to BMC. */ size_t ir_requestlen; u_char *ir_reply; /* Reply is data read from BMC. */ size_t ir_replybuflen; /* Length of ir_reply[] buffer. */ int ir_replylen; /* Length of reply from BMC. */ int ir_error; long ir_msgid; uint8_t ir_addr; uint8_t ir_command; uint8_t ir_compcode; }; #define MAX_RES 3 #define KCS_DATA 0 #define KCS_CTL_STS 1 #define SMIC_DATA 0 #define SMIC_CTL_STS 1 #define SMIC_FLAGS 2 struct ipmi_softc; /* Per file descriptor data. */ struct ipmi_device { TAILQ_ENTRY(ipmi_device) ipmi_link; TAILQ_HEAD(,ipmi_request) ipmi_completed_requests; struct selinfo ipmi_select; struct ipmi_softc *ipmi_softc; int ipmi_closing; int ipmi_requests; u_char ipmi_address; /* IPMB address. */ u_char ipmi_lun; }; struct ipmi_kcs { }; struct ipmi_smic { }; struct ipmi_ssif { device_t smbus; int smbus_address; }; struct ipmi_softc { device_t ipmi_dev; union { struct ipmi_kcs kcs; struct ipmi_smic smic; struct ipmi_ssif ssif; } _iface; int ipmi_io_rid; int ipmi_io_type; struct mtx ipmi_io_lock; struct resource *ipmi_io_res[MAX_RES]; int ipmi_io_spacing; int ipmi_irq_rid; struct resource *ipmi_irq_res; void *ipmi_irq; int ipmi_detaching; int ipmi_opened; struct cdev *ipmi_cdev; TAILQ_HEAD(,ipmi_request) ipmi_pending_requests; eventhandler_tag ipmi_watchdog_tag; int ipmi_watchdog_active; struct intr_config_hook ipmi_ich; struct mtx ipmi_requests_lock; struct cv ipmi_request_added; struct proc *ipmi_kthread; driver_intr_t *ipmi_intr; int (*ipmi_startup)(struct ipmi_softc *); int (*ipmi_enqueue_request)(struct ipmi_softc *, struct ipmi_request *); int (*ipmi_driver_request)(struct ipmi_softc *, struct ipmi_request *, int); }; #define ipmi_ssif_smbus_address _iface.ssif.smbus_address #define ipmi_ssif_smbus _iface.ssif.smbus struct ipmi_ipmb { u_char foo; }; #define KCS_MODE 0x01 #define SMIC_MODE 0x02 #define BT_MODE 0x03 #define SSIF_MODE 0x04 /* KCS status flags */ #define KCS_STATUS_OBF 0x01 /* Data Out ready from BMC */ #define KCS_STATUS_IBF 0x02 /* Data In from System */ #define KCS_STATUS_SMS_ATN 0x04 /* Ready in RX queue */ #define KCS_STATUS_C_D 0x08 /* Command/Data register write*/ #define KCS_STATUS_OEM1 0x10 #define KCS_STATUS_OEM2 0x20 #define KCS_STATUS_S0 0x40 #define KCS_STATUS_S1 0x80 #define KCS_STATUS_STATE(x) ((x)>>6) #define KCS_STATUS_STATE_IDLE 0x0 #define KCS_STATUS_STATE_READ 0x1 #define KCS_STATUS_STATE_WRITE 0x2 #define KCS_STATUS_STATE_ERROR 0x3 #define KCS_IFACE_STATUS_OK 0x00 #define KCS_IFACE_STATUS_ABORT 0x01 #define KCS_IFACE_STATUS_ILLEGAL 0x02 #define KCS_IFACE_STATUS_LENGTH_ERR 0x06 #define KCS_IFACE_STATUS_UNKNOWN_ERR 0xff /* KCS control codes */ #define KCS_CONTROL_GET_STATUS_ABORT 0x60 #define KCS_CONTROL_WRITE_START 0x61 #define KCS_CONTROL_WRITE_END 0x62 #define KCS_DATA_IN_READ 0x68 /* SMIC status flags */ #define SMIC_STATUS_BUSY 0x01 /* System set and BMC clears it */ #define SMIC_STATUS_SMS_ATN 0x04 /* BMC has a message */ #define SMIC_STATUS_EVT_ATN 0x08 /* Event has been RX */ #define SMIC_STATUS_SMI 0x10 /* asserted SMI */ #define SMIC_STATUS_TX_RDY 0x40 /* Ready to accept WRITE */ #define SMIC_STATUS_RX_RDY 0x80 /* Ready to read */ #define SMIC_STATUS_RESERVED 0x22 /* SMIC control codes */ #define SMIC_CC_SMS_GET_STATUS 0x40 #define SMIC_CC_SMS_WR_START 0x41 #define SMIC_CC_SMS_WR_NEXT 0x42 #define SMIC_CC_SMS_WR_END 0x43 #define SMIC_CC_SMS_RD_START 0x44 #define SMIC_CC_SMS_RD_NEXT 0x45 #define SMIC_CC_SMS_RD_END 0x46 /* SMIC status codes */ #define SMIC_SC_SMS_RDY 0xc0 #define SMIC_SC_SMS_WR_START 0xc1 #define SMIC_SC_SMS_WR_NEXT 0xc2 #define SMIC_SC_SMS_WR_END 0xc3 #define SMIC_SC_SMS_RD_START 0xc4 #define SMIC_SC_SMS_RD_NEXT 0xc5 #define SMIC_SC_SMS_RD_END 0xc6 #define IPMI_ADDR(netfn, lun) ((netfn) << 2 | (lun)) #define IPMI_REPLY_ADDR(addr) ((addr) + 0x4) #define IPMI_LOCK(sc) mtx_lock(&(sc)->ipmi_requests_lock) #define IPMI_UNLOCK(sc) mtx_unlock(&(sc)->ipmi_requests_lock) #define IPMI_LOCK_ASSERT(sc) mtx_assert(&(sc)->ipmi_requests_lock, MA_OWNED) #define IPMI_IO_LOCK(sc) mtx_lock(&(sc)->ipmi_io_lock) #define IPMI_IO_UNLOCK(sc) mtx_unlock(&(sc)->ipmi_io_lock) #define IPMI_IO_LOCK_ASSERT(sc) mtx_assert(&(sc)->ipmi_io_lock, MA_OWNED) #if __FreeBSD_version < 601105 #define bus_read_1(r, o) \ bus_space_read_1(rman_get_bustag(r), rman_get_bushandle(r), (o)) #define bus_write_1(r, o, v) \ bus_space_write_1(rman_get_bustag(r), rman_get_bushandle(r), (o), (v)) #endif /* I/O to a single I/O resource. */ #define INB_SINGLE(sc, x) \ bus_read_1((sc)->ipmi_io_res[0], (sc)->ipmi_io_spacing * (x)) #define OUTB_SINGLE(sc, x, value) \ bus_write_1((sc)->ipmi_io_res[0], (sc)->ipmi_io_spacing * (x), value) /* I/O with each register in its in I/O resource. */ #define INB_MULTIPLE(sc, x) \ bus_read_1((sc)->ipmi_io_res[(x)], 0) #define OUTB_MULTIPLE(sc, x, value) \ bus_write_1((sc)->ipmi_io_res[(x)], 0, value) /* * Determine I/O method based on whether or not we have more than one I/O * resource. */ #define INB(sc, x) \ ((sc)->ipmi_io_res[1] != NULL ? INB_MULTIPLE(sc, x) : INB_SINGLE(sc, x)) #define OUTB(sc, x, value) \ ((sc)->ipmi_io_res[1] != NULL ? OUTB_MULTIPLE(sc, x, value) : \ OUTB_SINGLE(sc, x, value)) -#define MAX_TIMEOUT 3 * hz +#define MAX_TIMEOUT 6 * hz int ipmi_attach(device_t); int ipmi_detach(device_t); void ipmi_release_resources(device_t); /* Manage requests. */ struct ipmi_request *ipmi_alloc_request(struct ipmi_device *, long, uint8_t, uint8_t, size_t, size_t); void ipmi_complete_request(struct ipmi_softc *, struct ipmi_request *); struct ipmi_request *ipmi_dequeue_request(struct ipmi_softc *); void ipmi_free_request(struct ipmi_request *); int ipmi_polled_enqueue_request(struct ipmi_softc *, struct ipmi_request *); int ipmi_submit_driver_request(struct ipmi_softc *, struct ipmi_request *, int); /* Identify BMC interface via SMBIOS. */ int ipmi_smbios_identify(struct ipmi_get_info *); /* Match BMC PCI device listed in SMBIOS. */ const char *ipmi_pci_match(uint16_t, uint16_t); /* Interface attach routines. */ int ipmi_kcs_attach(struct ipmi_softc *); int ipmi_kcs_probe_align(struct ipmi_softc *); int ipmi_smic_attach(struct ipmi_softc *); int ipmi_ssif_attach(struct ipmi_softc *, device_t, int); #ifdef IPMB int ipmi_handle_attn(struct ipmi_softc *); #endif extern devclass_t ipmi_devclass; extern int ipmi_attached; #endif /* !__IPMIVARS_H__ */ Index: stable/9/sys/dev =================================================================== --- stable/9/sys/dev (revision 287433) +++ stable/9/sys/dev (revision 287434) Property changes on: stable/9/sys/dev ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head/sys/dev:r248705,253812-253813 Index: stable/9/sys =================================================================== --- stable/9/sys (revision 287433) +++ stable/9/sys (revision 287434) Property changes on: stable/9/sys ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head/sys:r248705,253812-253813