Subject: Claiming Hardware Resources
To: None <tech-kern@netbsd.org>
From: Alan Ritter <rittera@cc.wwu.edu>
List: tech-kern
Date: 07/06/2005 21:44:51
--nextPart1267043.htAAKbEWo4
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi all, I'm trying to port FreeBSD's NDIS driver to NetBSD for Google's
"Summer of Code".
Anyway, as there isn't a specific piece of hardware this driver is being
written for, I need to find a way to detect which hardware resources to
claim. It seems like pci_mapreg_info() (man 9 pci) might work for this, but
I'm not totally sure.
I've also tried using pci_conf_print() and got the follwing output in my
dmesg output (just part of it):
Base address register at 0x10
type: 32-bit nonprefetchable memory
base: 0xfafee000, size: 0x00002000
Base address register at 0x14
not implemented(?)
Base address register at 0x18
not implemented(?)
Base address register at 0x1c
not implemented(?)
Base address register at 0x20
not implemented(?)
Base address register at 0x24
not implemented(?)
I get the same base address and size when using pci_mapreg_info() on BAR
0x10, so I'm figuring this is the only register that needs to get mapped in
this case. In general should I just test all these BAR's, and map those
for which pci_mapreg_info doesn't fail?
The FreeBSD attach() code uses BUS_GET_RESOURCE_LIST to get a
"resource_list" with all the hardware resources for a particular device.
This closely corresponds to the Windows CM_PARTIAL_RESOURCE_LIST, and they
convert their resource_list into this. Right now I'm thinking I'll have to
build up my own list of resources to do the conversion, but I thought I
should post here to see if anyone has any suggestions.
Thanks :-)
P.S. See my blog for more information and links to my sources on the web:
http://ndis-netbsd.blogspot.com/
--nextPart1267043.htAAKbEWo4
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)
iD8DBQBCzFDXdrBy3JhXjT8RArefAJ46A/MNlmUnXWCB8xDx6yuyH0UrkwCePHuv
TsTYZL2loiyAf40YgTVT5rU=
=S2GA
-----END PGP SIGNATURE-----
--nextPart1267043.htAAKbEWo4--