[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/17] usb: add ifnum to USBEndpoint
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 08/17] usb: add ifnum to USBEndpoint |
Date: |
Fri, 13 Jan 2012 11:18:25 +0100 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb.c | 14 ++++++++++++++
hw/usb.h | 3 +++
usb-linux.c | 1 +
3 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/hw/usb.c b/hw/usb.c
index 5d6baaf..6ba063a 100644
--- a/hw/usb.c
+++ b/hw/usb.c
@@ -422,6 +422,8 @@ void usb_ep_init(USBDevice *dev)
for (ep = 0; ep < USB_MAX_ENDPOINTS; ep++) {
dev->ep_in[ep].type = USB_ENDPOINT_XFER_INVALID;
dev->ep_out[ep].type = USB_ENDPOINT_XFER_INVALID;
+ dev->ep_in[ep].ifnum = 0;
+ dev->ep_out[ep].ifnum = 0;
}
}
@@ -444,3 +446,15 @@ void usb_ep_set_type(USBDevice *dev, int pid, int ep,
uint8_t type)
struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
uep->type = type;
}
+
+uint8_t usb_ep_get_ifnum(USBDevice *dev, int pid, int ep)
+{
+ struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
+ return uep->ifnum;
+}
+
+void usb_ep_set_ifnum(USBDevice *dev, int pid, int ep, uint8_t ifnum)
+{
+ struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
+ uep->ifnum = ifnum;
+}
diff --git a/hw/usb.h b/hw/usb.h
index 85cbe71..60e8858 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -175,6 +175,7 @@ struct USBDescString {
struct USBEndpoint {
uint8_t type;
+ uint8_t ifnum;
};
/* definition of a USB device */
@@ -334,7 +335,9 @@ void usb_cancel_packet(USBPacket * p);
void usb_ep_init(USBDevice *dev);
struct USBEndpoint *usb_ep_get(USBDevice *dev, int pid, int ep);
uint8_t usb_ep_get_type(USBDevice *dev, int pid, int ep);
+uint8_t usb_ep_get_ifnum(USBDevice *dev, int pid, int ep);
void usb_ep_set_type(USBDevice *dev, int pid, int ep, uint8_t type);
+void usb_ep_set_ifnum(USBDevice *dev, int pid, int ep, uint8_t ifnum);
void usb_attach(USBPort *port);
void usb_detach(USBPort *port);
diff --git a/usb-linux.c b/usb-linux.c
index 9967975..cb66ef3 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -1206,6 +1206,7 @@ static int usb_linux_update_endp_table(USBHostDevice *s)
assert(usb_ep_get_type(&s->dev, pid, ep) ==
USB_ENDPOINT_XFER_INVALID);
usb_ep_set_type(&s->dev, pid, ep, type);
+ usb_ep_set_ifnum(&s->dev, pid, ep, interface);
epd = get_endp(s, pid, ep);
epd->halted = 0;
--
1.7.1
- [Qemu-devel] [PULL 00/17] usb patch queue: audio, xhci, usbredir, Gerd Hoffmann, 2012/01/13
- [Qemu-devel] [PATCH 08/17] usb: add ifnum to USBEndpoint,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 12/17] usb: link packets to endpoints not devices, Gerd Hoffmann, 2012/01/13
- [Qemu-devel] [PATCH 01/17] usb-host: rip out legacy procfs support, Gerd Hoffmann, 2012/01/13
- [Qemu-devel] [PATCH 17/17] usb-redir: Improve some debugging messages, Gerd Hoffmann, 2012/01/13
- [Qemu-devel] [PATCH 04/17] usb-desc: audio endpoint support, Gerd Hoffmann, 2012/01/13
- [Qemu-devel] [PATCH 10/17] usb/debug: add usb_ep_dump, Gerd Hoffmann, 2012/01/13
- [Qemu-devel] [PATCH 09/17] usb-desc: USBEndpoint support, Gerd Hoffmann, 2012/01/13
- [Qemu-devel] [PATCH 14/17] usb-redir: Dynamically adjust iso buffering size based on ep interval, Gerd Hoffmann, 2012/01/13
- [Qemu-devel] [PATCH 16/17] usb-redir: Try to keep our buffer size near the target size, Gerd Hoffmann, 2012/01/13
- [Qemu-devel] [PATCH 02/17] usb: track configuration and interface count in USBDevice., Gerd Hoffmann, 2012/01/13
- [Qemu-devel] [PATCH 15/17] usb-redir: Pre-fill our isoc input buffer before sending pkts to the host, Gerd Hoffmann, 2012/01/13