Browse Source

[epic100] Fix wrong field used as rx packet length

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>
tags/v1.20.1
Alexey 12 years ago
parent
commit
8f17955c03
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/drivers/net/epic100.c

+ 2
- 2
src/drivers/net/epic100.c View File

376
 {
376
 {
377
     int entry;
377
     int entry;
378
     int retcode;
378
     int retcode;
379
-    int status;
379
+    unsigned long status;
380
     entry = cur_rx % RX_RING_SIZE;
380
     entry = cur_rx % RX_RING_SIZE;
381
 
381
 
382
     if ((rx_ring[entry].status & cpu_to_le32(RRING_OWN)) == RRING_OWN)
382
     if ((rx_ring[entry].status & cpu_to_le32(RRING_OWN)) == RRING_OWN)
401
 	retcode = 0;
401
 	retcode = 0;
402
     } else {
402
     } else {
403
 	/* Omit the four octet CRC from the length. */
403
 	/* Omit the four octet CRC from the length. */
404
-	nic->packetlen = le32_to_cpu((rx_ring[entry].buflength))- 4;
404
+	nic->packetlen = (status >> 16) - 4;
405
 	memcpy(nic->packet, &rx_packet[entry * PKT_BUF_SZ], nic->packetlen);
405
 	memcpy(nic->packet, &rx_packet[entry * PKT_BUF_SZ], nic->packetlen);
406
 	retcode = 1;
406
 	retcode = 1;
407
     }
407
     }

Loading…
Cancel
Save