RE: [Qemu-devel] [PATCH, RFC] USB OHCI isochronous transfers support

2007-10-22 Thread Arnon Gilboa
Thanks, Paul.
The attached updated patch seems to fix this bug.
Comments? 

-Original Message-
From: Paul Brook [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 22, 2007 1:53 PM
To: qemu-devel@nongnu.org
Cc: Arnon Gilboa
Subject: Re: [Qemu-devel] [PATCH, RFC] USB OHCI isochronous transfers
support

On Monday 22 October 2007, Arnon Gilboa wrote:
> Hi,
>
> The attached patch adds isochronous transfers support to the OHCI 
> emulation, similarly to the UHCI patch pushed two weeks ago.

> +uint16_t offset[8];
> +};

> +static inline int ohci_read_iso_td(uint32_t addr, struct ohci_iso_td 
> +*td) {
> +return get_dwords(addr, (uint32_t *)td, sizeof(*td) >> 2); }

This is wrong. It will break on big-endian hosts.
set_dwords only DTRT if all the structure fields are 32-bit.

Paul


usb-ohci-iso.patch
Description: usb-ohci-iso.patch


RE: [Qemu-devel] [PATCH, RFC] USB OHCI isochronous transfers support

2007-10-22 Thread Arnon Gilboa
no. uhci & ohci are for usb 1.1. ehci is for usb 2.0 and i have just
started working on its qemu emulation.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Itamar Heim
Sent: Monday, October 22, 2007 12:30 PM
To: qemu-devel@nongnu.org
Subject: RE: [Qemu-devel] [PATCH, RFC] USB OHCI isochronous transfers
support

So this is isochronous for usb 2.0?

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Arnon Gilboa
Sent: Monday, October 22, 2007 12:19 PM
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH, RFC] USB OHCI isochronous transfers
support

Hi,

The attached patch adds isochronous transfers support to the OHCI
emulation, similarly to the UHCI patch pushed two weeks ago.

In order to use ohci instead of uhci, replace the following line in
pc.c:
usb_uhci_piix3_init(pci_bus, piix3_devfn + 2);

With:
usb_ohci_init_pci(pci_bus, 3, piix3_devfn + 2);

Any comments?






Re: [Qemu-devel] [PATCH, RFC] USB OHCI isochronous transfers support

2007-10-22 Thread Hetz Ben Hamo
Hi Itamar,

On 22/10/2007, Itamar Heim <[EMAIL PROTECTED]> wrote:
>
> So this is isochronous for usb 2.0?
>

last I checked, OHCI is for USB 1.x, EHCI was for 2.0.

Thanks,
Hetz
-- 
Skepticism is the lazy person's default position.
my blog (hebrew): http://benhamo.org


RE: [Qemu-devel] [PATCH, RFC] USB OHCI isochronous transfers support

2007-10-22 Thread Itamar Heim
So this is isochronous for usb 2.0?

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Arnon Gilboa
Sent: Monday, October 22, 2007 12:19 PM
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH, RFC] USB OHCI isochronous transfers
support

Hi,

The attached patch adds isochronous transfers support to the OHCI
emulation, similarly to the UHCI patch pushed two weeks ago.

In order to use ohci instead of uhci, replace the following line in
pc.c:
usb_uhci_piix3_init(pci_bus, piix3_devfn + 2);

With:
usb_ohci_init_pci(pci_bus, 3, piix3_devfn + 2);

Any comments?




Re: [Qemu-devel] [PATCH, RFC] USB OHCI isochronous transfers support

2007-10-22 Thread Paul Brook
On Monday 22 October 2007, Arnon Gilboa wrote:
> Hi,
>
> The attached patch adds isochronous transfers support to the OHCI
> emulation, similarly to the UHCI patch pushed two weeks ago.

> +uint16_t offset[8];
> +};

> +static inline int ohci_read_iso_td(uint32_t addr, struct ohci_iso_td *td)
> +{
> +return get_dwords(addr, (uint32_t *)td, sizeof(*td) >> 2);
> +}

This is wrong. It will break on big-endian hosts.
set_dwords only DTRT if all the structure fields are 32-bit.

Paul




Re: [Qemu-devel] [PATCH, RFC] USB OHCI isochronous transfers support

2007-10-22 Thread Michal Schulz
On Monday 22 October 2007, Arnon Gilboa wrote:

> Good idea

Let me quote my ancient email (sent on this list on 29.03.2007 23:34):

> Hello. I've made small patch for qemu, which adds a new command line
> option - > the "-ohci". It instructs qemu that the OHCI controller should be
> emulated instead of the default UHCI. What do you think about it?

