From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 12 18:35:06 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D4391065676 for ; Fri, 12 Mar 2010 18:35:06 +0000 (UTC) (envelope-from cole@opteqint.net) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 54F7D8FC16 for ; Fri, 12 Mar 2010 18:35:06 +0000 (UTC) Received: by pvg3 with SMTP id 3so714865pvg.13 for ; Fri, 12 Mar 2010 10:35:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.143.84.2 with SMTP id m2mr838430wfl.56.1268418905661; Fri, 12 Mar 2010 10:35:05 -0800 (PST) X-Originating-IP: [196.210.202.6] Date: Fri, 12 Mar 2010 20:35:05 +0200 Message-ID: <9f206d1a1003121035w503840c4q69fde2174f19e9c9@mail.gmail.com> From: Cole To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: device_t, resource, and softc 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: Fri, 12 Mar 2010 18:35:06 -0000 Hi. Im busy implementing a kernel module to enable me to read/write certain control registers for a PCI card. I do not wish to modify the existing driver, merely create an add-on module that can be loaded to accomplish what I need. I can easily get the device_t structure of the device, and I know I can use device_get_softc, to get the softc of the structure. I also see there used to be a bus_get_resource function that no longer seems to be documented or has a man page on FreeBSD. So I was wondering if there is a way to get the resource for the device using the device_t structure, which would allow me to easily use the rman_get_bustag, and rman_get_bushandle functions to get the bus_tag and bus_handle values for the device and its resouce. Regards /Cole