Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Nov 2000 13:43:23 -0700
From:      Warner Losh <imp@village.org>
To:        "Justin T. Gibbs" <gibbs@scsiguy.com>
Cc:        wpaul@FreeBSD.ORG (Bill Paul), freebsd-current@FreeBSD.ORG
Subject:   Re: Getting at cardbus CIS data from inside drivers 
Message-ID:  <200011212043.NAA37246@harmony.village.org>
In-Reply-To: Your message of "Tue, 21 Nov 2000 13:28:46 MST." <200011212028.eALKSk465978@aslan.scsiguy.com> 
References:  <200011212028.eALKSk465978@aslan.scsiguy.com>  

next in thread | previous in thread | raw e-mail | index | archive | help
In message <200011212028.eALKSk465978@aslan.scsiguy.com> "Justin T. Gibbs" writes:
: >That's what I mean.  You call this, and it will remap the CIS (if it
: >has been unmapped), walk it for you and pass you a pointer to each CIS
: >entry one at a time to the function you specify.
: >
: >Warner
: 
: I'd rather have a seek/read interface than have a callback.

The problem with a read/seek interface is that you are consuming a
resource (a memory window) while you are using it.  You'd need an
open/close on top of that as well to properly map things in to start
and then free them at the end.  Plus you might want a ftell sort of
interface as well.  I'll likely punt on the seek/ftell part.

But it would make the client code a little easier to cope with:

	uchar8_t cis[CIS_MAX_LENGTH];
	size_t len;
	cis_cookie_t cookie;

	card_map_cis(dev, &cookie);
	while (card_read_cis(dev, cookie, cis, &len)) {
		frob the cis entry
	}
	card_unmap_cis(dev, cookie);

I'll see how hard it would be to come up with this, if this sort of
interface is reasonable.

Warner


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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