Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Mar 2010 20:35:05 +0200
From:      Cole <cole@opteqint.net>
To:        freebsd-hackers@freebsd.org
Subject:   device_t, resource, and softc
Message-ID:  <9f206d1a1003121035w503840c4q69fde2174f19e9c9@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9f206d1a1003121035w503840c4q69fde2174f19e9c9>