summaryrefslogtreecommitdiffstats
path: root/include/net.h
Commit message (Collapse)AuthorAgeFilesLines
* net: force PKTALIGN to ARCH_DMA_MINALIGNEric Nelson2012-03-291-1/+2
| | | | | | | This will prevent the need for architectures whose DMA alignment is greater than 32 to have bounce buffers. Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
* net/miiphy/serial: drop duplicate "NAMESIZE" defineMike Frysinger2012-03-181-3/+1
| | | | | | | | | | A few subsystems are using the same define "NAMESIZE". This has been working so far because they define it to the same number. However, I want to change the size of eth_device's NAMESIZE, so rather than tweak the define names, simply drop references to it. Almost no one does, and the handful that do can easily be changed to a sizeof(). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* eth: remove usb-ethernet devices before re-enumerating themVincent Palatin2012-03-031-0/+1
| | | | | | | | Fix the crash when running several times usb_init() with a USB ethernet device plugged. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: Wolfgang Grandegger <wg@denx.de>
* net: introduce per device indexMichael Walle2011-12-201-0/+1
| | | | | | | | | | | | | | | | Instead of counting the device index everytime a functions needs it, store it in the eth_device struct. eth_register() keeps track of the indices and updates the device's index number. This simplifies some functions in net/eth.c. Additionally, a network driver can now query its index, eg. to get the correct environment ethaddr name. Signed-off-by: Michael Walle <michael@walle.cc> Cc: Prafulla Wadaskar <prafulla@marvell.com> Cc: Mike Frysinger <vapier@gentoo.com> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* net: Make sure IPaddr_t is 32 bits in sizeMatthias Weisser2011-12-061-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-271-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-261-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-261-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-261-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-051-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-081-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-191-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-121-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-281-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* string_to_VLAN: constify "var" argMike Frysinger2010-11-281-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* copy_filename: constify "src" argMike Frysinger2010-11-281-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Integrate USB gadget layer and USB CDC driver layerRemy Bohmer2010-09-201-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-091-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-031-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-171-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-041-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-071-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-221-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-221-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-201-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-201-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-161-15/+16
| | | | Signed-off-by: Andy Fleming <afleming@freescale.com>
* Move is_valid_ether_addr() to include/net.hMike Frysinger2009-01-281-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-041-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-181-8/+8
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Big white-space cleanup.Wolfgang Denk2008-05-211-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-301-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-031-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-131-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-131-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-091-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-091-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-041-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-281-0/+1
|
* Cleanup for GCC-4.xWolfgang Denk2005-10-131-1/+1
|
* * Patch by Jon Loeliger, Kumar Gala 2005-02-08Jon Loeliger2005-07-231-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-011-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-091-1/+1
| | | | parameter type cleanup for NetSetTimeout()
* Add support for console over UDP (compatible to Ingo Molnar'swdenk2004-08-021-1/+2
| | | | netconsole patch under Linux)
* Patches by Pantelis Antoniou, 30 Mar 2004:wdenk2004-04-151-3/+49
| | | | add networking support for VLANs (802.1q), and CDP (Cisco Discovery Protocol)
* * Patch by Masami Komiy, 22 Feb 2004:wdenk2004-02-241-4/+4
| | | | | | Add support for NFS for file download * Minor code cleanup
* * Use "-fPIC" instead of "-mrelocatable" to prevent problems withwdenk2003-11-171-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-151-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-281-0/+3
|
* * Allow crc32 to be used at address 0x000wdenk2003-07-261-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
OpenPOWER on IntegriCloud