Re: [U-Boot] [PATCH v10 3/3] Adding wget

2018-04-30 Thread Joe Hershberger
On Sat, Apr 14, 2018 at 6:43 PM,   wrote:
> From: Duncan Hare 
>
> Why http and wget:
>
> HTTP is the most efficient file retrieval protocol in common
> use. The client send a single request, after TCP connection,
> to receive a file of any length.
>
> WGET is the application which implements http file transfer
> outside browsers as a file transfer protocol. Versions of
> wget exists on many operating systems.
> END
>
> Signed-off-by: Duncan Hare 
> ---
>
> Changes in v10: None
>
>  cmd/Kconfig|   5 +
>  cmd/net.c  |  13 ++
>  include/net.h  |  16 +-
>  include/net/wget.h |  17 +++
>  net/Kconfig|   7 +-
>  net/Makefile   |   1 +
>  net/wget.c | 420 
> +
>  7 files changed, 470 insertions(+), 9 deletions(-)
>  create mode 100644 include/net/wget.h
>  create mode 100644 net/wget.c
>
> diff --git a/cmd/Kconfig b/cmd/Kconfig
> index 136836d146..1113d69950 100644
> --- a/cmd/Kconfig
> +++ b/cmd/Kconfig
> @@ -1094,6 +1094,11 @@ config CMD_ETHSW
>   operations such as enabling / disabling a port and
>   viewing/maintaining the filtering database (FDB)
>
> +config CMD_WGET
> +   bool "wget"
> +   select TCP
> +   help
> + Download a kernel, or other files, from a web server over TCP.
>  endif
>
>  endmenu
> diff --git a/cmd/net.c b/cmd/net.c
> index d7c776aacf..6a7a51f357 100644
> --- a/cmd/net.c
> +++ b/cmd/net.c
> @@ -110,6 +110,19 @@ U_BOOT_CMD(
>  );
>  #endif
>
> +#if defined(CONFIG_CMD_WGET)
> +static int do_wget(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> +{
> +   return netboot_common(WGET, cmdtp, argc, argv);
> +}
> +
> +U_BOOT_CMD(
> +   wget,   3,  1,  do_wget,
> +   "boot image via network using HTTP protocol",
> +   "[loadAddress] [[hostIPaddr:]path and image name]"
> +);
> +#endif
> +
>  static void netboot_update_env(void)
>  {
> char tmp[22];
> diff --git a/include/net.h b/include/net.h
> index e29d804a23..ec44bf2bec 100644
> --- a/include/net.h
> +++ b/include/net.h
> @@ -15,10 +15,14 @@
>  #include 
>  #include  /* for nton* / ntoh* stuff */
>
> -#define DEBUG_LL_STATE  0  /* Link local state machine changes */
> -#define DEBUG_DEV_PKT   0  /* Packets or info directed to the device */
> +#define DEBUG_LL_STATE  0  /* Link local state machine changes*/
> +#define DEBUG_DEV_PKT   0  /* Packets or info directed to the device  */
>  #define DEBUG_NET_PKT   0  /* Packets on info on the network at large */
> -#define DEBUG_INT_STATE 0  /* Internal network state changes */
> +#define DEBUG_INT_STATE 0  /* Internal network state change   */

Random formatting change... also changed differently in a former patch
if I recall.

> +
> +#if defined(CONFIG_TCP)

Why would a #define need to be protected?

> +#define CONFIG_SYS_RX_ETH_BUFFER 12 /* For TCP */
> +#endif
>
>  /*
>   * The number of receive packet buffers, and the required packet buffer
> @@ -31,10 +35,6 @@
>   * data, the sending TCP will stop sending.
>   */
>
> -#if defined(CONFIG_TCP)
> -#define CONFIG_SYS_RX_ETH_BUFFER 12/* For TCP */
> -#endif

Why not just put it in the proper place in the TCP patch instead of
moving it later?

> -
>  #ifdef CONFIG_SYS_RX_ETH_BUFFER
>  # define PKTBUFSRX CONFIG_SYS_RX_ETH_BUFFER
>  #else
> @@ -362,8 +362,8 @@ struct vlan_ethernet_hdr {
>  #define PROT_PPP_SES   0x8864  /* PPPoE session messages   */
>
>  #define IPPROTO_ICMP1  /* Internet Control Message Protocol*/
> +#define IPPROTO_TCP  6  /* Transmission Control Protocol*/
>  #define IPPROTO_UDP17  /* User Datagram Protocol   */
> -#define IPPROTO_TCP 6  /* Transmission Control Protocol*/

Yeah... same thing... Looks like you didn't ignore me when I made this
in an earlier version, you just applied the change to the wrong patch.

>
>  /*
>   * Internet Protocol (IP) header.
> diff --git a/include/net/wget.h b/include/net/wget.h
> new file mode 100644
> index 00..dce16c573d
> --- /dev/null
> +++ b/include/net/wget.h
> @@ -0,0 +1,17 @@
> +/*
> + * Duncan Hare Copyright 2017
> + */
> +
> +void wget_start(void); /* Begin wget */
> +
> +enum WGET_STATE {
> +   WGET_CLOSED,
> +   WGET_CONNECTING,
> +   WGET_CONNECTED,
> +   WGET_TRANSFERRING,
> +   WGET_TRANSFERRED};

Closing brace on its own line.

> +
> +#defineDEBUG_WGET  0   /* Set to 1 for debug messges 
> */
> +#defineSERVER_PORT 80
> +#defineWGET_RETRY_COUNT30
> +#defineWGET_TIMEOUT2000UL
> diff --git a/net/Kconfig b/net/Kconfig
> index cc6dd83fc4..c973def3b8 100644
> --- a/net/Kconfig
> +++ b/net/Kconfig
> @@ -36,7 +36,12 @@ config NET_TFTP_VARS
>  config TCP
> bool "Include Subset TCP stack 

Re: [U-Boot] [PATCH v10 3/3] Adding wget

2018-04-30 Thread Joe Hershberger
On Wed, Apr 25, 2018 at 6:52 PM, Duncan Hare  wrote:
>
>
>From: Simon Glass 
>  To: Duncan Hare 
> Cc: Wolfgang Denk ; U-Boot Mailing List ; 
> Joe Hershberger 
>  Sent: Wednesday, April 25, 2018 4:44 PM
>  Subject: Re: [PATCH v10 3/3] Adding wget
>
> Hi Duncan,
>
> On 25 April 2018 at 08:33, Duncan Hare  wrote:
> 
>>> From: Simon Glass 
>>> To: Duncan Hare 
>>> Cc: U-Boot Mailing List ; Joe Hershberger
>>> 
>>> Sent: Tuesday, April 24, 2018 10:01 PM
>>> Subject: Re: [PATCH v10 3/3] Adding wget
>>>
>>> Hi Duncan,
>>>
 On 22 April 2018 at 21:22, Duncan Hare  wrote:

>The server can be tested with the wget command which
> can be installed on linux.
> I doubt that loop-back like this will produce the scrambling of packet
> order
> which is a feature of push down stacks for packet queues
> in the internet.
>
> Hence my comment in a different thread about buffering on the pi. Few of
> the
> socs appear to use net_pkt_buf  buffers for net traffic.
>
> If there are too many transmission errors the sending tcp drops the
> connection. My solution to this is to halve the size of
> CONFIG_SYS_RX_ETH_BUFFER until transmission works.
>
 >
> Possibly CONFIG_SYS_RX_ETH_BUFFER could come under Kconfig.

Just to be clear, I was wondering about having an automated test. Manual
> tests are not very useful since people won't do them. See 'make tests' for
> all the test that we >currently >run. I'm pretty sure you could standard 
> up
> a little server, run your wget, then shut it down, all within a pytest 
> test.
>>>
>>>
>Regards,
>Simon
>>>
>>> Hi Wolfgang. Simon
>>>
>>> Can we put a test 4 Mbyte kernel on the u-boot website for an automated test
>>> for other users of TCP & Wget in u-boot?
>>>
>>> Then I can produce a standard u-boot script for testing.
>
>>How about the test just creates a little (4KB) file. We don't want the
>>tests to access a real network, if possible, just use localhost.

This makes it portable to where ever the test is run.

>
>>Regards,
>>Simon
> 4k is 4 packets. I believe most kernels are larger.
> I was think of a static server set up with a known dns name.
> Thta's what I've got.
>
> Do the test setup once.

This assume accessibility to this Internet server and that this server
is up /still configured when the test runs.

Please setup a test that can run in an environment without the
Internet. That is critical for unit tests.

Hand tests for Internet usage and the environmental effects are great,
but that can't be what we include in the auto tests for repeat-ability
reasons. Simon is asking for a separate type of test.

>
>
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v10 3/3] Adding wget

2018-04-30 Thread Joe Hershberger
On Tue, Apr 17, 2018 at 10:10 AM, Simon Glass  wrote:
> Hi Duncan,
>
> On 14 April 2018 at 17:43,   wrote:
>> From: Duncan Hare 
>>
>> Why http and wget:
>>
>> HTTP is the most efficient file retrieval protocol in common
>> use. The client send a single request, after TCP connection,
>> to receive a file of any length.
>>
>> WGET is the application which implements http file transfer
>> outside browsers as a file transfer protocol. Versions of
>> wget exists on many operating systems.
>> END
>
> Why END?

I would assume that (from reading this blurb) this is really a series
cover letter and the END would terminate that... so the Cover-letter:
tag is probably malformed.

Which begs the question, where the actual log is for the wget patch?

>>
>> Signed-off-by: Duncan Hare 
>> ---
>>
>> Changes in v10: None
>
> There is no change log here. Has nothing changed since v1?

Duncan has been struggling to use patman effectively.

>
> This code looks OK to me, but please can you run it through patman? I
> see what look like some style errors.

This is after using patman since v2 or so.

>
> How can we create a test for this? Can we add something to test_net.py ?
>
> Regards,
> Simon
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v10 3/3] Adding wget

2018-04-25 Thread Duncan Hare


   From: Simon Glass 
 To: Duncan Hare  
Cc: Wolfgang Denk ; U-Boot Mailing List ; 
Joe Hershberger 
 Sent: Wednesday, April 25, 2018 4:44 PM
 Subject: Re: [PATCH v10 3/3] Adding wget
   
Hi Duncan,

On 25 April 2018 at 08:33, Duncan Hare  wrote:

>> From: Simon Glass 
>> To: Duncan Hare 
>> Cc: U-Boot Mailing List ; Joe Hershberger
>> 
>> Sent: Tuesday, April 24, 2018 10:01 PM
>> Subject: Re: [PATCH v10 3/3] Adding wget
>>
>> Hi Duncan,
>>
>>> On 22 April 2018 at 21:22, Duncan Hare  wrote:
>>>
The server can be tested with the wget command which
 can be installed on linux.
 I doubt that loop-back like this will produce the scrambling of packet
 order
 which is a feature of push down stacks for packet queues
 in the internet.

 Hence my comment in a different thread about buffering on the pi. Few of
 the
 socs appear to use net_pkt_buf  buffers for net traffic.

 If there are too many transmission errors the sending tcp drops the
 connection. My solution to this is to halve the size of
 CONFIG_SYS_RX_ETH_BUFFER until transmission works.

>>> >
 Possibly CONFIG_SYS_RX_ETH_BUFFER could come under Kconfig.
>>>
>>>Just to be clear, I was wondering about having an automated test. Manual
 tests are not very useful since people won't do them. See 'make tests' for
 all the test that we >currently >run. I'm pretty sure you could standard up
 a little server, run your wget, then shut it down, all within a pytest 
 test.
>>
>>
Regards,
Simon
>>
>> Hi Wolfgang. Simon
>>
>> Can we put a test 4 Mbyte kernel on the u-boot website for an automated test
>> for other users of TCP & Wget in u-boot?
>>
>> Then I can produce a standard u-boot script for testing.

>How about the test just creates a little (4KB) file. We don't want the
>tests to access a real network, if possible, just use localhost.

>Regards,
>Simon
4k is 4 packets. I believe most kernels are larger. 
I was think of a static server set up with a known dns name.
Thta's what I've got. 

Do the test setup once.



   
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v10 3/3] Adding wget

