diff options
| author | Enji Cooper <ngie@FreeBSD.org> | 2026-03-01 18:54:56 +0000 |
|---|---|---|
| committer | Enji Cooper <ngie@FreeBSD.org> | 2026-03-01 19:03:38 +0000 |
| commit | e81e724358e43dcf951e244a9df9df3eaa983fe9 (patch) | |
| tree | 855ffd2c1e256925f9a3ac41ee94af7714f2dea2 /sys/dev | |
| parent | ffe7d45d295c553ed90ad3b5cc67111450063741 (diff) | |
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/asmc/asmc.c | 11 | ||||
| -rw-r--r-- | sys/dev/asmc/asmcvar.h | 3 |
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index cf977071cc69..726d52874026 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -51,6 +51,7 @@ #include <sys/rman.h> #include <machine/resource.h> +#include <netinet/in.h> #include <contrib/dev/acpica/include/acpi.h> @@ -935,11 +936,17 @@ asmc_init(device_t dev) { struct asmc_softc *sc = device_get_softc(dev); struct sysctl_ctx_list *sysctlctx; + uint8_t buf[6]; int i, error = 1; - uint8_t buf[4]; sysctlctx = device_get_sysctl_ctx(dev); + error = asmc_key_read(dev, ASMC_KEY_REV, buf, 6); + if (error != 0) + goto out_err; + device_printf(dev, "SMC revision: %x.%x%x%x\n", buf[0], buf[1], buf[2], + ntohs(*(uint16_t *)buf + 4)); + if (sc->sc_model->smc_sms_x == NULL) goto nosms; @@ -1039,10 +1046,10 @@ nosms: sc->sc_nkeys = 0; } +out_err: #ifdef ASMC_DEBUG asmc_dumpall(dev); #endif - return (error); } diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h index 97e5076455c9..5afc1012849c 100644 --- a/sys/dev/asmc/asmcvar.h +++ b/sys/dev/asmc/asmcvar.h @@ -78,6 +78,9 @@ struct asmc_softc { /* Number of keys */ #define ASMC_NKEYS "#KEY" /* RO; 4 bytes */ +/* Query the ASMC revision */ +#define ASMC_KEY_REV "REV " /* RO: 6 bytes */ + /* * Fan control via SMC. */ |
