diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2018-09-26 16:48:57 -0500 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2018-10-10 12:28:58 -0500 |
commit | c67a420781012abb5c888e2857efde12cf27284b (patch) | |
tree | 4262632a50fe817a1ba0efc7aa25b55594c93d7a /arch/sandbox | |
parent | 76a503439e38be9d4fe365bdf87a6d0e74ea41c9 (diff) |
net: sandbox: Allow fake eth to handle more than 1 packet response
Use up to the max allocated receive buffers so as to be able to test
more complex situations.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/sandbox')
-rw-r--r-- | arch/sandbox/include/asm/eth.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/sandbox/include/asm/eth.h b/arch/sandbox/include/asm/eth.h index ced6d51999..7a49e98fa8 100644 --- a/arch/sandbox/include/asm/eth.h +++ b/arch/sandbox/include/asm/eth.h @@ -55,16 +55,18 @@ typedef int sandbox_eth_tx_hand_f(struct udevice *dev, void *pkt, * fake_host_hwaddr - MAC address of mocked machine * fake_host_ipaddr - IP address of mocked machine * disabled - Will not respond - * recv_packet_buffer - buffer of the packet returned as received - * recv_packet_length - length of the packet returned as received + * recv_packet_buffer - buffers of the packet returned as received + * recv_packet_length - lengths of the packet returned as received + * recv_packets - number of packets returned * tx_handler - function to generate responses to sent packets */ struct eth_sandbox_priv { uchar fake_host_hwaddr[ARP_HLEN]; struct in_addr fake_host_ipaddr; bool disabled; - uchar *recv_packet_buffer; - int recv_packet_length; + uchar * recv_packet_buffer[PKTBUFSRX]; + int recv_packet_length[PKTBUFSRX]; + int recv_packets; sandbox_eth_tx_hand_f *tx_handler; }; |