From owner-freebsd-acpi@FreeBSD.ORG  Sun May  8 06:44:51 2005
Return-Path: <owner-freebsd-acpi@FreeBSD.ORG>
Delivered-To: freebsd-acpi@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0D69816A4E1
	for <freebsd-acpi@freebsd.org>; Sun,  8 May 2005 06:44:51 +0000 (GMT)
Received: from schlepper.zs64.net (schlepper.zs64.net [212.12.50.230])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6188843D9F
	for <freebsd-acpi@freebsd.org>; Sun,  8 May 2005 06:44:50 +0000 (GMT)
	(envelope-from cracauer@schlepper.zs64.net)
Received: from schlepper.zs64.net (schlepper [212.12.50.230])
	by schlepper.zs64.net (8.13.1/8.12.9) with ESMTP id j486in2n001128
	for <freebsd-acpi@freebsd.org>; Sun, 8 May 2005 08:44:49 +0200 (CEST)
	(envelope-from cracauer@schlepper.zs64.net)
Received: (from cracauer@localhost)
	by schlepper.zs64.net (8.13.1/8.12.9/Submit) id j486inqZ001127
	for freebsd-acpi@freebsd.org; Sun, 8 May 2005 02:44:49 -0400 (EDT)
	(envelope-from cracauer)
Date: Sun, 8 May 2005 02:44:49 -0400
From: Martin Cracauer <cracauer@cons.org>
To: freebsd-acpi@freebsd.org
Message-ID: <20050508024448.A943@cons.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
Subject: Porting code from the Linux ibm-acpi sourceforge package
X-BeenThere: freebsd-acpi@freebsd.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: ACPI and power management development <freebsd-acpi.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-acpi>,
	<mailto:freebsd-acpi-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-acpi>
List-Post: <mailto:freebsd-acpi@freebsd.org>
List-Help: <mailto:freebsd-acpi-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-acpi>,
	<mailto:freebsd-acpi-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 08 May 2005 06:44:51 -0000

Hi,

I reinstalled my Thinkpad R40 with FreeBSD-5-stable.  Works very well
except for video corruption on sleep and that I miss some ACPI
functionality I had with the ibm-acpi package under Linux.

More specifically, I would like to port or reimplement some parts of
it, and I would like to start with the code to eject and re-mount the
ultrabay devices.

I have the Linux code in front of me which is showing, for the example
of the basic bay identifier and the eject code:

IBM_HANDLE(bay, root,
           "\\_SB.PCI.IDE.SECN.MAST",   /* 570 */
           "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */
           "\\_SB.PCI0.IDE0.SCND.MSTR", /* all others */
);                                      /* A21e, R30, R31 */
IBM_HANDLE(bay_ej, bay,
           "_EJ3",                 /* 600e/x, A2xm/p, A3x */
           "_EJ0",                 /* all others */
);                                 /* 570,A21e,G4x,R30,R31,R32,R40e,R50e */

Looking at FreeBSD's acpi_asus.c I can easily figure how this is
arranged in FreeBSD, but I am not sure whether I am lacking some glue
here.  Right now the sysctl acpi stuff is not mentioning any of the
IBM-specific variables.

Would these ACPI status variables only show up when I have a module
loaded which is actually using them?

Do I need to "grab" specific variables in advance, or is it sufficient
to just load the IBM equivalent of acpi_asus.c and would that do it
automatically?

Is there hope that I can hack this up without learning ACPI first? It
looks pretty straightforward, am I totally ignorant or is it
realistic?

Last but not least, if I just snarf the strings from the GPL code, I
assume that would make me stay clear of the GPL, would it? I obviously
want to give credit to the authors of that package.

Thanks
	Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@cons.org>   http://www.cons.org/cracauer/
 No warranty.    This email is probably produced by one of my cats 
 stepping on the keys. No, I don't have an infinite number of cats.