For some reason on at least the ThinkPad X1C 5th Gen, Lenovo makes
_BIX return a package with size 21 instead of 20, adding an int at
the end after the OEM string value (I'm guessing to be used as an
OEM int value).

The template that _BIX writes into:

                Name (BX0I, Package (0x15)
                {
                    0x01, 
                    0x00, 
                    0xFFFFFFFF, 
                    0xFFFFFFFF, 
                    0x01, 
                    0xFFFFFFFF, 
                    0x00, 
                    0x00, 
                    0xFFFFFFFF, 
                    0x00017318, 
                    0xFFFFFFFF, 
                    0xFFFFFFFF, 
                    0x03E8, 
                    0x01F4, 
                    0xFFFFFFFF, 
                    0xFFFFFFFF, 
                    "", 
                    "", 
                    "", 
                    "", 
                    0x00
                })

As long as all of the _BIX fields we care about are there, don't be
strict about the size.


Index: sys/dev/acpi/acpibat.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpibat.c,v
retrieving revision 1.65
diff -u -p -u -p -r1.65 acpibat.c
--- sys/dev/acpi/acpibat.c      25 Jul 2017 21:32:07 -0000      1.65
+++ sys/dev/acpi/acpibat.c      3 Sep 2017 19:47:00 -0000
@@ -332,7 +332,7 @@ acpibat_getbix(struct acpibat_softc *sc)
 
        if (aml_evalname(sc->sc_acpi, sc->sc_devnode, "_BIX", 0, NULL,
            &res) == 0) {
-               if (res.length == 20)
+               if (res.length >= 20)
                        sc->sc_use_bif = 0;
                else
                        dnprintf(10, "%s: invalid _BIX (%d != 20)\n",

Reply via email to