Statistics
| Branch: | Revision:

root / hw / usb-serial.c @ 079d0b7f

History | View | Annotate | Download (17.1 kB)

# Date Author Comment
7f74a56b 02/10/2012 12:31 pm Gerd Hoffmann

usb: kill handle_packet callback

All drivers except usb-hub use usb_generic_handle_packet. The only
reason the usb hub has its own function is that it used to be called
with packets which are intended for downstream devices. With the new,
separate device lookup step this doesn't happen any more, so the need...

079d0b7f 02/10/2012 12:31 pm Gerd Hoffmann

usb: Set USBEndpoint in usb_packet_setup().

With the separation of the device lookup (via usb_find_device) and
packet processing we can lookup device and endpoint before setting up
the usb packet. So we can initialize USBPacket->ep early and keep it
valid for the whole lifecycle of the USBPacket. Also the devaddr and...

39bffca2 02/03/2012 06:41 pm Anthony Liguori

qdev: register all types natively through QEMU Object Model

This was done in a mostly automated fashion. I did it in three steps and then
rebased it into a single step which avoids repeatedly touching every file in
the tree.

The first step was a sed-based addition of the parent type to the subclass...

ba02430f 02/03/2012 06:41 pm Anthony Liguori

usb: separate out legacy usb registration from type registration

Type registeration is going to get turned into a QOM call so decouple the
legacy support.

Signed-off-by: Anthony Liguori <>

62aed765 01/27/2012 06:50 pm Anthony Liguori

usb: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <>

1de14d43 01/13/2012 11:25 am Gerd Hoffmann

usb: track altsetting in USBDevice

Also handle {GET,SET}_INTERFACE in common code (usb-desc.c).

Signed-off-by: Gerd Hoffmann <>

27143a44 08/22/2011 06:17 pm Anthony Liguori

char: rename qemu_chr_open() -> qemu_chr_new()

Signed-off-by: Anthony Liguori <>

70f24fb6 08/22/2011 06:17 pm Anthony Liguori

char: rename qemu_chr_close() -> qemu_chr_delete()

Signed-off-by: Anthony Liguori <>

41084f1b 08/22/2011 06:17 pm Anthony Liguori

char: qemu_chr_ioctl() -> qemu_chr_fe_ioctl()

Signed-off-by: Anthony Liguori <>

2cc6e0a1 08/22/2011 06:17 pm Anthony Liguori

char: rename qemu_chr_write() -> qemu_chr_fe_write()

Signed-off-by: Anthony Liguori <>

9440b7e5 08/04/2011 04:51 pm Gerd Hoffmann

usb-serial: iovec support

Add full support for iovecs to usb-serial.

Signed-off-by: Gerd Hoffmann <>

4f4321c1 08/04/2011 04:51 pm Gerd Hoffmann

usb: use iovecs in USBPacket

Zap data pointer from USBPacket, add a QEMUIOVector instead.
Add a bunch of helper functions to manage USBPacket data.
Switch over users to the new interface.

Note that USBPacket->len was used for two purposes: First to
pass in the buffer size and second to return the number of...

e3745602 07/29/2011 05:39 pm Anthony Liguori

Merge remote-tracking branch 'kraxel/migration.2' into staging

8e31bf38 07/23/2011 07:26 pm Matthew Fernandez

Correct spelling of licensed

Correct typos of "licenced" to "licensed".

Reviewed-by: Stefan Weil <>
Reviewed-by: Andreas F=E4rber <>
Signed-off-by: Matthew Fernandez <>
Signed-off-by: Anthony Liguori <>

98e51ec9 07/20/2011 03:49 pm Gerd Hoffmann

usb-serial doesn't support migration

Signed-off-by: Gerd Hoffmann <>

add75088 05/26/2011 12:55 pm Brad Hards

usb: update config descriptors to identify number of interfaces

Previously we relied on the .bNumInterfaces, but that won't always be
accurate after the introduction of grouped interfaces.

Signed-off-by: Brad Hards <>
Signed-off-by: Gerd Hoffmann <>

