diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2015-03-22 17:09:21 -0500 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-18 11:11:13 -0600 |
commit | a346ca7902a185a1974d50d60790d34715be886e (patch) | |
tree | 698a093dcaa6f13556c6b94352ed7d064b991bb2 /board/sandbox | |
parent | 7ece1c61ade7f3b9ec25118d8adab5a8d47c3276 (diff) | |
download | u-boot-imx-a346ca7902a185a1974d50d60790d34715be886e.zip u-boot-imx-a346ca7902a185a1974d50d60790d34715be886e.tar.gz u-boot-imx-a346ca7902a185a1974d50d60790d34715be886e.tar.bz2 |
sandbox: eth: Add a bridge to a real network for sandbox
Implement a bridge between U-Boot's network stack and Linux's raw packet
API allowing the sandbox to send and receive packets using the host
machine's network interface.
This raw Ethernet API requires elevated privileges. You can either run
as root, or you can add the capability needed like so:
sudo /sbin/setcap "CAP_NET_RAW+ep" /path/to/u-boot
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board/sandbox')
-rw-r--r-- | board/sandbox/README.sandbox | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/board/sandbox/README.sandbox b/board/sandbox/README.sandbox index c1f5f7e..9f5d3f7 100644 --- a/board/sandbox/README.sandbox +++ b/board/sandbox/README.sandbox @@ -190,6 +190,58 @@ Also sandbox uses generic board (CONFIG_SYS_GENERIC_BOARD) and supports driver model (CONFIG_DM) and associated commands. +Linux RAW Networking Bridge +--------------------------- + +The sandbox_eth_raw driver bridges traffic between the bottom of the network +stack and the RAW sockets API in Linux. This allows much of the U-Boot network +functionality to be tested in sandbox against real network traffic. + +For Ethernet network adapters, the bridge utilizes the RAW AF_PACKET API. This +is needed to get access to the lowest level of the network stack in Linux. This +means that all of the Ethernet frame is included. This allows the U-Boot network +stack to be fully used. In other words, nothing about the Linux network stack is +involved in forming the packets that end up on the wire. To receive the +responses to packets sent from U-Boot the network interface has to be set to +promiscuous mode so that the network card won't filter out packets not destined +for its configured (on Linux) MAC address. + +The RAW sockets Ethernet API requires elevated privileges in Linux. You can +either run as root, or you can add the capability needed like so: + +sudo /sbin/setcap "CAP_NET_RAW+ep" /path/to/u-boot + +The default device tree for sandbox includes an entry for eth0 on the sandbox +host machine whose alias is "eth1". The following are a few examples of network +operations being tested on the eth0 interface. + +sudo /path/to/u-boot -D + +DHCP +.... + +set autoload no +set ethact eth1 +dhcp + +PING +.... + +set autoload no +set ethact eth1 +dhcp +ping $gatewayip + +TFTP +.... + +set autoload no +set ethact eth1 +dhcp +set serverip WWW.XXX.YYY.ZZZ +tftpboot u-boot.bin + + SPI Emulation ------------- |