public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "RichardHo [何明忠]" <richardho@ami.com>
To: Rebecca Cran <rebecca@quicinc.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Andrew Fish" <afish@apple.com>,
	"Leif Lindholm" <quic_llindhol@quicinc.com>,
	"Michael D Kinney" <michael.d.kinney@intel.com>,
	"Michael Kubacki" <michael.kubacki@microsoft.com>,
	"Zhiguang Liu" <zhiguang.liu@intel.com>,
	"Liming Gao" <gaoliming@byosoft.com.cn>,
	"Tony Lo (羅金松)" <TonyLo@ami.com>
Subject: Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network devices support
Date: Tue, 6 Dec 2022 09:15:25 +0000	[thread overview]
Message-ID: <DM5PR10MB16608F213D5C864997857659B01B9@DM5PR10MB1660.namprd10.prod.outlook.com> (raw)
In-Reply-To: <e4242f70-b3e3-92ed-1fc2-25ddb7e4fce5@quicinc.com>

Hi Rebecca,

Thanks for your response. I will fixed it next.

Thanks,
Richard

-----Original Message-----
From: Rebecca Cran <rebecca@quicinc.com>
Sent: 2022年12月5日 11:15 AM
To: devel@edk2.groups.io; Richard Ho (何明忠) <RichardHo@ami.com>
Cc: Andrew Fish <afish@apple.com>; Leif Lindholm <quic_llindhol@quicinc.com>; Michael D Kinney <michael.d.kinney@intel.com>; Michael Kubacki <michael.kubacki@microsoft.com>; Zhiguang Liu <zhiguang.liu@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Tony Lo (羅金松) <TonyLo@ami.com>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network devices support


**CAUTION: The e-mail below is from an external source. Please exercise caution before opening attachments, clicking links, or following guidance.**

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
-The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.

  reply	other threads:[~2022-12-06  9:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02  5:24 [PATCH] UsbNetworkPkg: add USB network devices support RichardHo [何明忠]
2022-09-02 21:48 ` [edk2-devel] " Rebecca Cran
2022-09-09  7:06   ` Chang, Abner
2022-09-12  3:48     ` RichardHo [何明忠]
2022-09-12  7:55       ` Chang, Abner
2022-09-21  2:34         ` RichardHo [何明忠]
2022-09-22 12:52           ` Chang, Abner
2022-09-06 15:05 ` Rebecca Cran
2022-09-07  5:31   ` RichardHo [何明忠]
2022-09-07 17:46     ` Rebecca Cran
2022-09-23  5:03     ` 回复: " gaoliming
2022-09-23  5:54       ` RichardHo [何明忠]
2022-09-23  7:17         ` 回复: " gaoliming
2022-11-26 18:56 ` Rebecca Cran
2022-11-28  5:24   ` RichardHo [何明忠]
2022-12-05  3:14 ` Rebecca Cran
2022-12-06  9:15   ` RichardHo [何明忠] [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-08-31  7:51 RichardHo [何明忠]
2022-08-31 13:28 ` [edk2-devel] " Rebecca Cran
2022-09-01  2:51   ` RichardHo [何明忠]
2022-09-01  9:05     ` Chang, Abner
2022-09-01 10:47       ` RichardHo [何明忠]
2022-09-01 12:38     ` Rebecca Cran
2022-08-31  2:31 RichardHo [何明忠]
2022-08-31 12:15 ` [edk2-devel] " Rebecca Cran
2022-08-19  9:17 richardho
2022-08-19 15:54 ` [edk2-devel] " Pedro Falcato
2022-08-19 15:56   ` Pedro Falcato
2022-08-29 10:57     ` RichardHo [何明忠]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM5PR10MB16608F213D5C864997857659B01B9@DM5PR10MB1660.namprd10.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox