Skip to contentSkip to conversation

SNTP support patch

U-Boot-Users Wolfgang Denk 3 participants 6 messages Mar 30, 2005 – Apr 5, 2005

lore
Share & tools
lore
#0 lore raw

[Forwarded on behalf of Masami Komiya.]

------- Forwarded Message

Date:    Wed, 30 Mar 2005 16:42:03 +0900
From:    Masami Komiya <[email protected]>
To:      Wolfgang Denk <[email protected]>

cc: "Sonare IT - Komiya" <[email protected]>
Subject: SNTP support patch

Dear Wolfgang,

No time see you.

I make a patch to add SNTP support and expand time server and time offset fields of DHCP support. (The roundtrip delay is ignored :-)

I want to send this patch to ML, but the mail server of SourceForge does not accept from me ;_;) If you think this is useful for U-BOOT, please forward to ML.

To use SNTP support, please add the define CFG_CMD_SNTP to CONFIG_COMMANDS in the configuration file of the board.

The "sntp" command gets network time from NTP time server and syncronize RTC of the board. This command needs the command line parameter of server's IP address or environment variable "timeserverip". The network time is sent as UTC. So if you want to set local time to RTC, set the offset in second from UTC to the enviroment variable "time offset".

If DHCP server provides time server's IP or time offset, you don't need to set the above environment variables yourself.

Any advice or comment are wellcome!!

Best regards.

Masami Komiya

------- End of Forwarded Message

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-sntp-00.gz
Type: application/x-gzip
Size: 3725 bytes
Desc: patch-sntp-00.gz
Url : http://lists.denx.de/pipermail/u-boot/attachments/20050330/b82c6cc9/attachment.bin

#1 lore raw

There are some wrong code about DHCP expansion in the last patch to add SNTP support. Please apply attached patch too.

The name of environment variable for NTP time server IP address is changed to "ntpserverip".

The current limitation of SNTP support is :
1. The roundtrip time is ignored.
2. Only 1st NTP server IP, in the option ntp-servers of DHCP, is effective.

Thank you for your any advice.

Masami Komiya

Quoted 32 lines · Wolfgang Denk

[Forwarded on behalf of Masami Komiya.]

------- Forwarded Message

Date:    Wed, 30 Mar 2005 16:42:03 +0900
From:    Masami Komiya <[email protected]>
To:      Wolfgang Denk <[email protected]>

cc: "Sonare IT - Komiya" <[email protected]>
Subject: SNTP support patch

Dear Wolfgang,

No time see you.

I make a patch to add SNTP support and expand time server and time offset fields of DHCP support. (The roundtrip delay is ignored :-)

I want to send this patch to ML, but the mail server of SourceForge does not accept from me ;_;) If you think this is useful for U-BOOT, please forward to ML.

To use SNTP support, please add the define CFG_CMD_SNTP to CONFIG_COMMANDS in the configuration file of the board.

The "sntp" command gets network time from NTP time server and syncronize RTC of the board. This command needs the command line parameter of server's IP address or environment variable "timeserverip". The network time is sent as UTC. So if you want to set local time to RTC, set the offset in second from UTC to the enviroment variable "time offset".

If DHCP server provides time server's IP or time offset, you don't need to set the above environment variables yourself.

Quoted 9 lines

Any advice or comment are wellcome!!

Best regards.

Masami Komiya

------- End of Forwarded Message

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-sntp-01.gz
Type: application/x-gzip
Size: 1570 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20050331/148ee52c/attachment.bin

#2 lore raw
Quoted 3 lines · In message <[email protected]> you wrote:

There are some wrong code about DHCP expansion in the last patch to add SNTP support. Please apply attached patch too.

Done. Thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Our OS who art in CPU, UNIX be thy name.
Thy programs run, thy syscalls done,
In kernel as it is in user!
#3 lore raw
In reply to Wolfgang Denk
Quoted 3 lines · In message <[email protected]> you wrote:

I make a patch to add SNTP support and expand time server and time offset fields of DHCP support. (The roundtrip delay is ignored :-)

Added, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I wish I had a bronze torc for every user who didn't read the manual.
                             - Terry Pratchett, _The Light Fantastic_
#4 lore raw
In reply to Wolfgang Denk
Quoted 10 lines · Wolfgang Denk

[Forwarded on behalf of Masami Komiya.]

------- Forwarded Message

Date:    Wed, 30 Mar 2005 16:42:03 +0900
From:    Masami Komiya <[email protected]>
To:      Wolfgang Denk <[email protected]>

cc: "Sonare IT - Komiya" <[email protected]>
Subject: SNTP support patch

Quoted 6 lines

Dear Wolfgang,

No time see you.

I make a patch to add SNTP support and expand time server and time offset fields of DHCP support. (The roundtrip delay is ignored :-)

Extenting proto_t enum rings bell here. Please consider applying following inliner.

Index: common/cmd_net.c
===================================================================
RCS file: /cvsroot/u-boot/u-boot/common/cmd_net.c,v retrieving revision 1.15

cmd_net.c +2 -2
diff -u -r1.15 cmd_net.c
@@ -33,7 +33,7 @@
 
 extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
 
-static int netboot_common (int, cmd_tbl_t *, int , char *[]);
+static int netboot_common (proto_t, cmd_tbl_t *, int , char *[]);
 
 int do_bootp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
@@ -152,7 +152,7 @@
 }
 
 static int
-netboot_common (int proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
+netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
 {
 	char *s;
 	int   rcode = 0;
#5 lore raw
Quoted 3 lines · In message <20050405145127.GA9944@orphique> you wrote:

Extenting proto_t enum rings bell here. Please consider applying following inliner.

Thanks, added.

But please provide a proper patch next time (CHANGELOG entry).

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Many Myths are based on truth
	-- Spock, "The Way to Eden",  stardate 5832.3