summaryrefslogtreecommitdiff
path: root/net/net.c
Commit message (Collapse)AuthorAgeLines
* 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>
* minor debug cleanups in ./netRobin Getz2009-08-07-56/+24
| | | | | | | | | | | | | | | 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>
* 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 DNS supportRobin Getz2009-07-22-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+4
| | | | | | | | 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>
* netloop: updates for NetLoopHeiko Schocher2009-05-15-4/+3
| | | | | | | | | | | | | 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>
* 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-12/+5
| | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Ben Warren <biggerbadderben@gmail.com>
* convert print_IPaddr() to %pI4Mike Frysinger2009-03-20-12/+1
| | | | | | | | | 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-59/+75
| | | | | | | | | | | | | | 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>
* 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-3/+4
|\
| * 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>
* rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD2008-10-18-6/+6
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* net: express the first argument to NetSetTimeout() in millisecondsBartlomiej Sieka2008-10-18-12/+7
| | | | | | | | | | | | | | | | | | 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>
* Fix some more printf() format issues.Wolfgang Denk2008-07-13-1/+1
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Fix some more printf() format issues.Jean-Christophe PLAGNIOL-VILLARD2008-07-13-1/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Fix some more print() format errors.Wolfgang Denk2008-07-11-1/+2
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Get rid of annoying/superfluous bad-checksum warning messageRemy Bohmer2008-06-04-0/+4
| | | | | | | | | | | | | U-boot can complain a lot about 'checksum bad' when it is attached to the network. It is annoying for ordinary users who start to doubt the network connection in general when they see messages like this. This is caused by the routine NetCksumOk() which cannot handle IP-headers longer than 20 bytes. Those packages can be ignored anyway by U-boot, so we trash them now before checking the checksum. Signed-off-by: Remy Bohmer <linux@bohmer.net> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Big white-space cleanup.Wolfgang Denk2008-05-21-3/+3
| | | | | | | | | | | This commit gets rid of a huge amount of silly white-space issues. Especially, all sequences of SPACEs followed by TAB characters get removed (unless they appear in print statements). Also remove all embedded "vim:" and "vi:" statements which hide indentation problems. Signed-off-by: Wolfgang Denk <wd@denx.de>
* net: make ARP timeout configurableGuennadi Liakhovetski2008-04-28-6/+17
| | | | | | | | | | | | | | Currently the timeout waiting for an ARP reply is hard set to 5 seconds. On i.MX31ADS due to a hardware "strangeness" up to four first IP packets to the boards get lost, which typically are ARP replies. By configuring the timeout to a lower value we significantly improve the first network transfer time on this board. The timeout is specified in milliseconds, later internally it is converted to deciseconds, because it has to be converted to hardware ticks, and CFG_HZ ranges from 900 to 27000000 on different boards. Signed-off-by: Guennadi Liakhovetski <lg@denx.de> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* net: Add CONFIG_NET_DO_NOT_TRY_ANOTHER optionMatthias Fuchs2008-01-03-0/+2
| | | | | | | | | | When CONFIG_NET_DO_NOT_TRY_ANOTHER is defined U-Boot's networking stack does not automatically switch to another interface. This patch does not touch the default behavior. Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Introduce new eth_receive routineRafal Jaworowski2008-01-03-0/+10
| | | | | | | | | | | | | | The purpose of this routine is receiving a single network frame, outside of U-Boot's NetLoop(). Exporting it to standalone programs that run on top of U-Boot will let them utilise networking facilities. For sending a raw frame the already existing eth_send() can be used. The direct consumer of this routine is the newly introduced API layer for external applications (enabled with CONFIG_API). Signed-off-by: Rafal Jaworowski <raj@semihalf.com> Signed-off-by: Piotr Kruszynski <ppk@semihalf.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Fix warning differ in signedness in net/net.c and net/nfs.cJean-Christophe PLAGNIOL-VILLARD2007-11-18-4/+4
|
* Fix memory corruption problem on STX GP3 SSA Board.Wolfgang Denk2007-09-12-2/+2
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Coding style cleanup; rebuild CHANGELOGWolfgang Denk2007-08-14-1/+1
|
* multicast tftp: RFC2090David Updegraff2007-08-13-0/+8
| | | | | | | | 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-10-4/+4
| | | | | | | | 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>
* Finally retire cmd_confdefs.h and CONFIG_BOOTP_MASK!Jon Loeliger2007-07-09-1/+1
| | | | | | | | | | All of the choices for CONFIG_BOOTP_ are now documented in the README file. You must now individually select exactly the set that you want using a series of #define CONFIG_BOOTP_<x> statements in the board port config files now. Signed-off-by: Jon Loeliger <jdl@freescale.com>
* net/: Remove obsolete references to CONFIG_COMMANDSJon Loeliger2007-07-09-30/+30
| | | | Signed-off-by: Jon Loeliger <jdl@freescale.com>
* net/: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).Jon Loeliger2007-07-04-30/+30
| | | | | | | | | | | | | | 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>
* net - Support ping reply when processing net-loopEd Swarthout2007-03-07-0/+20
| | | | | | | | | | | | | | Add ICMP_ECHO_REQUEST packet support by responding with a ICMP_ECHO_REPLY. This permits the ping command to test the phy interface when the phy is put in loopback mode (typically by setting register 0 bit 14). It also allows the port to respond to an external ping when u-boot is processing some other net command (such as tftp). This is useful when tftp appears to hang. Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com> Signed-off-by: Ben Warren <bwarren@qstreams.com>
* GCC-4.x fixes: clean up global data pointer initialization for all boards.Wolfgang Denk2006-03-31-5/+2
|
* Fix behaviour if gatewayip is not setWolfgang Denk2006-03-12-1/+3
| | | | Patch by Robin Gilks, 23 Dec 2004
* Add explanation for CDP checksum algorithmWolfgang Denk2005-11-10-1/+4
|
* Add support for multiple PHYs.Marian Balakowicz2005-10-28-2/+2
|
* Cleanup for GCC-4.xWolfgang Denk2005-10-13-2/+5
|
* Add I2C support to TQM8540 and TQM8560 boards (EEPROM, RTC, LM75-DTT).Stefan Roese2005-08-31-1/+1
| | | | | | Removed CFG_CMD_DISPLAY from default commands. Fixed compiler warning in net.c. Patch by Stefan Roese, 31 Aug 2005
* Prepare U-Boot for gcc-4.xWolfgang Denk2005-08-26-1/+2
|
* Minor code cleanupWolfgang Denk2005-08-12-20/+20
|
* Add UPD-Checksum code, fix problem in net.c (return instead of break)Stefan Roese2005-08-12-2/+42
| | | | Patch by Reinhard Arlt, 12 Aug 2005
* README: add explanation about patch policywdenk2005-05-03-5/+5
| | | | net/net.c: fix indentation
* Patch by David Adair, 27 Oct 2004:wdenk2005-04-03-2/+2
| | | | Add missing 440GX SDRAM Controller reset
* * Patch by Richard Klingler, 03 Apr 2005:wdenk2005-04-03-1/+4
| | | | | | | | | Add call to eth_halt() in net/net.c when called functions fail after eth_init() has been called. * Patch by Sam Song, 3 April 2005: - Update README.Netconsole - Update README
* Minor cleanupwdenk2005-04-03-3/+5
|
* * Patch by Masami Komiya, 30 Mar 2005:wdenk2005-04-01-1/+37
| | | | | | | | add SNTP support and expand time server and time offset fields of DHCP support. See doc/README.SNTP * Patch by Steven Scholz, 13 Dec 2004: Fix bug in at91rm920 ethernet driver
* * Some Cleanup.wdenk2005-01-12-0/+1
| | | | | | | | | | | | | | * Patch by Richard Woodruff, 10 Jan 2005: Update support for OMAP2420 (ARM11) and H4 board: o clean up and add new types to H4 memory probe code. o fix to work with internal boot. o added PRCM config III operation. o fix marginal flash timings. o add revison ATAG usage. o enable voltage scaling at power chip. o fix compile error for i2c. * Fix network problem (error when receiving multiple ARP packets)