提交 76a50343 编写于 作者: J Joe Hershberger

net: sandbox: Share the priv structure with tests

If tests want to implement tx handlers, they will likely need access to
the details in the priv structure.
Signed-off-by: NJoe Hershberger <joe.hershberger@ni.com>
Reviewed-by: NSimon Glass <sjg@chromium.org>
Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
上级 c7eb733d
......@@ -49,6 +49,25 @@ int sandbox_eth_ping_req_to_reply(struct udevice *dev, void *packet,
typedef int sandbox_eth_tx_hand_f(struct udevice *dev, void *pkt,
unsigned int len);
/**
* struct eth_sandbox_priv - memory for sandbox mock driver
*
* 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
* 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;
sandbox_eth_tx_hand_f *tx_handler;
};
/*
* Set packet handler
*
......
......@@ -15,25 +15,6 @@
DECLARE_GLOBAL_DATA_PTR;
/**
* struct eth_sandbox_priv - memory for sandbox mock driver
*
* 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
* 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;
sandbox_eth_tx_hand_f *tx_handler;
};
static bool skip_timeout;
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册