From: Duarte Silva <duartejcsilva@gmail.com>
To: linux-acpi@vger.kernel.org
Subject: Re: Problems evaluating WMI method
Date: Wed, 1 Oct 2008 21:13:50 +0100 [thread overview]
Message-ID: <200810012113.50723.duartejcsilva@gmail.com> (raw)
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.
next reply other threads:[~2008-10-01 20:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-01 20:13 Duarte Silva [this message]
2008-10-01 20:26 ` Problems evaluating WMI method Carlos Corbacho
2008-10-01 20:48 ` Duarte Silva
-- strict thread matches above, loose matches on Subject: below --
2008-09-30 22:56 Duarte Silva
2008-10-01 17:55 ` Carlos Corbacho
2008-10-01 18:22 ` Duarte Silva
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200810012113.50723.duartejcsilva@gmail.com \
--to=duartejcsilva@gmail.com \
--cc=linux-acpi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.