2018-04-25 Thread Simon Glass
Hi Duncan,

On 25 April 2018 at 08:33, Duncan Hare  wrote:
>
>
> 
> From: Simon Glass 
> To: Duncan Hare 
> Cc: U-Boot Mailing List ; Joe Hershberger
> 
> Sent: Tuesday, April 24, 2018 10:01 PM
> Subject: Re: [PATCH v10 3/3] Adding wget
>
> Hi Duncan,
>
> On 22 April 2018 at 21:22, Duncan Hare  wrote:
>>
>>>The server can be tested with the wget command which
>>> can be installed on linux.
>>> I doubt that loop-back like this will produce the scrambling of packet
>>> order
>>> which is a feature of push down stacks for packet queues
>>> in the internet.
>>>
>>> Hence my comment in a different thread about buffering on the pi. Few of
>>> the
>>> socs appear to use net_pkt_buf  buffers for net traffic.
>>>
>>> If there are too many transmission errors the sending tcp drops the
>>> connection. My solution to this is to halve the size of
>>> CONFIG_SYS_RX_ETH_BUFFER until transmission works.
>>>
>  >
>>> Possibly CONFIG_SYS_RX_ETH_BUFFER could come under Kconfig.
>>
>>>Just to be clear, I was wondering about having an automated test. Manual
>>> tests are not very useful since people won't do them. See 'make tests' for
>>> all the test that we >currently >run. I'm pretty sure you could standard up
>>> a little server, run your wget, then shut it down, all within a pytest test.
>
>
>>>Regards,
>>>Simon
>
> Hi Wolfgang. Simon
>
> Can we put a test 4 Mbyte kernel on the u-boot website for an automated test
> for other users of TCP & Wget in u-boot?
>
> Then I can produce a standard u-boot script for testing.

