diff mbox

[U-Boot,2/8] net: tftp: Move tftp.h file from ./net to ./include

Message ID 1436715044-18706-3-git-send-email-l.majewski@majess.pl
State Superseded
Headers show

Commit Message

Lukasz Majewski July 12, 2015, 3:30 p.m. UTC
This change gives the ability to reuse the <tftp.h> header file by other
subsystems (like e.g. dfu).

Without this change compilation error emerges for the legacy update.c file.

Signed-off-by: Lukasz Majewski <l.majewski@majess.pl>
---
 common/update.c |  2 +-
 include/tftp.h  | 30 ++++++++++++++++++++++++++++++
 net/bootp.c     |  2 +-
 net/net.c       |  2 +-
 net/rarp.c      |  2 +-
 net/tftp.c      |  2 +-
 net/tftp.h      | 30 ------------------------------
 7 files changed, 35 insertions(+), 35 deletions(-)
 create mode 100644 include/tftp.h
 delete mode 100644 net/tftp.h

Comments

Joe Hershberger July 15, 2015, 6:17 p.m. UTC | #1
Hi Lukasz,

On Sun, Jul 12, 2015 at 10:30 AM, Lukasz Majewski <l.majewski@majess.pl> wrote:
> This change gives the ability to reuse the <tftp.h> header file by other
> subsystems (like e.g. dfu).
>
> Without this change compilation error emerges for the legacy update.c file.
>
> Signed-off-by: Lukasz Majewski <l.majewski@majess.pl>
> ---
>  common/update.c |  2 +-
>  include/tftp.h  | 30 ++++++++++++++++++++++++++++++

I'd like to start moving net headers to include/net/*... lets start here.

>  net/bootp.c     |  2 +-
>  net/net.c       |  2 +-
>  net/rarp.c      |  2 +-
>  net/tftp.c      |  2 +-
>  net/tftp.h      | 30 ------------------------------
>  7 files changed, 35 insertions(+), 35 deletions(-)
>  create mode 100644 include/tftp.h
>  delete mode 100644 net/tftp.h
>
> diff --git a/common/update.c b/common/update.c
> index 1c6aa18..7bd7e94 100644
> --- a/common/update.c
> +++ b/common/update.c
> @@ -20,7 +20,7 @@
>  #include <command.h>
>  #include <flash.h>
>  #include <net.h>
> -#include <net/tftp.h>
> +#include <tftp.h>
>  #include <malloc.h>
>
>  /* env variable holding the location of the update file */
> diff --git a/include/tftp.h b/include/tftp.h
> new file mode 100644
> index 0000000..c411c9b
> --- /dev/null
> +++ b/include/tftp.h
> @@ -0,0 +1,30 @@
> +/*
> + *     LiMon - BOOTP/TFTP.
> + *
> + *     Copyright 1994, 1995, 2000 Neil Russell.
> + *     Copyright 2011 Comelit Group SpA
> + *                    Luca Ceresoli <luca.ceresoli@comelit.it>
> + *     (See License)
> + */
> +
> +#ifndef __TFTP_H__
> +#define __TFTP_H__
> +
> +/**********************************************************************/
> +/*
> + *     Global functions and variables.
> + */
> +
> +/* tftp.c */
> +void tftp_start(enum proto_t protocol);        /* Begin TFTP get/put */
> +
> +#ifdef CONFIG_CMD_TFTPSRV
> +void tftp_start_server(void);  /* Wait for incoming TFTP put */
> +#endif
> +
> +extern ulong tftp_timeout_ms;
> +extern int tftp_timeout_count_max;
> +
> +/**********************************************************************/
> +
> +#endif /* __TFTP_H__ */
> diff --git a/net/bootp.c b/net/bootp.c
> index 43466af..d325cd0 100644
> --- a/net/bootp.c
> +++ b/net/bootp.c
> @@ -11,8 +11,8 @@
>  #include <common.h>
>  #include <command.h>
>  #include <net.h>
> +#include <tftp.h>
>  #include "bootp.h"
> -#include "tftp.h"
>  #include "nfs.h"
>  #ifdef CONFIG_STATUS_LED
>  #include <status_led.h>
> diff --git a/net/net.c b/net/net.c
> index 67e0ad2..8460a51 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -86,6 +86,7 @@
>  #include <environment.h>
>  #include <errno.h>
>  #include <net.h>
> +#include <tftp.h>
>  #if defined(CONFIG_STATUS_LED)
>  #include <miiphy.h>
>  #include <status_led.h>
> @@ -105,7 +106,6 @@
>  #if defined(CONFIG_CMD_SNTP)
>  #include "sntp.h"
>  #endif
> -#include "tftp.h"
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> diff --git a/net/rarp.c b/net/rarp.c
> index 4ce2f37..2693d4b 100644
> --- a/net/rarp.c
> +++ b/net/rarp.c
> @@ -8,10 +8,10 @@
>  #include <common.h>
>  #include <command.h>
>  #include <net.h>
> +#include <tftp.h>
>  #include "nfs.h"
>  #include "bootp.h"
>  #include "rarp.h"
> -#include "tftp.h"
>
>  #define TIMEOUT 5000UL /* Milliseconds before trying BOOTP again */
>  #ifndef        CONFIG_NET_RETRY_COUNT
> diff --git a/net/tftp.c b/net/tftp.c
> index 3e99e73..f95f737 100644
> --- a/net/tftp.c
> +++ b/net/tftp.c
> @@ -10,7 +10,7 @@
>  #include <command.h>
>  #include <mapmem.h>
>  #include <net.h>
> -#include "tftp.h"
> +#include <tftp.h>
>  #include "bootp.h"
>  #ifdef CONFIG_SYS_DIRECT_FLASH_TFTP
>  #include <flash.h>
> diff --git a/net/tftp.h b/net/tftp.h
> deleted file mode 100644
> index c411c9b..0000000
> --- a/net/tftp.h
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -/*
> - *     LiMon - BOOTP/TFTP.
> - *
> - *     Copyright 1994, 1995, 2000 Neil Russell.
> - *     Copyright 2011 Comelit Group SpA
> - *                    Luca Ceresoli <luca.ceresoli@comelit.it>
> - *     (See License)
> - */
> -
> -#ifndef __TFTP_H__
> -#define __TFTP_H__
> -
> -/**********************************************************************/
> -/*
> - *     Global functions and variables.
> - */
> -
> -/* tftp.c */
> -void tftp_start(enum proto_t protocol);        /* Begin TFTP get/put */
> -
> -#ifdef CONFIG_CMD_TFTPSRV
> -void tftp_start_server(void);  /* Wait for incoming TFTP put */
> -#endif
> -
> -extern ulong tftp_timeout_ms;
> -extern int tftp_timeout_count_max;
> -
> -/**********************************************************************/
> -
> -#endif /* __TFTP_H__ */
> --
> 2.1.4
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
Lukasz Majewski July 16, 2015, 8:02 p.m. UTC | #2
Hi Joe,