-- 
Michal Schulz
diff -Naur qemu-0.9.0/hw/pc.c qemu-0.9.0-ohci-patch/hw/pc.c
--- qemu-0.9.0/hw/pc.c	2007-02-06 00:01:54.0 +0100
+++ qemu-0.9.0-ohci-patch/hw/pc.c	2007-03-29 15:43:18.0 +0200
@@ -695,7 +695,10 @@
 cmos_init(ram_size, boot_device, bs_table);
 
 if (pci_enabled && usb_enabled) {
-usb_uhci_init(pci_bus, piix3_devfn + 2);
+if (use_ohci_instead)
+	usb_ohci_init(pci_bus, 3, -1);
+	else
+usb_uhci_init(pci_bus, piix3_devfn + 2);
 }
 
 if (pci_enabled && acpi_enabled) {
diff -Naur qemu-0.9.0/vl.c qemu-0.9.0-ohci-patch/vl.c
--- qemu-0.9.0/vl.c	2007-02-06 00:01:54.0 +0100
+++ qemu-0.9.0-ohci-patch/vl.c	2007-03-29 15:44:52.0 +0200
@@ -155,6 +155,7 @@
 int win2k_install_hack = 0;
 #endif
 int usb_enabled = 0;
+int use_ohci_instead = 0;
 static VLANState *first_vlan;
 int smp_cpus = 1;
 const char *vnc_display;
@@ -6048,6 +6049,7 @@
"-win2k-hack use it when installing Windows 2000 to avoid a disk full bug\n"
 #endif
"-usbenable the USB driver (will be the default soon)\n"
+	   "-ohci   use the OHCI controller instead of the UHCI\n"
"-usbdevice name add the host or guest USB device 'name'\n"
 #if defined(TARGET_PPC) || defined(TARGET_SPARC)
"-g WxH[xDEPTH]  Set the initial graphical resolution and depth\n"
@@ -6198,6 +6200,7 @@
 QEMU_OPTION_kernel_kqemu,
 QEMU_OPTION_win2k_hack,
 QEMU_OPTION_usb,
+QEMU_OPTION_ohci,
 QEMU_OPTION_usbdevice,
 QEMU_OPTION_smp,
 QEMU_OPTION_vnc,
@@ -6284,6 +6287,7 @@
 
 /* temporary options */
 { "usb", 0, QEMU_OPTION_usb },
+{ "ohci", 0, QEMU_OPTION_ohci },
 { "cirrusvga", 0, QEMU_OPTION_cirrusvga },
 { "no-acpi", 0, QEMU_OPTION_no_acpi },
 { "no-reboot", 0, QEMU_OPTION_no_reboot },
@@ -6917,6 +6921,9 @@
 case QEMU_OPTION_usb:
 usb_enabled = 1;
 break;
+	case QEMU_OPTION_ohci:
+	use_ohci_instead = 1;
+		break;
 case QEMU_OPTION_usbdevice:
 usb_enabled = 1;
 if (usb_devices_index >= MAX_USB_CMDLINE) {
diff -Naur qemu-0.9.0/vl.h qemu-0.9.0-ohci-patch/vl.h
--- qemu-0.9.0/vl.h	2007-02-06 00:01:54.0 +0100
+++ qemu-0.9.0-ohci-patch/vl.h	2007-03-29 15:42:19.0 +0200
@@ -155,6 +155,7 @@
 extern int kqemu_allowed;
 extern int win2k_install_hack;
 extern int usb_enabled;
+extern int use_ohci_instead;
 extern int smp_cpus;
 extern int no_quit;
 extern int semihosting_enabled;


RE: [Qemu-devel] [PATCH, RFC] USB OHCI isochronous transfers support

2007-10-22 Thread Arnon Gilboa
Good idea 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Dor Laor
Sent: Monday, October 22, 2007 12:45 PM
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH, RFC] USB OHCI isochronous transfers
support

Arnon Gilboa wrote:
>
> Hi,
>
> The attached patch adds isochronous transfers support to the OHCI 
> emulation, similarly to the UHCI patch pushed two weeks ago.
>
> In order to use ohci instead of uhci, replace the following line in
> pc.c:
> usb_uhci_piix3_init(pci_bus, piix3_devfn + 2);
>
> With:
> usb_ohci_init_pci(pci_bus, 3, piix3_devfn + 2);
>
> Any comments?
>
What about making it dynamically set by cmdline?
Dor






Re: [Qemu-devel] [PATCH, RFC] USB OHCI isochronous transfers support

2007-10-22 Thread Dor Laor

Arnon Gilboa wrote:


Hi,

The attached patch adds isochronous transfers support to the OHCI
emulation, similarly to the UHCI patch pushed two weeks ago.

In order to use ohci instead of uhci, replace the following line in
pc.c:
usb_uhci_piix3_init(pci_bus, piix3_devfn + 2);

With:
usb_ohci_init_pci(pci_bus, 3, piix3_devfn + 2);

Any comments?


What about making it dynamically set by cmdline?
Dor




[Qemu-devel] [PATCH, RFC] USB OHCI isochronous transfers support

2007-10-22 Thread Arnon Gilboa
Hi,

The attached patch adds isochronous transfers support to the OHCI
emulation, similarly to the UHCI patch pushed two weeks ago.

In order to use ohci instead of uhci, replace the following line in
pc.c:
usb_uhci_piix3_init(pci_bus, piix3_devfn + 2);

With:
usb_ohci_init_pci(pci_bus, 3, piix3_devfn + 2);

Any comments?


usb-ohci-iso.patch
Description: usb-ohci-iso.patch