]>
git.ipfire.org Git - people/ms/u-boot.git/blob - board/hymod/fetch.c
3 * Murray Jensen, CSIRO-MIT, <Murray.Jensen@csiro.au>
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 /* imports from input.c */
28 extern int hymod_get_ethaddr (void);
31 fetch_and_parse (char *fn
, ulong addr
, int (*cback
)(uchar
*, uchar
*))
37 while ((ethaddr
= getenv ("ethaddr")) == NULL
|| *ethaddr
== '\0') {
39 printf ("*** Ethernet address is%s not set\n",
40 count
== 0 ? "" : " STILL");
42 if ((rc
= hymod_get_ethaddr ()) < 0) {
44 puts ("\n*** interrupted!");
46 puts ("\n*** timeout!");
47 printf (" - fetch of '%s' aborted\n", fn
);
54 copy_filename (BootFile
, fn
, sizeof (BootFile
));
56 NetBootFileXferSize
= 0;
58 if (NetLoop (TFTP
) == 0) {
59 printf ("tftp transfer of file '%s' failed\n", fn
);
63 if (NetBootFileXferSize
== 0) {
64 printf ("can't determine size of file '%s'\n", fn
);
68 fp
= (uchar
*)load_addr
;
69 efp
= fp
+ NetBootFileXferSize
;
74 if (*fp
== '#' || *fp
== '\n') {
76 while (fp
< efp
&& *fp
++ != '\n')
83 while (fp
< efp
&& *fp
!= '=' && *fp
!= '\n')
95 while (fp
< efp
&& *fp
!= '\n')
99 *fp
++ = '\0'; /* ok if we go off the end here */
101 if ((*cback
)(name
, value
) == 0)