[U-Boot] [RFC PATCH v4 19/23] sandbox: eth: Add ability to disable ping reply in sandbox eth driver
Joe Hershberger
joe.hershberger at ni.com
Wed Feb 25 01:02:28 CET 2015
This is needed to test the netretry functionality (make the command fail
on a sandbox eth device).
Signed-off-by: Joe Hershberger <joe.hershberger at ni.com>
---
Changes in v4:
-Add ability to disable ping reply in sandbox eth driver
Changes in v3: None
Changes in v2: None
drivers/net/sandbox.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/sandbox.c b/drivers/net/sandbox.c
index 81362e6..28fe09a 100644
--- a/drivers/net/sandbox.c
+++ b/drivers/net/sandbox.c
@@ -49,9 +49,14 @@ static int sb_eth_send(struct udevice *dev, void *packet, int length)
{
struct eth_sandbox_priv *priv = dev_get_priv(dev);
struct ethernet_hdr *eth = packet;
+ char varname[32];
debug("eth_sandbox: Send packet %d\n", length);
+ sprintf(varname, "eth_sandbox_disable_%d", dev->seq);
+ if (getenv_yesno(varname) > 0)
+ return 0;
+
if (ntohs(eth->et_protlen) == PROT_ARP) {
struct arp_hdr *arp = packet + ETHER_HDR_SIZE;
--
1.7.11.5
More information about the U-Boot
mailing list