summaryrefslogtreecommitdiffstats
path: root/net
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/parameter-types'Sascha Hauer2017-05-051-2/+9
|\
| * net: use dev_add_param_stringSascha Hauer2017-04-111-2/+9
| | | | | | | | | | | | | | dev_add_param_string allows to pass a priv * so that the device_d * argument is not needed and can be removed later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: ifup needs to be able to run commandsLucas Stach2017-04-261-0/+1
|/ | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: replace set_active by open/closeBastian Stender2017-02-281-10/+17
| | | | | | | | | Opening and closing consoles should be independent from setting them active. This way it is possible to open e.g. a framebuffer console and display text on it without showing stdout/stderr. Signed-off-by: Bastian Stender <bst@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: add linux.bootarg parameter from ifup callEnrico Jorns2016-09-222-0/+11
| | | | | | | | | | | | | This sets a `ip=dhcp` or `ip=<clientip>:<serverip>:<gatewayip>:<netmaskip>::<iface>:` bootarg for the network device upon execution of 'ifup'. This is the only point where we can distinguish between a static ip and a dhcp-based network setup and thus set a valid bootarg options as it will be required for nfs boot, for example. Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* convert users to %pI4Sascha Hauer2016-09-225-29/+8
| | | | | | | Convert users of ip_to_string() and print_IPaddr() to %pI4 and remove the now unused functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Pass network device to net_answer_arp()Sascha Hauer2016-07-141-3/+2
| | | | | | | | | The caller already has the correct network device, so pass it to net_answer_arp() rather than using eth_get_current() there. This is a step towards making a global current network device unnecessary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: eth: add name to struct eth_deviceSascha Hauer2016-07-141-5/+7
| | | | | | | | | Using dev_name often is not a good idea since it's a statically allocated string which gets overwritten by later calls to dev_name. Add a devname string to struct eth_device to have the name available for later use. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: introduce for_each_netdev iteratorSascha Hauer2016-07-141-7/+7
| | | | | | | | for_each_netdev is nicer to read. Also export the list of network devices since it will be used by code outside of net/eth.c in later patches. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: eth: open correct edev in eth_check_openSascha Hauer2016-07-141-1/+1
| | | | | | | | eth_check_open gets the network device to check as parameter, so use it rather than using eth_current. Currently both are the same, so this currently does not fix anything. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ifup: fix handling when ip env is not givenAlexander Aring2016-06-151-0/+3
| | | | | | | | This patch handles the ip env to "" if no ip env is given. Otherwise we get a NULL pointer derefence. Signed-off-by: Alexander Aring <aar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* string: Fix (v)asprintf prototypesSascha Hauer2016-04-153-7/+7
| | | | | | | | | | Our asprintf and vasprintf have different prototypes than the glibc functions. This causes trouble when we want to share barebox code with userspace code. Change the prototypes for (v)asprintf to match the glibc prototypes. Since the current (v)asprintf are convenient to use change the existing functions to b(v)asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/rtc'Sascha Hauer2016-01-113-0/+176
|\
| * net: Add SNTP supportSascha Hauer2016-01-073-0/+176
| | | | | | | | | | | | | | | | This adds support for retrieving the time via Simple Network Time Protocol (SNTP). No fancy features are supported, only plainly getting the current time. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: resolv: Make argument constSascha Hauer2015-12-141-2/+2
| | | | | | | | | | | | resolv() is not allowed to change the hostname argument, make it const. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: dhcp: make unmodified variable constSascha Hauer2015-12-141-3/+3
| | | | | | | | | | | | | | 'str' in dhcp_set_string_options is never modified, so make it const. With this we no longer have to cast away the const returned from getenv. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: dhcp: simplify dhcp_options_processSascha Hauer2015-12-141-9/+6
| | | | | | | | | | | | | | | | | | | | dhcp_options_handle returns the index into the dhcp_options array. This is only to be able in the caller to print a debug message when the index returned from dhcp_options_handle is out of bounds. Simplify this by printing the debug message in dhcp_options_handle and not in the caller. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: dhcp: unify options and paramsSascha Hauer2015-12-141-77/+57
|/ | | | | | | | | The dhcp code distinguishes between options and params. If sent to the server they are params, if received from the server they are options. Unify them all to be options. If it has a handle_param callback it's a param, if it has a handle callback it's an option. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: eth: Remove ethaddr_paramJan Remmet2015-11-201-2/+2
| | | | | | | | commit d00db554 introduce ethaddr_param. But it is not initialized, so devinfo fails to show the mac. Remove it and use edev->ethaddr. Signed-off-by: Jan Remmet <j.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: eth: Fixup OF tree with registered MAC addresses tooTrent Piepho2015-10-221-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | The eth code registers an OF tree fixup that looks for any nodes in the Linux oftree that match eth devices loaded in barebox and sets the mac-address property in those nodes. The purpose is to pass MAC addresses to the Linux kernel for drivers that expect the MAC address to be in the device tree. If barebox does not have a driver for the network device, either because it has been disabled or because one does not exist, then the OF tree will not be fixed up to include a MAC address. The eth code also has a list of MAC addresses which board code has registered, usually done when it reads the address from an EEPROM or on-chip memory. If an eth device is created later in the boot, it will look here for an address. The registered MAC address list is not used for the OF tree fix up, and this patch changes that. This way barebox can place a MAC address in the device-tree without needing a driver for the network device. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: eth: Refactor OF tree fixup of one node into new functionTrent Piepho2015-10-221-28/+34
| | | | | | | | Code that fixes up one node with a new MAC address is refactored into a new function that eth_of_fixup() calls in a loop. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: Fix CONFIG variable nameWadim Egorov2015-09-291-1/+1
| | | | | Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>