Skip to contentSkip to conversation

patch for arch/ppc/8xx_io/fec.c

PATCH Thomas Lange 1 participant 1 message Oct 24, 2002

lore
Share & tools
lore
#0 lore raw

Against bk:linuxppc_2_4

Use retry counter (RC) to detect collisions instead of Defer (DEF).

Quoted 1 line

From Table 6-29: (MPC860T (Rev. D) Fast Ethernet Controller 0.8)

6 DEF Defer indication, written by FEC (valid if L = 1). Set when the FEC had to defer while trying to
transmit a frame. This bit is not set if a collision occurs during transmission.

10-13 RC Retry count, written by FEC (valid if L = 1). Counts retries needed
to successfully send this frame. If RC = 0, the frame was sent correctly the first time. If RC = 15, the frame was sent successfully while the retry
count was at its maximum value. If RL = 1, RC has no meaning.

/Thomas

fec_cfix.c renamed from fec.c +6 -5
@@ -502,11 +502,12 @@
 		if (bdp->cbd_sc & BD_ENET_TX_READY)
 			printk("HEY! Enet xmit interrupt and TX_READY.\n");
 #endif
-		/* Deferred means some collisions occurred during transmit,
-		 * but we eventually sent the packet OK.
-		 */
-		if (bdp->cbd_sc & BD_ENET_TX_DEF)
-			fep->stats.collisions++;
+		/* Check retry counter, i.e. collision counter */
+		/* Only valid if LAST is set, but it should always be. */
+		if (bdp->cbd_sc & BD_ENET_TX_RCMASK){
+			/* Note that counter cannot go higher than 15 */
+			fep->stats.collisions+=(bdp->cbd_sc & BD_ENET_TX_RCMASK)>>2;
+		}
 
 		/* Free the sk buffer associated with this last transmit.
 		 */