How about the test just creates a little (4KB) file. We don't want the
tests to access a real network, if possible, just use localhost.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v10 3/3] Adding wget

2018-04-25 Thread Duncan Hare


 From: Simon Glass 
 To: Duncan Hare  
Cc: U-Boot Mailing List ; Joe Hershberger 

 Sent: Tuesday, April 24, 2018 10:01 PM
 Subject: Re: [PATCH v10 3/3] Adding wget
   
Hi Duncan,

On 22 April 2018 at 21:22, Duncan Hare  wrote:
>
>>The server can be tested with the wget command which
>> can be installed on linux.
>> I doubt that loop-back like this will produce the scrambling of packet order
>> which is a feature of push down stacks for packet queues
>> in the internet.
>>
>> Hence my comment in a different thread about buffering on the pi. Few of the
>> socs appear to use net_pkt_buf  buffers for net traffic.
>>
>> If there are too many transmission errors the sending tcp drops the
>> connection. My solution to this is to halve the size of
>> CONFIG_SYS_RX_ETH_BUFFER until transmission works.
>>
 > 
>> Possibly CONFIG_SYS_RX_ETH_BUFFER could come under Kconfig.
>
>>Just to be clear, I was wondering about having an automated test. Manual 
>>tests are not very useful since people won't do them. See 'make tests' for 
>>all the test that we >currently >run. I'm pretty sure you could standard up a 
>>little server, run your wget, then shut it down, all within a pytest test.

