[syslinux:lwip] pxe: Remove the lwip_test code

syslinux-bot for Eric W. Biederman ebiederm at xmission.com
Fri Apr 22 20:06:12 PDT 2011


Commit-ID:  2ce3f9aee490450bcc6a55eb79887778efdeba59
Gitweb:     http://syslinux.zytor.com/commit/2ce3f9aee490450bcc6a55eb79887778efdeba59
Author:     Eric W. Biederman <ebiederm at xmission.com>
AuthorDate: Tue, 12 Apr 2011 00:14:12 -0700
Committer:  Eric W. Biederman <ebiederm at xmission.com>
CommitDate: Tue, 12 Apr 2011 14:41:24 -0700

pxe: Remove the lwip_test code

lwip works so we no longer need this test code.

Signed-off-by: Eric W. Biederman <ebiederm at xmission.com>


---
 core/fs/pxe/pxe.c |  123 -----------------------------------------------------
 1 files changed, 0 insertions(+), 123 deletions(-)

diff --git a/core/fs/pxe/pxe.c b/core/fs/pxe/pxe.c
index 47f8976..b9a7a04 100644
--- a/core/fs/pxe/pxe.c
+++ b/core/fs/pxe/pxe.c
@@ -1027,129 +1027,6 @@ static void gpxe_init(void)
     has_gpxe = (~gpxe_funcs & 0x4b) == 0;
 }
 
-#if 0
-static void undi_clear_stats(void)
-{
-    static __lowmem t_PXENV_UNDI_CLEAR_STATISTICS clear;
-
-    pxe_call(PXENV_UNDI_CLEAR_STATISTICS, &clear);
-}
-
-static void undi_stats(void)
-{
-    static __lowmem t_PXENV_UNDI_GET_STATISTICS stats;
-
-    pxe_call(PXENV_UNDI_GET_STATISTICS, &stats);
-
-    printf("UNDI: Xmit %u Rcv %u CRC %u Resource %u\n",
-	   stats.XmtGoodFrames, stats.RcvGoodFrames,
-	   stats.RcvCRCErrors, stats.RcvResourceErrors);
-}
-
-static void lwip_test(void)
-{
-    err_t err;
-    struct ip_addr ip;
-    struct netconn *conn;
-    char header_buf[512];
-    int header_len;
-    static const char host_str[] = "www3.kernel.org";
-    static const char path_str[] = "/pub/linux/kernel/v2.6/linux-2.6.31.tar.gz";
-    struct netbuf *buf;
-    mstime_t t0, t1;
-    size_t bytes, x_bytes;
-    size_t ms, kbits_per_sec;
-    bool found_eoh;
-    int found_nl;
-    int i;
-
-    /* Test the lwIP stack by trying to open a HTTP connection... */
-    printf("Starting lwIP test...\n");
-    err = netconn_gethostbyname(host_str, &ip);
-    printf("Gethostbyname: ip = %d.%d.%d.%d, err = %d\n",
-	   ((uint8_t *)&ip)[0],
-	   ((uint8_t *)&ip)[1],
-	   ((uint8_t *)&ip)[2],
-	   ((uint8_t *)&ip)[3],
-	   err);
-
-    for (i = 1; i < 10; i++) {
-	undi_clear_stats();
-
-	conn = netconn_new(NETCONN_TCP);
-	err = netconn_connect(conn, &ip, 80);
-	if (err) {
-	    printf("netconn_connect error %d\n", err);
-	    continue;
-	}
-	
-	header_len = snprintf(header_buf, sizeof header_buf,
-				  "GET %s HTTP/1.0\r\n"
-				  "Host: %s\r\n"
-				  "\r\n",
-				  path_str, host_str);
-	
-	err = netconn_write(conn, header_buf, header_len, NETCONN_NOCOPY);
-	if (err)
-	    printf("netconn_write error %d\n", err);
-	bytes = x_bytes = 0;
-	found_nl = 0;
-	found_eoh = false;
-	
-	t0 = ms_timer();
-	for (;;) {
-		void *data;
-		char *p;
-		u16_t len;
-	
-		buf = netconn_recv(conn);
-		if (!buf)
-		    break;
-	
-		do {
-		    netbuf_data(buf, &data, &len);
-		    p = data;
-		    while (__unlikely(!found_eoh && len)) {
-			switch (*p) {
-			case '\r':
-			    break;
-			case '\n':
-			    if (++found_nl == 2)
-				found_eoh = true;
-			    break;
-			default:
-			    found_nl = 0;
-			    break;
-			}
-			p++;
-			len--;
-		    }
-		    bytes += len;
-		    if ((bytes^x_bytes) >> 20) {
-			printf("%dM\r", bytes >> 20);
-			x_bytes = bytes;
-		    }
-		} while (netbuf_next(buf) >= 0);
-	
-		netbuf_delete(buf);
-	}
-	t1 = ms_timer();
-	ms = t1 - t0;
-
-	kbits_per_sec = (bytes << 3) / ms;	
-
-	printf("Done: %zu bytes in %u ms (%u.%03u Mbps)\n",
-	       bytes, ms, kbits_per_sec/1000, kbits_per_sec%1000);
-	undi_stats();
-	
-	netconn_disconnect(conn);
-    }
-
-    for(;;)
-	asm volatile("hlt");
-}
-#endif
-
 /*
  * Network-specific initialization
  */



More information about the Syslinux-commits mailing list