]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[epic100] Fix wrong field used as rx packet length
authorAlexey <darkover@corbina.com.ua>
Thu, 24 May 2012 19:41:40 +0000 (22:41 +0300)
committerMichael Brown <mcb30@ipxe.org>
Mon, 23 Jul 2012 12:22:43 +0000 (13:22 +0100)
Datasheet pp. 41-42 defines 'rx packet length' as upper word of
'status' dword field of the receive descriptor table.

  http://www.smsc.com/media/Downloads_Archive/discontinued/83c171.pdf

Tested on SMC EtherPower II.

Signed-off-by: Alexey Smazhenko <darkover@corbina.com.ua>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/epic100.c

index b478fab500a720a234b6880826237960e0f55ca5..884eb72297db53bba77377871eb26a234df70185 100644 (file)
@@ -376,7 +376,7 @@ epic100_poll(struct nic *nic, int retrieve)
 {
     int entry;
     int retcode;
-    int status;
+    unsigned long status;
     entry = cur_rx % RX_RING_SIZE;
 
     if ((rx_ring[entry].status & cpu_to_le32(RRING_OWN)) == RRING_OWN)
@@ -401,7 +401,7 @@ epic100_poll(struct nic *nic, int retrieve)
        retcode = 0;
     } else {
        /* Omit the four octet CRC from the length. */
-       nic->packetlen = le32_to_cpu((rx_ring[entry].buflength))- 4;
+       nic->packetlen = (status >> 16) - 4;
        memcpy(nic->packet, &rx_packet[entry * PKT_BUF_SZ], nic->packetlen);
        retcode = 1;
     }