From owner-freebsd-current Tue Nov 21 20:42: 8 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 8C2D937B479; Tue, 21 Nov 2000 20:42:04 -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 eAM4g3Q33748; Tue, 21 Nov 2000 21:42:03 -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 VAA39910; Tue, 21 Nov 2000 21:42:02 -0700 (MST) Message-Id: <200011220442.VAA39910@harmony.village.org> To: Mike Smith Subject: Re: Getting at cardbus CIS data from inside drivers Cc: "Justin T. Gibbs" , wpaul@FreeBSD.ORG (Bill Paul), freebsd-current@FreeBSD.ORG In-reply-to: Your message of "Tue, 21 Nov 2000 20:27:34 PST." <200011220427.eAM4RYF00772@mass.osd.bsdi.com> References: <200011220427.eAM4RYF00772@mass.osd.bsdi.com> Date: Tue, 21 Nov 2000 21:42:02 -0700 From: Warner Losh Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <200011220427.eAM4RYF00772@mass.osd.bsdi.com> Mike Smith writes: : No; the CIS parser should know which function it's being called on behalf : of, and simply elide the tuples that don't relate to that function. This isn't always the right thing to do. At least in the 16-bit world, there are drivers that want to look at the CIS entries for the other function of the card for various reasons (some of them need to know what kind of modem is present, iirc, to initalize some things in a non-standard way, the example was the NetBSD driver mhz, iirc). I don't wish to preclude that. : Export the commonly-known stuff through the "right" interface : (eg. cardbus_get_cistuple(dev, CARDBUS_CIS_STATION_ADDRESS)) and then : provide a backdoor (cardbus_get_cistuple(dev, CARSBUS_CIS_RAW + index)) : for the evil side, perhaps. Right now pccard exports this as: uchar8_t ether_addr[ETEHR_ADDR_LEN]; pccard_get_ether(dev, ether_addr); where pccard_get_ether is generated by really ugly, but usefully stolen from pci, macros in dev/pccard/pccardvar.h. The OLDCARD code set this from the userland after parsing the CIS. NEWCARD currently doesn't implement this correctly, but will need to do so shortly. I'd like to do exactly the same thing for cardbus: uchar8_t ether_addr[ETEHR_ADDR_LEN]; cardbus_get_ether(dev, ether_addr); to make things easy. I don't think that we can easily do the index thing for CIS entries, for reasons that I've talked about before. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message