summaryrefslogtreecommitdiffstats
path: root/net/net.c
Commit message (Collapse)AuthorAgeFilesLines
* net: add a context to the packet handlerSascha Hauer2011-04-121-7/+10
| | | | | | | This is not yet used, but with this the different network commands can get rid of their global data. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Fix error handling with malloc, memalign etc. Introduce xmemalign().Krzysztof Halasa2011-01-071-2/+2
| | | | | | | | | | | | | | The idea is to panic() when there is no memory available for normal operation. Exception: code which can consume arbitrary amount of RAM (example: files allocated in ramfs) must report error instead of panic(). This patch also fixes code which didn't check for NULL from malloc() etc. Usage: malloc(), memalign() return NULL when out of RAM. xmalloc(), xmemalign() always return non-NULL or panic(). Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* LED: Add LED trigger supportSascha Hauer2010-12-201-5/+15
| | | | | | | This patch allows to associate LEDs with certain triggers, such as heartbeat or network activity. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: make locally used functions staticSascha Hauer2010-10-211-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: use a random mac address if the current device does not have a valid ↵Sascha Hauer2010-06-221-1/+10
| | | | | | address Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: remove old network stackSascha Hauer2010-06-171-897/+47
| | | | | | All network commands now use the new stack, so remove the old one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Implement a new network stackSascha Hauer2010-06-171-4/+536
| | | | | | | | | | | | | | | | | The old network stack has some bad limitations: - network commands are required to call NetLoop() which only returns when the network layer wants to. Instead we now use a net_poll() function which returns after handling one packet (or immediately if no packet is available). - There can be only one packet handler which makes it impossible to handle multiple connections - CamelCaseMakesItHardToRead The new network stack is implemented as a parallel universe. Currently all commands still use the old stack. They are converted in subsequent patches. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: remove need for eth_halt/eth_openSascha Hauer2010-06-171-8/+13
| | | | | | | | | | | We used to eth_open/eth_halt the network devices during NetLoopInit which is called whenever the user enters a network command. Change this behaviour so that the current network device gets opened when making it the current one. With this change it's always possible to send packages and we are able to implement a new network stack in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* put only once used function inlineSascha Hauer2010-02-011-13/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* replace ET_DEBUG with pr_debugSascha Hauer2010-02-011-45/+24
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove unused NETCONSOLE stuffSascha Hauer2010-02-011-10/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove unused variable NetBootFileSizeSascha Hauer2009-10-171-1/+0
| | | | Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* make locally used funtion staticSascha Hauer2009-10-171-1/+1
| | | | Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* remove sntp support. Has been broken for long enoughSascha Hauer2009-10-131-23/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* do not abuse the received packet to send back another packetSascha Hauer2009-10-131-1/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: remove unnecessary ifSascha Hauer2009-10-131-17/+11
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* only the ping code is interested in the ping ipSascha Hauer2009-10-131-14/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: remove dead codeSascha Hauer2009-10-131-9/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: cleanup header fileSascha Hauer2009-10-131-1/+0
| | | | | | move contents of bootp.h to .c file and remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: remove switch/case in NetLoop()Sascha Hauer2009-10-131-51/+1
| | | | | | | | Instead of having a big switch/case for every protocol, do the right things in the individual functions before callong NetLoop(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootp: remove unnecessary counterSascha Hauer2009-10-131-2/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: check prerequisites in NetLoopIinit()Sascha Hauer2009-10-131-52/+49
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* return is not a functionSascha Hauer2009-10-131-11/+11
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: split NetLoop in NetLoop and NetLoopInitSascha Hauer2009-10-131-2/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: remove unused state NETLOOP_RESTARTSascha Hauer2009-10-131-5/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: remove NetStartAgain()Sascha Hauer2009-10-131-45/+3
| | | | | | Do not let the network stack restart itself Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add a device_d to ethernet devicesSascha Hauer2009-07-211-9/+9
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fix 62e2cd0a681c19fdc4180adf89e69709c696133bSascha Hauer2008-08-211-7/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: remove redundant assignmentSascha Hauer2008-08-201-2/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: initialize Net* variables unconditionally, not in a big switch/caseSascha Hauer2008-08-201-53/+12
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Fix string_to_ipSascha Hauer2008-08-201-13/+19
| | | | | | | | Use a pointer to an ip address instead of the return value in string_to_ip and use the return value for error indication only. 0.0.0.0 can be a valid ip address Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Coding style changesSascha Hauer2008-08-201-7/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add missing call to eth_halt()Sascha Hauer2008-08-141-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'master' of git://www.denx.de/git/u-boot-v2Sascha Hauer2008-06-021-65/+1
|\
| * [net] cleanups:Sascha Hauer2008-04-071-416/+1
| | | | | | | | | | - remove cdp support - replace CONFIG_BOOTP_MASK with #ifdef CONFIG_...
* | remove cdp support. Probably not working anymore anyway.Sascha Hauer2008-03-311-351/+0
| |
* | fix typo and indentionSascha Hauer2008-03-211-2/+2
|/
* using a consistent ipaddr parameter all over the placeJuergen Beisert2007-11-081-1/+1
| | | | Signed-off-by: Juergen Beisert <jbe@octopus.labnet.pengutronix.de>
* When printing error messages about network parameters printsascha2007-10-181-3/+6
| | | | the network device id with it.
* check if there is an ethernet device set in NetLoopsascha2007-10-181-0/+5
|
* rename mac parameter to ethaddrsascha2007-10-181-1/+1
|
* change functions containing 'mac' or 'enet' in its name to 'ethaddr'.sascha2007-10-181-3/+3
| | | | change the parameter name for ethernet devices to 'ethaddr' aswell.
* Use safe_strncpy() instead of copy_filename(). The shell has already removedSascha Hauer2007-09-281-13/+0
| | | | quotes, so we don't need this functionality from copy_filename()
* - putc is now putchar for better standard conformitySascha Hauer2007-09-211-1/+1
| | | | - make printf return int
* Use unsigned char * for mac address. Otherwise (s)printf interpetsSascha Hauer2007-09-111-1/+1
| | | | | parts of the mac address as negative numbers and gives wrong results.
* svn_rev_580Sascha Hauer2007-07-051-1/+1
|
* svn_rev_502Sascha Hauer2007-07-051-1/+1
| | | | complete multiple console support
* svn_rev_481Sascha Hauer2007-07-051-2/+2
| | | | make more char * const, fix compiler warnings
* svn_rev_469Sascha Hauer2007-07-051-4/+5
| | | | | - make some more char * const - dev_add_parameter -> dev_add_param
* svn_rev_405Sascha Hauer2007-07-051-6/+4
| | | | add 0x for hex value in $filesize, remove $fileaddr