aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2011-08-29 12:57:48 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-01-17 09:44:50 +0100
commit82f02fe96514605d0bb46f976871ec662193394a (patch)
tree724473df6de2caf49f4f273b22623b421cbc1c8f /hw
parentd8e17efdecaaa1a2d5c8f422fc44ae229e7f4fb4 (diff)
downloadqemu-82f02fe96514605d0bb46f976871ec662193394a.zip
qemu-82f02fe96514605d0bb46f976871ec662193394a.tar.gz
qemu-82f02fe96514605d0bb46f976871ec662193394a.tar.bz2
usb: add ifnum to USBEndpoint
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb.c14
-rw-r--r--hw/usb.h3
2 files changed, 17 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);