From owner-freebsd-hackers Thu Nov 12 09:31:58 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA00675 for freebsd-hackers-outgoing; Thu, 12 Nov 1998 09:31:58 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from heathers.stdio.com (heathers.stdio.com [199.89.192.5]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA00670 for ; Thu, 12 Nov 1998 09:31:57 -0800 (PST) (envelope-from lile@stdio.com) Received: from localhost (lile@localhost) by heathers.stdio.com (8.8.8/8.8.8) with SMTP id MAA00382; Thu, 12 Nov 1998 12:34:55 -0500 (EST) (envelope-from lile@heathers.stdio.com) Date: Thu, 12 Nov 1998 12:34:55 -0500 (EST) From: "Larry S. Lile" To: Mike Smith cc: "Ron G. Minnich" , hackers@FreeBSD.ORG Subject: Re: PCI device question In-Reply-To: <199811121659.IAA11527@dingo.cdrom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 12 Nov 1998, Mike Smith wrote: > > > > I already know the io-base address, dma-level, csn, pci slot, ... from > > > > another call. > > > > > > That's where stuff like base address etc. are. If you have pulled out > > > base address info via config read and friends then you already know. If > > > you are not pulling base etc. out via config reads then you have to fix > > > your driver :-) > > > > > > Functions look like this: > > > int data = pci_conf_read(tag, PCI_CLASS_REG); > > > > > > Are you using these? > > > > No, there is a probe function in the driver kit that will find all > > of the adapters presumably through PIO, so I have not neede to > > delve into this yet. They then want a pointer into the right spot > > in memory for the config. info passed into another function. > > Don't do this. It's Bad and Evil and if they feel the only way to find > device information is to go behind the system's back then I can't wait > to hear what else they think is a "good idea". They have written the kit so that it is OS independent, don't bust an artery. They just want the config info passed to them so their half of the driver can make sure it is ok. Here is their blurb about it... [For PCI adapters the configuration is retrieved by the driver through [PCI BIOS calls (or their equivalents in the OS in question). The PCI ID [to look for is 108D0001 for OC-3136 and OC-3137. To set-up the complete [configuration, retrive the 64 byte configuration space header and pass [this to TRlld. [ [ int TRlldPCIConfig(TRlldDriver_t *driver, TRLLDAdapterConfig_t *config [ char *PCIConfiguration) The "driver" here is the FreeBSD driver, I have to get the info and pass it to them, they don't change it. If they don't like it, they tell me and I have to fix it. I could very easily copy the data into a buffer and pass it to them. Now, the question was (and still is) how do I get the 64 byte configuration header out of FreeBSD, or how do I get a pointer to it? > > > What I need is a way to get a pointer (char *) to the beginning > > of the config. info for a particular card (one with a PCI ID of > > > Config data is not guaranteed to be memory-mapped. Fine, I can copy it into a buffer and pass it to the function. How do I get the data? Could I loop through like this: char foo[64] for (i = 0; i < 64, i++) foo[i] = pci_read_conf(tag, i); And what would "tag" be? How do I relate that to a PCI ID? Larry Lile lile@stdio.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message