summaryrefslogtreecommitdiff
path: root/arch/sandbox/cpu
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2018-07-02 14:47:54 -0500
committerJoe Hershberger <joe.hershberger@ni.com>2018-07-26 14:08:19 -0500
commitf40a31e695638e0422fdce3c4c6eb39cd1f11f91 (patch)
treec31007bdb6512d4d75f182f0e0410a52cbd96727 /arch/sandbox/cpu
parentb96ced9cdb6bbba1ef4e0087eec799127a22afab (diff)
downloadu-boot-f40a31e695638e0422fdce3c4c6eb39cd1f11f91.tar.gz
sandbox: eth-raw: Add a SIMPLE_BUS to enumerate host interfaces
Ask the OS for each of its interfaces and for each one, bind a U-Boot device and then probe it. This will allocate the priv data structure that is then populated. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox/cpu')
-rw-r--r--arch/sandbox/cpu/eth-raw-os.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/sandbox/cpu/eth-raw-os.c b/arch/sandbox/cpu/eth-raw-os.c
index df7acaa0bc..75bfaa4c90 100644
--- a/arch/sandbox/cpu/eth-raw-os.c
+++ b/arch/sandbox/cpu/eth-raw-os.c
@@ -23,6 +23,16 @@
#include <linux/if_ether.h>
#include <linux/if_packet.h>
+struct sandbox_eth_raw_if_nameindex *sandbox_eth_raw_if_nameindex(void)
+{
+ return (struct sandbox_eth_raw_if_nameindex *)if_nameindex();
+}
+
+void sandbox_eth_raw_if_freenameindex(struct sandbox_eth_raw_if_nameindex *ptr)
+{
+ if_freenameindex((struct if_nameindex *)ptr);
+}
+
int sandbox_eth_raw_os_is_local(const char *ifname)
{
int fd = socket(AF_INET, SOCK_DGRAM, 0);