RTL8169: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
Line 134: Line 134:
else
else
Rx_Descriptors[i].command = (OWN | (rx_buffer_len & 0x3FFF));
Rx_Descriptors[i].command = (OWN | (rx_buffer_len & 0x3FFF));

Rx_Descriptors[i].low_buf = (unsigned int)&packet_buffer_address; /* This is where the packet data will go */
/** packet_buffer_address is the *physical* address for the buffer */
Rx_Descriptors[i].low_buf = (unsigned int)&packet_buffer_address;
Rx_Descriptors[i].high_buf = 0;
Rx_Descriptors[i].high_buf = 0;
/* If you are programming for a 64-bit OS, put the high memory location in the 'high_buf' descriptor area */
/* If you are programming for a 64-bit OS, put the high memory location in the 'high_buf' descriptor area */
Line 159: Line 161:
/* offset 0x20 == Transmit Descriptor Start Address Register
/* offset 0x20 == Transmit Descriptor Start Address Register
offset 0xE4 == Receive Descriptor Start Address Register */
offset 0xE4 == Receive Descriptor Start Address Register
Again, these are *physical* addresses. This code assumes physical==linear, this is
typically not the case in real world kernels
*/
outportl(ioaddr + 0x20, (unsigned long)&Tx_Descriptors[0]; /* Tell the NIC where the first Tx descriptor is */
outportl(ioaddr + 0x20, (unsigned long)&Tx_Descriptors[0]; /* Tell the NIC where the first Tx descriptor is */
outportl(ioaddr + 0xE4, (unsigned long)&Rx_Descriptors[0]; /* Tell the NIC where the first Rx descriptor is */
outportl(ioaddr + 0xE4, (unsigned long)&Rx_Descriptors[0]; /* Tell the NIC where the first Rx descriptor is */