public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "RichardHo [何明忠]" <richardho@ami.com>
To: Tinh Nguyen OS <tinhnguyen@os.amperecomputing.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Tony Lo (羅金松)" <TonyLo@ami.com>,
	"Felix Polyudov" <Felixp@ami.com>,
	"Srini Narayana" <SriniN@ami.com>,
	"Harikrishna Doppalapudi" <Harikrishnad@ami.com>,
	"Dos Hsieh" <doshsieh@ami.com>
Subject: Re: [edk2-devel] [PATCH v4 1/3] UsbNetworkPkg/UsbRndis: Add USB RNDIS devices support
Date: Tue, 21 Feb 2023 03:01:41 +0000	[thread overview]
Message-ID: <CY8PR10MB644167959900C7CD0D6C68D4B0A59@CY8PR10MB6441.namprd10.prod.outlook.com> (raw)
In-Reply-To: <2e170b3a-0822-9e13-bbf1-15c99d646d78@amperemail.onmicrosoft.com>

[-- Attachment #1: Type: text/plain, Size: 4956 bytes --]

Hi Tinh,

Our last RNDIS driver’s code has add that.
To see https://learn.microsoft.com/en-us/windows-hardware/drivers/network/control-channel-characteristics<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>,
It need to read the Interrupt IN endpoint before response the RNDIS message.

The host does not continuously poll the USB Control endpoint for input control messages. Upon placing a control message
on its Control endpoint, the device must return a notification on the Communication Class interface's Interrupt IN endpoint,
which is polled by the host whenever the device can return control messages. The transfer from the device's interrupt IN endpoint
to the host is a standard USB Interrupt IN transfer. The only defined device notification is the RESPONSE_AVAILABLE notification,
defined in the following table.



Thanks,
Richard

From: Tinh Nguyen OS <tinhnguyen@os.amperecomputing.com>
Sent: 2023年2月21日 10:24 AM
To: devel@edk2.groups.io; Richard Ho (何明忠) <RichardHo@ami.com>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v4 1/3] UsbNetworkPkg/UsbRndis: Add USB RNDIS devices support


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


On 18/02/2023 16:47, RichardHo [何明忠] via groups.io wrote:



+  PrintRndisMsg (RndisMsg);

+

+  Status = UsbIo->UsbControlTransfer (

+                    UsbIo,

+                    &DevReq,

+                    EfiUsbDataOut,

+                    USB_ETHERNET_TRANSFER_TIMEOUT,

+                    RndisMsg,

+                    RndisMsg->MessageLength,

+                    &UsbStatus

+                    );

+

+  DEBUG ((DEBUG_INFO, "RndisControlMsg: UsbStatus : %x Status : %r RndisMsgResponse : %lx\n", UsbStatus, Status, RndisMsgResponse));

+

+  // Error or no response expected

+  if ((EFI_ERROR (Status)) || (RndisMsgResponse == NULL)) {

+    DEBUG ((DEBUG_INFO, "RndisControlMsg: UsbStatus : %x Status : %r\n", UsbStatus, Status));

+    return Status;

+  }

+

+  for (Index = 0; Index < (RNDIS_CONTROL_TIMEOUT/100); Index++) {

+    ReadRndisResponseInterrupt (UsbRndisDevice);

Could you help review the ReadRndisResponseInterrupt function? (). While using USB Rndis, the Jade platform crashes.

I found that AMI had published the same driver here OSF-Aptio-OpenEdition/UsbRndisFunction.c at main · opencomputeproject/OSF-Aptio-OpenEdition (github.com)<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>,

however the RndisControlMsg function does not call ReadRndisResponseInterrupt.

Jade platform (aarch64) works well with this (OSF-Aptio-OpenEdition/UsbRndisFunction.c at main · opencomputeproject/OSF-Aptio-OpenEdition (github.com)<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>). Does your x86 system work without this line ?

+    ZeroMem (&DevReq, sizeof (EFI_USB_DEVICE_REQUEST));

+

+    DevReq.RequestType = USB_ENDPOINT_DIR_IN | USB_REQ_TYPE_CLASS | USB_TARGET_INTERFACE;

+    DevReq.Request     = GET_ENCAPSULATED_RESPONSE;

-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.

[-- Attachment #2: Type: text/html, Size: 13151 bytes --]

  reply	other threads:[~2023-02-21  3:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-18  9:47 [PATCH v4 1/3] UsbNetworkPkg/UsbRndis: Add USB RNDIS devices support RichardHo [何明忠]
2023-02-18  9:47 ` [PATCH v4 2/3] UsbNetworkPkg/UsbCdcEcm: Add USB Cdc ECM " RichardHo [何明忠]
2023-03-06  8:13   ` [edk2-devel] " Tinh Nguyen
2023-02-18  9:47 ` [PATCH v4 3/3] UsbNetworkPkg/UsbCdcNcm: Add USB Cdc NCM " RichardHo [何明忠]
2023-02-21  2:23 ` [edk2-devel] [PATCH v4 1/3] UsbNetworkPkg/UsbRndis: Add USB RNDIS " Tinh Nguyen
2023-02-21  3:01   ` RichardHo [何明忠] [this message]
2023-03-03  9:34     ` RichardHo [何明忠]
2023-03-06  7:59 ` Tinh Nguyen

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=CY8PR10MB644167959900C7CD0D6C68D4B0A59@CY8PR10MB6441.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