From 029e2ee3ee2ccaaff6d1feba482ace8455ab5f7e Mon Sep 17 00:00:00 2001 From: John Polstra Date: Tue, 7 Jan 2003 01:33:03 +0000 Subject: [PATCH] Put the ASIC revision into the device description string so it appears in the dmesg output. MFC after: 3 days --- sys/dev/bge/if_bge.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index c506a6d2cb3..f0871027451 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -131,6 +131,7 @@ static const char rcsid[] = * ID burned into it, though it will always be overriden by the vendor * ID in the EEPROM. Just to be safe, we cover all possibilities. */ +#define BGE_DEVDESC_MAX 64 /* Maximum device description length */ static struct bge_type bge_devs[] = { { ALT_VENDORID, ALT_DEVICEID_BCM5700, @@ -1417,6 +1418,7 @@ bge_probe(dev) { struct bge_type *t; struct bge_softc *sc; + char *descbuf; t = bge_devs; @@ -1432,7 +1434,14 @@ bge_probe(dev) bge_vpd_read(sc); device_set_desc(dev, sc->bge_vpd_prodname); #endif - device_set_desc(dev, t->bge_name); + descbuf = malloc(BGE_DEVDESC_MAX, M_TEMP, M_NOWAIT); + if (descbuf == NULL) + return(ENOMEM); + snprintf(descbuf, BGE_DEVDESC_MAX, + "%s, ASIC rev. %#04x", t->bge_name, + pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> 16); + device_set_desc_copy(dev, descbuf); + free(descbuf, M_TEMP); return(0); } t++;