Subject: Re: Claiming Hardware Resources
To: Quentin Garnier <cube@cubidou.net>
From: Alan Ritter <rittera@cc.wwu.edu>
List: tech-kern
Date: 07/06/2005 22:36:44
--nextPart6918033.mnVnqfijbM
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Wednesday 06 July 2005 10:30 pm, Quentin Garnier wrote:
> I think you'll have to call pci_mapreg_type() on each BAR, because you'll
> need the type information when doing the actual mapping.

Yes, this is exactly what I do (I hope I'm doing this right though):
pci_mapreg_info(sc->pci_c, sc->pci_t, bar,=20
			pci_mapreg_type(sc->pci_c, sc->pci_t, bar),
			&sc->res_b, &sc->res_s, &sc->res_flags)

> I don't know what the NDIS driver will ask for, but once you have the
> list of the BARs and their type, you can either call pci_mapreg_info() if
> the NDIS driver asks for an address to map, but you're more likely to not
> have to do that, and only call pci_mapreg_map() when asked by the NDIS
> driver.

If I recall, Windows drivers are assumed to want all of the resources=20
available to them, and have to deallocate any resources in their=20
CM_PARTIAL_RESOURCE_LIST that they don't in fact need.  This makes me think=
=20
that I'd want to allocate all possible resources before passing them to the=
=20
Windows driver.  Also it appears that the FreeBSD code is claiming all the=
=20
resources it gets from BUS_GET_RESOURCE_LIST But I should look into this a=
=20
bit more.

Thanks :-)

--nextPart6918033.mnVnqfijbM
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)

iD8DBQBCzF0CdrBy3JhXjT8RAmp/AJ9Qu1F8NKlGx4JwcejeiuOYSVaQygCeLq7O
8cmT5ozshfNubYB6q/v8G6k=
=VOsP
-----END PGP SIGNATURE-----

--nextPart6918033.mnVnqfijbM--