From owner-freebsd-current Tue Nov 21 12:43:29 2000 Delivered-To: freebsd-current@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 7F27137B4C5; Tue, 21 Nov 2000 12:43:26 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.0/8.11.0) with ESMTP id eALKhNQ32214; Tue, 21 Nov 2000 13:43:24 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id NAA37246; Tue, 21 Nov 2000 13:43:23 -0700 (MST) Message-Id: <200011212043.NAA37246@harmony.village.org> To: "Justin T. Gibbs" Subject: Re: Getting at cardbus CIS data from inside drivers Cc: wpaul@FreeBSD.ORG (Bill Paul), freebsd-current@FreeBSD.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> Date: Tue, 21 Nov 2000 13:43:23 -0700 From: Warner Losh Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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