summaryrefslogtreecommitdiffstats
path: root/hw/usb-serial.c
Commit message (Collapse)AuthorAgeFilesLines
* usb-serial: Fail instead of crash when chardev is missingMarkus Armbruster2010-06-301-0/+5
| | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* usb: remove dead assignments, spotted by clang analyzerBlue Swirl2010-04-251-1/+1
| | | | | | Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* error: Replace qemu_error() by error_report()Markus Armbruster2010-03-161-4/+4
| | | | | | | | | | | | | 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 IFF_VNET_HDR available" (all three versions). There's one place that passes arguments without newlines intentionally: load_vmstate(). Fix it up.
* error: Move qemu_error & friends into their own headerMarkus Armbruster2010-03-161-0/+1
|
* Fix -usbdevice crashPaul Brook2010-02-251-0/+3
| | | | | | | | 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 <paul@codesourcery.com>
* segfault due to buffer overrun in usb-serialDavid S. Ahern2010-02-101-6/+22
| | | | | | | | | | | | 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 next element after the receive buffer (recv_ptr) to get overwritten with random data. Signed-off-by: David Ahern <daahern@cisco.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix QEMU_WARN_UNUSED_RESULTKevin Wolf2010-01-191-2/+2
| | | | | | | | | | | | 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 results. These calls are changed to qdev_init_nofail to avoid build failures. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: Replace device names containing whitespaceMarkus Armbruster2009-12-121-6/+4
| | | | | | | | | | | | 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 name should be short & sweet. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: Separate USB product description from qdev nameMarkus Armbruster2009-12-121-0/+2
| | | | | | | | | | | | 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 the value is still the same. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb-serial and braille: use qdev for -usbdeviceGerd Hoffmann2009-10-301-20/+65
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: rename CHR_EVENT_RESET to CHR_EVENT_OPENEDAmit Shah2009-10-211-1/+1
| | | | | | | | | 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 <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb: hook unplug into qdev, cleanups + fixes.Gerd Hoffmann2009-10-051-1/+0
| | | | | | | | | | | | | | | 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. Unplugging a usb hub works now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev/usb: add usb bus support to qdev, convert drivers.Gerd Hoffmann2009-09-091-16/+32
| | | | | | | | | | | | | | * 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. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb-serial: implement break event.Jason Wessel2009-05-221-2/+10
| | | | | | | | | | | | | | 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 controller with the serial break status set. This was tested against a linux development image which enables sysrq via a serial break on the ftdi usb console. Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
* Replace gcc variadic macro extension with C99 versionBlue Swirl2009-05-131-3/+3
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hw: remove error handling from qemu_malloc() callers (Avi Kivity)aliguori2009-02-051-2/+0
| | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6529 c046a42c-6fe2-441c-8c8c-71466251a162
* add an init function parameter to qemu_chr_open()aurel322009-01-181-1/+1
| | | | | | | | | And use it for the malta emulation. Fix segfault introduced in revision 6352. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6365 c046a42c-6fe2-441c-8c8c-71466251a162
* Implement "info chardev" command. (Gerd Hoffmann)aliguori2008-10-311-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 filename to each character device. By default it just copyes the filename passed in. Individual drivers can fill in something else though. qemu_chr_open_pty() sets the filename to name of the pseudo tty allocated. Output looks like this: (qemu) info chardev monitor: filename=unix:/tmp/run.sh-26827/monitor,server,nowait serial0: filename=unix:/tmp/run.sh-26827/console,server serial1: filename=pty:/dev/pts/5 parallel0: filename=vc:640x480 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5575 c046a42c-6fe2-441c-8c8c-71466251a162
* [PATCH] usb-serial: Fix data corruption with usb serial emulationaurel322008-09-171-4/+2
| | | | | | | | | | | | | | | * 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 reset with: s->recv_ptr = (s->recv_ptr + len) % RECV_BUF; Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5242 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix some warnings that would be generated by gcc -Wmissing-prototypesblueswir12008-08-171-3/+3
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5022 c046a42c-6fe2-441c-8c8c-71466251a162
* usb-serial: add support for modem linesaurel322008-08-131-9/+45
| | | | | | | Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4998 c046a42c-6fe2-441c-8c8c-71466251a162
* Change the usb-serial product ID to a more widely recognised value (Samuel ↵balrog2008-01-191-1/+1
| | | | | | | | | | 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
* USB-to-serial device (Samuel Thibault).balrog2008-01-141-0/+549
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3914 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud