Skip to contentSkip to conversation

Problems evaluating WMI method

DISCUSSION Duarte Silva 2 participants 3 messages Sep 30, 2008 – Oct 1, 2008 ACPI

lore
Share & tools
lore
#0 lore raw

Hi,

After parsing the _WDG buffer from a PNP0C14 device I got this (the format is <guid> - <object-id> - <parsed-guid-type> - <guid-type>)

C3A72B38-D3EF-42D3-8CBB-D5A57049F66D - AB - method - 2 E4FB94F9-7F2B-4173-AD1A-CD1D95086248 - event - 8 023B133E-49D1-4E10-B313-698220140DC2 - event - 8 37BE1AC0-C3F2-4B1F-BFBE-8FDEAF2814D6 - event - 8 911BAD44-7DF8-4FBB-9319-BABA1C4B293B - event - 8 4E5C4404-3CED-4A5E-8C7A-1BA875D00A43 - BA - method - 2 2B4F501A-BD3C-4394-8DCF-00A7D2BC8210 - BB - method - 2 05901221-D566-11D1-B2F0-00A0C9062910 - AC - unknown - 0

That first GUID map to WMAB (I guess). So why when I do this (simplified version)

struct acpi_buffer out = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer in;

structwmab_args args = {
	.mar0 = 0x00,
	.mar1 = 0x01,
	.mar2 = 0x00,
};

in.length = (acpi_size)sizeof(struct wmab_args);
in.pointer = &args;

wmi_evaluate_method("C3A72B38-D3EF-42D3-8CBB-D5A57049F66D", 1, 1, &in, &out);

printk( KERN_INFO "QUERY %i\n", (u32)out.length);

kfree(out.pointer);

I get a output with a lenght of 24 and when I convert it to a acpi_object I get type integer. Result in dmesg

QUERY 24

When the code in WMAB is

Method (WMAB, 3, Serialized)

{
    Store (Arg0, MAR0)
    Store (Arg1, MAR1)
    Store (Arg2, MAR2)
    If (LAnd (LGreaterEqual (MAR0, Zero), LLessEqual (MAR0, 0x2F)))
    {
        If (LEqual (MAR0, Zero))
        {
            If (LEqual (MAR1, One))
            {
                Return (0x0300)
            }
            Return (0x80000002)
       }
       (...)

With the parameters I provided it should be returning something like 0x300. What Iam doing wrong?

#1 lore raw
Quoted 11 lines · On Tuesday 30 September 2008 23:56:09 Duarte Silva wrote:

wmi_evaluate_method("C3A72B38-D3EF-42D3-8CBB-D5A57049F66D", 1, 1, &in, &out);

printk( KERN_INFO "QUERY %i\n", (u32)out.length);

kfree(out.pointer);

I get a output with a lenght of 24 and when I convert it to a acpi_object I get type integer. Result in dmesg

QUERY 24

Ok, but what's the actual result?

e.g.

acpi_object *obj;

wmi_evaluate_method(guid, 1, 1, &in, &out);

obj = (union acpi_object *) out.pointer;

printk(KERN_INFO "RESULT %i\n", obj->value);

-Carlos

Signature · 3 lines
E-Mail: [email protected]
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D
#2 lore raw
Quoted 19 lines · On Wednesday 01 October 2008 18:55:29 Carlos Corbacho wrote:
Quoted 11 lines · On Tuesday 30 September 2008 23:56:09 Duarte Silva wrote:

wmi_evaluate_method("C3A72B38-D3EF-42D3-8CBB-D5A57049F66D", 1, 1, &in, &out);

printk( KERN_INFO "QUERY %i\n", (u32)out.length);

kfree(out.pointer);

I get a output with a lenght of 24 and when I convert it to a acpi_object I get type integer. Result in dmesg

QUERY 24

Ok, but what's the actual result?

e.g.

acpi_object *obj;

Quoted 7 lines

wmi_evaluate_method(guid, 1, 1, &in, &out);

obj = (union acpi_object *) out.pointer;

printk(KERN_INFO "RESULT %i\n", obj->value);

-Carlos

It's of type integer and the result is allways one. But it is possible, Iam in a 64 bits platform, so three ints are 24 bytes (8 * 3)
But the strange part is that the result is allways one, when it should be 0x0300.