<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:新細明體;
        panose-1:2 2 5 0 0 0 0 0 0 0;}
@font-face
        {font-family:Gulim;
        panose-1:2 11 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"\@新細明體";
        panose-1:2 2 5 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
@font-face
        {font-family:GulimChe;}
@font-face
        {font-family:"\@Gulim";
        panose-1:2 11 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:"\@GulimChe";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:12.0pt;
        font-family:"Gulim",sans-serif;
        mso-fareast-language:KO;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML 預設格式 字元";
        margin:0in;
        font-size:12.0pt;
        font-family:GulimChe;
        mso-fareast-language:KO;}
span.HTML
        {mso-style-name:"HTML 預設格式 字元";
        mso-style-priority:99;
        mso-style-link:"HTML 預設格式";
        font-family:Consolas;
        mso-fareast-language:KO;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:ZH-TW">Hi Tinh,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:ZH-TW"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:ZH-TW">Our last RNDIS driver’s code has add that.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">To see <a href="https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fwindows-hardware%2Fdrivers%2Fnetwork%2Fcontrol-channel-characteristics&data=05%7C01%7CRichardHo%40ami.com%7C4edbc66360fa4936d99608dac8de1e74%7C27e97857e15f486cb58e86c2b3040f93%7C1%7C0%7C638043153572597130%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=pfWsBTOfoNxFyg65xTKvnNeRxyvUstt4c1W%2FlGieYWM%3D&reserved=0">
https://learn.microsoft.com/en-us/windows-hardware/drivers/network/control-channel-characteristics</a>,
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">It need to read the Interrupt IN endpoint before response the RNDIS message.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Segoe UI",sans-serif;color:#171717;background:white">The host does not continuously poll the USB Control endpoint for input control messages. Upon placing a control message
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Segoe UI",sans-serif;color:#171717;background:white">on its Control endpoint,
<span style="background:yellow;mso-highlight:yellow">the device must return a notification on the Communication Class interface's Interrupt IN endpoint,</span>
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Segoe UI",sans-serif;color:#171717;background:white">which is polled by the host whenever the device can return control messages. The transfer from the device's interrupt IN endpoint
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Segoe UI",sans-serif;color:#171717;background:white">to the host is a standard USB Interrupt IN transfer. The only defined device notification is the RESPONSE_AVAILABLE notification,
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Segoe UI",sans-serif;color:#171717;background:white">defined in the following table.</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:ZH-TW"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:ZH-TW"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:ZH-TW"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:ZH-TW">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:ZH-TW">Richard<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:ZH-TW"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:ZH-TW">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:ZH-TW"> Tinh Nguyen OS <tinhnguyen@os.amperecomputing.com>
<br>
<b>Sent:</b> 2023</span><span lang="ZH-TW" style="font-size:11.0pt;mso-fareast-language:ZH-TW">年</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:ZH-TW">2</span><span lang="ZH-TW" style="font-size:11.0pt;mso-fareast-language:ZH-TW">月</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:ZH-TW">21</span><span lang="ZH-TW" style="font-size:11.0pt;mso-fareast-language:ZH-TW">日</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:ZH-TW">
 10:24 AM<br>
<b>To:</b> devel@edk2.groups.io; Richard Ho (</span><span lang="ZH-TW" style="font-size:11.0pt;mso-fareast-language:ZH-TW">何明忠</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:ZH-TW">) <RichardHo@ami.com><br>
<b>Subject:</b> [EXTERNAL] Re: [edk2-devel] [PATCH v4 1/3] UsbNetworkPkg/UsbRndis: Add USB RNDIS devices support<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:12.0pt;background:#E02222">
<strong><span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:white">**CAUTION:</span></strong><span style="font-size:10.0pt;color:white"> The e-mail below is from an external source. Please exercise caution before opening attachments, clicking
 links, or following guidance.** </span><o:p></o:p></p>
<div>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 18/02/2023 16:47, RichardHo [<span lang="KO">何明忠</span>] via groups.io wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre>+  PrintRndisMsg (RndisMsg);<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>+  Status = UsbIo->UsbControlTransfer (<o:p></o:p></pre>
<pre>+                    UsbIo,<o:p></o:p></pre>
<pre>+                    &DevReq,<o:p></o:p></pre>
<pre>+                    EfiUsbDataOut,<o:p></o:p></pre>
<pre>+                    USB_ETHERNET_TRANSFER_TIMEOUT,<o:p></o:p></pre>
<pre>+                    RndisMsg,<o:p></o:p></pre>
<pre>+                    RndisMsg->MessageLength,<o:p></o:p></pre>
<pre>+                    &UsbStatus<o:p></o:p></pre>
<pre>+                    );<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>+  DEBUG ((DEBUG_INFO, "RndisControlMsg: UsbStatus : %x Status : %r RndisMsgResponse : %lx\n", UsbStatus, Status, RndisMsgResponse));<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>+  // Error or no response expected<o:p></o:p></pre>
<pre>+  if ((EFI_ERROR (Status)) || (RndisMsgResponse == NULL)) {<o:p></o:p></pre>
<pre>+    DEBUG ((DEBUG_INFO, "RndisControlMsg: UsbStatus : %x Status : %r\n", UsbStatus, Status));<o:p></o:p></pre>
<pre>+    return Status;<o:p></o:p></pre>
<pre>+  }<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>+  for (Index = 0; Index < (RNDIS_CONTROL_TIMEOUT/100); Index++) {<o:p></o:p></pre>
<pre>+    ReadRndisResponseInterrupt (UsbRndisDevice);<o:p></o:p></pre>
</blockquote>
<p>Could you help review the ReadRndisResponseInterrupt function? (). While using USB Rndis, the Jade platform crashes.<o:p></o:p></p>
<p>I found that AMI had published the same driver here <a href="https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fopencomputeproject%2FOSF-Aptio-OpenEdition%2Fblob%2Fmain%2FUsbRndisPkg%2FUsbRndis%2FUsbRndisFunction.c&data=05%7C01%7Crichardho%40ami.com%7Cec4d080c33d24cd6647208db13b2a4c2%7C27e97857e15f486cb58e86c2b3040f93%7C1%7C0%7C638125430210029610%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=aFtORrifBCKmIBo3XhLQYtzF0Ek3mkA5Ezk%2BDth4iVo%3D&reserved=0">
OSF-Aptio-OpenEdition/UsbRndisFunction.c at main · opencomputeproject/OSF-Aptio-OpenEdition (github.com)</a>,
<o:p></o:p></p>
<p>however the RndisControlMsg function does not call ReadRndisResponseInterrupt.<o:p></o:p></p>
<p>Jade platform (aarch64) works well with this (<a href="https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fopencomputeproject%2FOSF-Aptio-OpenEdition%2Fblob%2Fmain%2FUsbRndisPkg%2FUsbRndis%2FUsbRndisFunction.c&data=05%7C01%7Crichardho%40ami.com%7Cec4d080c33d24cd6647208db13b2a4c2%7C27e97857e15f486cb58e86c2b3040f93%7C1%7C0%7C638125430210029610%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=aFtORrifBCKmIBo3XhLQYtzF0Ek3mkA5Ezk%2BDth4iVo%3D&reserved=0">OSF-Aptio-OpenEdition/UsbRndisFunction.c
 at main · opencomputeproject/OSF-Aptio-OpenEdition (github.com)</a>). Does your x86 system work without this line ?<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>+    ZeroMem (&DevReq, sizeof (EFI_USB_DEVICE_REQUEST));<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>+    DevReq.RequestType = USB_ENDPOINT_DIR_IN | USB_REQ_TYPE_CLASS | USB_TARGET_INTERFACE;<o:p></o:p></pre>
<pre>+    DevReq.Request     = GET_ENCAPSULATED_RESPONSE;<o:p></o:p></pre>
</blockquote>
</div>
</div>
-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.
</body>
</html>


<div width="1" style="color:white;clear:both">_._,_._,_</div>
<hr>


Groups.io Links:<p>


  
    You receive all messages sent to this group.
  
  


<p>
<a target="_blank" href="https://edk2.groups.io/g/devel/message/100397">View/Reply Online (#100397)</a> |


  

|

  <a target="_blank" href="https://groups.io/mt/97046156/1813853">Mute This Topic</a>

| <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>




<a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> |
<a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |

<a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>

 [edk2-devel-archive@redhat.com]<br>
<div width="1" style="color:white;clear:both">_._,_._,_</div>