[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/10] uhci: make bandwidth tunable
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 03/10] uhci: make bandwidth tunable |
Date: |
Fri, 25 May 2012 11:44:14 +0200 |
Add a property for the uhci bandwidth. Can be used to make uhci
emulation run faster than real hardware.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/hcd-uhci.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 91bcc7e..2e7c8f9 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -133,6 +133,7 @@ struct UHCIState {
QEMUTimer *frame_timer;
QEMUBH *bh;
uint32_t frame_bytes;
+ uint32_t frame_bandwidth;
UHCIPort ports[NB_PORTS];
/* Interrupts that should be raised at the end of the current frame. */
@@ -908,7 +909,7 @@ static void uhci_async_complete(USBPort *port, USBPacket
*packet)
uhci_async_free(async);
} else {
async->done = 1;
- if (s->frame_bytes < 1280) {
+ if (s->frame_bytes < s->frame_bandwidth) {
qemu_bh_schedule(s->bh);
}
}
@@ -1007,7 +1008,7 @@ static void uhci_process_frame(UHCIState *s)
qhdb_reset(&qhdb);
for (cnt = FRAME_MAX_LOOPS; is_valid(link) && cnt; cnt--) {
- if (s->frame_bytes >= 1280) {
+ if (s->frame_bytes >= s->frame_bandwidth) {
/* We've reached the usb 1.1 bandwidth, which is
1280 bytes/frame, stop processing */
trace_usb_uhci_frame_stop_bandwidth();
@@ -1258,6 +1259,7 @@ static int usb_uhci_exit(PCIDevice *dev)
static Property uhci_properties[] = {
DEFINE_PROP_STRING("masterbus", UHCIState, masterbus),
DEFINE_PROP_UINT32("firstport", UHCIState, firstport, 0),
+ DEFINE_PROP_UINT32("bandwidth", UHCIState, frame_bandwidth, 1280),
DEFINE_PROP_END_OF_LIST(),
};
--
1.7.1
- [Qemu-devel] [PATCH 00/10] usb: uhci & usb-storage updates, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 03/10] uhci: make bandwidth tunable,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 04/10] uhci: fix trace format strings, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 09/10] usb-storage: add scsi_off, remove scsi_buf, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 05/10] uhci: zap uhci_pre_save, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 02/10] uhci: use bottom half, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 10/10] usb-storage: migration support, Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 08/10] usb-storage: add usb_msd_packet_complete(), Gerd Hoffmann, 2012/05/25
- [Qemu-devel] [PATCH 01/10] uhci: fix bandwidth management, Gerd Hoffmann, 2012/05/25