>>Regards,
>>Simon

Hi Wolfgang. Simon
Can we put a test 4 Mbyte kernel on the u-boot website for an automated test 
for other users of TCP & Wget in u-boot?
Then I can produce a standard u-boot script for testing.
RegardsDuncan Hare
   
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v10 3/3] Adding wget

2018-04-24 Thread Simon Glass
Hi Duncan,

On 22 April 2018 at 21:22, Duncan Hare  wrote:
>
>
> 
>>From: Simon Glass 
>>To: Duncan Hare 
>>Sent: Sunday, April 22, 2018 1:10 PM
>>Subject: Re: [PATCH v10 3/3] Adding wget
>>
>>Hi Duncan,
>
>>On 17 April 2018 at 15:58, Duncan Hare  wrote:
>>> From: Simon Glass 
>
>>> It has been through patman, and the only errors flagged a packed
>>> structures,
>>> necessary for packed headers.
>
>>It should be possible in the Python test to enable an http server on
>> localhost with a few lines of code, and then connect to it in the test?
>
> Yes server at port 80. The server can be tested with the wget command
which
> can be installed on linux.
> I doubt that loop-back like this will produce the scrambling of packet
order
> which is a feature of push down stacks for packet queues
> in the internet.
>
> The pi is easy to overrun when testing on a low latency network, because
the
> TCP send window size is defined by the number of
> net_rx_buffers, which is controlled the CONFIG_SYS_RX_ETH_BUFFER in
> include.net.h,  which sets PKTBUFSRX at the beginning of include/net.h,
> which in-turn defines a buffer pool in net/net.c, array named
net_pkt_buf.
>
> Hence my comment in a different thread about buffering on the pi. Few of
the
> socs appear to use net_pkt_buf  buffers for net traffic.
>
> If there are too many transmission errors the sending tcp drops the
> connection. My solution to this is to halve the size of
> CONFIG_SYS_RX_ETH_BUFFER until transmission works.
>
> If I was thinking about a buffer pool for in the drivers, I'd implement it
> in net/net.c. Interface "getbuffer," returns a pointer,
> and increments an index to the next net_rx_buffer with no protection for
> overrun. Overrun is managed by ack numbers in TCP
> and timeout in UDP.
>
> Possibly CONFIG_SYS_RX_ETH_BUFFER could come under Kconfig.

