From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by mx.groups.io with SMTP id smtpd.web10.6079.1670210093229469257 for ; Sun, 04 Dec 2022 19:14:53 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@quicinc.com header.s=qcppdkim1 header.b=Z/kMIv3n; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: quicinc.com, ip: 205.220.180.131, mailfrom: quic_rcran@quicinc.com) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B52wsIS030367; Mon, 5 Dec 2022 03:14:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=j5ANQCnnSNQWvgI//RgeHU1B29akqB2Jw6i+HbRXM+E=; b=Z/kMIv3nRy7rXQmcI6aYL8QxLaXfR9+yMCGkxKI0tvji+VZL+aQikp9k5RNz2ICj3H9e bOJYcmtsfDCcNWfUsdloet5kpg5rjgbo2S6CTe5p5XgRWMZvJjDbuScV+amq2Vm8JI4d pXjG3WjGeA5nHXiLm6CE3u887LiDFn7c6eaQtVWfqmLRCiaaknnVkDgQqGXWjOUEG2pN ljOOK1gPIJHO9BjCWvNg5ArMByuGuE9/RH7RhphXGHiI9hzKe/MCqsaa1ka3xonFCiWR 37daxh8VcJQ4PyH2OEMR/Yh+AMNw43/4uW2UfeePFXUF1yFuv9ozGDHV8yaO3gwQWi7f CQ== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3m7xudaswc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Dec 2022 03:14:41 +0000 Received: from nasanex01b.na.qualcomm.com (corens_vlan604_snip.qualcomm.com [10.53.140.1]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2B53Eeeb028809 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 5 Dec 2022 03:14:40 GMT Received: from [10.110.8.230] (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 4 Dec 2022 19:14:39 -0800 Message-ID: Date: Sun, 4 Dec 2022 20:14:39 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network devices support To: , CC: Andrew Fish , Leif Lindholm , Michael D Kinney , Michael Kubacki , Zhiguang Liu , Liming Gao , =?UTF-8?B?VG9ueUxvIFvnvoXph5Hmnb5d?= References: <20220902052418.2253-1-richardho@ami.com> From: "Rebecca Cran" In-Reply-To: <20220902052418.2253-1-richardho@ami.com> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 9iQdBq8dIjUmHBUL4HZgNQVuXqK2cRgA X-Proofpoint-ORIG-GUID: 9iQdBq8dIjUmHBUL4HZgNQVuXqK2cRgA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-05_01,2022-12-01_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 suspectscore=0 spamscore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212050024 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-0031df01.pphosted.com id 2B52wsIS030367 Content-Language: en-US Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable On 9/1/22 23:24, RichardHo [=E4=BD=95=E6=98=8E=E5=BF=A0] via groups.io wr= ote: > + DataLength =3D (UINTN)(Cpb->DataLen + (UINT32)Cpb->MediaheaderLen); > + > + while (1) { > + if (Counter >=3D 3) { > + StatCode =3D PXE_STATCODE_BUSY; > + break; > + } > + > + Status =3D Nic->UsbEth->UsbEthTransmit (Cdb, Nic->UsbEth, (VOID *)= (UINTN)BulkOutData, &DataLength); > + if (EFI_ERROR (Status)) { > + StatCode =3D PXE_STATFLAGS_COMMAND_FAILED; > + } > + > + if (Status =3D=3D EFI_INVALID_PARAMETER) { > + StatCode =3D PXE_STATCODE_INVALID_PARAMETER; > + break; > + } > + > + if (Status =3D=3D EFI_DEVICE_ERROR) { > + StatCode =3D PXE_STATCODE_DEVICE_FAILURE; > + break; > + } > + > + if (!EFI_ERROR (Status)) { > + Nic->TxFrame++; > + StatCode =3D PXE_STATCODE_SUCCESS; > + break; > + } > + > + Counter++; > + } You need to set DataLength inside the while loop, otherwise on=20 subsequent iterations DataLength will be whatever value UsbEthTransmit=20 just set it to, which will likely be 0 since an error occurred. --=20 Rebecca Cran