summaryrefslogtreecommitdiff
path: root/arch/sandbox/include
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2018-07-02 14:47:52 -0500
committerJoe Hershberger <joe.hershberger@ni.com>2018-07-26 14:08:18 -0500
commitc9e2caff8503b0dfa750b5ed08f882919fd3b510 (patch)
tree37c9f94265e4fe0be0a8cec139cb42b9b18f0df3 /arch/sandbox/include
parentac13270b49d55677aeea5a64dfbf1764118820e3 (diff)
sandbox: eth-raw: Allow interface to be specified by index
With systemd stable interface names, eth0 will almost never exist. Instead of using that name in the sandbox.dts, use an index. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox/include')
-rw-r--r--arch/sandbox/include/asm/eth-raw-os.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/sandbox/include/asm/eth-raw-os.h b/arch/sandbox/include/asm/eth-raw-os.h
index edd09d2e08..99f674e82e 100644
--- a/arch/sandbox/include/asm/eth-raw-os.h
+++ b/arch/sandbox/include/asm/eth-raw-os.h
@@ -42,6 +42,15 @@ struct eth_sandbox_raw_priv {
*/
int sandbox_eth_raw_os_is_local(const char *ifname);
+/*
+ * Look up the name of the interface based on the ifindex populated in priv.
+ *
+ * Overwrite the host_ifname member in priv based on looking up host_ifindex
+ *
+ * returns - 0 if success, negative if error
+ */
+int sandbox_eth_raw_os_idx_to_name(struct eth_sandbox_raw_priv *priv);
+
int sandbox_eth_raw_os_start(struct eth_sandbox_raw_priv *priv,
unsigned char *ethmac);
int sandbox_eth_raw_os_send(void *packet, int length,