Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jun 2006 20:38:05 GMT
From:      Olivier Houchard <cognet@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 99555 for review
Message-ID:  <200606182038.k5IKc5Df054820@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=99555

Change 99555 by cognet@cognet on 2006/06/18 20:37:24

	- Spell BOOT_MP920X BOOT_KB9202.
	- Reset the timeout each time we received a packet.

Affected files ...

.. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#18 edit

Differences ...

==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#18 (text+ko) ====

@@ -232,7 +232,7 @@
  * any here.
  * .KB_C_FN_DEFINITION_END
  */
-static void
+static int
 CheckForNewPacket(ip_header_t *pHeader)
 {
 	unsigned short	*pFrameType;
@@ -252,7 +252,7 @@
 	}
 		
 	if (!process)
-		return ;
+		return (0);
 						
 	process = i;
 		
@@ -334,6 +334,7 @@
 		}
 	}
 	p_rxBD[process].address &= ~0x01;
+	return (1);
 }
 
 
@@ -613,7 +614,7 @@
 		  AT91C_PA8_ETXEN | AT91C_PA16_EMDIO | AT91C_PA9_ETX0 |
 		  AT91C_PA10_ETX1 | AT91C_PA11_ECRS_ECRSDV | AT91C_PA15_EMDC |
 		  AT91C_PA7_ETXCK_EREFCK;
-#ifdef BOOT_MB920X	/* Really !RMII */
+#ifdef BOOT_KB9202	/* Really !RMII */
 		AT91C_BASE_PIOB->PIO_BSR =
 		  AT91C_PB12_ETX2 | AT91C_PB13_ETX3 | AT91C_PB14_ETXER |
 		  AT91C_PB15_ERX2 | AT91C_PB16_ERX3 | AT91C_PB17_ERXDV |
@@ -641,16 +642,18 @@
 	ackBlock = -1;
 
 	while (running && timeout) {
+		int newpacket;
 
-		CheckForNewPacket(&IpHeader);
+		newpacket = CheckForNewPacket(&IpHeader);
 
 		tickUpdate = 0;
 
-		if (thisSeconds != GetSeconds()) {
+		if (!newpacket && thisSeconds != GetSeconds()) {
 			tickUpdate = 1;
 			--timeout;
 			thisSeconds = GetSeconds();
-		}
+		} else if (newpacket)
+			timeout = 10;
 
 		switch (state) {
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606182038.k5IKc5Df054820>