From 40129db5502e314eafc68a73d874ad95b8d67165 Mon Sep 17 00:00:00 2001 From: emaste Date: Tue, 1 Apr 2008 20:53:32 +0000 Subject: Calling RequestSupplementAdapterInfo before RequestAdapterInfo appears to trip a bug causing the latter to return a zeroed struct aac_adapter_info. This causes two issues. One is cosmetic only -- a verbose boot prints information about the controller, and shows all zero: aac0: Unknown processor 0MHz, 0MB memory (0MB cache, 0MB execution), unknown battery platform The second problem is that the firmware version information is stored away for aac_rev_check, for userland tools (like aaccli) to query via the FSACTL_MINIPORT_REV_CHECK and FSACTL_LNX_MINIPORT_REV_CHECK ioctls. When aaccli encounters this issue it prints Command Error: Move the RequestSupplementAdapterInfo call after RequestAdapterInfo, which seems to fix both problems. --- sys/dev/aac/aac.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'sys/dev/aac') diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index 8f29262..a26397a 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -2768,22 +2768,6 @@ aac_describe_controller(struct aac_softc *sc) mtx_lock(&sc->aac_io_lock); aac_alloc_sync_fib(sc, &fib); - if (sc->supported_options & AAC_SUPPORTED_SUPPLEMENT_ADAPTER_INFO) { - fib->data[0] = 0; - if (aac_sync_fib(sc, RequestSupplementAdapterInfo, 0, fib, 1)) - device_printf(sc->aac_dev, - "RequestSupplementAdapterInfo failed\n"); - else - adapter_type = ((struct aac_supplement_adapter_info *) - &fib->data[0])->AdapterTypeText; - } - device_printf(sc->aac_dev, "%s, aac driver %d.%d.%d-%d\n", - adapter_type, - AAC_DRIVER_VERSION >> 24, - (AAC_DRIVER_VERSION >> 16) & 0xFF, - AAC_DRIVER_VERSION & 0xFF, - AAC_DRIVER_BUILD); - fib->data[0] = 0; if (aac_sync_fib(sc, RequestAdapterInfo, 0, fib, 1)) { device_printf(sc->aac_dev, "RequestAdapterInfo failed\n"); @@ -2796,7 +2780,6 @@ aac_describe_controller(struct aac_softc *sc) info = (struct aac_adapter_info *)&fib->data[0]; sc->aac_revision = info->KernelRevision; - if (bootverbose) { device_printf(sc->aac_dev, "%s %dMHz, %dMB memory " "(%dMB cache, %dMB execution), %s\n", @@ -2838,6 +2821,23 @@ aac_describe_controller(struct aac_softc *sc) "\23ARRAY64BIT" "\24HEATSENSOR"); } + + if (sc->supported_options & AAC_SUPPORTED_SUPPLEMENT_ADAPTER_INFO) { + fib->data[0] = 0; + if (aac_sync_fib(sc, RequestSupplementAdapterInfo, 0, fib, 1)) + device_printf(sc->aac_dev, + "RequestSupplementAdapterInfo failed\n"); + else + adapter_type = ((struct aac_supplement_adapter_info *) + &fib->data[0])->AdapterTypeText; + } + device_printf(sc->aac_dev, "%s, aac driver %d.%d.%d-%d\n", + adapter_type, + AAC_DRIVER_VERSION >> 24, + (AAC_DRIVER_VERSION >> 16) & 0xFF, + AAC_DRIVER_VERSION & 0xFF, + AAC_DRIVER_BUILD); + aac_release_sync_fib(sc); mtx_unlock(&sc->aac_io_lock); } -- cgit v1.1