summaryrefslogtreecommitdiff
path: root/include/net.h
Commit message (Collapse)AuthorAgeLines
* net: Make sure IPaddr_t is 32 bits in sizeMatthias Weisser2011-12-06-1/+2
| | | | | | | | | | | When building u-boot as 64 bit application (e.g. sandbox) ulong might be 64 bits in size. This breaks network code as IPaddr_t is 64 bytes in size then and an IPv4 address is 32 bits in size. This patch makes sure that IPaddr_t is always 32 bits in size. Also some warnings introduced by this patch are fixed. Signed-off-by: Matthias Weisser <weisserm@arcor.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* net: Export auto_load, use it in rarpSimon Glass2011-10-27-0/+6
| | | | | | | | | | | The rarp code includes another instance of the auto_load logic, so call what is now net_auto_load() instead. This also fixes an incorrect call to TftpStart() which was never seen since apparently no boards enable rarp. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* net: tftpput: Support selecting get/put for tftpSimon Glass2011-10-26-1/+1
| | | | | | TftpStart should support starting either a get or a put. Signed-off-by: Simon Glass <sjg@chromium.org>
* net: tftpput: Rename TFTP to TFTPGETSimon Glass2011-10-26-3/+5
| | | | | | | | This is a better name for this protocol. Also remove the typedef to keep checkpatch happy, and move zeroing of NetBootFileXferSize a little earlier since TFTPPUT will need to change this. Signed-off-by: Simon Glass <sjg@chromium.org>
* net: tftpput: Add support for receiving ICMP packetsSimon Glass2011-10-26-0/+19
| | | | | | | | | | ICMP packets can tell you when there is no server at the other end. It is useful for tftp to figure this out, so that a quick error can be displayed, rather than pointlessly retrying. This adds an ICMP packet handler to the net interface. Signed-off-by: Simon Glass <sjg@chromium.org>
* net: drop !NET_MULTI codeMike Frysinger2011-10-05-40/+0
| | | | | | | | | | | This is long over due. All but two net drivers have been converted, but those have now been dropped. The only thing left to do is actually delete all references to NET_MULTI and code that is compiled when that is not defined. So here we scrub the core code. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Add Ethernet hardware MAC address framework to usbnetSimon Glass2011-08-08-1/+24
| | | | | | | | | | | | Built-in Ethernet adapters support setting the mac address by means of a ethaddr environment variable for each interface (ethaddr, eth1addr, eth2addr). This adds similar support to the USB network side, using the names usbethaddr, usbeth1addr, etc. They are kept separate since we don't want a USB device taking the MAC address of a built-in device or vice versa. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Eric BĂ©nard <eric@eukrea.com>
* TFTP: add tftpsrv commandLuca Ceresoli2011-05-19-1/+2
| | | | | | Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Detlev Zundel <dzu@denx.de>
* NET: pass source IP address to packet handlersLuca Ceresoli2011-05-12-5/+10
| | | | | | | | | | 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>
* string_to_ip: constify "s" argMike Frysinger2010-11-28-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* string_to_VLAN: constify "var" argMike Frysinger2010-11-28-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* copy_filename: constify "src" argMike Frysinger2010-11-28-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Integrate USB gadget layer and USB CDC driver layerRemy Bohmer2010-09-20-2/+15
| | | | | | | Derived from Linux kernel 2.6.27 Signed-off-by: Thomas Smits <ts.smits@gmail.com> Signed-off-by: Remy Bohmer <linux@bohmer.net>
* Fix compile warnings for const correctnessBen Warren2010-08-09-1/+1
| | | | | | | | | | | Commit 6e37b1a3a25004d3df5867de49fff6b3fc9c4f04 modifies several net calls to take a (const char *) parameter instead of (char *), but in some cases the modified functions call other functions taking (char *). The end result is warnings about discarding the const qualifier. This patch fixes these other function signatures. Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Program net device MAC addresses after initializingBen Warren2010-05-03-0/+1
| | | | | | | | | | | | | | | | Add a new function to the eth_device struct for programming a network controller's hardware address. After all network devices have been initialized and the proper MAC address for each has been determined, make a device driver call to program the address into the device. Only device instances with valid unicast addresses will be programmed. Signed-off-by: Ben Warren <biggerbadderben@gmail.com> Acked-by: Detlev Zundel <dzu@denx.de> Tested-by: Prafulla Wadaskar <prafulla@marvell.com> Tested-by: Heiko Schocher <hs@denx.de> Tested-by: Thomas Chou <thomas@wytron.com.tw>
* Make getenv_IPaddr() globalDirk Behme2010-01-17-3/+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>
* net: add random_port() prototypeMike Frysinger2009-10-04-0/+3
| | | | | | | | | | The random_port() is meant to be used by other net code, but without a prototype, we get fun warnings like: dns.c: In function 'DnsSend': dns.c:89: warning: implicit declaration of function 'random_port' Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* net: sync env ethaddr to device enetaddr in eth_init()Mike Frysinger2009-08-07-1/+1
| | | | | | | | | | | | 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>
* Add DNS supportRobin Getz2009-07-22-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | | 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>
* net: new utility functions for working with enetaddr'sMike Frysinger2009-03-20-0/+3
| | | | | | | | | | | | | | 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-3/+0
| | | | | | | | | 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>
* Make some minor whitespace changes to eliminate line-wrappingAndy Fleming2009-02-16-15/+16
| | | | Signed-off-by: Andy Fleming <afleming@freescale.com>
* Move is_valid_ether_addr() to include/net.hMike Frysinger2009-01-28-0/+16
| | | | | | | Import the is_valid_ether_addr() function from the Linux kernel. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* net: Define IP flag field valuesPeter Tyser2008-12-04-0/+6
| | | | | | | | | 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>
* rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD2008-10-18-8/+8
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Big white-space cleanup.Wolfgang Denk2008-05-21-9/+9
| | | | | | | | | | | 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>
* Fix warnings while compiling net/net.c for MPC8610HPCD boardAnatolij Gustschin2008-04-30-4/+4
| | | | | | | | | MPC8610HPCD board adds -O2 gcc option to PLATFORM_CPPFLAGS causing overriding default -Os option. New gcc (ver. 4.2.2) produces warnings while compiling net/net.c file with -O2 option. The patch is an attempt to fix this. Signed-off-by: Anatolij Gustschin <agust@denx.de>
* Introduce new eth_receive routineRafal Jaworowski2008-01-03-0/+3
| | | | | | | | | | | | | | 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>
* multicast tftp: RFC2090David Updegraff2007-08-13-2/+9
| | | | | | | | 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>
* Add ability to take MAC address from the environment to DM9000 driverMike Rapoport2007-08-13-0/+23
| | | | | Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Ben Warren <bwarren@qstreams.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>
* include/: Remove obsolete references to CONFIG_COMMANDSJon Loeliger2007-07-09-3/+3
| | | | | | Mostly removed from comments here. Signed-off-by: Jon Loeliger <jdl@freescale.com>
* include/ non-config: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).Jon Loeliger2007-07-04-3/+3
| | | | | | | | | | | | | | 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>
* Add support for multiple PHYs.Marian Balakowicz2005-10-28-0/+1
|
* Cleanup for GCC-4.xWolfgang Denk2005-10-13-1/+1
|
* * Patch by Jon Loeliger, Kumar Gala 2005-02-08Jon Loeliger2005-07-23-1/+1
| | | | | | | | - Convert the CPM2 based functionality to use new CONFIG_CPM2 option rather than a myriad of CONFIG_MPC8560-like variants. Applies to MPC85xx and MPC8260 boards, includes stxgp3 and sbc8560. Eliminates the CONFIG_MPC8560 option entirely. Distributes the new CONFIG_CPM2 option to each 8260 board.
* * Patch by Masami Komiya, 30 Mar 2005:wdenk2005-04-01-1/+6
| | | | | | | | 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
* Patch by Andreas Engel, 16 Aug 2004:wdenk2004-10-09-1/+1
| | | | parameter type cleanup for NetSetTimeout()
* Add support for console over UDP (compatible to Ingo Molnar'swdenk2004-08-02-1/+2
| | | | netconsole patch under Linux)
* Patches by Pantelis Antoniou, 30 Mar 2004:wdenk2004-04-15-3/+49
| | | | add networking support for VLANs (802.1q), and CDP (Cisco Discovery Protocol)
* * Patch by Masami Komiy, 22 Feb 2004:wdenk2004-02-24-4/+4
| | | | | | Add support for NFS for file download * Minor code cleanup
* * Use "-fPIC" instead of "-mrelocatable" to prevent problems withwdenk2003-11-17-0/+1
| | | | | | | | | | | | | recent tools * Add checksum verification to 'imls' command * Add bd_info fields needed for 4xx Linux I2C driver * Patch by Martin Krause, 4 Nov. 2003: Fix error in cmd_vfd.c (TRAB board: "vfd /1" shows now only one Bitmap) * Print used network interface when CONFIG_NET_MULTI is set
* * Patches by Xianghua Xiao, 15 Oct 2003:wdenk2003-10-15-1/+1
| | | | | | | | - Added Motorola CPU 8540/8560 support (cpu/85xx) - Added Motorola MPC8540ADS board support (board/mpc8540ads) - Added Motorola MPC8560ADS board support (board/mpc8560ads) * Minor code cleanup
* - Added CONFIG_BOOTP_DNS2 and CONFIG_BOOTP_SEND_HOSTNAME to CONFIG_BOOTP_MASK.stroese2003-08-28-0/+3
|
* * Allow crc32 to be used at address 0x000wdenk2003-07-26-0/+8
| | | | | | | | * Provide consistent interface to standalone applications to access the 'global_data' structure Provide a doc/README.standalone more useful to users/developers. * Make IceCube MGT5100 FEC driver work
* * Code cleanup:wdenk2003-06-27-5/+3
| | | | | | | | | - remove trailing white space, trailing empty lines, C++ comments, etc. - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c) * Patches by Kenneth Johansson, 25 Jun 2003: - major rework of command structure (work done mostly by Michal Cendrowski and Joakim Kristiansen)
* * Fix CONFIG_NET_MULTI support in include/net.hwdenk2003-06-15-5/+7
| | | | | | | | | | | | | * Patches by Kyle Harris, 13 Mar 2003: - Add FAT partition support - Add command support for FAT - Add command support for MMC ---- - Add Intel PXA support for video - Add Intel PXA support for MMC ---- - Enable MMC and FAT for lubbock board - Other misc changes for lubbock board
* * Add support for RMU boardwdenk2003-06-05-1/+13
| | | | | | | | * Add support for TQM862L at 100/50 MHz * Patch by Pantelis Antoniou, 02 Jun 2003: major reconstruction of networking code; add "ping" support (outgoing only!)
* - CFG_ETH_RX_BUFFER added.stroese2003-06-05-6/+3
|