Just to be clear, I was wondering about having an automated test. Manual
tests are not very useful since people won't do them. See 'make tests' for
all the test that we currently run. I'm pretty sure you could standard up a
little server, run your wget, then shut it down, all within a pytest test.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v10 3/3] Adding wget

2018-04-22 Thread Duncan Hare


>From: Simon Glass 
 >To: Duncan Hare  
 >Sent: Sunday, April 22, 2018 1:10 PM
 >Subject: Re: [PATCH v10 3/3] Adding wget
   >
>Hi Duncan,

>On 17 April 2018 at 15:58, Duncan Hare  wrote:
>> From: Simon Glass 
>> It has been through patman, and the only errors flagged a packed structures,
>> necessary for packed headers.

>It should be possible in the Python test to enable an http server on localhost 
>with a few lines of code, and then connect to it in the test?
Yes server at port 80. The server can be tested with the wget command which can 
be installed on linux.I doubt that loop-back like this will produce the 
scrambling of packet order which is a feature of push down stacks for packet 
queuesin the internet.
The pi is easy to overrun when testing on a low latency network, because the 
TCP send window size is defined by the number ofnet_rx_buffers, which is 
controlled the CONFIG_SYS_RX_ETH_BUFFER in include.net.h,  which sets PKTBUFSRX 
at the beginning of include/net.h, 
which in-turn defines a buffer pool in net/net.c, array named  net_pkt_buf.
Hence my comment in a different thread about buffering on the pi. Few of the 
socs appear to use net_pkt_buf  buffers for net traffic.

If there are too many transmission errors the sending tcp drops the connection. 
My solution to this is to halve the size of 
CONFIG_SYS_RX_ETH_BUFFER until transmission works.
If I was thinking about a buffer pool for in the drivers, I'd implement it in 
net/net.c. Interface "getbuffer," returns a pointer, 
and increments an index to the next net_rx_buffer with no protection for 
overrun. Overrun is managed by ack numbers in TCPand timeout in UDP.

