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.1793.1662572806732430348 for ; Wed, 07 Sep 2022 10:46:46 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@quicinc.com header.s=qcppdkim1 header.b=EJThdD+T; 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 (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 287CLDgw019884; Wed, 7 Sep 2022 17:46:33 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=8Z3Yw4MxKVUDaJqXRuihLWPN/P8e8eFYg71LimabbW0=; b=EJThdD+TX7m/wySWC6p4ztprw7Z3hfXUl06y0vLjR9lLx0dDupUbRgqLupO75QIaXC2L sNUMurfHSRszaolFYh6j/dDYLLCN3XXTWVdSM9s0YVXpfW20KByo00kkPOqC0UEkPVoU j7Ng5vLVDHjQu9jLhTlLpjwooM0Jw1FV88uYk35OPIfhpoZgcGw5xVM2Hliprti+4pZc nqXvDoT40gZe3jCOV4Xkc3E3SLe878xZIOBrCHfeEFgUd1eTQaVkgvHrSyBNSNvnEPfo /nCcd3LPdWGqy+aYLmhMJ0em8Abskye8vNB7zutF5AE1l9160hvE8Io4aZ5Th0WdAoUH ZA== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3jefarua79-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Sep 2022 17:46:33 +0000 Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 287HkW8S014061 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 7 Sep 2022 17:46:32 GMT Received: from [10.110.11.216] (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.29; Wed, 7 Sep 2022 10:46:31 -0700 Message-ID: <1b4d3484-4f27-ca79-8e47-d5f3a2f53919@quicinc.com> Date: Wed, 7 Sep 2022 11:46:30 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network devices support To: =?UTF-8?B?UmljaGFyZEhvIFvkvZXmmI7lv6Bd?= , "devel@edk2.groups.io" 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> <71155a5e-2756-828c-ec56-79b5a73b488e@quicinc.com> From: "Rebecca Cran" In-Reply-To: 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: iRink8k7yWxv6WjT49VXAQgcRjJrRHgK X-Proofpoint-ORIG-GUID: iRink8k7yWxv6WjT49VXAQgcRjJrRHgK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-07_09,2022-09-07_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 mlxlogscore=656 adultscore=0 mlxscore=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209070068 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-0031df01.pphosted.com id 287CLDgw019884 Content-Language: en-US Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable In theory, yes QEMU should be the standard USB RNDIS protocol, but I=20 don't know what bugs are present in the implementation. --=20 Rebecca Cran On 9/6/22 23:31, RichardHo [=E4=BD=95=E6=98=8E=E5=BF=A0] wrote: > Hi Rebecca, > > We didn't check it in QEMU. > Is QEMU report standard USB RNDIS protocol? > > We only test it in physical device. Below is device lists. > > USB RNDIS: > AST2500 : BMC report the RNDIS device > > USB NCM: > DisplayLink HIS USB3.0 Portable Dock(DisplayLink (UK) Ltd.) > Vendor ID: 0x17E9 > Product ID: 0x4301 > > USB ECM: > DM9621(Davicom Semiconductor, Inc.) > Vendor ID: 0x0A46 > Product ID: 0x1269 > > Thanks, > Richard > > -----Original Message----- > From: Rebecca Cran > Sent: 2022=E5=B9=B49=E6=9C=886=E6=97=A5 11:05 PM > To: devel@edk2.groups.io; RichardHo [=E4=BD=95=E6=98=8E=E5=BF=A0] > Cc: Andrew Fish ; Leif Lindholm ; Michael D Kinney ; Michael Kubacki ; Zhiguang Liu ; Limi= ng Gao ; TonyLo [=E7=BE=85=E9=87=91=E6=9D=BE] <= TonyLo@ami.com> > Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB net= work devices support > > > **CAUTION: The e-mail below is from an external source. Please exercise= caution before opening attachments, clicking links, or following guidanc= e.** > > Is it expected that this will work with QEMU (with the usb-net fixes fr= om https://nam12.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgi= thub.com%2Fmcb30%2Fqemu%2Ftree%2Fusbnet3&data=3D05%7C01%7Crichardho%4= 0ami.com%7C1dd20e124cd64659b4e908da90193dd3%7C27e97857e15f486cb58e86c2b30= 40f93%7C1%7C0%7C637980735342252066%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLj= AwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&= sdata=3DxHRQc%2Fnv7fPk%2BPEVavIlfFpaXj6Gq8NiHUsRdd5HD%2Fc%3D&reserved= =3D0), > for example using the SBSA-REF machine for Arm or OVMF for X64? > > I'm adding the following parameters to QEMU: > > -netdev user,id=3Dnet0,net=3D192.168.10.0/24,dhcpstart=3D192.168.10.1 -= device usb-net,netdev=3Dnet0 > > > On OVMF I get the following crash when loading UsbRndis.efi after Netwo= rkCommon.efi: > > Support(): UNDI3.1 found on handle 6550D18 > Support(): supported on 6550D18 > Start(): UNDI3.1 found > !!!! X64 Exception Type - 06(#UD - Invalid Opcode) CPU Apic ID - 00000= 000 !!!! > RIP - 00000000000B0001, CS - 0000000000000038, RFLAGS - 0000000000000= 283 RAX - 000000000653AF80, RCX - 00000000065DC382, RDX - 00000000000054= 41 RBX - 00000000065D8000, RSP - 0000000007E8EA48, RBP - 00000000065DB00= 1 RSI - 0000000000000048, RDI - 0000000006CE82C0 > R8 - 0000000007E8EA60, R9 - 0000000007E8EAD0, R10 - 0000000007E8E804 > R11 - 0000000000000000, R12 - 8000000000000003, R13 - 0000000000000001 > R14 - 0000000006CEE640, R15 - 0000000000000006 > DS - 0000000000000030, ES - 0000000000000030, FS - 0000000000000030 > GS - 0000000000000030, SS - 0000000000000030 > CR0 - 0000000080010033, CR2 - 0000000000000000, CR3 - 0000000007C01000 > CR4 - 0000000000000668, CR8 - 0000000000000000 > DR0 - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000 > DR3 - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400= GDTR - 00000000079DE000 0000000000000047, LDTR - 0000000000000000 > IDTR - 000000000753C018 0000000000000FFF, TR - 0000000000000000 > FXSAVE_STATE - 0000000007E8E6A0 > !!!! Can't find image information. !!!! > > > On Arm, I don't get a crash but no network interface gets created. > I've checked the QEMU RNDIS interface is working: if I boot to Linux I = can get an IP address and communicate with the outside world. > > -- > Rebecca Cran > > > On 9/1/22 23:24, RichardHo [=E4=BD=95=E6=98=8E=E5=BF=A0] via groups.io = wrote: >> UsbNetworkPkg provides network functions for USB ACM, USB NCM, and USB >> RNDIS network device. >> >> Signed-off-by: Richard Ho >> Cc: Andrew Fish >> Cc: Leif Lindholm >> Cc: Michael D Kinney >> Cc: Michael Kubacki >> Cc: Zhiguang Liu >> Cc: Liming Gao >> Reviewed-by: Tony Lo >> --- >> UsbNetworkPkg/Config/UsbNetworkPkg.inc.dsc | 9 + >> .../Config/UsbNetworkPkgComponentsDxe.inc.dsc | 20 + >> .../Config/UsbNetworkPkgComponentsDxe.inc.fdf | 20 + >> .../Config/UsbNetworkPkgDefines.inc.dsc | 23 + >> .../Include/Protocol/UsbEthernetProtocol.h | 872 +++++++++ >> UsbNetworkPkg/NetworkCommon/ComponentName.c | 264 +++ >> UsbNetworkPkg/NetworkCommon/DriverBinding.c | 583 ++++++ >> UsbNetworkPkg/NetworkCommon/DriverBinding.h | 263 +++ >> UsbNetworkPkg/NetworkCommon/NetworkCommon.inf | 43 + >> UsbNetworkPkg/NetworkCommon/PxeFunction.c | 1734 ++++++++++++++= +++ >> UsbNetworkPkg/ReadMe.md | 65 + >> UsbNetworkPkg/ReleaseNotes.md | 11 + >> UsbNetworkPkg/UsbCdcEcm/ComponentName.c | 170 ++ >> UsbNetworkPkg/UsbCdcEcm/UsbCdcEcm.c | 504 +++++ >> UsbNetworkPkg/UsbCdcEcm/UsbCdcEcm.h | 211 ++ >> UsbNetworkPkg/UsbCdcEcm/UsbCdcEcm.inf | 41 + >> UsbNetworkPkg/UsbCdcEcm/UsbEcmFunction.c | 861 ++++++++ >> UsbNetworkPkg/UsbCdcNcm/ComponentName.c | 170 ++ >> UsbNetworkPkg/UsbCdcNcm/UsbCdcNcm.c | 508 +++++ >> UsbNetworkPkg/UsbCdcNcm/UsbCdcNcm.h | 245 +++ >> UsbNetworkPkg/UsbCdcNcm/UsbCdcNcm.inf | 41 + >> UsbNetworkPkg/UsbCdcNcm/UsbNcmFunction.c | 946 +++++++++ >> UsbNetworkPkg/UsbNetworkPkg.dec | 32 + >> UsbNetworkPkg/UsbRndis/ComponentName.c | 172 ++ >> UsbNetworkPkg/UsbRndis/UsbRndis.c | 848 ++++++++ >> UsbNetworkPkg/UsbRndis/UsbRndis.h | 569 ++++++ >> UsbNetworkPkg/UsbRndis/UsbRndis.inf | 41 + >> UsbNetworkPkg/UsbRndis/UsbRndisFunction.c | 1587 ++++++++++++++= + >> 28 files changed, 10853 insertions(+) >> create mode 100644 UsbNetworkPkg/Config/UsbNetworkPkg.inc.dsc >> create mode 100644 UsbNetworkPkg/Config/UsbNetworkPkgComponentsDxe.= inc.dsc >> create mode 100644 UsbNetworkPkg/Config/UsbNetworkPkgComponentsDxe.= inc.fdf >> create mode 100644 UsbNetworkPkg/Config/UsbNetworkPkgDefines.inc.ds= c >> create mode 100644 UsbNetworkPkg/Include/Protocol/UsbEthernetProtoc= ol.h >> create mode 100644 UsbNetworkPkg/NetworkCommon/ComponentName.c >> create mode 100644 UsbNetworkPkg/NetworkCommon/DriverBinding.c >> create mode 100644 UsbNetworkPkg/NetworkCommon/DriverBinding.h >> create mode 100644 UsbNetworkPkg/NetworkCommon/NetworkCommon.inf >> create mode 100644 UsbNetworkPkg/NetworkCommon/PxeFunction.c >> create mode 100644 UsbNetworkPkg/ReadMe.md >> create mode 100644 UsbNetworkPkg/ReleaseNotes.md >> create mode 100644 UsbNetworkPkg/UsbCdcEcm/ComponentName.c >> create mode 100644 UsbNetworkPkg/UsbCdcEcm/UsbCdcEcm.c >> create mode 100644 UsbNetworkPkg/UsbCdcEcm/UsbCdcEcm.h >> create mode 100644 UsbNetworkPkg/UsbCdcEcm/UsbCdcEcm.inf >> create mode 100644 UsbNetworkPkg/UsbCdcEcm/UsbEcmFunction.c >> create mode 100644 UsbNetworkPkg/UsbCdcNcm/ComponentName.c >> create mode 100644 UsbNetworkPkg/UsbCdcNcm/UsbCdcNcm.c >> create mode 100644 UsbNetworkPkg/UsbCdcNcm/UsbCdcNcm.h >> create mode 100644 UsbNetworkPkg/UsbCdcNcm/UsbCdcNcm.inf >> create mode 100644 UsbNetworkPkg/UsbCdcNcm/UsbNcmFunction.c >> create mode 100644 UsbNetworkPkg/UsbNetworkPkg.dec >> create mode 100644 UsbNetworkPkg/UsbRndis/ComponentName.c >> create mode 100644 UsbNetworkPkg/UsbRndis/UsbRndis.c >> create mode 100644 UsbNetworkPkg/UsbRndis/UsbRndis.h >> create mode 100644 UsbNetworkPkg/UsbRndis/UsbRndis.inf >> create mode 100644 UsbNetworkPkg/UsbRndis/UsbRndisFunction.c > -The information contained in this message may be confidential and prop= rietary to American Megatrends (AMI). This communication is intended to b= e read only by the individual or entity to whom it is addressed or by the= ir 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 o= r by telephone at 770-246-8600, and then delete or destroy all copies of = the transmission.