From owner-freebsd-current Thu Jan 23 15:30:39 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0414837B401 for ; Thu, 23 Jan 2003 15:30:37 -0800 (PST) Received: from takawata.st.wakwak.ne.jp (takawata.st.wakwak.ne.jp [61.115.75.145]) by mx1.FreeBSD.org (Postfix) with ESMTP id E551843E4A for ; Thu, 23 Jan 2003 15:30:33 -0800 (PST) (envelope-from takawata@takawata.st.wakwak.ne.jp) Received: from takawata.st.wakwak.ne.jp (localhost [127.0.0.1]) by sana.home.local (8.12.6/8.12.6) with ESMTP id h0NNOKc4027604; Fri, 24 Jan 2003 08:24:21 +0900 (JST) (envelope-from takawata@takawata.st.wakwak.ne.jp) Message-Id: <200301232324.h0NNOKc4027604@sana.home.local> To: Marcel Moolenaar , l From: takawata@axe-inc.co.jp Cc: current@freebsd.org, acpi-jp@jp.freebsd.org Subject: Re: psm0 not found on a Sony Vaio w/ 5.0-RELEASE In-reply-to: Your message of "Thu, 23 Jan 2003 10:50:43 PST." <20030123185043.GB579@dhcp01.pn.xcllnt.net> Date: Fri, 24 Jan 2003 08:24:20 +0900 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <20030123185043.GB579@dhcp01.pn.xcllnt.net>, Marcel Moolenaar wrote: >On Thu, Jan 23, 2003 at 07:50:36AM -0600, Ben Hockenhull wrote: >> > >> >Use acpidump(8) and grep(1) for MOUE. The definition of _HID is >> >the PnP id that you need to add. It probably is 0x0190d94d in >> >your case. You can add the PnP id, or checkout -rHEAD, because >> >it's fixed already. >> >> Exactly what I needed to know. I discovered that it's actually 0x090cd041 >> for my Vaio R505EC. I've added that to pcm.c and recompiled and it's now >> found and works normally. > >Hmmm.... That PnP id is a generic id (has the PNP prefix). A Sony >specific PnP id is 0x####d94d... Your Id is one for an ACPI embedded >controller and I don't think it has to be a mouse. I suspect there's >a _CID value as well and that it's a generic PS/2 mouse id... Quick Hack for _CID.(Compiler passes, but not tested yet actually.) Index: acpi.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi.c,v retrieving revision 1.83 diff -u -r1.83 acpi.c --- acpi.c 28 Dec 2002 14:58:50 -0000 1.83 +++ acpi.c 23 Jan 2003 23:17:05 -0000 @@ -113,6 +113,7 @@ static struct resource *acpi_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); static int acpi_release_resource(device_t bus, device_t child, int type, int rid, struct resource *r); +static u_int32_t acpi_isa_get_compatid(device_t dev); static u_int32_t acpi_isa_get_logicalid(device_t dev); static int acpi_isa_pnp_probe(device_t bus, device_t child, struct isa_pnp_id *ids); @@ -590,10 +591,11 @@ /* ISA compatibility */ case ISA_IVAR_VENDORID: case ISA_IVAR_SERIAL: - case ISA_IVAR_COMPATID: *(int *)result = -1; break; - + case ISA_IVAR_COMPATID: + *(int *)result = acpi_isa_get_compatid(child); + break; case ISA_IVAR_LOGICALID: *(int *)result = acpi_isa_get_logicalid(child); break; @@ -697,7 +699,32 @@ | (PNP_HEXTONUM(s[3]) << 20) \ | (PNP_HEXTONUM(s[6]) << 24) \ | (PNP_HEXTONUM(s[5]) << 28)) +#define MAX_VALID_EISAID 9 +static u_int32_t +acpi_isa_get_compatid(device_t dev) +{ + ACPI_HANDLE h; + ACPI_OBJECT *obj; + ACPI_BUFFER resbuf; + char resbufbody[sizeof(ACPI_OBJECT) + MAX_VALID_EISAID +1]; + + /* + *resbuf size is allocated so that it can hold ACPI_OBJECT + *with EISAID string + */ + obj = (ACPI_OBJECT *)resbufbody; + resbuf.Length = sizeof(resbufbody); + resbuf.Pointer = resbufbody; + h = acpi_get_handle(dev); + if(ACPI_FAILURE(AcpiEvaluateObject(h, "_CID", NULL, &resbuf))) + return 0; + if(obj->Type == ACPI_TYPE_INTEGER) + return obj->Integer.Value; + else if(obj->Type == ACPI_TYPE_STRING) + return PNP_EISAID(obj->String.Pointer); + return 0; +} static u_int32_t acpi_isa_get_logicalid(device_t dev) { To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message