Possibly CONFIG_SYS_RX_ETH_BUFFER could come under Kconfig.

>Regards,
>Simon
RegardsDuncan


   
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v10 3/3] Adding wget

2018-04-18 Thread Duncan Hare



Hi Duncan,

On 14 April 2018 at 17:43,   wrote:
>> From: Duncan Hare 
>>
> Why http and wget:
>> END

Why END?
Don't know.  will delete.

>
> Signed-off-by: Duncan Hare 
> ---
>
> Changes in v10: None

There is no change log here. Has nothing changed since v1?
changed c to C for cover meno tag.

This code looks OK to me, but please can you run it through patman? I
see what look like some style errors.
Has passed patman. Only error messages are for packed structures.

How can we create a test for this? Can we add something to test_net.py ?
Do not see why not. It's only an app and has no hardware dependencies. 
One needs a web server and test file, and code the verify the integrity of the 
test file in local memory.I used a file with line numbers and a pattern 
repeated on every "line". Make it easy to findinvalid offsets mis ordered 
packets.
We use nginx as the web server. We used wbox for a while, but then mvbed to 
nginx. We could not get Apacheconfigured.
For internet test we use a Ubuntu image & nginx on the Amazon cloud. 
The internet path to Amazon does a nice job of scrambling the order of packets.

Regards,
Duncan


   
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v10 3/3] Adding wget

2018-04-17 Thread Simon Glass
Hi Duncan,

On 14 April 2018 at 17:43,   wrote:
> From: Duncan Hare 
>
> Why http and wget:
>
> HTTP is the most efficient file retrieval protocol in common
> use. The client send a single request, after TCP connection,
> to receive a file of any length.
>
> WGET is the application which implements http file transfer
> outside browsers as a file transfer protocol. Versions of
> wget exists on many operating systems.
> END

Why END?

>
> Signed-off-by: Duncan Hare 
> ---
>
> Changes in v10: None

There is no change log here. Has nothing changed since v1?

This code looks OK to me, but please can you run it through patman? I
see what look like some style errors.

How can we create a test for this? Can we add something to test_net.py ?

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v10 3/3] Adding wget

2018-04-14 Thread DH
From: Duncan Hare 

Why http and wget:

HTTP is the most efficient file retrieval protocol in common
use. The client send a single request, after TCP connection,
to receive a file of any length.

WGET is the application which implements http file transfer
outside browsers as a file transfer protocol. Versions of
wget exists on many operating systems.
END

Signed-off-by: Duncan Hare 
---

Changes in v10: None

 cmd/Kconfig|   5 +
 cmd/net.c  |  13 ++
 include/net.h  |  16 +-
 include/net/wget.h |  17 +++
 net/Kconfig|   7 +-
 net/Makefile   |   1 +
 net/wget.c | 420 +
 7 files changed, 470 insertions(+), 9 deletions(-)
 create mode 100644 include/net/wget.h
 create mode 100644 net/wget.c

diff --git a/cmd/Kconfig b/cmd/Kconfig
index 136836d146..1113d69950 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1094,6 +1094,11 @@ config CMD_ETHSW
  operations such as enabling / disabling a port and
  viewing/maintaining the filtering database (FDB)
 
+config CMD_WGET
+   bool "wget"
+   select TCP
+   help
+ Download a kernel, or other files, from a web server over TCP.
 endif
 
 endmenu
diff --git a/cmd/net.c b/cmd/net.c
index d7c776aacf..6a7a51f357 100644
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -110,6 +110,19 @@ U_BOOT_CMD(
 );
 #endif
 
