On 9/1/22 23:24, RichardHo [何明忠] via groups.io wrote:
+ DataLength = (UINTN)(Cpb->DataLen + (UINT32)Cpb->MediaheaderLen); + + while (1) { + if (Counter >= 3) { + StatCode = PXE_STATCODE_BUSY; + break; + } + + Status = Nic->UsbEth->UsbEthTransmit (Cdb, Nic->UsbEth, (VOID *)(UINTN)BulkOutData, &DataLength); + if (EFI_ERROR (Status)) { + StatCode = PXE_STATFLAGS_COMMAND_FAILED; + } + + if (Status == EFI_INVALID_PARAMETER) { + StatCode = PXE_STATCODE_INVALID_PARAMETER; + break; + } + + if (Status == EFI_DEVICE_ERROR) { + StatCode = PXE_STATCODE_DEVICE_FAILURE; + break; + } + + if (!EFI_ERROR (Status)) { + Nic->TxFrame++; + StatCode = PXE_STATCODE_SUCCESS; + break; + } + + Counter++; + }
You need to set DataLength inside the while loop, otherwise on subsequent iterations DataLength will be whatever value UsbEthTransmit just set it to, which will likely be 0 since an error occurred.
-- Rebecca Cran -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#96935): https://edk2.groups.io/g/devel/message/96935 Mute This Topic: https://groups.io/mt/93121092/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-