Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Nov 1998 18:55:44 -0600
From:      Zach Heilig <zach@gaffaneys.com>
To:        hackers@FreeBSD.ORG
Subject:   Reading values out of/Writing values to a PCI device...
Message-ID:  <19981127185544.A2982@znh.org>

next in thread | raw e-mail | index | archive | help
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



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