+#if defined(CONFIG_CMD_WGET)
+static int do_wget(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   return netboot_common(WGET, cmdtp, argc, argv);
+}
+
+U_BOOT_CMD(
+   wget,   3,  1,  do_wget,
+   "boot image via network using HTTP protocol",
+   "[loadAddress] [[hostIPaddr:]path and image name]"
+);
+#endif
+
 static void netboot_update_env(void)
 {
char tmp[22];
diff --git a/include/net.h b/include/net.h
index e29d804a23..ec44bf2bec 100644
--- a/include/net.h
+++ b/include/net.h
@@ -15,10 +15,14 @@
 #include 
 #include  /* for nton* / ntoh* stuff */
 
-#define DEBUG_LL_STATE  0  /* Link local state machine changes */
-#define DEBUG_DEV_PKT   0  /* Packets or info directed to the device */
+#define DEBUG_LL_STATE  0  /* Link local state machine changes*/
+#define DEBUG_DEV_PKT   0  /* Packets or info directed to the device  */
 #define DEBUG_NET_PKT   0  /* Packets on info on the network at large */
-#define DEBUG_INT_STATE 0  /* Internal network state changes */
+#define DEBUG_INT_STATE 0  /* Internal network state change   */
+
+#if defined(CONFIG_TCP)
+#define CONFIG_SYS_RX_ETH_BUFFER 12 /* For TCP */
+#endif
 
 /*
  * The number of receive packet buffers, and the required packet buffer
@@ -31,10 +35,6 @@
  * data, the sending TCP will stop sending.
  */
 
-#if defined(CONFIG_TCP)
-#define CONFIG_SYS_RX_ETH_BUFFER 12/* For TCP */
-#endif
-
 #ifdef CONFIG_SYS_RX_ETH_BUFFER
 # define PKTBUFSRX CONFIG_SYS_RX_ETH_BUFFER
 #else
@@ -362,8 +362,8 @@ struct vlan_ethernet_hdr {
 #define PROT_PPP_SES   0x8864  /* PPPoE session messages   */
 
 #define IPPROTO_ICMP1  /* Internet Control Message Protocol*/
+#define IPPROTO_TCP  6  /* Transmission Control Protocol*/
 #define IPPROTO_UDP17  /* User Datagram Protocol   */
-#define IPPROTO_TCP 6  /* Transmission Control Protocol*/
 
 /*
  * Internet Protocol (IP) header.
diff --git a/include/net/wget.h b/include/net/wget.h
new file mode 100644
index 00..dce16c573d
--- /dev/null
+++ b/include/net/wget.h
@@ -0,0 +1,17 @@
+/*
+ * Duncan Hare Copyright 2017
+ */
+
+void wget_start(void); /* Begin wget */
+
+enum WGET_STATE {
+   WGET_CLOSED,
+   WGET_CONNECTING,
+   WGET_CONNECTED,
+   WGET_TRANSFERRING,
+   WGET_TRANSFERRED};
+
+#defineDEBUG_WGET  0   /* Set to 1 for debug messges */
+#defineSERVER_PORT 80
+#defineWGET_RETRY_COUNT30
+#defineWGET_TIMEOUT2000UL
diff --git a/net/Kconfig b/net/Kconfig
index cc6dd83fc4..c973def3b8 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -36,7 +36,12 @@ config NET_TFTP_VARS
 config TCP
bool "Include Subset TCP stack for wget"
help
- TCP protocol support for wget.
+ Selecting TCP protocol support adds TCP for receiving
+ streams of data. The TCP packets are presented
+ as received (possibly out of order). The application
+ receiving the TCP stream places the date by sequence number
+ as an offset from the kernel address. TCP transmission is
+ not supported.
 
 config BOOTP_BOOTPATH
bool "Enable BOOTP BOOTPATH"
diff --git a/net/Makefile b/net/Makefile
index 25729ebeeb..f83df5b728 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -26,6 +26,7 @@ obj-$(CONFIG_CMD_RARP) += rarp.o
 obj-$(CONFIG_CMD_SNTP) += sntp.o
 obj-$(CONFIG_CMD_NET)  += tftp.o