007fd62f 05/26/2011 12:55 pm Hans de Goede

usb: Pass the packet to the device's handle_control callback

This allows using the generic usb_generic_handle_packet function from
device code which does ASYNC control requests (such as the linux host
pass through code).

Signed-off-by: Hans de Goede <>

41c6abbd 01/11/2011 04:56 pm Gerd Hoffmann

usb: move USB_REQ_SET_ADDRESS handling to common code

USB_REQ_SET_ADDRESS handling is identical in all emulated devices.
Move it to common code.

Signed-off-by: Gerd Hoffmann <>

a980a065 01/11/2011 04:56 pm Gerd Hoffmann

usb: move USB_REQ_{GET,SET}_CONFIGURATION handling to common code

This patch adds fields to the USBDevice struct for the current
speed (hard-wired to full speed for now) and current device
configuration. Also a init function is added which inializes
these fields. This allows USB_REQ_{GET,SET}_CONFIGURATION...

ed5a83dd 01/11/2011 04:56 pm Gerd Hoffmann

usb: move remote wakeup handling to common code

This patch moves setting and clearing the remote_wakeup feature
bit (via USB_REQ_{SET,CLEAR}_FEATURE) to common code. Also
USB_REQ_GET_STATUS handling is moved to common code.

Signed-off-by: Gerd Hoffmann <>

f29783f7 01/11/2011 04:56 pm Gerd Hoffmann

usb serial: use new descriptor infrastructure.

Switch the usb serial drivers (serial, braille) over to the
new descriptor infrastructure.

Note that this removes the freely configurable vendor and product id
properties. I think the only reason this was configurable is that the...

81bf96d3 06/30/2010 09:35 pm Markus Armbruster

usb-serial: Fail instead of crash when chardev is missing

Signed-off-by: Markus Armbruster <>
Acked-by: Gerd Hoffmann <>
Signed-off-by: Aurelien Jarno <>

d4c4e6fd 04/25/2010 09:23 pm Blue Swirl

usb: remove dead assignments, spotted by clang analyzer

Value stored is never read.

Signed-off-by: Blue Swirl <>

1ecda02b 03/16/2010 05:58 pm Markus Armbruster

error: Replace qemu_error() by error_report()

error_report() terminates the message with a newline. Strip it it
from its arguments.

This fixes a few error messages lacking a newline:
net_handle_fd_param()'s "No file descriptor named %s found", and
tap_open()'s "vnet_hdr=1 requested, but no kernel support for...

2f792016 03/16/2010 05:55 pm Markus Armbruster

error: Move qemu_error & friends into their own header

d44168ff 02/25/2010 03:29 pm Paul Brook

Fix -usbdevice crash

If -usbdevice is used on a machine with no USB busses, usb_create
will fail and return NULL. Patch below handles this failure gracefully
rather than crashing when we try to init the device.

Signed-off-by: Paul Brook <>

4ab4183d 02/10/2010 08:45 pm David S. Ahern

segfault due to buffer overrun in usb-serial

This fixes a segfault due to buffer overrun in the usb-serial device.
The memcpy was incrementing the start location by recv_used yet, the
computation of first_size (how much to write at the end of the buffer
before wrapping to the front) was not accounting for it. This causes the...

beb6f0de 01/20/2010 12:31 am Kevin Wolf

Fix QEMU_WARN_UNUSED_RESULT

Since commit 747bbdf7 QEMU_WARN_UNUSED_RESULT is never defined as it is
conditional on a define from config-host.h which is included only later.
Include that file earlier to get the warnings back.

Reactivating it unfortunately leads to some warnings about unused qdev_init...

06384698 12/12/2009 03:59 pm Markus Armbruster

qdev: Separate USB product description from qdev name

Using the qdev name for the product description makes for inconvenient
qdev names.

Put the product description in new USBDeviceInfo member product_desc.
Make usb_qdev_init() use it. No user or guest visible change, since...

556cd098 12/12/2009 03:59 pm Markus Armbruster

