diff options
author | imp <imp@FreeBSD.org> | 2005-08-01 07:09:15 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-08-01 07:09:15 +0000 |
commit | e47bf14064592ba2cfd5f5fed30cac0dfab72293 (patch) | |
tree | df5be478587db74121adacc99a9e34816545b8f2 /sys/dev/eisa | |
parent | 1c04aa97aa46439eb55179c1331c60bd9f42cb43 (diff) | |
download | FreeBSD-src-e47bf14064592ba2cfd5f5fed30cac0dfab72293.zip FreeBSD-src-e47bf14064592ba2cfd5f5fed30cac0dfab72293.tar.gz |
Make the eisa probe messages just like all the others in the system.
Make the eisa no match printf closer to pci.
Diffstat (limited to 'sys/dev/eisa')
-rw-r--r-- | sys/dev/eisa/eisaconf.c | 84 |
1 files changed, 18 insertions, 66 deletions
diff --git a/sys/dev/eisa/eisaconf.c b/sys/dev/eisa/eisaconf.c index ce0aba6..2441af5 100644 --- a/sys/dev/eisa/eisaconf.c +++ b/sys/dev/eisa/eisaconf.c @@ -93,10 +93,9 @@ TUNABLE_INT("hw.eisa_slots", &num_eisa_slots); static devclass_t eisa_devclass; static int eisa_probe_slot(int slot, eisa_id_t *eisa_id); -static void eisa_reg_print (device_t, char *, char *, int *); -static struct irq_node * eisa_find_irq(struct eisa_device *e_dev, int rid); -static struct resvaddr * eisa_find_maddr(struct eisa_device *e_dev, int rid); -static struct resvaddr * eisa_find_ioaddr(struct eisa_device *e_dev, int rid); +static struct irq_node *eisa_find_irq(struct eisa_device *e_dev, int rid); +static struct resvaddr *eisa_find_maddr(struct eisa_device *e_dev, int rid); +static struct resvaddr *eisa_find_ioaddr(struct eisa_device *e_dev, int rid); static int mainboard_probe(device_t dev) @@ -231,94 +230,47 @@ eisa_probe_nomatch(device_t dev, device_t child) u_int32_t eisa_id = eisa_get_id(child); u_int8_t slot = eisa_get_slot(child); - device_printf(dev, "unknown card %c%c%c%03x%01x (0x%08x) at slot %d\n", + device_printf(dev, "%c%c%c%03x%01x (0x%08x) at slot %d (no driver attached)\n", EISA_MFCTR_CHAR0(eisa_id), EISA_MFCTR_CHAR1(eisa_id), EISA_MFCTR_CHAR2(eisa_id), EISA_PRODUCT_ID(eisa_id), EISA_REVISION_ID(eisa_id), eisa_id, slot); return; } -static void -eisa_reg_print (device_t dev, char *string, char *separator, int *column) -{ - int length = strlen(string); - - length += (separator ? 2 : 1); - - if (((*column) + length) >= MAX_COL) { - printf("\n"); - (*column) = 0; - } else if ((*column) != 0) { - if (separator) { - printf("%c", *separator); - (*column)++; - } - printf(" "); - (*column)++; - } - - if ((*column) == 0) - (*column) += device_printf(dev, "%s", string); - else - (*column) += printf("%s", string); - - return; -} - static int eisa_print_child(device_t dev, device_t child) { - char buf[81]; struct eisa_device * e_dev = device_get_ivars(child); int rid; struct irq_node * irq; struct resvaddr * resv; - char separator = ','; - int column = 0; int retval = 0; - if (device_get_desc(child)) { - snprintf(buf, sizeof(buf), "<%s>", device_get_desc(child)); - eisa_reg_print(child, buf, NULL, &column); - } - + retval += bus_print_child_header(dev, child); rid = 0; while ((resv = eisa_find_ioaddr(e_dev, rid++))) { if (resv->size == 1 || (resv->flags & RESVADDR_BITMASK)) - snprintf(buf, sizeof(buf), "%s%lx", - rid == 1 ? "at 0x" : "0x", resv->addr); + retval += printf("%s%lx", rid == 1 ? " port 0x" : ",0x", + resv->addr); else - snprintf(buf, sizeof(buf), "%s%lx-0x%lx", - rid == 1 ? "at 0x" : "0x", resv->addr, - resv->addr + resv->size - 1); - eisa_reg_print(child, buf, rid == 2 ? &separator : NULL, - &column); + retval += printf("%s%lx-0x%lx", rid == 1 ? " port 0x" : + ",0x", resv->addr, resv->addr + resv->size - 1); } - rid = 0; while ((resv = eisa_find_maddr(e_dev, rid++))) { if (resv->size == 1 || (resv->flags & RESVADDR_BITMASK)) - snprintf(buf, sizeof(buf), "%s%lx", - rid == 1 ? "at 0x" : "0x", resv->addr); + retval += printf("%s%lx", rid == 1 ? " mem 0x" : ",0x", + resv->addr); else - snprintf(buf, sizeof(buf), "%s%lx-0x%lx", - rid == 1 ? "at 0x" : "0x", - resv->addr, resv->addr + resv->size - 1); - eisa_reg_print(child, buf, rid == 2 ? &separator : NULL, - &column); + retval += printf("%s%lx-0x%lx", rid == 1 ? " mem 0x" : + ",0x", resv->addr, resv->addr + resv->size - 1); } - rid = 0; - while ((irq = eisa_find_irq(e_dev, rid++)) != NULL) { - snprintf(buf, sizeof(buf), "irq %d (%s)", irq->irq_no, - irq->irq_trigger ? "level" : "edge"); - eisa_reg_print(child, buf, rid == 1 ? &separator : NULL, - &column); - } - - snprintf(buf, sizeof(buf), "on %s slot %d\n", - device_get_nameunit(dev), eisa_get_slot(child)); - eisa_reg_print(child, buf, NULL, &column); + while ((irq = eisa_find_irq(e_dev, rid++)) != NULL) + retval += printf(" irq %d (%s)", irq->irq_no, + irq->irq_trigger ? "level" : "edge"); + retval += printf(" at slot %d on %s\n", eisa_get_slot(child), + device_get_nameunit(dev)); return (retval); } |