summaryrefslogtreecommitdiffstats
path: root/include/net.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-11-23 19:15:31 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-12-14 14:30:19 +0100
commitdfe2d162f3fc693bb95d3b67c674f2f264dc47e8 (patch)
tree557be9b6da351b00310ded7c10041897151cfeca /include/net.h
parente612a5ca7aa8207efb119105a594e81a011ec7ce (diff)
downloadbarebox-dfe2d162f3fc693bb95d3b67c674f2f264dc47e8.tar.gz
barebox-dfe2d162f3fc693bb95d3b67c674f2f264dc47e8.tar.xz
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>
Diffstat (limited to 'include/net.h')
-rw-r--r--include/net.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net.h b/include/net.h
index 9f98b6f4df..926d817802 100644
--- a/include/net.h
+++ b/include/net.h
@@ -61,6 +61,12 @@ struct eth_device {
IPaddr_t netmask;
char ethaddr[6];
char *bootarg;
+
+ bool ifup;
+#define ETH_MODE_DHCP 0
+#define ETH_MODE_STATIC 1
+#define ETH_MODE_DISABLED 2
+ unsigned int global_mode;
};
#define dev_to_edev(d) container_of(d, struct eth_device, dev)
@@ -473,6 +479,7 @@ void led_trigger_network(enum led_trigger trigger);
#define IFUP_FLAG_FORCE (1 << 0)
+int ifup_edev(struct eth_device *edev, unsigned flags);
int ifup(const char *name, unsigned flags);
int ifup_all(unsigned flags);