mirror of https://github.com/xqemu/xqemu.git
usb: add USBEndpoint->{nr,pid}
Add a "nr" and "pid" fields to USBEndpoint so you can easily figure the endpoint number and direction of any given endpoint. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
f53c398aa6
commit
63095ab54c
5
hw/usb.c
5
hw/usb.c
|
@ -402,10 +402,15 @@ void usb_ep_init(USBDevice *dev)
|
||||||
{
|
{
|
||||||
int ep;
|
int ep;
|
||||||
|
|
||||||
|
dev->ep_ctl.nr = 0;
|
||||||
dev->ep_ctl.type = USB_ENDPOINT_XFER_CONTROL;
|
dev->ep_ctl.type = USB_ENDPOINT_XFER_CONTROL;
|
||||||
dev->ep_ctl.ifnum = 0;
|
dev->ep_ctl.ifnum = 0;
|
||||||
dev->ep_ctl.dev = dev;
|
dev->ep_ctl.dev = dev;
|
||||||
for (ep = 0; ep < USB_MAX_ENDPOINTS; ep++) {
|
for (ep = 0; ep < USB_MAX_ENDPOINTS; ep++) {
|
||||||
|
dev->ep_in[ep].nr = ep + 1;
|
||||||
|
dev->ep_out[ep].nr = ep + 1;
|
||||||
|
dev->ep_in[ep].pid = USB_TOKEN_IN;
|
||||||
|
dev->ep_out[ep].pid = USB_TOKEN_OUT;
|
||||||
dev->ep_in[ep].type = USB_ENDPOINT_XFER_INVALID;
|
dev->ep_in[ep].type = USB_ENDPOINT_XFER_INVALID;
|
||||||
dev->ep_out[ep].type = USB_ENDPOINT_XFER_INVALID;
|
dev->ep_out[ep].type = USB_ENDPOINT_XFER_INVALID;
|
||||||
dev->ep_in[ep].ifnum = 0;
|
dev->ep_in[ep].ifnum = 0;
|
||||||
|
|
Loading…
Reference in New Issue