Intel Ethernet i217: Difference between revisions

Jump to navigation Jump to search
m
Bot: Replace deprecated source tag with syntaxhighlight
[unchecked revision][unchecked revision]
m (Bot: Replace deprecated source tag with syntaxhighlight)
m (Bot: Replace deprecated source tag with syntaxhighlight)
Line 9:
 
To start with, lets state some macro definitions that we are going to use in the code.
<sourcesyntaxhighlight lang="c">
 
#define INTEL_VEND 0x8086 // Vendor ID for Intel
Line 106:
#define TSTA_LC (1 << 2) // Late Collision
#define LSTA_TU (1 << 3) // Transmit Underrun
</syntaxhighlight>
</source>
 
Now lets define the data structures for the transmit and receive buffers
Line 406:
Now we need to detect if the card has an EEPROM or not. The Qemu and Bochs emulate EEPROM, but the I217 and 82577LM do not. The following first method tries to read the status field of the EEPROM, the status field should contain the value 0x10, and based on the result the internal data member eerprom_exists. The second method performs a 2-bytes read operation from the EEPROM
 
<sourcesyntaxhighlight lang="c">
bool E1000::detectEEProm()
{
Line 441:
}
 
</syntaxhighlight>
</source>
 
 
Line 447:
The first thing you will need to do after detecting the BAR0 type and the existence of the EEPROM is to read the hardware MAC address of the NIC. The following method reads the hardware mac address based. If an EEPROM exists it will read it from the EEPROM else it will read it from address 0x5400 where it should be located in that case. It is very important to detect if an EEPROM exists or not prior to reading the MAC address.
 
<sourcesyntaxhighlight lang="c">
 
bool E1000::readMACAddress()
Line 479:
return true;
}
</syntaxhighlight>
</source>
 
 
Now, we need to configure the transmit and receive descriptor buffers, here are the implementation of the corresponding methods. The rxinit method is identical to the one I use for my e1000 driver. The difference is in txinit
 
<sourcesyntaxhighlight lang="c">
 
void E1000::rxinit()
Line 564:
 
 
</syntaxhighlight>
</source>
 
 
Line 602:
 
 
<sourcesyntaxhighlight lang="c">
 
bool E1000::start ()
Line 625:
 
 
</syntaxhighlight>
</source>
 
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu