Re: Problems evaluating WMI method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I found out the problem. Looking at a part on the WMAB code

Method (WMAB, 3, Serialized)
{
    Store (Arg0, MAR0)
    Store (Arg1, MAR1)
    Store (Arg2, MAR2)
    (...)

    If (LEqual (MAR0, 0x33))
    {
        If (LEqual (MAR1, One))
        {
            If (ECON)
            {
                Store (^^PCI0.LPCB.EC.DFAN, Local0)
            }
            (...)
            Return (Local0)
       }
       (...)

I know the posible values for DFAN, they are 12, 22 and 2. This are the states 
of the laptop fan. So when I do WMAB(0x33, 0x01, 0x00) it should return one 
of those values. In wmi.c we got this 

acpi_status wmi_evaluate_method(const char *guid_string, u8 instance,
u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out)
{
    (...)
    input.count = 2;
    input.pointer = params;
    params[0].type = ACPI_TYPE_INTEGER;
    params[0].integer.value = instance;
    params[1].type = ACPI_TYPE_INTEGER;
    params[1].integer.value = method_id;

    if (in) {
        input.count = 3;

        if (block->flags & ACPI_WMI_STRING) {
            params[2].type = ACPI_TYPE_STRING;
        } else {
            params[2].type = ACPI_TYPE_BUFFER;
        }
        params[2].buffer.length = in->length;
        params[2].buffer.pointer = in->pointer;
    }

    strncat(method, block->object_id, 2);

    status = acpi_evaluate_object(handle, method, &input, out);

So, when I try to evaluate the WMAB method, the parameters will be screwed up 
because we are not only passing the structure, we are also passing the 
instance and the method_id to WMAB. The following is a stack look like 
representation.

[CORRECT] [CURRENT]
arg0           instance -> gets to be the Arg0
arg1           method_id -> gets to be the Arg1
arg2           arg0 -> gets to be the Arg2
                  arg1
                  arg2

I got the correct answer when I do instance = 0x33 and method_id = 0x01. So, I 
looked at hp-wmi.c code and acer-wmi.c and they depend on this instance and  
method_id. But my laptop doesnt seem to depend. Is this instance and 
method_id a WMI standart or is it a HP and Acer laptop specific? My laptop is 
a LG.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux