NE2000 NIC driver for Linux 2.6

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hello,

I'm trying to write my own driver for NE2000 NIC PCI card for Linux.
I read the docs for DP8390 (NE2000) controller but I can't understand  
the remote DMA operations.
The doc mentions that remote DMA can be used to move received frames  
from rx-ring to host memory.  
How can I use this remote DMA to transfer while there is not any 32bit
registers to specify memory address in host memory?

efo


Re: NE2000 NIC driver for Linux 2.6
2014-04-06 15:55, snipped-for-privacy@neostrada.pl skrev:
Quoted text here. Click to load it
The NE2000 was designed for the ISA bus, which did not have any bus  
master functionality, similar to that of PCI.

The NE2000 is/was intended for a board which had a local dual-access  
memory on the board. This memory is limited by the narrow address bus.
If a Board is a bus master, and can autonomously write packets
from the board to system memory over the PCI bus, then it is not
NE2000 compatible.


BR
Ulf Samuelsson


Re: NE2000 NIC driver for Linux 2.6
Quoted text here. Click to load it
  
So if NE2000 doesn't have possibility to direct access to host memory - how
can I put packet from host to NE2000 and how to fetch received packet to
host memory?

efo
  

Re: NE2000 NIC driver for Linux 2.6
On 08 Apr 2014 14:40:41 GMT, snipped-for-privacy@neostrada.pl wrote:
  
Quoted text here. Click to load it

You read from it and write to it.

All versions of the NE2000 had PIO control, later versions also had
DMA target support (but *not* bus mastering).  You set up a transfer
using PIO and then perform the transfer using PIO or DMA.

George

Re: NE2000 NIC driver for Linux 2.6
On 08 Apr 2014 14:40:41 GMT, snipped-for-privacy@neostrada.pl wrote:

Quoted text here. Click to load it


PIO. I was going to describe the sequence, but I'll just quote
http://wiki.osdev.org/Ne2000 instead:


"Sending a Packet
The following sequence is the one observed by the ne2k-pci module in
linux. Note that some odd cards needs a patch (read-before-write) that
isn't covered here. The data configuration is initialized at 0x49
(word transfer, 8086 byte order, dual 16bit DMA, loopback disabled).
Note that the weird driver doesn't seem to use interrupts for
completion notification.

1. COMMAND register set to "start" and "nodma" (0x22)
2. RBCRx are loaded with the packet size
3. "Remote DMA complete?" bit is cleared by writing a 1 in bit 6 of
ISR (that's odd, but that's the way it works)
4. RSARx are loaded with 0x00 (low) and target page number (high)
respectively. At this stage, the chip is ready receiving packet data
and storing it in the ring buffer for emission.
5. COMMAND register set to "start" and "remote write DMA" (0x12)
6. Packets data is now written to the "data port" (that is register
0x10) of the NIC in a loop (or using an "outsx" if available). The NIC
will then update its remote DMA logic after each written word/dword
and places bytes in the transmit ring buffer.
7. Poll ISR register until bit 6 (Remote DMA completed) is set."

Receiving a packet is similar.


Re: NE2000 NIC driver for Linux 2.6
Quoted text here. Click to load it

Ok, thank you. That is what I needed - the info about address of  
"data port"  - 0x10. In my documentation there was no info about
0x10 address so I didn't know how to fetch or push data to NIC  
internal RAM.
  
efo


Re: NE2000 NIC driver for Linux 2.6
snipped-for-privacy@neostrada.pl wrote:
Quoted text here. Click to load it

AFAIR, the Adaptec SCSI host adapters (1540, 1542, etc) did do
bus mastering in ISA systems.

--  

Re: NE2000 NIC driver for Linux 2.6
On 4/7/2014 3:31 PM, Ulf Samuelsson wrote:

Quoted text here. Click to load it

Huh.

I wonder why it's specified that the DRQ0 to DRQ3 and DRQ5 to DRQ7 lines  
are specified to not only request service from the system DMA channel of  
that number, but also (quoting from  
http://www.techfest.com/hardware/bus/isa.htm here) " ... or to request  
ownership of the bus as a bus master device. ... "

As noted in another message, the Adaptec SCSI controllers (the 1540 et  
al) were DMA bus masters, or rather, could be when configured that way.

RwP

--  
I was sitting there, under my blanket, with fever and flu-like symptoms.
I was fuzzy in the head and having a hard time concentrating.
We've slightly trimmed the long signature. Click to see the full one.
Re: NE2000 NIC driver for Linux 2.6
On Mon, 07 Apr 2014 22:31:52 +0200, Ulf Samuelsson

Quoted text here. Click to load it

The ISA bus did have mastering capability - the NE2000 didn't use it
because it was designed to be cheap.

George

Site Timeline