qdev: Replace device names containing whitespace

Device names with whitespace require quoting in the shell and in the
monitor. Some of the offenders are also overly long. Some have a
more convenient alias, some don't.

The place for verbose device names is DeviceInfo member desc. The...

2b0efdc3 10/30/2009 03:39 pm Gerd Hoffmann

usb-serial and braille: use qdev for -usbdevice

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

b6b8df56 10/21/2009 09:35 pm Amit Shah

char: rename CHR_EVENT_RESET to CHR_EVENT_OPENED

The char event RESET is emitted when a char device is opened.
Give it a better name.

Patchworks-ID: 35287
Signed-off-by: Amit Shah <>
Signed-off-by: Anthony Liguori <>

a8e662b5 10/05/2009 05:32 pm Gerd Hoffmann

usb: hook unplug into qdev, cleanups + fixes.

Hook into DeviceInfo->exit().

handle_destroy() must not free the state struct, this is handled
by the new usb_qdev_exit() function now.

qdev_free(usb_device) works now.

Fix usb hub to qdev_free() all connected devices on unplug....

806b6024 09/09/2009 10:55 pm Gerd Hoffmann

qdev/usb: add usb bus support to qdev, convert drivers.

  • Add USBBus. * Add USBDeviceInfo, move device callbacks here. * Add usb-qdev helper functions. * Switch drivers to qdev.

TODO: * make the rest of qemu aware of usb busses and kill the FIXMEs
added by this patch....

7e57f049 05/22/2009 06:50 pm Jason Wessel

usb-serial: implement break event.

Implement the serial break via usb serial.

The second data byte in ftdi status packet contains the break status.
The values were already defined in usb-serial.c so it was a matter of
making use of the event_trigger to form a urb to send over to the host...

001faf32 05/13/2009 08:53 pm Blue Swirl

Replace gcc variadic macro extension with C99 version

Signed-off-by: Blue Swirl <>

487414f1 02/06/2009 12:06 am aliguori

hw: remove error handling from qemu_malloc() callers (Avi Kivity)

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6529 c046a42c-6fe2-441c-8c8c-71466251a162

ceecf1d1 01/18/2009 04:08 pm aurel32

add an init function parameter to qemu_chr_open()

And use it for the malta emulation. Fix segfault introduced in
revision 6352.

Signed-off-by: Aurelien Jarno <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6365 c046a42c-6fe2-441c-8c8c-71466251a162

5ccfae10 10/31/2008 07:31 pm aliguori

Implement "info chardev" command. (Gerd Hoffmann)

This patch makes qemu keep track of the character devices in use and
implements a "info chardev" monitor command to print a list.

qemu_chr_open() sticks the devices into a linked list now. It got a new
argument (label), so there is a name for each device. It also assigns a...

8109b9b6 09/18/2008 01:04 am aurel32

[PATCH] usb-serial: Fix data corruption with usb serial emulation

  • Remove the unused send_buf variable and its constant.
  • Fix a math error
    The variables recv_ptr and recv_used are not large enough to hold
    the constant 384, which causes data corruption when the pointer is...
8fcd3692 08/17/2008 11:26 pm blueswir1

Fix some warnings that would be generated by gcc -Wmissing-prototypes

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5022 c046a42c-6fe2-441c-8c8c-71466251a162

abb8a139 08/13/2008 07:23 am aurel32

usb-serial: add support for modem lines

Signed-off-by: Samuel Thibault <>
Signed-off-by: Aurelien Jarno <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4998 c046a42c-6fe2-441c-8c8c-71466251a162

a11d070e 01/19/2008 03:00 pm balrog

Change the usb-serial product ID to a more widely recognised value (Samuel Thibault).
Implement chr_close callback for "stdio" so that it can be closed and reopened.
Free chr devices after they're closed.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3927 c046a42c-6fe2-441c-8c8c-71466251a162

a7954218 01/14/2008 05:41 am balrog

USB-to-serial device (Samuel Thibault).

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3914 c046a42c-6fe2-441c-8c8c-71466251a162