Pārlūkot izejas kodu

[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 gadus atpakaļ
vecāks
revīzija
8f17955c03
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2
    2
      src/drivers/net/epic100.c

+ 2
- 2
src/drivers/net/epic100.c Parādīt failu

@@ -376,7 +376,7 @@ epic100_poll(struct nic *nic, int retrieve)
376 376
 {
377 377
     int entry;
378 378
     int retcode;
379
-    int status;
379
+    unsigned long status;
380 380
     entry = cur_rx % RX_RING_SIZE;
381 381
 
382 382
     if ((rx_ring[entry].status & cpu_to_le32(RRING_OWN)) == RRING_OWN)
@@ -401,7 +401,7 @@ epic100_poll(struct nic *nic, int retrieve)
401 401
 	retcode = 0;
402 402
     } else {
403 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 405
 	memcpy(nic->packet, &rx_packet[entry * PKT_BUF_SZ], nic->packetlen);
406 406
 	retcode = 1;
407 407
     }

Notiek ielāde…
Atcelt
Saglabāt