AMD PCNET: Difference between revisions
[unchecked revision] | [unchecked revision] |
m (Added specifications link) |
m (Too many s's) |
||
Line 41: | Line 41: | ||
==Links== |
==Links== |
||
[http://www.datasheetcatalog.org/datasheet/AdvancedMicroDevices/mXxsxv.pdf |
[http://www.datasheetcatalog.org/datasheet/AdvancedMicroDevices/mXxsxv.pdf Specification] |
Revision as of 15:39, 14 June 2012
The AMD PCNET family of network interface chips are supported by most popular virtual machines and emulators, including QEMU, VMware and VirtualBox. While not as simple as the RTL8139 it is easier to test with an emulator, as the RTL8139 is only supported in QEMU, and getting QEMU's full network support running is sometimes difficult. This article will focus on the Am79C970A a.k.a. the AMD PCnet-PCI II in VirtualBox.
Overview
This article will cover using the card with IO port accesses as opposed to memory mapped IO.
The card uses a system of index registers. What this means is that one first writes to an IO port to select the chip register you want to access, and then read/write to/from a certain IO port. It can also support reading and writing in both 16 and 32bit modes, but this article will use 32bit mode for simplicity's sake.
IO Ports
In 32bit mode the card has only 4+6 IO ports necessary to use the card:
Offset (from IO base) | Name |
---|---|
0x00-0x05 | MAC0-MAC5 |
0x10 | RDP |
0x14 | RAP |
0x18 | RST |
0x1C | BDP |
- MAC0-MAC5 are the ports used to access the MAC address stored in the card's ROM. These should be accessed byte-by-byte in order to ensure compatibility with all three emulators.
- RAP is the Register Access Pointer, and selects which card register one wants to access.
- RDP is the Register Data Pointer and is the port used to access the first set of registers
- BDP is the Bus Configuration Data Port and is used to access the second set of registers
- RST is used to reset the card.
DMA Descriptors
The PCNET cards use a series of descriptors to handle DMA.
struct pcnet_descriptor {
uint32_t address; //physical address of buffer
uint16_t length; //length of buffer (rx) or length of packet (tx)
uint16_t status;
uint32_t flags;
uint32_t user;//can be used to store whatever value you want, such as the virtual address of your buffer
};