From owner-freebsd-hackers Fri Nov 27 17:00:26 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA16822 for freebsd-hackers-outgoing; Fri, 27 Nov 1998 17:00:26 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from dingo.cdrom.com (dingo.cdrom.com [204.216.28.145]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA16816 for ; Fri, 27 Nov 1998 17:00:25 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost.cdrom.com [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id QAA01827; Fri, 27 Nov 1998 16:59:00 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199811280059.QAA01827@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Zach Heilig cc: hackers@FreeBSD.ORG Subject: Re: Reading values out of/Writing values to a PCI device... In-reply-to: Your message of "Fri, 27 Nov 1998 18:55:44 CST." <19981127185544.A2982@znh.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 27 Nov 1998 16:59:00 -0800 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Save yourself. http://www.freebsd.org/~wpaul/VIA > I'm currently attempting to write a network device driver for the VIA > 86C100A (Rhine?) Fast Ethernet Controller, as this seems to not be > currently supported, and does not have an NE2000 compatability mode. > (A grep for '1106' and '3043' in /sys/pci shows nothing, except a > VIA motherboard chipset). > > Writing the "probe" was rather easy (it detects just fine) :-). > Writing the "attach" function has hit a snag: > > I have #1 the Linux driver [this is kinda confusing], #2 the 86C100A > spec sheets [the linux driver is less relavent now ;-)], and #3 the > eeprom info sheets [difficult to make sense of parts of #2 above > without it]. > > This is what the card looks like (to FreeBSD): > > found-> vendor=0x1106, dev=0x3043, revid=0x06 > class=02-00-00, hdrtype=0x00, mfdev=0 > subordinatebus=0 secondarybus=0 > intpin=a, irq=9 > map[0]: type 4, range 32, base 00006100, size 7 > map[1]: type 1, range 32, base f1000000, size 7 > > I'm presuming I want to use the 'type 1' map (memory map rather than > port map). I'm also going to guess that I can't just read/write to > 'memory address 0xf100 0000', and I somehow need to get that mapped > into my driver space. Another guess is the 'range 32' means 32*4 > bytes (that's the only interpretation that makes sense given 128 bytes > of pci registers). I can't figure out what the 'size 7' means (or > even if it is important). > > It does require a 32-bit aligned data buffer. Do we have the same > problem as Linux (they have 14-byte headers, so "need" a data copy to > an alignment buffer). This chip can be programmed to put different > parts of an ethernet frame into different buffers, so maybe that isn't > really a problem... except with that particular driver. > > Also, I see this '...softc' structure.. Is there any description for > it anywhere (other than poking around in the source)? > > -- > Zach Heilig (zach@gaffaneys.com) > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message