2017-12-15 |
net: Add linuxdevname property
...
When you have a static network environment but more than one network
device on your machine it is necessary to provide the <device> parameter
to the ip parameter at kernel cmd line.
The device name assigned by Linux cannot in general be predicted as it
depends on driver bind order.
This patch introduces a new property linux.devname to eth devices.
The value is added to bootargs per interface and can be changed in
env/network/INTF
Based on patch by Gavin Schenk <g.schenk@eckelmann.de>.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Dec 2017
|
2017-12-14 |
net: Provide new way to configure network devices
...
This provides a new way to configure network interfaces based
on nvvars. A network interface can now be configured with variables
in the nv.dev.<ethname>.* namespace. There is a new network device
parameter "mode" which specifies the mode used to obtain IP settings.
The mode can be "dhcp", "static" or "disabled":
nv.dev.eth0.mode=dhcp
(ipaddr, netmask are ignored in this setting)
nv.dev.eth0.mode=static
nv.dev.eth0.ipaddr=192.168.0.17
nv.dev.eth0.netmask=255.255.0.0
nv.dev.eth0.mode=disabled
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Dec 2017
|
ifup: Use dhcp C API rather than running command
...
DHCP has a C API, so use it instead of running as command.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Dec 2017
|
net: ifup: Factor out a eth_discover function
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Dec 2017
|
net: remove "current" network device
...
Now that we can do routing we no longer need a "current"
network device. Remove it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Dec 2017
|
net: Pick network device based on IP settings
...
The IP/netmask/gateway settings contain all informations
needed to pick the correct network device. This patch
adds support for that and makes specifying the "current"
network interface using the ethact command unnecessary.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Dec 2017
|
net: dhcp: rework
...
The DHCP code is a mess. It is not clear which options are sent to the
server and which options are returned from the server. Also environment
variables are read from and written to all over the place.
This patch cleans this up. There now is struct dhcp_req_param which is
used for options sent to the server and struct dhcp_result which contains
the values sent from the server. The values from the server are written
to the barebox variables in a single place. Also it's now possible to
call the dhcp code without modifying barebox variables at all, storing
the result only in the dhcp result struct.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Dec 2017
|
net: dhcp: Coding style fixes
...
Fix some spaces-before-function-opening-brackets and duplicate empty
lines.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Dec 2017
|
net: dhcp: avoid unnecessary casts
...
Drop explicit casts to/from void pointers.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Dec 2017
|
net: dhcp: Allow to specify network device
...
Instead of allowing to DHCP only on the "current" network
device, allow to specify the desired network device. This
is a first step to get rid of the concept of a "current"
network device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Dec 2017
|
2017-12-01 |
net: allow udp connections on specified network device
...
This allows the DHCP code to configure specific network
devices so that DHCP no longer depends on any "current"
network device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Dec 2017
|
net: Use a single gateway
...
There is not much point in having a network device specific
gateway. If barebox really is part of such a complicated network
in which it needs multiple gateways, then we probably need a
real routing table. Until this happens, a single gateway should
be enough.
This introduces global.net.gateway which holds the gateway ip. The
previously used device specific <ethx>.gateway variables still exist,
but are only aliases for the single gateway.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Dec 2017
|
net: dhcp: Do not overwrite serverip if it is valid
...
Some DHCP servers provide the wrong serverip in which case
it is desired to specify it manually and won't let the dhcp
command overwrite it.
This has previously been done by setting the serverip again
to the desired value after dhcp has been executed. With this
patch we do not overwrite it in the first place if it is valid
already. This is necessary when the serverip is not set via
/env/network/eth* but via nv.net.server.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Dec 2017
|
net: introduce global.net.server
...
The server to use is independent of the network device, there is
not much point to make the server specific to a network device.
This introduces global.net.server as the serverip which is
used as standard NFS/tftp server. The previously used eth
device specific parameters still exist, but are only aliases
for the global single variable.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Dec 2017
|
net: Add functions to get/set nameserver and domainname
...
It's more convenient to have getter/setter functions for
variables rather than using the detour around global vars
which use string matching and all kinds of overhead in the
background.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Dec 2017
|
net: Make domainname and nameserver globalvars
...
Register domainname and nameserver as globalvars rather than attaching
them to a dedicated net device. the global device already exists and
already contains much of the barebox configuration, so no need to add
an extra device for network config.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Dec 2017
|
net: Add and use IP_BROADCAST
...
Rather than using the hardcoded value 0xffffffff in several places
add a define for the broadcast IP.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Dec 2017
|
net: use pr_* functions for messages
...
Use pr_* functions in the networking code rather than printf() and
debug(). Also Add a "net: " prefix to messages to give them some more
context.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Dec 2017
|
2017-05-05 |
Merge branch 'for-next/parameter-types'
Sascha Hauer
committed
on 5 May 2017
|
2017-04-26 |
net: ifup needs to be able to run commands
...
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Lucas Stach
authored
on 25 Apr 2017
Sascha Hauer
committed
on 26 Apr 2017
|
2017-04-11 |
net: use dev_add_param_string
...
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>
Sascha Hauer
committed
on 11 Apr 2017
|
2017-02-28 |
console: replace set_active by open/close
...
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>
Bastian Stender
authored
on 28 Feb 2017
Sascha Hauer
committed
on 28 Feb 2017
|
2016-09-22 |
net: add linux.bootarg parameter from ifup call
...
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>
Enrico Jorns
authored
on 19 Sep 2016
Sascha Hauer
committed
on 22 Sep 2016
|
convert users to %pI4
...
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>
Sascha Hauer
committed
on 22 Sep 2016
|
2016-07-14 |
net: Pass network device to net_answer_arp()
...
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>
Sascha Hauer
committed
on 14 Jul 2016
|
net: eth: add name to struct eth_device
...
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>
Sascha Hauer
committed
on 14 Jul 2016
|
net: introduce for_each_netdev iterator
...
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>
Sascha Hauer
committed
on 14 Jul 2016
|
net: eth: open correct edev in eth_check_open
...
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>
Sascha Hauer
committed
on 14 Jul 2016
|
2016-06-15 |
ifup: fix handling when ip env is not given
...
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>
Alexander Aring
authored
on 14 Jun 2016
Sascha Hauer
committed
on 15 Jun 2016
|
2016-04-15 |
string: Fix (v)asprintf prototypes
...
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>
Sascha Hauer
committed
on 15 Apr 2016
|