summaryrefslogtreecommitdiff
path: root/net
Commit message (Collapse)AuthorAgeLines
* TFTP: allow for adjustable retransmission timoutWolfgang Denk2010-03-21-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>
* Make getenv_IPaddr() globalDirk Behme2010-01-17-26/+0
| | | | | | | | | | | | | | | | | | | There are boards out there that do not have network support in U-Boot (CONFIG_CMD_NET not set), but they do so in Linux. This makes it desirable to be able to port network configuration (like the IP address) to the Linux kernel. We should not make the passing of the IP configuration to Linux dependent on U-Boot features / settings. For this, make getenv_IPaddr() global. This fixes build error u-boot/lib_xxx/board.c:360: undefined reference to `getenv_IPaddr' on various architectures. Signed-off-by: Dirk Behme <dirk.behme@googlemail.com> Acked-by: Ben Warren <biggerbadderben@gmail.com>
* Add error codes/handling for TFTP-serverRemy Bohmer2009-12-13-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-13-30/+9
| | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* nfs: NfsTimeout() updatesEvan Samanas2009-12-07-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - NfsTimeout() does not correctly update the NFS timeout value which results in NfsTimeout() only being called once in certain situations. This can result in the 'nfs' command hanging indefinetly. For example, the command: nfs 192.168.0.1:/home/user/file will not exit until ctrl-c is pressed if 192.168.0.1 does not have an NFS server running. This issue is resolved by reinitializting the NFS timeout value inside NfsTimeout() when a timeout occurs. - Make the 'nfs' command print the 'T' character when a timeout occurs. Previously there was no indication that timeouts were occuring. - Mimic the 'tftpboot' command and when a download fails print "Retry count exceeded; starting again", and restart the download taking the 'netretry' environment variable into account. Signed-off-by: Evan Samanas <esamanas@xes-inc.com> Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Tested on TQM8xxL. Tested by: Wolfgang Denk <wd@denx.de> Tested on MPC8527DS. Tested by: Ed Swarthout <Ed.Swarthout@freescale.com>
* fix nfs symlink name corruptionEd Swarthout2009-12-07-1/+1
| | | | | | | | | An off by one error may cause nfs readlink lookup fail if nfs_path_buff has non-zero data from a previous use. Loading: *** ERROR: File lookup fail Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
* Repair the 'netretry=once' option.Remy Bohmer2009-11-24-8/+24
| | | | | | | | 'netretry = once' does the same as 'netretry = yes', because it is not stored when it was tried once. Signed-off-by: Remy Bohmer <linux@bohmer.net> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* net/bootp.c: fix compile warningWolfgang Denk2009-09-11-1/+5
| | | | | | | | Fix warning: bootp.c:695: warning: dereferencing type-punned pointer will break strict-aliasing rules Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Ben Warren <biggerbadderben@gmail.com>
* Add Transfer Size Option to tftpRobin Getz2009-08-25-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>
* nfs: accept CONFIG_NFS_READ_SIZE from config fileAlessandro Rubini2009-08-25-2/+8
| | | | | | | | | To take advantage of defragmented packets, the config file can define CONFIG_NFS_READ_SIZE to override the 1kB default. No support is there for an environment variable by now. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* tftp: get the tftp block size from config file and from the environmentAlessandro Rubini2009-08-25-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: defragment IP packetsAlessandro Rubini2009-08-25-5/+183
| | | | | | | | | | | | | | | | | The defragmenting code is enabled by CONFIG_IP_DEFRAG; the code is useful for TFTP and NFS transfers. The user can specify the maximum defragmented payload as CONFIG_NET_MAXDEFRAG (default 16k). Since NFS has a bigger per-packet overhead than TFTP, the static reassembly buffer can hold CONFIG_NET_MAXDEFRAG + the NFS overhead. The packet buffer is used as an array of "hole" structures, acting as a double-linked list. Each new fragment can split a hole in two, reduce a hole or fill a hole. No support is there for a fragment overlapping two diffrent holes (i.e., thre new fragment is across an already-received fragment). 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-10-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>
* net: sync env ethaddr to device enetaddr in eth_init()Mike Frysinger2009-08-07-29/+23
| | | | | | | | | | | | In the previous enetaddr refactoring, the assumption with commit 56b555a644 was that the eth layer would handle the env -> device enetaddr syncing. This was not the case as eth_initialize() is called only once and the sync occurs there. So make sure the eth_init() function does the env -> device sync with every network init. Reported-by: Andrzej Wolski <awolski@poczta.fm> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* minor debug cleanups in ./netRobin Getz2009-08-07-167/+77
| | | | | | | | | | | | | | | 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>
* Coding Style cleanup; update CHANGELOG.Wolfgang Denk2009-07-23-1/+0
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Save server's MAC address in environmentRobin Getz2009-07-22-0/+9
| | | | | | | | | | | | | | | Linux's netconsole works much better when you can pass it the MAC address of the server. (otherwise it just uses broadcast, which everyone else on my network complains about :) This sets the env var "serveraddr" (to match ethaddr), so that you can pass it to linux with whatever bootargs you want to.... addnetconsole=set bootargs $(bootargs) netconsole=@$(ipaddr)/eth0,@$(serverip)/$(serveraddr) Signed-of-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* DHCP regression on 2009-06Michael Zaidman2009-07-22-0/+3
| | | | | | | | | | Fixed the DHCP/BOOTP/RARP regression introduced in u-boot-2009.06 by initializing our IP addr to 0 in order to accept any IP addr assigned to us by the DHCP/BOOTP/RARP server. Ack-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Michael Zaidman <michael.zaidman@gmail.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Add warning about upcoming removal of old Ethernet APIBen Warren2009-07-22-0/+2
| | | | Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Add DNS supportRobin Getz2009-07-22-3/+283
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On 04 Oct 2008 Pieter posted a dns implementation for U-Boot. http://www.mail-archive.com/u-boot-users@lists.sourceforge.net/msg10216.html > > DNS can be enabled by setting CFG_CMD_DNS. After performing a query, > the serverip environment var is updated. > > Probably there are some cosmetic issues with the patch. Unfortunatly I > do not have the time to correct these. So if anybody else likes DNS > support in U-Boot and has the time, feel free to patch it in the main tree. Here it is again - slightly modified & smaller: - update to 2009-06 (Pieter's patch was for U-Boot 1.2.0) - README.dns is added - syntax is changed (now takes a third option, the env var to store the result in) - add a random port() function in net.c - sort Makefile in ./net/Makefile - dns just returns unless a env var is given - run through checkpatch, and clean up style issues - remove packet from stack - cleaned up some comments - failure returns much faster (if server responds, don't wait for timeout) - use built in functions (memcpy) rather than byte copy. Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Pieter Voorthuijsen <pieter.voorthuijsen@prodrive.nl> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* net: rename NetRxPkt to NetRxPacketMike Frysinger2009-07-22-5/+5
| | | | | | | | The net code is mostly consistent in using 'Packet' rather than 'Pkt', so rename the minor detractor to follow suite. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* A VLAN tagged DHCP request/discover is 4 bytes shortNorbert van Bolhuis2009-06-15-2/+2
| | | | | | | | | The problem is that BOOTP_SIZE uses ETHER_HDR_SIZE which is 14 bytes. If sending a VLAN tagged frame (when env variable vlan is set) this should be VLAN_ETHER_HDR_SIZE=18 which is what NetSetEther returns. Signed-off-by: Norbert van Bolhuis <nvbolhuis@aimvalley.nl> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Remove support for non-CONFIG_NET_MULTI on PPC4xx EMACBen Warren2009-06-15-4/+0
| | | | Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Switched davinci_emac Ethernet driver to use newer APIBen Warren2009-06-15-4/+0
| | | | | | | | Added CONFIG_NET_MULTI to all Davinci boards Removed all calls to Davinci network driver from board code Added cpu_eth_init() to cpu/arm926ejs/cpu.c Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* netloop: updates for NetLoopHeiko Schocher2009-05-15-7/+5
| | | | | | | | | | | | | Fix some issues introduced from commit: 2f70c49e5b9813635ad73666aa30f304c7fdeda9 suggested by Mike Frysinger. - added some comment for the env_id variable in common_cmd_nvedit.c - moved some variables in fn scope instead of file scope - NetInitLoop now static void Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Ben Warren <biggerbadderben@gmail.com>
* Replace __attribute references with __attribute__Peter Tyser2009-04-28-2/+2
| | | | | | | | __attribute__ follows gcc's documented syntax and is generally more common than __attribute. This change is only asthetic and should not affect functionality. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* NetLoop initialization bugMichael Zaidman2009-04-19-59/+4
| | | | | | | | | | | | | | | | | | | | The patch fixes the bug of partial initialization of global network parameters. Upon u-boot's start up the first ping command causes a failure of the consequent TFTP command. It happens in the recently added mechanism of the NetLoop initialization where initialization of global network parameters is separated in the NetInitLoop routine which is called per env_id change. Thus, ping request will initialize the network parameters necessary for ping operation only, afterwards the env_changed_id will be set to the env_id that will prevent all following initialization requests from other protocols. The problem is that the initialized by ping subset of network parameters is not sufficient for other protocols and particularly for TFTP which requires the NetServerIp also. Signed-off-by: Michael Zaidman <michael.zaidman@gmail.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* net: get mac address from environment and use eth util funcsMike Frysinger2009-03-20-22/+6
| | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Ben Warren <biggerbadderben@gmail.com>
* net: new utility functions for working with enetaddr'sMike Frysinger2009-03-20-31/+38
| | | | | | | | | | | | | | Declare new utility functions for converting between the environment variables (eth*addr) and the binary MAC address representation. This way we can unify all the random places that already do this kind of thing. The functions in question: eth_parse_enetaddr - "..." -> {...} eth_getenv_enetaddr - env -> {...} eth_setenv_enetaddr - {...} -> env Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Ben Warren <biggerbadderben@gmail.com>
* convert print_IPaddr() to %pI4Mike Frysinger2009-03-20-37/+14
| | | | | | | | | 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>
* netloop: speed up NetLoopHeiko Schocher2009-02-22-61/+84
| | | | | | | | | | | | | | NetLoop polls every cycle with getenv some environment variables. This is horribly slow, especially when the environment is big. This patch reads only the environment variables in NetLoop, when they were changed. Also moved the init part of the NetLoop function in a seperate function. Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Add eth_get_dev_by_indexAndy Fleming2009-02-16-0/+22
| | | | | | This allows code to iterate through the ethernet devices Signed-off-by: Andy Fleming <afleming@freescale.com>
* net/sntp.c: move ifdef into Makefile COBJS-$(...)Mike Frysinger2009-02-09-5/+1
| | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Fix IP alignment problemOlav Morken2009-01-28-1/+1
| | | | | | | | | | | | | | This patch removes volatile from: volatile IP_t *ip = (IP_t *)xip; Due to a bug, avr32-gcc will assume that ip is aligned on a word boundary when using volatile, which causes an exception since xip isn't aligned on a word boundary. Signed-off-by: Gunnar Rangoy <gunnar@rangoy.com> Signed-off-by: Paul Driveklepp <pauldriveklepp@gmail.com> Signed-off-by: Olav Morken <olavmrk@gmail.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Merge branch 'master' of git://git.denx.de/u-boot-netWolfgang Denk2008-12-09-5/+5
|\
| * net: Fix TftpStart() ip:filename bugPeter Tyser2008-12-04-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>
| * net: Add additional IP fragmentation checkPeter Tyser2008-12-04-1/+2
| | | | | | | | | | | | | | | | | | Ignore IP packets which have the "more fragments" flag bit set. This flag indicates the IP packet is fragmented and must be ignored by U-Boot. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
| * net: Define IP flag field valuesPeter Tyser2008-12-04-3/+3
| | | | | | | | | | | | | | | | | | These defines were pulled from the "Add simple IP/UDP fragmentation support" patch from Frank Haverkamp <haver@vnet.ibm.com>. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* | Update U-Boot's build timestamp on every compilePeter Tyser2008-12-06-0/+3
|/ | | | | | | Use the GNU 'date' command to auto-generate a new U-Boot timestamp on every compile. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* Moved initialization of PPC4xx EMAC to cpu_eth_init()Ben Warren2008-11-09-4/+0
| | | | | | | Removed initialization of the driver from net/eth.c Signed-off-by: Ben Warren <biggerbadderben@gmail.com> Acked-by: Stefan Roese <sr@denx.de>
* Changed PPC4xx EMAC driver to require CONFIG_PPC4xx_EMACBen Warren2008-11-09-3/+2
| | | | | | | All in-tree IBM/AMCC PPC4xx boards using the EMAC get this new CONFIG Signed-off-by: Ben Warren <biggerbadderben@gmail.com> Acked-by: Stefan Roese <sr@denx.de>
* Moved initialization of MPC8XX SCC to cpu_eth_init()Ben Warren2008-11-09-4/+0
| | | | | | Removed initialization of the driver from net/eth.c Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Moved initialization of MPC8220 FEC to cpu_eth_init()Ben Warren2008-11-09-4/+0
| | | | | | Removed initialization of the driver from net/eth.c Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Moved initialization of QE Ethernet controller to cpu_eth_init()Ben Warren2008-11-09-19/+0
| | | | | | Removed initialization of the driver from net/eth.c Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Moved initialization of FCC Ethernet controller to cpu_eth_initBen Warren2008-11-09-5/+0
| | | | | | | | | | | Affected boards: Several MPC8xx boards Several MPC8260/MPC8272 boards Several MPC85xx boards Removed initialization of the driver from net/eth.c Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* net: Move initialization of Au1x00 SoC ethernet MAC to cpu_eth_initShinya Kuribayashi2008-11-09-4/+0
| | | | | | | | | This patch will move au1x00_eth_initialize from net/eth.c to cpu_eth_init as a part of ongoing eth_initialize cleanup work. The function ret value is also fixed as it should be negative on fail. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Moved initialization of IXP4XX_NPE Ethernet controller to cpu_eth_init()Ben Warren2008-11-09-4/+0
| | | | | | Also, removed the driver initialization from net/eth.c Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD2008-10-18-19/+19
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* net: Make TFTP server timeout configurableBartlomiej Sieka2008-10-18-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-18-33/+28
| | | | | | | | | | | | | | | | | | 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>