> Hi Lukasz,
> 
> On Sun, Jul 12, 2015 at 10:30 AM, Lukasz Majewski
> <l.majewski@majess.pl> wrote:
> > This change gives the ability to reuse the <tftp.h> header file by
> > other subsystems (like e.g. dfu).
> >
> > Without this change compilation error emerges for the legacy
> > update.c file.
> >
> > Signed-off-by: Lukasz Majewski <l.majewski@majess.pl>
> > ---
> >  common/update.c |  2 +-
> >  include/tftp.h  | 30 ++++++++++++++++++++++++++++++
> 
> I'd like to start moving net headers to include/net/*... lets start
> here.

Ok, no problem.

> 
> >  net/bootp.c     |  2 +-
> >  net/net.c       |  2 +-
> >  net/rarp.c      |  2 +-
> >  net/tftp.c      |  2 +-
> >  net/tftp.h      | 30 ------------------------------
> >  7 files changed, 35 insertions(+), 35 deletions(-)
> >  create mode 100644 include/tftp.h
> >  delete mode 100644 net/tftp.h
> >
> > diff --git a/common/update.c b/common/update.c
> > index 1c6aa18..7bd7e94 100644
> > --- a/common/update.c
> > +++ b/common/update.c
> > @@ -20,7 +20,7 @@
> >  #include <command.h>
> >  #include <flash.h>
> >  #include <net.h>
> > -#include <net/tftp.h>
> > +#include <tftp.h>
> >  #include <malloc.h>
> >
> >  /* env variable holding the location of the update file */
> > diff --git a/include/tftp.h b/include/tftp.h
> > new file mode 100644
> > index 0000000..c411c9b
> > --- /dev/null
> > +++ b/include/tftp.h
> > @@ -0,0 +1,30 @@
> > +/*
> > + *     LiMon - BOOTP/TFTP.
> > + *
> > + *     Copyright 1994, 1995, 2000 Neil Russell.
> > + *     Copyright 2011 Comelit Group SpA
> > + *                    Luca Ceresoli <luca.ceresoli@comelit.it>
> > + *     (See License)
> > + */
> > +
> > +#ifndef __TFTP_H__
> > +#define __TFTP_H__
> > +
> > +/**********************************************************************/
> > +/*
> > + *     Global functions and variables.
> > + */
> > +
> > +/* tftp.c */
> > +void tftp_start(enum proto_t protocol);        /* Begin TFTP
> > get/put */ +
> > +#ifdef CONFIG_CMD_TFTPSRV
> > +void tftp_start_server(void);  /* Wait for incoming TFTP put */
> > +#endif
> > +
> > +extern ulong tftp_timeout_ms;
> > +extern int tftp_timeout_count_max;
> > +
> > +/**********************************************************************/
> > +
> > +#endif /* __TFTP_H__ */
> > diff --git a/net/bootp.c b/net/bootp.c
> > index 43466af..d325cd0 100644
> > --- a/net/bootp.c
> > +++ b/net/bootp.c
> > @@ -11,8 +11,8 @@
> >  #include <common.h>
> >  #include <command.h>
> >  #include <net.h>
> > +#include <tftp.h>
> >  #include "bootp.h"
> > -#include "tftp.h"
> >  #include "nfs.h"
> >  #ifdef CONFIG_STATUS_LED
> >  #include <status_led.h>
> > diff --git a/net/net.c b/net/net.c
> > index 67e0ad2..8460a51 100644
> > --- a/net/net.c
> > +++ b/net/net.c
> > @@ -86,6 +86,7 @@
> >  #include <environment.h>
> >  #include <errno.h>
> >  #include <net.h>
> > +#include <tftp.h>
> >  #if defined(CONFIG_STATUS_LED)
> >  #include <miiphy.h>
> >  #include <status_led.h>
> > @@ -105,7 +106,6 @@
> >  #if defined(CONFIG_CMD_SNTP)
> >  #include "sntp.h"
> >  #endif
> > -#include "tftp.h"
> >
> >  DECLARE_GLOBAL_DATA_PTR;
> >
> > diff --git a/net/rarp.c b/net/rarp.c
> > index 4ce2f37..2693d4b 100644
> > --- a/net/rarp.c
> > +++ b/net/rarp.c
> > @@ -8,10 +8,10 @@
> >  #include <common.h>
> >  #include <command.h>
> >  #include <net.h>
> > +#include <tftp.h>
> >  #include "nfs.h"
> >  #include "bootp.h"
> >  #include "rarp.h"
> > -#include "tftp.h"
> >
> >  #define TIMEOUT 5000UL /* Milliseconds before trying BOOTP again */
> >  #ifndef        CONFIG_NET_RETRY_COUNT
> > diff --git a/net/tftp.c b/net/tftp.c
> > index 3e99e73..f95f737 100644
> > --- a/net/tftp.c
> > +++ b/net/tftp.c
> > @@ -10,7 +10,7 @@
> >  #include <command.h>
> >  #include <mapmem.h>
> >  #include <net.h>
> > -#include "tftp.h"
> > +#include <tftp.h>
> >  #include "bootp.h"
> >  #ifdef CONFIG_SYS_DIRECT_FLASH_TFTP
> >  #include <flash.h>
> > diff --git a/net/tftp.h b/net/tftp.h
> > deleted file mode 100644
> > index c411c9b..0000000
> > --- a/net/tftp.h
> > +++ /dev/null
> > @@ -1,30 +0,0 @@
> > -/*
> > - *     LiMon - BOOTP/TFTP.
> > - *
> > - *     Copyright 1994, 1995, 2000 Neil Russell.
> > - *     Copyright 2011 Comelit Group SpA
> > - *                    Luca Ceresoli <luca.ceresoli@comelit.it>
> > - *     (See License)
> > - */
> > -
> > -#ifndef __TFTP_H__
> > -#define __TFTP_H__
> > -
> > -/**********************************************************************/
> > -/*
> > - *     Global functions and variables.
> > - */
> > -
> > -/* tftp.c */
> > -void tftp_start(enum proto_t protocol);        /* Begin TFTP
> > get/put */ -
> > -#ifdef CONFIG_CMD_TFTPSRV
> > -void tftp_start_server(void);  /* Wait for incoming TFTP put */
> > -#endif
> > -
> > -extern ulong tftp_timeout_ms;
> > -extern int tftp_timeout_count_max;
> > -
> > -/**********************************************************************/
> > -
> > -#endif /* __TFTP_H__ */
> > --
> > 2.1.4
> >
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot@lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot

Best regards,
Lukasz Majewski
diff mbox

Patch

diff --git a/common/update.c b/common/update.c
index 1c6aa18..7bd7e94 100644
--- a/common/update.c
+++ b/common/update.c
@@ -20,7 +20,7 @@ 
 #include <command.h>
 #include <flash.h>
 #include <net.h>
-#include <net/tftp.h>
+#include <tftp.h>
 #include <malloc.h>
 
 /* env variable holding the location of the update file */
diff --git a/include/tftp.h b/include/tftp.h
new file mode 100644
index 0000000..c411c9b
--- /dev/null
+++ b/include/tftp.h
@@ -0,0 +1,30 @@ 
+/*
+ *	LiMon - BOOTP/TFTP.
+ *
+ *	Copyright 1994, 1995, 2000 Neil Russell.
+ *	Copyright 2011 Comelit Group SpA
+ *	               Luca Ceresoli <luca.ceresoli@comelit.it>
+ *	(See License)
+ */
+
+#ifndef __TFTP_H__
+#define __TFTP_H__
+
+/**********************************************************************/
+/*
+ *	Global functions and variables.
+ */
+
+/* tftp.c */
+void tftp_start(enum proto_t protocol);	/* Begin TFTP get/put */
+
+#ifdef CONFIG_CMD_TFTPSRV
+void tftp_start_server(void);	/* Wait for incoming TFTP put */
+#endif
+
+extern ulong tftp_timeout_ms;
+extern int tftp_timeout_count_max;
+
+/**********************************************************************/
+
+#endif /* __TFTP_H__ */
diff --git a/net/bootp.c b/net/bootp.c
index 43466af..d325cd0 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -11,8 +11,8 @@ 
 #include <common.h>
 #include <command.h>
 #include <net.h>
