Discussion:
[edk2] USB question: how change to a different alternate setting of an interface?
Eric Wittmayer
2015-06-11 06:19:59 UTC
Permalink
Hello all,
I'm new to the list and to edk2/uefi. I'm working on a USB device driver
for a device that has interrupt endpoints declared on interface alternate
#1. So the default interface descriptor has zero endpoints and the
alternate 1 interface descriptor has 2 endpoints. I am able to use
UsbIo->UsbControlTransfer to send a Set Interface command to the device and
I can see on my usb analyzer that it does get sent.
After that I call UsbIo->UsbGetInterfaceDescriptor again to get what I
expected was the interface descriptor for alternate #1 but I get back the
same descriptor as before I set the interface.
Looking through the code I can see in the XhciDxe code for
XhcControlTransfer that it handles updating the xhci controllers
representation of the endpoints when it sees the select interface command
but I'm not sure if there is something else I need to do in order to update
the data returned by UsbGetInterfaceDescriptor.

How do I get the correct descriptors for the newly active alternate setting?
Will they have a different UsbIo protocol handle and if so how do I find it?

Thanks for any help.
Eric



------------------------------------------------------------------------------
Tian, Feng
2015-06-11 07:26:09 UTC
Permalink
Hi, Eric

It should be enough to get alternative setting through these two steps you did.

Could you let me know whether you saw this debug message " UsbSelectSetting: setting %d selected for interface %d " got printed ? and which values are in the printed message?

Thanks
Feng

-----Original Message-----
From: Eric Wittmayer [mailto:***@frescologic.com]
Sent: Thursday, June 11, 2015 14:20
To: edk2-***@lists.sourceforge.net
Subject: [edk2] USB question: how change to a different alternate setting of an interface?

Hello all,
I'm new to the list and to edk2/uefi. I'm working on a USB device driver for a device that has interrupt endpoints declared on interface alternate #1. So the default interface descriptor has zero endpoints and the alternate 1 interface descriptor has 2 endpoints. I am able to use
UsbIo->UsbControlTransfer to send a Set Interface command to the device
UsbIo->and
I can see on my usb analyzer that it does get sent.
After that I call UsbIo->UsbGetInterfaceDescriptor again to get what I expected was the interface descriptor for alternate #1 but I get back the same descriptor as before I set the interface.
Looking through the code I can see in the XhciDxe code for XhcControlTransfer that it handles updating the xhci controllers representation of the endpoints when it sees the select interface command but I'm not sure if there is something else I need to do in order to update the data returned by UsbGetInterfaceDescriptor.

How do I get the correct descriptors for the newly active alternate setting?
Will they have a different UsbIo protocol handle and if so how do I find it?

Thanks for any help.
Eric
Eric Wittmayer
2015-06-11 07:53:57 UTC
Permalink
Feng,
Thanks for your quick response. I'll turn on the debug printing tomorrow and let you know what I get.

Eric
Post by Tian, Feng
Hi, Eric
It should be enough to get alternative setting through these two steps you did.
Could you let me know whether you saw this debug message " UsbSelectSetting: setting %d selected for interface %d " got printed ? and which values are in the printed message?
Thanks
Feng
-----Original Message-----
Sent: Thursday, June 11, 2015 14:20
Subject: [edk2] USB question: how change to a different alternate setting of an interface?
Hello all,
I'm new to the list and to edk2/uefi. I'm working on a USB device driver for a device that has interrupt endpoints declared on interface alternate #1. So the default interface descriptor has zero endpoints and the alternate 1 interface descriptor has 2 endpoints. I am able to use
UsbIo->UsbControlTransfer to send a Set Interface command to the device
UsbIo->and
I can see on my usb analyzer that it does get sent.
After that I call UsbIo->UsbGetInterfaceDescriptor again to get what I expected was the interface descriptor for alternate #1 but I get back the same descriptor as before I set the interface.
Looking through the code I can see in the XhciDxe code for XhcControlTransfer that it handles updating the xhci controllers representation of the endpoints when it sees the select interface command but I'm not sure if there is something else I need to do in order to update the data returned by UsbGetInterfaceDescriptor.
How do I get the correct descriptors for the newly active alternate setting?
Will they have a different UsbIo protocol handle and if so how do I find it?
Thanks for any help.
Eric
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Loading...