summaryrefslogtreecommitdiffstats
path: root/net
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/net'Sascha Hauer2015-08-061-0/+8
|\
| * net: make eth_register_ethaddr work on registered network devicesSascha Hauer2015-07-281-0/+8
| | | | | | | | | | | | | | When eth_register_ethaddr is called after the device has been registered it should work aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: eth_send: Allow to use multiple network interfaces at onceAntony Pavlov2015-07-231-1/+1
|/ | | | | | | | | | | | | | | | | | | | The commit commit be0404c21f22da2d736168b2e56a9ae583cc3e95 Author: Sascha Hauer <s.hauer@pengutronix.de> Date: Wed May 14 16:08:04 2014 +0200 net: Allow to use multiple network interfaces at once changes the eth_send() function: - return eth_current->send(eth_current, packet, length); + return edev->send(eth_current, packet, length); But we have to change the both eth_current occurrences to edev here! Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net'Sascha Hauer2015-07-031-4/+9
|\
| * dns: handle incoming packets in the separate dns_recv() functionAntony Pavlov2015-07-011-4/+9
| | | | | | | | | | | | | | | | The separation of incoming packets handling makes it much easier to run barebox dns client on top of picotcp network stack in the future. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | treewide: fix 'new blank line at EOF' formatting errorAntony Pavlov2015-07-022-2/+0
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: Move library functions to net/lib.cSascha Hauer2015-07-023-78/+110
| | | | | | | | | | | | | | Some network related functions are also needed when networking is disabled. Move these to a separate file which is always compiled. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: eth: Do not rely on CONFIG_PARAMETER to be enabledSascha Hauer2015-06-262-9/+20
|/ | | | | | | | | register_preset_mac_address only works when CONFIG_PARAMETER is enabled because otherwise dev_set_param is a no-op. Add a function to set the MAC address explicitly without the need of CONFIG_PARAMETER and use it where appropriate. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/am33xx'Sascha Hauer2015-06-093-102/+69
|\
| * net: dhcp: Split dhcp funcionality & add dhcp commandWadim Egorov2015-06-053-102/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | dhcp/bootp was bound to the command functionality. This patch splits the dhcp command. We are now able to use bootp without a shell. This patch adds also a check for environment variables and globalvar. So only when ENVIRONMENT_VARIABLES and GLOBALVAR is set, all received dhcp data will be stored. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | eth: halt active ethernet device on unregisterSascha Hauer2015-04-281-0/+3
|/ | | | | | | When an active ethernet device is unregistered it should be halted to quiesce the device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: ping: return an error exit code when connection failsMirko Damiani2015-04-031-3/+3
| | | | | | | | | ping command does not always returns 1 as exit code when connection to host fails. In particular it returns the exit code of the previous run. This patch fixes this issue. Signed-off-by: Mirko Damiani <mirko@develer.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net'Sascha Hauer2015-02-041-6/+3
|\
| * dhcp: fix request packet's seconds elapsedEric Bénard2015-01-291-2/+1
| | | | | | | | | | | | | | it's done in the discover packet so let's do it also in the request packet. Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * dhcp: fix request packetEric Bénard2015-01-291-3/+1
| | | | | | | | | | | | | | we are not supposed to fill ciaddr, yiaddr and siaddr in the request packet. Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * dhcp: fix request packet's requested IP optionEric Bénard2015-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In the request packet, we are supposed to copy the IP that the DHCP server provided in the offer packet so that dhcp_extended can fill the option 50. There is actually an error in barebox as the pointer to the packet currently built is used as the source instead of the pointer to the offer packet. With this patch, barebox now sends a request packet which includes the right requested IP in option 50. Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | console: allow to specify the device idJean-Christophe PLAGNIOL-VILLARD2015-01-131-0/+1
|/ | | | | | | so we can use dynamic number id with specific devname Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* netconsole: activate in set_active callbackSascha Hauer2014-12-171-21/+34
| | | | | | | | | Activate the netconsole in the set_active callback. Add proper checks there for port and ip address, print an error when the network hasn't been configured and finally print when the netconsole has been enabled successfully. This makes using of the netconsole easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Call edev->recv with correct eth_deviceSascha Hauer2014-09-171-1/+1
| | | | | | | | edev->recv has to be called with edev as argument, not eth_current. This fixes networking when multiple network devices are used and the current one is switched during runtime. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* netconsole: rename console to "netconsole"Sascha Hauer2014-07-111-0/+1
| | | | | | So that it can be used without guessing the name first. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Do not use macros in command helpSascha Hauer2014-07-081-1/+1
| | | | | | | The help texts are parsed by sphinx which cannot handle macros, so replace them with their values. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation: remove doxygen documentationSascha Hauer2014-06-261-28/+0
| | | | | | | The doxygen documentation is long outdated. Remove it. It will be replaced with sphinx based documentation later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ifup: Add comment why xxx-discover files have to be skippedSascha Hauer2014-06-231-0/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: ifup: skip *-discover files for ifup -aSascha Hauer2014-06-231-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net'Sascha Hauer2014-06-043-40/+54
|\ | | | | | | | | Conflicts: drivers/net/dm9k.c
| * net: take eth id from devicetree aliasSascha Hauer2014-05-151-2/+11
| | | | | | | | | | | | | | If the devicetree has an alias for the ethernet device, then use it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: Allow to use multiple network interfaces at onceSascha Hauer2014-05-152-37/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In barebox network packets always go out at the current ethernet device and are expected to be received from the current interface. This has some side effects. When for example an NFS is mounted when one interface is active and the interface is changed afterwards the NFS packets leave the new interface, but the NFS server won't be reachable there. Instead of changing the whole network traffic to the current ethernet interface we now initialize a network connection with the current network interface, but then the connection will continue to use that interface even when the current interface is changed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: Pass eth_device to net_receiveSascha Hauer2014-05-151-1/+1
| | | | | | | | | | | | | | So that barebox has the information which interface a packet came from. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: ifup: Set current ethernet device when doing ifupSascha Hauer2014-05-151-0/+2
| | | | | | | | | | | | | | When doing an ifup set the current interface to the one just brought up so that it is actually used. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: show enetaddr in lowercaseHolger Schurig2014-06-021-1/+1
| | | | | | | | | | | | | | | | | | "ifconfig" and "ip" from normal Linux userspace shows ethernet addresses normally in lowercase. And the %pM format specifier in Linux does that, too. Conform to this custom formatting. Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: move CMD_IFUP to commands/KconfigHolger Schurig2014-05-141-7/+0
| | | | | | | | | | | | | | | | | | * this places the command into the "Network commands" section of Kconfig * while at it, improve Kconfig documention Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: NET_DHCP -> CMD_DHCPHolger Schurig2014-05-142-5/+1
| | | | | | | | | | | | | | | | | | | | | | * this compile option actually turns on a command, so name it accordingly * also move the Kconfig definition into commands/Kconfig, thus placing getopt into the "Network commands" section * while at it, improve Kconfig documention Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: NET_PING -> CMD_PINGHolger Schurig2014-05-142-5/+1
| | | | | | | | | | | | | | | | | | | | | | * this compile option actually turns on a command, so name it accordingly * also move the Kconfig definition into commands/Kconfig, thus placing getopt into the "Network commands" section * while at it, improve Kconfig documention Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: introduce CMD_HOSTHolger Schurig2014-05-141-1/+2
| | | | | | | | | | | | | | | | ... because NET_RESOLV can be used alone to turn on the functionality of resolv(). Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: harmonize in-barebox documentationHolger Schurig2014-05-145-38/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does probably too much, but it's hard (and very cumbersome/time consuming) to break it out. What is does is this: * each command has one short description, e.g. "list MUX configuration" * made sure the short descriptions start lowercase * each command has one usage. That string contains just the options, e.g. "[-npn]". It's not part of the long help text. * that is, it doesn't say "[OPTIONS]" anymore, every usable option is listed by character in this (short) option string (the long description is in the long help text, as before) * help texts have been reworked, to make them - sometimes smaller - sometimes describe the options better - more often present themselves in a nicer format * all long help texts are now created with BUSYBOX_CMD_HELP_ macros, no more 'static const __maybe_unused char cmd_foobar_help[]' * made sure the long help texts starts uppercase * because cmdtp->name and cmdtp->opts together provide the new usage, all "Usage: foobar" texts have been removed from the long help texts * BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this is nicer in the source code * BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself * made sure no line gets longer than 77 characters * delibertely renamed cmdtp->usage, so that we can get compile-time errors (e.g. in out-of-tree modules that use register_command() * the 'help' command can now always emit the usage, even without compiled long help texts * 'help -v' gives a list of commands with their short description, this is similar like the old "help" command before my patchset * 'help -a' gives out help of all commands Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: group 'help' outputHolger Schurig2014-05-145-0/+5
|/ | | | | | | | | | | | | | | | | | | The old output of "help" was just producing a long list, that usually scrolled of the screen (even on a X11 terminal). This list is more compact, and also sorted by groups. The old output format (plus grouping) is now available with 'help -v'. Example: Information commands: ?, devinfo, help, iomem, meminfo, version Boot commands: boot, bootm, go, loadb, loads, loadx, loady, saves, uimage ... Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net/ifup.c: avoid setting the MAC twiceJuergen Borleis2014-04-241-1/+0
| | | | | | | | | | The command always sets the MAC address of the interface in the code path. For the static network configuration case it sets it again, due to the environment variable keyword ("ethaddr") is listed again in the table. Remove this keyword from the table, because the MAC is already set. Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net/ifup.c: don't fail silentlyJuergen Borleis2014-04-241-2/+6
| | | | | | | | | | | Since commit a162dfe50345d3461010759f8a0e79f7e388c140 the ifup command is implemented in C and runs up to two external scripts. If one of these scripts return with an error code, the command terminates silently. This can confuse a user because there is no hint about the reason why it fails. Add error messages to avoid this case. Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2014-04-041-11/+3
|\
| * param: Add dev_add_param_macSascha Hauer2014-04-041-11/+3
| | | | | | | | | | | | | | This adds a convenience function to register a MAC address device parameter. The only current user is converted to use it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | netconsole: bail out when no connection is openedSascha Hauer2014-03-311-0/+6
|/ | | | | | | | | When no connection is opened we should not call into the networking stack. Otherwise it can happen that we delay further execution until the network stack detected a link (or timed out bringing the link up). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ifup: set serverip to provided value when doing dhcpSascha Hauer2014-03-141-0/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/nfs'Sascha Hauer2014-03-074-1/+192
|\ | | | | | | | | Conflicts: defaultenv/defaultenv-2-base/bin/ifup
| * net: Add ifup supportSascha Hauer2014-03-073-0/+191
| | | | | | | | | | | | | | | | The defaultenv-2 has ifup support as a shell script. This patch replaces it with a command which is more robust, can be called from C and now can also bring up all configured interfaces. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: constify eth_get_byname argumentSascha Hauer2014-03-071-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mtd'Sascha Hauer2014-03-071-2/+0
|\ \ | | | | | | | | | | | | | | | Conflicts: drivers/mtd/core.c net/eth.c
| * | device: remove parameters when unregistering a deviceSascha Hauer2014-02-131-2/+0
| |/ | | | | | | | | | | | | | | Otherwise we loose memory on each device_unregister. The ethernet code used to do this before calling unregister_device. This can now be removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / remove redundant NULL check on freeLucas Stach2014-02-101-1/+1
|/ | | | | | | | free() already checks the pointer to be non NULL. No need to do it again. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Fix error return value for string_to_ethaddrSascha Hauer2014-01-201-2/+2
| | | | | | Return a proper error code instead of -1 which would be -EPERM. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* barebox: remove double semicolonsAlexander Aring2013-11-182-2/+2
| | | | | Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>