mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-29 18:11:43 +00:00
efi_selftest: check EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT
Check that when the WaitForPacket event occurs EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT is set. Check the return value of Receive(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
7f6d874d17
commit
0c7adf4b5f
1 changed files with 14 additions and 2 deletions
|
@ -268,6 +268,7 @@ static int execute(void)
|
||||||
struct efi_mac_address destaddr;
|
struct efi_mac_address destaddr;
|
||||||
size_t buffer_size;
|
size_t buffer_size;
|
||||||
u8 *addr;
|
u8 *addr;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The timeout is to occur after 10 s.
|
* The timeout is to occur after 10 s.
|
||||||
*/
|
*/
|
||||||
|
@ -298,6 +299,8 @@ static int execute(void)
|
||||||
events[0] = timer;
|
events[0] = timer;
|
||||||
events[1] = net->wait_for_packet;
|
events[1] = net->wait_for_packet;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
u32 int_status;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wait for packet to be received or timer event.
|
* Wait for packet to be received or timer event.
|
||||||
*/
|
*/
|
||||||
|
@ -323,7 +326,16 @@ static int execute(void)
|
||||||
* Receive packet
|
* Receive packet
|
||||||
*/
|
*/
|
||||||
buffer_size = sizeof(buffer);
|
buffer_size = sizeof(buffer);
|
||||||
net->receive(net, NULL, &buffer_size, &buffer,
|
ret = net->get_status(net, &int_status, NULL);
|
||||||
|
if (ret != EFI_SUCCESS) {
|
||||||
|
efi_st_error("Failed to get status");
|
||||||
|
return EFI_ST_FAILURE;
|
||||||
|
}
|
||||||
|
if (!(int_status & EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT)) {
|
||||||
|
efi_st_error("RX interrupt not set");
|
||||||
|
return EFI_ST_FAILURE;
|
||||||
|
}
|
||||||
|
ret = net->receive(net, NULL, &buffer_size, &buffer,
|
||||||
&srcaddr, &destaddr, NULL);
|
&srcaddr, &destaddr, NULL);
|
||||||
if (ret != EFI_SUCCESS) {
|
if (ret != EFI_SUCCESS) {
|
||||||
efi_st_error("Failed to receive packet");
|
efi_st_error("Failed to receive packet");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue