Beginner Questions
Eric Norum
eric.norum at usask.ca
Wed Nov 27 16:43:57 UTC 2002
On Wednesday, November 27, 2002, at 03:12 PM, Imran Ali wrote:
> Me too a beginner in this embedded tech. I can't afford a board just
> for learning RTEMS. But I have the issue with my network card (an RTL
> 8139). Is it possible to port the driver from Linux? Or should I go
> for another NIC? If so which one? Make? Model?
I wouldn't spend (waste) any time porting the driver. I looked around
for PC-104 cards until I found one with a NIC compatible with the
Intel EtherExpress Pro (if_fxp.c driver). Thomas Doerfler ported the
driver and generously made it available.
If you *do* want to port a driver you should start from the FreeBSD
source, not the Linux source, since the RTEMS network stack came from
FreeBSD. The licensing issues are simpler, too.
Quoting from the FreeBSD source for the RTL 8139:
* The RealTek 8139 PCI NIC redefines the meaning of 'low end.' This is
* probably the worst PCI ethernet controller ever made, with the
possible
* exception of the FEAST chip made by SMC. The 8139 supports bus-master
* DMA, but it has a terrible interface that nullifies any performance
* gains that bus-master DMA usually offers.
*
* For transmission, the chip offers a series of four TX descriptor
* registers. Each transmit frame must be in a contiguous buffer,
aligned
* on a longword (32-bit) boundary. This means we almost always have to
* do mbuf copies in order to transmit a frame, except in the unlikely
* case where a) the packet fits into a single mbuf, and b) the packet
* is 32-bit aligned within the mbuf's data area. The presence of only
* four descriptor registers means that we can never have more than four
* packets queued for transmission at any one time.
*
* Reception is not much better. The driver has to allocate a single
large
* buffer area (up to 64K in size) into which the chip will DMA received
* frames. Because we don't know where within this region received
packets
* will begin or end, we have no choice but to copy data from the buffer
* area into mbufs in order to pass the packets up to the higher
protocol
* levels.
*
* It's impossible given this rotten design to really achieve decent
* performance at 100Mbps, unless you happen to have a 400Mhz PII or
* some equally overmuscled CPU to drive it.
*
* On the bright side, the 8139 does have a built-in PHY, although
* rather than using an MDIO serial interface like most other NICs, the
* PHY registers are directly accessible through the 8139's register
* space. The 8139 supports autonegotiation, as well as a 64-bit
multicast
* filter.
*
--
Eric Norum <eric.norum at usask.ca>
Department of Electrical Engineering
University of Saskatchewan
Saskatoon, Canada.
Phone: (306) 966-5394 FAX: (306) 966-5407
More information about the users
mailing list