From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.54]) by mx.groups.io with SMTP id smtpd.web12.6728.1663851129008367844 for ; Thu, 22 Sep 2022 05:52:09 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=JC6tXcyh; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.92.54, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dLPe7n0ly2JRhvNdiR/tOMq4up/nk2DZh1JpCjSaNR7xrFC8m/D+vFtk2rI9/Q75d7jzGkpQGPwcJQR8ck4Z2Wv7G98xtrxjoj/qYZ3AQh/TnMy+bc1vjtlnyLmfuKlz7iWzi3LuSMmQZIy5+xPBkE1jXVnyXG+HQl10c5NBqimheNbNl+r9SO1T3UETwtbxCF6++QNpjTQ7Q0fJWSWmMbr4PUpxFI9wXG9cUsPaZX7dHGsWBp/ao1bYsvy0H66/1fSuHp5/hA3VdyI4nDDF4hsWRTiPHwV6VvWa1DvfSUGsVBYwsW1lWuxp8ygVc44GRobFCz4pgTQWc7fC/xNOLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yPdvS2RO0QTqaDOOaC70WG4YWCrgnmYBNCNzLa+51hc=; b=JhLnrnX6z0GFx2YA7yWj0T62JnPXCVlnJpe01C3O7jQqlNEfSWIKP3WjqX/EGxM+qVetfByyCA1E2CNCs8/cdq+NgsLqO2a+KU9gDwWJe4x6y+FVnWa6naRkYtYjs84d3A7woaLr+jHvJWOWdOuO+gxuwu5xYvgv3MQabVOCRgi4ORCJQYsylr4k/j5L3f3oF3bZtMS9+Vdkioj8oM39+dpZ8DIKWT+PSE7TM5T5KuET8omGThXMaGMl8iATZ5Quk5bi/Zv3UGFWLb2pASGwo13Zjuh1BKjG2MnbopxuUxrCY/qvyiDdwQ0nPheo4yKqHqb1/wWOXXRE5qxyrsSelA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yPdvS2RO0QTqaDOOaC70WG4YWCrgnmYBNCNzLa+51hc=; b=JC6tXcyhl8wEVbpPOJioqmgvxZu9O8mpC52WJb8uyePmY8I1Oc+XdTOvNTR5QdZkKoq6PLRj7q6hfhQqYAZjoY+VfzipsNv75Gj1sAJxzGKJkCTSPin5O/Lbk18t6ksdPqVB4+2Msqb0eDOmCCmDBYBSlvZLjYEg3/d7EPqrAik= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by SJ0PR12MB5501.namprd12.prod.outlook.com (2603:10b6:a03:304::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.19; Thu, 22 Sep 2022 12:52:06 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::998b:f1a2:b183:43be]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::998b:f1a2:b183:43be%4]) with mapi id 15.20.5654.019; Thu, 22 Sep 2022 12:52:04 +0000 From: "Chang, Abner" To: =?iso-2022-jp?B?UmljaGFyZEhvIFsbJEIyP0xAQ2kbKEJd?= , "devel@edk2.groups.io" , "quic_rcran@quicinc.com" CC: Andrew Fish , Leif Lindholm , Michael D Kinney , Michael Kubacki , Zhiguang Liu , Liming Gao , =?iso-2022-jp?B?VG9ueUxvIFsbJEJNZTZiPj4bKEJd?= Subject: Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network devices support Thread-Topic: [EXTERNAL] Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network devices support Thread-Index: AQHYvoxJHCaS+XfGmkKn0h/vNPlrZ63MrkMAgAoAM9CABHir8IAATFFwgA3Uz+CAAj03IA== Date: Thu, 22 Sep 2022 12:52:03 +0000 Message-ID: References: <20220902052418.2253-1-richardho@ami.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2022-09-22T12:51:29Z; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=fdd34a93-1ca5-484c-84d0-55383ad63405; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|SJ0PR12MB5501:EE_ x-ms-office365-filtering-correlation-id: 0267feef-fab7-4d6c-50ca-08da9c993fd3 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SrJctX5S9HGiEr+7Lb2KcBoEKNyvt0TR9LwS0sBE7jKVIsPDVaVPHyYuF6Pf1zhu9Utfrd66K4M0ZDOBNAwN2y7/OtyjlHM/P6/AKvIWvxad3Yo4tQ1L9sLnZWQr6tuFbpy4TJypeOHsrZlSgVDXz47HioXXZ8kza0euON8+WyOS18N/1+LCnjqpQtK5+XE/T3aSko3sjrBzdD11ElAF9W4y3F/AEnXMvb8bw1Ms80KCgEgkjTU4xso2q+frG5PKahSUpsX9bN6C5USBHh7x52553QVfYik+9DGCdLee7bugdKKhQQczo0sIt7kQwDC1T6SwWIR4QMRCJk2UbQu9jbW4ZlZJgiGC5WPGmX/fXXDtLzpYR8tshAsendECgGnHWhIh6sjfleLHoScKjRvEQN+xtmj6jQE3VyqDiz2JaNz5XcKB2bAmA0oUJchYL6gNz+OEYDI6Y98UsdIfsrWne0YPwGS77S4VTzv0uIb5T0hLHfrugWGCU+fNZeXw+DxYDR4IKAMP/bQ7GK7U3VrnbhN7hwDWaGx/L44lJoyvsEQK10t5VFSTYoyKXXAmEo4utThj4zbv99cCkPf1tdFkGLvxNYyfbwy6doj/m4bABsRn0Er7izl87HZTKVIIh9DzKWTw0HMkbGDKH/BiuGwyxks32SKDzUX+cAelhvLS3YlTMK8K7g8DBWS14Y8wAiNHL/mGMEvfe57LnEIGDpAckqExuixFG9SStyw4DUAQ33g1EBy9xF1mvqqa7eS/F4mzsUTRvY3gZA0lu+vR55dCKpwa1g3g2jC+CI+QYRcqUp8= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB3966.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(39860400002)(136003)(396003)(376002)(346002)(451199015)(83380400001)(110136005)(54906003)(86362001)(30864003)(40140700001)(33656002)(38070700005)(2906002)(7416002)(5660300002)(38100700002)(55016003)(122000001)(52536014)(41300700001)(8936002)(66556008)(66446008)(4326008)(66946007)(64756008)(8676002)(66476007)(76116006)(45080400002)(316002)(9686003)(53546011)(7696005)(6506007)(26005)(71200400001)(966005)(186003)(478600001)(579004);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?a3psdnRUbWpHRkc2MGRna3hseGx0SnZvMDdhMlltVVNtZ3VHRXhQTzdP?= =?iso-2022-jp?B?MWQvK21ub0U5V210Z21xTkhxUXB6a2dxb3FUOHFKa3dHQnR6SU5Wa2lW?= =?iso-2022-jp?B?ajkrNmNtN0p4UlFQV2RiNlJYYnJESU5OMDV2cWpTeGpDa2k0cEM5WWlB?= =?iso-2022-jp?B?Q3ZISjVpckZxZ1J6NmNDaUVuVXNERW9DZUUvMzMxcnZua3VnNUN3WEhz?= =?iso-2022-jp?B?RnQyWmxodGg5U2IvVmM0VlBTVVY3cVl1bFcvODUxSWp2M0NVRDRWUFgv?= =?iso-2022-jp?B?NDM4WVpMbVlzL0lkQ0JUWENiUHF0Nk5maWk4Z3lmNDFDbGhudFRka1po?= =?iso-2022-jp?B?YTE3SU1FVUtLYzluZlZuU2VLMGUzRjVHVTVhWXMyOFUwVFlJUlpIWjFH?= =?iso-2022-jp?B?UWVyQytad2xidlNNRTRTOStuazJCNmFXZXhhMzVoZGc1c0NQWWxUV2t2?= =?iso-2022-jp?B?QmN2c29ZYTRrbkNWVHVDbkN2V1pvMWZFQXliY3RvVzh6MU5iR1ZTdXRQ?= =?iso-2022-jp?B?aWt0K1pTUU93WnlOWnNXOW9zWUc3WFF5VEM1d2VpT2p6R2kyUnhQTStY?= =?iso-2022-jp?B?Y2MzbTFTR3hVa2x1NzdvcGZuSmpGWnNJL2hKRnhOT0drVlN6UU8yME52?= =?iso-2022-jp?B?bnorNzE4WXltUHpYT0xZL25BZEo3aVcvUys4Y01uTHJRVktjcHRYQS94?= =?iso-2022-jp?B?QUlodFdUaVlXSFJJNVRCdUcvSFlDRWhXSU5LTmJoS1NUSWFHUGZ6ZHB6?= =?iso-2022-jp?B?Y1hRZmd5L3VKZ1dFdk1pazBzSHN4M0FURWNPUURyMUxYYWhyTVF4QW1j?= =?iso-2022-jp?B?alNCczFOZW1tNHFxbnp2OWVueEYzWVlYQjJJd0tCdFdSWU1uRDBOby9H?= =?iso-2022-jp?B?ZXByaWNVZDM0UWI1QzdMRjFTNjlVN2N2S3JKZGZQeUFyZEJ5MkNkZjI1?= =?iso-2022-jp?B?a29hTHkvUitsZFkvdlMwc2Jkd0pJdFVQaEl3Y1dnSmRGK3NPNXNUeTZO?= =?iso-2022-jp?B?MHNYM3Jyd0FvVjNDVDJjZnlSMXhpQ0w3RXVyUFZraGZXVzBjR1hRNXVp?= =?iso-2022-jp?B?djJVNGszc1hNZDFWaUE4Y1ZCK3B4dXRZSHJXc0FTVkhMSlgrY2tLNlRO?= =?iso-2022-jp?B?WUdSeVBGYjYxemltWXBWb2tPUDhUcGpsUDFMb0twQmhzdCt0SjQ0K1Bl?= =?iso-2022-jp?B?dGZ6TzFzQW5XU3llNFhLc0IrNTd0T0tMdDJRM1RhSVA4Zmx6VTJiVWhQ?= =?iso-2022-jp?B?ZEVaZDh5aEhtUytFdTBRcmRNUVV1S0E4ODZKQmpqNE9LSDV6eWdnSmUv?= =?iso-2022-jp?B?ak8yZ0xDTTR0WFhjUDNmYkJrcjlVTWNMTW9MT1ZXQW1RaGdqVUFQTWpl?= =?iso-2022-jp?B?MGJWeExwcXNBYzFZS0pXei9uVjVnL3JGbUlYbE9ISHRYeThhM3NIcXFz?= =?iso-2022-jp?B?UWhLajNPLzVUcUFqVkFjb0M3Z1NiR01MZTVQZG4rN2oxS0theWtvUHh2?= =?iso-2022-jp?B?QWN1cGE5T1EyTkZNNGpVTmF2SEZ4c3dZVHBNcXgzeE1mRGJ3d2REUzhV?= =?iso-2022-jp?B?eG0xdStrNEkrYlBWTkJaQVBQR2RnU083WldjQlhZMk9xWjVFWHBJRVYx?= =?iso-2022-jp?B?VWJpVHJqa0thOHczMW16RXBaeVRJdStHKzkzVjVGbWZmL21wVkN3aytL?= =?iso-2022-jp?B?YkNBQjIrUE1XUUhadVVBYkwzY1p1RFllUFc3OGNJREtZVithOUVweXp0?= =?iso-2022-jp?B?VzdKcXRTZW9IWCs1d3hJNVYyUEpCVk9GQzRmbzEzZmhjS1EzM1l6bTVm?= =?iso-2022-jp?B?NFRtc0FpelYybXVpLzhrbVdORDl4aW4yaHptLzRua3ZoVWFPWm1JUncw?= =?iso-2022-jp?B?RFY4cGVhTjZBc3hCaGdDNlppNUdacXFyRThuUm9WcDBObEx0TDhvQ2pL?= =?iso-2022-jp?B?TDBoWGVXYnNDR3Z6bWZ0d0dFOUd4YVhLQTBBME1CU3pJQzM0dnZZZFlJ?= =?iso-2022-jp?B?TmNSMmdjNTNDWDdLNGUxb2J0SkFITVFrTkcvSWswUWl5N3RHTlh6TzVP?= =?iso-2022-jp?B?VVMzRnlNV2Vsb1Z1R3RpY3c1UkMyOTU0Y01TUjZ6dllGMERWU1hTaGF4?= =?iso-2022-jp?B?bjc1SnVaVitTY2Q1UkFLS3RtSG1xSkJSK2tMUDM5R1lTNjhFNndIZHlR?= =?iso-2022-jp?B?UkFRa25yUnNPbEt1VzBaYjllcnZXZnJlVmxUM01ldU4rR3NGWTVEVk1X?= =?iso-2022-jp?B?L0FpUEFVanlxbUJTcU1MY1VGZWltWDhLND0=?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0267feef-fab7-4d6c-50ca-08da9c993fd3 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Sep 2022 12:52:04.0464 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: RcTaEtIsDLG/6Sc/hKNW0fYJ1rP5r4J85GS+mOAukWpiFOEwqu2y0QD7vB/J2EHLgu5t/swZy5/YRH4gvjSXrw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5501 Content-Language: en-US Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Thanks Richard. Please just send out the v2, I will give my feedback based on that. Please run PatchCheck and Uncrustify on your patch before sending it out. A= lso, it would be helpful if you can organize your patches on driver based i= nstead of having everything all together in one patch. It would be easier f= or us to review and also easier for you to address the comments. Thanks Abner > -----Original Message----- > From: RichardHo [=1B$B2?L@Ci=1B(B] > Sent: Wednesday, September 21, 2022 10:35 AM > To: devel@edk2.groups.io; Chang, Abner ; > quic_rcran@quicinc.com > Cc: Andrew Fish ; Leif Lindholm > ; Michael D Kinney ; > Michael Kubacki ; Zhiguang Liu > ; Liming Gao ; TonyLo > [=1B$BMe6b>>=1B(B] > Subject: RE: [EXTERNAL] Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB > network devices support >=20 > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. >=20 >=20 > Hi Abner, >=20 > For #4, To see below code. RNDIS driver provide the RndisUndiStart routin= e. > It could execute RndisUndiStart in UndiStart routine end. > The upper layer driver not need to know the USB CDC driver = interface > class. > It only provide the USB_ETHERNET_PROTOCOL. The UNDI protoco= l is > easy to control by NetworkCommon driver. >=20 > I have convert the USB_ETHERNET_PROTOCOL to > EDKII_USB_ETHERNET_PROTOCOL, will send the patch next. >=20 > UsbRndisDevice->Signature =3D USB_RNDIS_SIGNAT= URE; > UsbRndisDevice->NumOfInterface =3D Interface.Interf= aceNumber; > UsbRndisDevice->UsbRndisHandle =3D RndisHandle; > UsbRndisDevice->UsbCdcDataHandle =3D 0; > UsbRndisDevice->UsbIo =3D UsbIo; >=20 > // ------ Below is for USB_ETHERNET_PROTOCOL > UsbRndisDevice->UsbEth.UsbEthReceive =3D RndisUndiReceive= ; > UsbRndisDevice->UsbEth.UsbEthTransmit =3D RndisUndiTransmi= t; > UsbRndisDevice->UsbEth.UsbEthInterrupt =3D UsbRndisInterrup= t; > UsbRndisDevice->UsbEth.UsbEthMacAddress =3D GetUsbEthMacAddr= ess; > UsbRndisDevice->UsbEth.UsbEthMaxBulkSize =3D UsbEthBulkSize; > UsbRndisDevice->UsbEth.UsbHeaderFunDescriptor =3D > GetUsbHeaderFunDescriptor; > UsbRndisDevice->UsbEth.UsbUnionFunDescriptor =3D > GetUsbUnionFunDescriptor; > UsbRndisDevice->UsbEth.UsbEthFunDescriptor =3D > GetUsbRndisFunDescriptor; > UsbRndisDevice->UsbEth.SetUsbEthMcastFilter =3D SetUsbRndisMcast= Filter; > UsbRndisDevice->UsbEth.SetUsbEthPowerPatternFilter =3D > SetUsbRndisPowerFilter; > UsbRndisDevice->UsbEth.GetUsbEthPoewrPatternFilter =3D > GetUsbRndisPowerFilter; > UsbRndisDevice->UsbEth.SetUsbEthPacketFilter =3D SetUsbRndisPacke= tFilter; > UsbRndisDevice->UsbEth.GetUsbEthStatistic =3D GetRndisStatisti= c; >=20 > // ------- Below is for UNDI Hook > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiGetState =3D > RndisDummyReturn; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiStart =3D RndisUn= diStart; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiStop =3D RndisUn= diStop; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiGetInitInfo =3D > RndisUndiGetInitInfo; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiGetConfigInfo =3D > RndisUndiGetConfigInfo; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiInitialize =3D > RndisUndiInitialize; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiReset =3D RndisUn= diReset; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiShutdown =3D > RndisUndiShutdown; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiInterruptEnable =3D > RndisDummyReturn; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiReceiveFilter =3D > RndisUndiReceiveFilter; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiStationAddress =3D > RndisDummyReturn; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiStatistics =3D NULL; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiMcastIp2Mac =3D > RndisDummyReturn; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiNvData =3D > RndisDummyReturn; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiGetStatus =3D > RndisUndiGetStatus; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiFillHeader =3D > RndisDummyReturn; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiTransmit =3D NULL; > UsbRndisDevice->UsbEth.UsbEthUndi.UsbEthUndiReceive =3D NULL; >=20 > UndiStart ( > IN PXE_CDB *Cdb, > IN NIC_DATA *Nic > ) > { > PXE_CPB_START_31 *Cpb; > EFI_STATUS Status; >=20 > if ((Cdb->OpCode !=3D PXE_OPCODE_START) || > (Cdb->StatCode !=3D PXE_STATCODE_INITIALIZE) || > (Cdb->StatFlags !=3D PXE_STATFLAGS_INITIALIZE) || > (Cdb->IFnum >=3D (gPxe->IFcnt | gPxe->IFcntExt << 8)) || > (Cdb->CPBsize !=3D sizeof (PXE_CPB_START_31)) || > (Cdb->DBsize !=3D PXE_DBSIZE_NOT_USED) || > (Cdb->DBaddr !=3D PXE_DBADDR_NOT_USED) || > (Cdb->OpFlags !=3D PXE_OPFLAGS_NOT_USED)) > { > Cdb->StatFlags =3D PXE_STATFLAGS_COMMAND_FAILED; > Cdb->StatCode =3D PXE_STATCODE_INVALID_CDB; > return; > } else { > Cdb->StatFlags =3D PXE_STATFLAGS_COMMAND_COMPLETE; > Cdb->StatCode =3D PXE_STATCODE_SUCCESS; > } >=20 > if (Nic->State !=3D PXE_STATFLAGS_GET_STATE_STOPPED) { > Cdb->StatFlags =3D PXE_STATFLAGS_COMMAND_FAILED; > Cdb->StatCode =3D PXE_STATCODE_ALREADY_STARTED; > return; > } >=20 > Cpb =3D (PXE_CPB_START_31 *)(UINTN)Cdb->CPBaddr; >=20 > Nic->PxeStart.Delay =3D Cpb->Delay; > Nic->PxeStart.Virt2Phys =3D Cpb->Virt2Phys; > Nic->PxeStart.Block =3D Cpb->Block; > Nic->PxeStart.Map_Mem =3D 0; > Nic->PxeStart.UnMap_Mem =3D 0; > Nic->PxeStart.Sync_Mem =3D Cpb->Sync_Mem; > Nic->PxeStart.Unique_ID =3D Cpb->Unique_ID; > Nic->State =3D PXE_STATFLAGS_GET_STATE_STARTED; >=20 > if (Nic->UsbEth->UsbEthUndi.UsbEthUndiStart !=3D NULL) { > Status =3D Nic->UsbEth->UsbEthUndi.UsbEthUndiStart (Cdb, Nic); <--= - > RndisUndiStart > if (EFI_ERROR (Status)) { > Cdb->StatFlags =3D PXE_STATFLAGS_COMMAND_FAILED; > } > } > } >=20 > Thanks, > Richard >=20 >=20 > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Chang, > Abner via groups.io > Sent: 2022=1B$BG/=1B(B9=1B$B7n=1B(B12=1B$BF|=1B(B 3:56 PM > To: RichardHo [=1B$B2?L@Ci=1B(B] ; devel@edk2.groups.i= o; > quic_rcran@quicinc.com > Cc: Andrew Fish ; Leif Lindholm > ; Michael D Kinney ; > Michael Kubacki ; Zhiguang Liu > ; Liming Gao ; TonyLo > [=1B$BMe6b>>=1B(B] > Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB > network devices support >=20 >=20 > **CAUTION: The e-mail below is from an external source. Please exercise > caution before opening attachments, clicking links, or following guidance= .** >=20 > [AMD Official Use Only - General] >=20 > Hi Richard, thanks for the reply. My feedback in line below, >=20 > > -----Original Message----- > > From: RichardHo [=1B$B2?L@Ci=1B(B] > > Sent: Monday, September 12, 2022 11:48 AM > > To: Chang, Abner ; devel@edk2.groups.io; > > quic_rcran@quicinc.com > > Cc: Andrew Fish ; Leif Lindholm > > ; Michael D Kinney > > ; Michael Kubacki > > ; Zhiguang Liu > > ; Liming Gao ; > > TonyLo [=1B$BMe6b>>=1B(B] > > > > Subject: RE: [EXTERNAL] RE: [edk2-devel] [PATCH] UsbNetworkPkg: add > > USB network devices support > > > > [CAUTION: External Email] > > > > Hi Abner, > > > > Ans #1. I think the USB network feature is better in the > > UsbNetworkPkg. It is easy to control USB network stack in this package. > > The package is same as NetworkPkg(The NetworkPkg gathers > > all network stack features). The UsbNetworkPkg could gather the USB > > network stack. > UsbNetworkPkg has the feature that overlaps with Bus\Usb and \NetworkPkg = in > my opinion, that is the reason I think we can have these modules in the e= xisting > package. Plus as I know from the edk2 community view point, we only creat= e a > new package when necessary for a totally new feature. However, this is at= the > discretion of edk2 stewards. You can confirm this with them. >=20 > > Ans #2. OK. I will rename it next. > > Ans #4 Other driver could use EFI_OPEN_PROTOCOL_BY_DRIVER with > > USB_ETHERNET_PROTOCOL to own on the specific USB CDC device. > > But, the specific USB CDC driver need to install the > > binding driver before NetworkCommon driver. > My question was USB_ETHERNET_PROTOCOL is designed as an abstract > protocol, with this the underlying transport (UsbIo or PciIo) is agnostic= to the > upper layer driver. Upper layer driver (e.g., USB_ETHERNET_PROTOCOL based > SNP driver) can check whether USB_ETHERNET_PROTOCOL is installed on the > given Controller handle at Supported() function. However, seems the upper= layer > driver has no way to distinguish the USB CDC driver interface class if I = read your > code right; then manages the right device (in the case of multiple USB CD= C > devices are attached to the system). We can either attach USB Class Devic= e Path > to the device path in Usb CDC driver or provide a function to retrieve th= e USB > CDC interface class/subclass/protocol via USB_ETHERNET_PROTOCOL. I would > prefer the former one. >=20 > Thanks > Abner >=20 > > Ans #5 NetworkCommon driver build a Mac device path that link PciIo > > device path. > > So, SNP driver could found PciIo device path when > > NetworkCommon driver to install the > EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL. > > > > Thanks, > > Richard > > > > -----Original Message----- > > From: Chang, Abner > > Sent: 2022=1B$BG/=1B(B9=1B$B7n=1B(B9=1B$BF|=1B(B 3:07 PM > > To: devel@edk2.groups.io; quic_rcran@quicinc.com; RichardHo [=1B$B2?L@C= i=1B(B] > > > > Cc: Andrew Fish ; Leif Lindholm > > ; Michael D Kinney > > ; Michael Kubacki > > ; Zhiguang Liu > > ; Liming Gao ; > > TonyLo [=1B$BMe6b>>=1B(B] > > > > 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.** > > > > [AMD Official Use Only - General] > > > > Hi Richard, > > That is pretty hard to give the in-line comment in this huge patch > > email. You would be also hard to find the comments given to each > > module or the protocol header file. > > So fist all of, please organize your change into several patches. For > > example, 1. UsbEthernetProtocol.h 2. UsbRndis module 3. UsbCdcNcm modul= e > 4. > > UsbCdcEcm module 5. NetworkCommon module > > > > Some rough feedbacks to this change before I giving the comments to > > each patch after you resending the new patch set. > > 1. I suggest having UsbNetwork folder under MdeModulePkg/Usb/. Then > > under UsbNetwork, you can have those four USB network related modules. > > However, we can Rename NetwrokCommon to UsbNetwork if your are ok > with > > it. > > 2. UsbEhernetProtocol is not an EFI protocol, so please add EdkII as > > the prefix to UsbEthernetProtocol, it would be > > EdkIIUsbEthernetProtocol. And we can have UsbEthernetProtocol.h under > MdeModulePkg/Include/Protocol 4. > > From this change, NetwrokCommon driver listens to > > USB_ETHERNET_PROTOCOL and install EFI NII protocol for each instance. > > However, the upper layer driver wouldn't know the CDC interface > > class/subclass/protocol if it only listen to USB_ETHERNET_PROTOCOL and > > install its own SNP on the specific USB CDC device; in the case if > > there are multiple USB CDC devices attached on the system. Is my > > understanding correct? > > 5. I don=1B$B!G=1B(Bt see the UsbEthernetProtocol based SNP protocol is= installed > > and the SNP driver under NetworkPkg has the dependency with PciIo. Do > > we have to implement UsbEthernetProtocol based SNP by our own? > > > > I will check the functionality on our platform if I get the chance. > > Thanks > > Abner > > > > > > > -----Original Message----- > > > From: devel@edk2.groups.io On Behalf Of > > Rebecca > > > Cran via groups.io > > > Sent: Saturday, September 3, 2022 5:48 AM > > > To: devel@edk2.groups.io; richardho@ami.com > > > Cc: Andrew Fish ; Leif Lindholm > > > ; Michael D Kinney > > > ; Michael Kubacki > > > ; Zhiguang Liu > > > ; Liming Gao ; > > > TonyLo [=1B$BMe6b>>=1B(B] > > > > > > Subject: Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network > > > devices support > > > > > > [CAUTION: External Email] > > > > > > I've pushed this patch to a branch at > > > > > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fnam= 1 > > > 2.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fnam > 1 > > > &data=3D05%7C01%7Cabner.chang%40amd.com%7Cf79f1cf3f8354d727467 > 08da9b > > > 79d240%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C63799324477 > 7924364 > > > %7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJB > TiI6I > > > k1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3D21Xp09W656c14 > EGfJms8Ov > > TvUZ4xihlIep3ES9kAC0U%3D&reserved=3D0 > > > 1.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fnam > & > > > amp;data=3D05%7C01%7Cigork%40ami.com%7C2dbbb37cd5aa464372d408da949 > 44389% > > > 7C27e97857e15f486cb58e86c2b3040f93%7C1%7C0%7C637985661785139437% > 7CUnkn > > > own%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1ha > Wwi > > > LCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3D6kJ7djzYAbWay75nEMfH2 > eATKEWC2 > > j%2FoFYakFE2PuJw%3D&reserved=3D0 > > 1 > > > > > 2.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fn > > am1 > > > > > &data=3D05%7C01%7CAbner.Chang%40amd.com%7C92e0dc34ec2a4c9a9f > > 6908da94 > > > > > > 71a29e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C63798551306 > > 1024727 > > > > > %7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiL > > CJBTiI6I > > > > > k1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3D78%2FyX9SBP > > 4wrftOYrmnP > > > muF5e%2F3NsmqY7JVw4atcoGM%3D&reserved=3D0 > > > > > 1.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fgi > > th > > > > > &data=3D05%7C01%7Crichardho%40ami.com%7C1ffd2a8dbf6f4cda9da908 > > da9231 > > > > > > e426%7C27e97857e15f486cb58e86c2b3040f93%7C1%7C0%7C63798304023249 > > 3161%7 > > > > > CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJ > > BTiI6Ik1 > > > > > haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DXK3dw8vGMtln2 > > Ig6Rcieyw6l > > > orLdsvy2Oko9gAllSK0%3D&reserved=3D0 > > > ub.com%2Fbcran%2Fedk2%2Ftree%2Fusb- > > > > > net&data=3D05%7C01%7Cabner.chang%40amd.com%7C2c812dc15b9542b > > > > > > 8a64308da8d2cdf2b%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C > > > > > 637977521120662673%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwM > > > > > DAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7 > > > > > C&sdata=3DZFcSw3AL0MnljvyODrv1dYAL8LuadwCYe65xhE1hXWY%3D&a > > > mp;reserved=3D0 . > > > > > > -- > > > Rebecca Cran > > > > > > On 9/1/22 23:24, RichardHo [=1B$B2?L@Ci=1B(B] 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.dsc > > > > create mode 100644 > > > UsbNetworkPkg/Include/Protocol/UsbEthernetProtocol.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 > > 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. >=20 >=20 >=20 >=20 >=20 > -The information contained in this message may be confidential and propri= etary > to American Megatrends (AMI). This communication is intended to be read o= nly > 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 t= hat 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 th= en > delete or destroy all copies of the transmission.