summaryrefslogtreecommitdiffstats
path: root/net
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* treewide: Add missing includesSascha Hauer2013-11-081-0/+1
| | | | | | | | A lot of files rely on include/driver.h including include/of.h (and this including include/errno.h. include the files explicitly so we can eventually get rid of including of.h from driver.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: Add a context pointer to fixup functionsSascha Hauer2013-11-061-2/+2
| | | | | | | If drivers want to fixup their specific instance they need some context to know which instance they have to fixup. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/console'Sascha Hauer2013-10-071-1/+0
|\
| * console: drop f_caps and check the function pointer getc/putc insteadJean-Christophe PLAGNIOL-VILLARD2013-09-211-1/+0
| | | | | | | | | | | | | | | | | | | | None of the driver make the difference between STDOUT and STDERR. So we just need to check if putc or getc are filled in the console_device save 32 bytes on versatilepb Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | dhcp: replace dhcp_getenv_int with getenv_uintSascha Hauer2013-10-071-11/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/powerpc'Sascha Hauer2013-09-051-10/+12
|\
| * net, of: fixup MAC address by aliasRenaud Barbier2013-09-051-10/+12
| | | | | | | | | | | | | | | | | | If a network device has not been registered from the devicetree, we may still find it by its alias in the devicetree. This way also platform based network devices can obtain a valid MAC address in the devicetree. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/boardinfo'Sascha Hauer2013-09-051-2/+1
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: arch/mips/boards/qemu-malta/init.c commands/bootm.c drivers/of/base.c
| * | Make hostname available to C CodeSascha Hauer2013-08-161-1/+0
| | | | | | | | | | | | | | | | | | | | | The boards often have a sane default for the hostname. Provide a C function for setting/getting it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | globalvar: Allow to set initial valueSascha Hauer2013-08-161-1/+1
| |/ | | | | | | | | | | | | Calling globalvar_add_simple() and setting a value is more than common. Add a parameter for the initial value. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / net: fix checksum verificationBaruch Siach2013-08-121-1/+1
|/ | | | | | | | | Checksum calculation on data including its own checksum (as is the case with IP headers) should give 0xffff before bit flipping. Current code works well for the correct checksum case, but fails to identify errors. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: net: Use correct devicetree in eth_of_fixupSascha Hauer2013-07-271-1/+1
| | | | | | | | eth_of_fixup() is passed a devicetree, so use this one instead of the internal devicetree. This makes sure it also works when the tree to fixup is not the internal one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next-manual/oftree-linux-sync'Sascha Hauer2013-07-021-1/+1
|\
* | net: Set mac-address propertySascha Hauer2013-06-051-0/+54
|/ | | | | | | | | | Linux normally has no idea how to retrieve MAC Addresses, but instead expects the MAC address in the devicetree. This patch adds the MAC address to the devicetree for Linux if we find a valid one in barebox. This mechanism is limited of course to devices barebox has a driver for and which are probed themselves from the devicetree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Add of_register_ethaddrSascha Hauer2013-05-211-12/+56
| | | | | | | | | | | | We already have a possibility to register a MAC address provider based on a ethernet device id. This adds a similar functionality for devices probed from devicetree. Code can register itself to be a MAC address provider for a certain devicetree node. This helps on i.MX to let the IIM unit provide a MAC address for the FEC. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: Fix tftp servername handlingSascha Hauer2013-05-141-3/+6
| | | | | | | | | | | | | When the dhcp code discovered the tftp-server-name option it immediately tries to resolve the name. This can't succeed since the we are somewhere in the dhcp processing and the nameserver may not even be known. Fix this by resolving the name when dhcp is completed. While at it, do this in a way that net_set_serverip is only called when resolv() returns something useful. Otherwise we may end up overwriting a previously configured serverip which came from the bootp bp_siaddr field. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: Fix return value on ctrl-cSascha Hauer2013-05-141-2/+4
| | | | | | | the dhcp command will return with 0 when ctrl-c is pressed. Fix this to -EINTR instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* netconsole: use dev_add_param_* helpersSascha Hauer2013-04-111-44/+6
| | | | | | For shorter code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: store ethernet device parameters in deviceSascha Hauer2013-04-112-81/+39
| | | | | | | | Rather than storing the parameters globally and trying to keep them in sync with the device parameters, store the parameters in the ethernet device directly. Also, update to dev_add_param_ip(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>