summaryrefslogtreecommitdiffstats
path: root/net/tftp.c
Commit message (Collapse)AuthorAgeFilesLines
* net/tftp.c: fix typoLuca Ceresoli2011-05-191-1/+1
| | | | | | Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Detlev Zundel <dzu@denx.de>
* TFTP: net/tftp.c: add server mode receiveLuca Ceresoli2011-05-191-4/+58
| | | | | | Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Detlev Zundel <dzu@denx.de>
* TFTP: rename STATE_RRQ to STATE_SEND_RRQLuca Ceresoli2011-05-191-6/+6
| | | | | | | | | With the upcoming TFTP server implementation, requests can be either outgoing or incoming, so avoid ambiguities. Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Detlev Zundel <dzu@denx.de>
* TFTP: replace "server" with "remote" in local variable namesLuca Ceresoli2011-05-191-14/+14
| | | | | | | | | With the upcoming TFTP server implementation, the remote node can be either a client or a server, so avoid ambiguities. Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Detlev Zundel <dzu@denx.de>
* net/tftp.c: cosmetic: do not initialise statics to 0 or NULLLuca Ceresoli2011-05-191-2/+2
| | | | | | | | This removes the following checkpatch issue: - ERROR: do not initialise statics to 0 or NULL Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de>
* net/tftp.c: cosmetic: fix indentationLuca Ceresoli2011-05-191-5/+6
| | | | | | | | This removes the following checkpatch issue: - WARNING: suspect code indent for conditional statements Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de>
* net/tftp.c: cosmetic: trailing statements should be on next lineLuca Ceresoli2011-05-191-3/+6
| | | | | | | | This removes the following checkpatch issue: - ERROR: trailing statements should be on next line Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de>
* net/tftp.c: cosmetic: fix brace issuesLuca Ceresoli2011-05-191-11/+6
| | | | | | | | | This removes the following checkpatch issues: - WARNING: braces {} are not necessary for single statement blocks - WARNING: braces {} are not necessary for any arm of this statement Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de>
* net/tftp.c: cosmetic: do not use assignment in if conditionLuca Ceresoli2011-05-191-6/+12
| | | | | | | | | | | | | | | | | | | This removes the following checkpatch issue: - ERROR: do not use assignment in if condition. There is one such error left: ERROR: do not use assignment in if condition #239: FILE: tftp.c:239: + if (!ProhibitMcast + && (Bitmap = malloc(Mapsize)) + && eth_get_dev()->mcast) { which would require an additional nested if to be fixed, resulting in longer and less readable code. Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de>
* net/tftp.c: cosmetic: fix pointer syntax issuesLuca Ceresoli2011-05-191-10/+10
| | | | | | | | | This removes the following checkpatch issues: - ERROR: "foo * bar" should be "foo *bar" - ERROR: "(foo*)" should be "(foo *)" Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de>
* net/tftp.c: cosmetic: fix whitespace issuesLuca Ceresoli2011-05-191-95/+97
| | | | | | | | | | | | | | | | | | This removes the following checkpatch issues: - ERROR: space prohibited before that close parenthesis ')' - ERROR: space required after that ';' (ctx:BxV) - ERROR: space required after that ',' (ctx:VxV) - ERROR: space required after that ';' (ctx:VxV) - ERROR: spaces required around that '<<=' (ctx:VxV) - ERROR: spaces required around that '<' (ctx:VxV) - ERROR: spaces required around that '=' (ctx:VxV) - ERROR: spaces required around that '+=' (ctx:VxV) - ERROR: spaces required around that '=' (ctx:VxW) - WARNING: please, no spaces at the start of a line - WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de>
* net/tftp.c: cosmetic: fix lines over 80 charactersLuca Ceresoli2011-05-191-24/+42
| | | | | Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de>
* NET: pass source IP address to packet handlersLuca Ceresoli2011-05-121-1/+2
| | | | | | | | | | This is needed for the upcoming TFTP server implementation. This also simplifies PingHandler() and fixes rxhand_f documentation. Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Detlev Zundel <dzu@denx.de>
* TFTP: allow for adjustable retransmission timoutWolfgang Denk2010-03-211-5/+18
| | | | | | | | | | | | | So far, TFTP negotiated a fixed retransmission timeout of 5 seconds. In some cases (busy networks, slow TFTP servers) this caused very slow transfers. A new environment variable "tftptimeout" allows to set this timeout. Lowering this value may make downloads succeed faster in networks with high packet loss rates or with unreliable TFTP servers. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Ben Warren <biggerbadderben@gmail.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Add error codes/handling for TFTP-serverRemy Bohmer2009-12-131-3/+29
| | | | | Signed-off-by: Remy Bohmer <linux@bohmer.net> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* net: pull CONFIG checks out of source and into makefileMike Frysinger2009-12-131-4/+0
| | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Add Transfer Size Option to tftpRobin Getz2009-08-251-2/+36
| | | | | | | | | | | | | | | Optionally add RFC 2349 "Transfer Size Option", so we can minimize the time spent sending data over the UART (now print a single line during a tftp transfer). - If turned on (CONFIG_TFTP_TSIZE), U-Boot asks for the size of the file. - if receives the file size, a single line (50 chars) are printed. one hash mark == 2% of the file downloaded. - if it doesn't receive the file size (the server doesn't support RFC 2349, prints standard hash marks (one mark for each UDP frame). Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* tftp: get the tftp block size from config file and from the environmentAlessandro Rubini2009-08-251-2/+11
| | | | | | | | | | | Increasing the block size is useful if CONFIG_IP_DEFRAG is used. Howerver, the last fragments in a burst may overflow the receiving ethernet, so the default is left at 1468, with thre new CONFIG_TFTP_BLOCKSIZE for config files. Further, "tftpblocksize" can be set in the environment. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* net/tftp.c: fix warning: pointer targets differ in signednessWolfgang Denk2009-08-101-1/+3
| | | | | | | | | | tftp.c:294: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness This was only visible for the utx8245 board which seems to have DEBUG enabled. Signed-off-by: Wolfgang Denk <wd@denx.de>
* minor debug cleanups in ./netRobin Getz2009-08-071-16/+5
| | | | | | | | | | | | | | | Minor ./net cleanups - no functional changes - change #ifdef DEBUG printf(); #endif to just debug() - changed __FUNCTION__ to __func__ - got rid of extra whitespace between function and opening brace - removed unnecessary braces on if statements gcc dead code elimination should make this functionally/size equivalent when DEBUG is not defined. (confirmed on Blackfin, with gcc 4.3.3). Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* convert print_IPaddr() to %pI4Mike Frysinger2009-03-201-6/+4
| | | | | | | | | Now that our printf functions support the %pI4 modifier like the kernel, let's drop the inflexible print_IPaddr() function and covert over to the %pI4 modifier. Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Ben Warren <biggerbadderben@gmail.com>
* net: Fix TftpStart() ip:filename bugPeter Tyser2008-12-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The TftpStart() function modifies the 'BootFile' string when 'BootFile' contains both an IP address and filename (eg 1.2.3.4:/path/file). This causes subsequent calls to TftpStart to incorrectly parse the TFTP filename and server IP address to use. For example: => tftp 0x100000 10.52.0.62:/home/ptyser/non_existant Speed: 100, half duplex Using eTSEC1 device TFTP from server 10.52.0.62; our IP address is 10.52.253.79 ^^^^^^^^^^ CORRECT Filename '/home/ptyser/non_existant'. ^^^^^^^^^^^^^^^^^^^^^^^^^ CORRECT Load address: 0x100000 Loading: * TFTP error: 'File not found' (1) Starting again eTSEC2: No link. Speed: 100, half duplex Using eTSEC1 device TFTP from server 10.52.0.33; our IP address is 10.52.253.79 ^^^^^^^^^^ WRONG Filename '10.52.0.62'. ^^^^^^^^^^ WRONG Load address: 0x100000 Loading: * TFTP error: 'File not found' (1) Starting again TftpStart() was modified to not modify the 'BootFile' string. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD2008-10-181-4/+4
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* net: Make TFTP server timeout configurableBartlomiej Sieka2008-10-181-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | There are two aspects of a TFTP transfer involving timeouts: 1. timeout waiting for initial server reply after sending RRQ 2. timeouts while transferring actual data from the server Since the upcoming auto-update feature attempts a TFTP download during each boot, it is undesirable to have a long delay when the TFTP server is not available. Thus, this commit makes the server timeout (1.) configurable by two global variables: TftpRRQTimeoutMSecs TftpRRQTimeoutCountMax TftpRRQTimeoutMSecs overrides default timeout when trying to connect to a TFTP server, TftpRRQTimeoutCountMax overrides default number of connection retries. The total delay when trying to download a file from a non-existing TFTP server is TftpRRQTimeoutMSecs x TftpRRQTimeoutCountMax milliseconds. Timeouts during file transfers (2.) are unaffected. Signed-off-by: Rafal Czubak <rcz@semihalf.com> Signed-off-by: Bartlomiej Sieka <tur@semihalf.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* net: express the first argument to NetSetTimeout() in millisecondsBartlomiej Sieka2008-10-181-5/+5
| | | | | | | | | | | | | | | | | | Enforce millisecond semantics of the first argument to NetSetTimeout() -- the change is transparent for well-behaving boards (CFG_HZ == 1000 and get_timer() countiing in milliseconds). Rationale for this patch is to enable millisecond granularity for network-related timeouts, which is needed for the upcoming automatic software update feature. Summary of changes: - do not scale the first argument to NetSetTimeout() by CFG_HZ - change timeout values used in the networking code to milliseconds Signed-off-by: Rafal Czubak <rcz@semihalf.com> Signed-off-by: Bartlomiej Sieka <tur@semihalf.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Don't tftp to unknown flashJochen Friedrich2008-09-021-0/+2
| | | | | | | | | | If a board has a variable number of flash banks, there are empty entries in flash_info[] and CFG_DIRECT_FLASH_TFTP is set, tftp boot fails with "Outside available Flash". This patch skips flash banks with unknown flash ids. Signed-off-by: Jochen Friedrich <jochen@scram.de> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Fix printf errors.Andrew Klossner2008-07-091-1/+1
| | | | | | | | | | | | The compiler will help find mismatches between printf formats and arguments if you let it. This patch adds the necessary attributes to declarations in include/common.h, then begins to correct the resulting compiler warnings. Some of these were bugs, e.g., "$d" instead of "%d" and incorrect arguments. Others were just annoying, like int-long mismatches on a system where both are 32 bits. It's worth fixing the annoying errors to catch the real ones. Signed-off-by: Andrew Klossner <andrew@cesa.opbu.xerox.com>
* TFTP: fix search of ':' in BootFileJean-Christophe PLAGNIOL-VILLARD2008-02-141-1/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* TFTP: add host ip addr supportJean-Christophe PLAGNIOL-VILLARD2008-02-051-10/+30
| | | | | | | | allow to use a different server as set in serverip add CONFIG_TFTP_FILE_NAME_MAX_LEN to configure the file name length if not defined the max length will be at 128 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Fix warning differ in signedness in net/net.c and net/nfs.cJean-Christophe PLAGNIOL-VILLARD2007-11-181-1/+1
|
* Fix TFTP OACK code for short packets.Wolfgang Denk2007-08-311-2/+6
| | | | | | | | | | | The old code had a loop limit overflow bug which caused a semi- infinite loop for small packets, because in "i<len-8", "i" was signed, but "len" was unsigned, and "len-8" became a huge number for small values of "len". This is a workaround which replaces broken commit 8f1bc284. Signed-off-by: Wolfgang Denk <wd@denx.de>
* Backout commit 8f1bc284 as it causes TFTP to fail.Wolfgang Denk2007-08-301-10/+10
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* tftp: don't implicity trust the format of recevied packetsGrant Likely2007-08-301-10/+10
| | | | | | | | | | | | The TFTP OACK code trusts that the incoming packet is formated as ASCII text and can be processed by string functions. It also has a loop limit overflow bug where if the packet length is less than 8, it ends up looping over *all* of memory to find the 'blksize' string. This patch solves the problem by forcing the packet to be null terminated and using strstr() to search for the sub string. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* Fix: TFTP is not working on little endian systemsstefano babic2007-08-291-1/+1
| | | | | | | | TFTP does not work anymore after multicast tftp patch was applied on little endian systems. This patch fix it. Signed-off-by: Stefano Babic <sbabic@denx.de>
* 86xx: Fix lingering CFG_CMD_* references in sbc8641d.hJon Loeliger2007-08-151-1/+1
| | | | | | Remove a leftover in net/tftp.c while we're at it. Signed-off-by: Jon Loeliger <jdl@freescale.com>
* Coding style cleanup; rebuild CHANGELOGWolfgang Denk2007-08-141-18/+18
|
* multicast tftp: RFC2090David Updegraff2007-08-131-5/+233
| | | | | | | | Implemented IETF RFC2090, Multicast TFTP. Initial implementation on Realtek RTL8139 and Freescale TSEC. Signed-off-by: David Updegraff <dave@cray.com> Signed-off-by: Ben Warren <bwarren@qstreams.com>
* net/: Remove lingering references to CFG_CMD_* symbols.Jon Loeliger2007-07-101-1/+1
| | | | | | | | Fixed some broken instances of "#ifdef CMD_CFG_IDE" too. Those always evaluated TRUE, and thus were always compiled even when IDE really wasn't defined/wanted. Signed-off-by: Jon Loeliger <jdl@freescale.com>
* net/: Remove obsolete references to CONFIG_COMMANDSJon Loeliger2007-07-091-1/+1
| | | | Signed-off-by: Jon Loeliger <jdl@freescale.com>
* net/: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).Jon Loeliger2007-07-041-1/+1
| | | | | | | | | | | | | | This is a compatibility step that allows both the older form and the new form to co-exist for a while until the older can be removed entirely. All transformations are of the form: Before: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) After: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) Signed-off-by: Jon Loeliger <jdl@freescale.com>
* Fix typo.Wolfgang Denk2006-08-141-1/+1
| | | | Patch by Andreas Engel, 28 Nov 2005
* Merge with /home/m8/git/u-bootWolfgang Denk2005-10-151-1/+1
|\
| * Added support for TQM834x boards.Marian Balakowicz2005-10-111-1/+1
| |
* | Cleanup for GCC-4.xWolfgang Denk2005-10-131-1/+1
|/
* Update for TFTP using a fixed UDP portWolfgang Denk2005-09-241-1/+4
| | | | | | Use the approved environment variable names. Added "tftpdstp" to allow ports other than 69 per Tolunay Orkun's recommendation. Patch by Jerry Van Baren, 12 Jan 2005
* Allow to force TFTP to use a fixed UDP portWolfgang Denk2005-09-241-0/+10
| | | | | (Add a configuration option CONFIG_TFTP_PORT and optional env variable tftpport) Patch by Jerry Van Baren, 10 Jan 2005
* Prepare U-Boot for gcc-4.xWolfgang Denk2005-08-261-8/+20
|
* Fix endianess problem in TFTP / NFS default filenamesWolfgang Denk2005-08-041-6/+4
| | | | Patch by Hiroshi Ito, 06 Dec 2004
* Patches by Pantelis Antoniou, 30 Mar 2004:wdenk2004-04-151-1/+1
| | | | add networking support for VLANs (802.1q), and CDP (Cisco Discovery Protocol)
* * Patches by Thomas Viehweger, 16 Mar 2004:wdenk2004-03-231-1/+1
| | | | | | | | | - show PCI clock frequency on MPC8260 systems - add FCC_PSMR_RMII flag for HiP7 processors - in do_jffs2_fsload(), take load address from load_addr if not set explicit, update load_addr otherwise - replaced printf by putc/puts when no formatting is needed (smaller code size, faster execution)
OpenPOWER on IntegriCloud