+#include <tftp.h>
 #include "bootp.h"
-#include "tftp.h"
 #include "nfs.h"
 #ifdef CONFIG_STATUS_LED
 #include <status_led.h>
diff --git a/net/net.c b/net/net.c
index 67e0ad2..8460a51 100644
--- a/net/net.c
+++ b/net/net.c
@@ -86,6 +86,7 @@ 
 #include <environment.h>
 #include <errno.h>
 #include <net.h>
+#include <tftp.h>
 #if defined(CONFIG_STATUS_LED)
 #include <miiphy.h>
 #include <status_led.h>
@@ -105,7 +106,6 @@ 
 #if defined(CONFIG_CMD_SNTP)
 #include "sntp.h"
 #endif
-#include "tftp.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/net/rarp.c b/net/rarp.c
index 4ce2f37..2693d4b 100644
--- a/net/rarp.c
+++ b/net/rarp.c
@@ -8,10 +8,10 @@ 
 #include <common.h>
 #include <command.h>
 #include <net.h>
+#include <tftp.h>
 #include "nfs.h"
 #include "bootp.h"
 #include "rarp.h"
-#include "tftp.h"
 
 #define TIMEOUT 5000UL /* Milliseconds before trying BOOTP again */
 #ifndef	CONFIG_NET_RETRY_COUNT
diff --git a/net/tftp.c b/net/tftp.c
index 3e99e73..f95f737 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -10,7 +10,7 @@ 
 #include <command.h>
 #include <mapmem.h>
 #include <net.h>
-#include "tftp.h"
+#include <tftp.h>
 #include "bootp.h"
 #ifdef CONFIG_SYS_DIRECT_FLASH_TFTP
 #include <flash.h>
diff --git a/net/tftp.h b/net/tftp.h
deleted file mode 100644
index c411c9b..0000000
--- a/net/tftp.h
+++ /dev/null
@@ -1,30 +0,0 @@ 
-/*
- *	LiMon - BOOTP/TFTP.
- *
- *	Copyright 1994, 1995, 2000 Neil Russell.
- *	Copyright 2011 Comelit Group SpA
- *	               Luca Ceresoli <luca.ceresoli@comelit.it>
- *	(See License)
- */
-
-#ifndef __TFTP_H__
-#define __TFTP_H__
-
-/**********************************************************************/
-/*
- *	Global functions and variables.
- */
-
-/* tftp.c */
-void tftp_start(enum proto_t protocol);	/* Begin TFTP get/put */
-
-#ifdef CONFIG_CMD_TFTPSRV
-void tftp_start_server(void);	/* Wait for incoming TFTP put */
-#endif
-
-extern ulong tftp_timeout_ms;
-extern int tftp_timeout_count_max;
-
-/**********************************************************************/
-
-#endif /* __TFTP_H__ */