From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 11 09:05:38 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3F1416A404 for ; Wed, 11 Apr 2007 09:05:37 +0000 (UTC) (envelope-from alan@fromorbit.com) Received: from thing1.auspcmarket.com.au (mail.fromorbit.com [203.31.169.65]) by mx1.freebsd.org (Postfix) with ESMTP id B4FB613C44B for ; Wed, 11 Apr 2007 09:05:37 +0000 (UTC) (envelope-from alan@fromorbit.com) Received: from [192.168.1.99] (unknown [192.168.1.99]) by thing1.auspcmarket.com.au (Postfix) with ESMTP id 125CA5DD4 for ; Wed, 11 Apr 2007 19:05:33 +1000 (EST) From: Alan Garfield To: freebsd-hackers@freebsd.org In-Reply-To: <1176205240.4514.3.camel@hiro.auspc.com.au> References: <1176096815.4064.6.camel@hiro.auspc.com.au> <1176171656.4276.8.camel@hiro.auspc.com.au> <1176183021.5525.4.camel@hiro.auspc.com.au> <1176205240.4514.3.camel@hiro.auspc.com.au> Content-Type: text/plain Date: Wed, 11 Apr 2007 19:05:33 +1000 Message-Id: <1176282333.4134.4.camel@hiro.auspc.com.au> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6) Content-Transfer-Encoding: 7bit Subject: Resources and ACPI X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2007 09:05:38 -0000 Hi all, When you have say :- ---- static int jnet_probe(device_t dev) { static char *jnet_ids[] = { "NWS8001", NULL }; if (acpi_disabled("jnet") || ACPI_ID_PROBE(device_get_parent(dev), dev, jnet_ids) == NULL) return (ENXIO); // Woo we found it, set the description s we know what we are. device_set_desc(dev, "JNet Ethernet System Interface"); return (BUS_PROBE_DEFAULT); } ---- and when the device is kldload'ed you get :- ---- jnet0: port 0xa8,0xae-0xaf irq 19 on acpi0 ---- are these resources automagically allocated for me? Or do I have to allocate them myself? I've got my driver mostly working but at the moment I've hard-coded in the resources and I'm thinking this isn't correct given the acpi bus knows what resources I'm expecting and lists them helpfully in the dmesg output. If the resources are allocated how do I access/see them? I've been all through device_t and bus.h this and acpi.h that, and I cannot find a good example of getting resources from the acpi bus. Any help would be appreciated! Thanks, Alan.