From 72ff0042585bedab4364afbd7ecc935e48324ade Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Wed, 26 Sep 2018 16:49:01 -0500 Subject: test: eth: Add a test for the target being pinged The target will respond to pings while doing other network handling. Make sure that the response happens and is correct. This currently corrupts the ongoing operation of the device if it happens to be awaiting an ARP reply of its own to whatever serverip it is attempting to communicate with. In the test, add an expectation that the user operation (ping, in this case) will fail. A later patch will address this problem. Signed-off-by: Joe Hershberger Reviewed-by: Simon Glass Reviewed-by: Bin Meng --- arch/sandbox/include/asm/eth.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'arch/sandbox') diff --git a/arch/sandbox/include/asm/eth.h b/arch/sandbox/include/asm/eth.h index d068486f0be..477fa00fad8 100644 --- a/arch/sandbox/include/asm/eth.h +++ b/arch/sandbox/include/asm/eth.h @@ -49,6 +49,16 @@ int sandbox_eth_ping_req_to_reply(struct udevice *dev, void *packet, */ int sandbox_eth_recv_arp_req(struct udevice *dev); +/* + * sandbox_eth_recv_ping_req() + * + * Inject a ping request for this target + * + * @dev: device that received the packet + * @return 0 if injected, -EOVERFLOW if not + */ +int sandbox_eth_recv_ping_req(struct udevice *dev); + /** * A packet handler * -- cgit v1.2.3