aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-01-11usb: add attach callbackGerd Hoffmann2-1/+11
Add handle_attach() callback to USBDeviceInfo which is called by the generic package handler when the device is attached to the usb bus (i.e. plugged into a port). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb: add speed mask to portsGerd Hoffmann6-6/+18
Add a field to usb ports indicating the speed(s) they are able to handle. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb: hid: change serial number to "42".Gerd Hoffmann1-1/+1
It would be nice to have some way to signal our hid devices support remote wakeup. There is a descriptor bit for that of course. Problem with using is one is that older qemu versions used to set the bit even though they did *not* support remote wakeup. Bummer. This patch changes the serial number of our hid devices from "1" to "42" to signal "it is safe to enable remote wakeup". The serial number was choosen because it isn't used for anything and it is available in sysfs so it is easy to match it using udev rules like this: ACTION=="add", SUBSYSTEM=="usb", \ ATTR{product}=="QEMU USB Tablet", ATTR{serial}=="42", \ RUN+="usb_enable_autosuspend %p" Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb: hid: remote wakeup support.Gerd Hoffmann1-0/+2
Add usb_wakeup() call to the hid driver so remote wakeup actually works. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb: hub: remote wakeup support.Gerd Hoffmann1-0/+12
This patch makes the usb hub handle remote wakeup requests from devices properly by updating the port status register and forwarding the wakeup to the upstream port. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb: uhci: remote wakeup support.Gerd Hoffmann1-2/+21
Add support for remote wakeup to the UHCI adapter. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb: add usb_wakeup() + wakeup callback to port opsGerd Hoffmann2-0/+9
Add wakeup callback to port ops for remote wakeup handling. Also add a usb_wakeup() function for devices which want trigger a remote wakeup. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb: rework attach/detach workflowGerd Hoffmann6-133/+122
Add separate detach callback to USBPortOps, split uhci/ohci/musb/usbhub attach functions into two. Move common code to the usb_attach() function, only the hardware-specific bits remain in the attach/detach callbacks. Keep track of the port it is attached to for each usb device. [ v3: fix tyops in usb-musb.c ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb: create USBPortOps, move attach there.Gerd Hoffmann7-10/+30
Create USBPortOps struct, move the attach function to that struct. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb: move remote wakeup handling to common codeGerd Hoffmann9-155/+31
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 <kraxel@redhat.com>
2011-01-11usb: move USB_REQ_{GET,SET}_CONFIGURATION handling to common codeGerd Hoffmann11-93/+66
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 handling to be moved to common code. For most drivers the conversion is trivial ad they support a single configuration only anyway. One exception is bluetooth where some device-specific setup code runs after get/set configuration. The other is usb-net which actually has two configurations so the the code to check for the active configuration has been adapted. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb: move USB_REQ_SET_ADDRESS handling to common codeGerd Hoffmann9-29/+7
USB_REQ_SET_ADDRESS handling is identical in *all* emulated devices. Move it to common code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb network: use new descriptor infrastructure.Gerd Hoffmann1-244/+209
Switch the usb network driver over to the new descriptor infrastructure. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb storage: serial number supportGerd Hoffmann1-0/+6
If a serial number is present for the drive fill it into the usb serialnumber string descriptor. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb descriptors: add settable strings.Gerd Hoffmann4-9/+57
This patch allows to set usb descriptor strings per device instance. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb hub: use new descriptor infrastructure.Gerd Hoffmann1-63/+78
Switch the usb hub driver over to the new descriptor infrastructure. It also removes the nr_ports variable and MAX_PORTS define and introduces a NUM_PORTS define instead. The numver of ports was (and still is) fixed at 8 anyway. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb bluetooth: use new descriptor infrastructure.Gerd Hoffmann1-271/+202
Switch the usb bluetooth driver over to the new descriptor infrastructure. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb wacom: use new descriptor infrastructure.Gerd Hoffmann1-105/+73
Switch the usb wavom driver over to the new descriptor infrastructure. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb storage: use new descriptor infrastructure.Gerd Hoffmann1-104/+63
Switch the usb storage driver over to the new descriptor infrastructure. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb serial: use new descriptor infrastructure.Gerd Hoffmann1-117/+83
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 only difference between the serial and the braille device is the vendor+product id. Of course the serial and braille devices keep their different IDs, but they can't be overritten from the command line any more. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb hid: use new descriptor infrastructure.Gerd Hoffmann1-243/+205
Switch the usb hid drivers (keyboard, mouse, tablet) over to the new descriptor infrastructure. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb: data structs and helpers for usb descriptors.Gerd Hoffmann5-1/+339
This patch adds hw/usb-desc.[ch] files. They carry data structures for various usb descriptors and helper functions to generate usb packets from the structures. The intention is to have a internal representation of the device desription which is more usable than the current char array blobs, so we can have common code handle common usb device emulation using the device description. The usage of this infrastructure is optional for usb drivers as there are cases such as pass-through where it probably isn't very useful. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-11usb: update MAINTAINERSGerd Hoffmann1-2/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-10cris: Remove unused orig_flagsEdgar E. Iglesias1-2/+2
Based on a patch by Blue Swirl <blauwirbel@gmail.com>. Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-10cris: Allow more TB chaining for crisv10Edgar E. Iglesias2-14/+33
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-10cris: Support disassembly of crisv10Edgar E. Iglesias3-4/+15
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-10Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori16-35/+410
2011-01-10slirp: fix unaligned access in bootp codeAurelien Jarno1-15/+17
Slirp code tries to be smart an avoid data copy by using pointer to the data. This solution leads to unaligned access, in this case preq_addr, which is a 32-bit long structure. There is no real point of avoiding data copy in a such case, as the value itself is smaller or the same size as a pointer. The patch replaces pointers to the preq_addr structure by the strcture itself, and use the address 0.0.0.0 if no address has been requested (this is not a valid address in such a request). It compares it with htonl(0L) for correctness reasons, in case a code checker look for such mistakes. It also uses memcpy() for copying the data, which takes care of alignement issues. This fixes an unaligned access on IA64 host while requesting a DHCP address. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-10bswap.h: add cpu_to_be64wu()Aurelien Jarno1-0/+15
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-10tcg/arm: improve constant loadingAurelien Jarno1-18/+21
Improve constant loading in two ways: - On all ARM versions, it's possible to load 0xffffff00 = -0x100 using the mvn rd, #0. Fix the conditions. - On <= ARMv6 versions, where movw and movt are not available, load the constants using mov and orr with rotations depending on the constant to load. This is very useful for example to load constants where the low byte is 0. This reduce the generated code size by about 7%. Also fix the coding style at the same time. Cc: Andrzej Zaborowski <balrog@zabor.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-10tcg/ia64: remove an unnecessary stop bitAurelien Jarno1-1/+1
Spotted by Richard Henderson. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-10target-sh4: improve TLBAurelien Jarno1-21/+44
SH4 is using 16-bit instructions which means most of the constants are loaded through a constant pool at the end of the subroutine. The same memory page is therefore accessed in exec and read mode. With the current implementation, a QEMU TLB entry is set to read or read/write mode after an UTLB search and to exec mode after an ITLB search, which causes a lot of TLB exceptions to switch from read or read/write to exec and vice versa. This patch optimizes that by already setting the QEMU TLB entry in read or read/write mode when an UTLB entry is copied into ITLB (during an ITLB miss). This improve the emulation speed by about 14%. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-09target-sh4: implement writes to mmaped ITLBAurelien Jarno3-0/+23
Some Linux kernels seems to implement ITLB/UTLB flushing through by writing all TLB entries through the memory mapped interface instead of writing one to MMUCR.TI. Implement memory mapped ITLB write interface so that such kernels can boot. This fixes https://bugs.launchpad.net/bugs/700774 . Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-09tcg: fix typo in readmeMike Frysinger1-1/+1
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-09tcg/README: Spelling fixesStefan Weil1-4/+4
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-09qemu-tech: Spelling fixesStefan Weil1-2/+2
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-09qemu-doc: Spelling fixesStefan Weil1-10/+10
neccessary -> necessary Keberos -> Kerberos emuilated -> emulated transciever -> transceiver emulaton -> emulation inital -> initial MingGW -> MinGW Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-09qemu-doc: Add missing blanksStefan Weil1-2/+2
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-09qemu-doc: Add missing menu entryStefan Weil1-0/+2
Each @section should have a menu entry and a @node entry. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-09qemu-doc: Clean whitespaceStefan Weil1-2/+2
Remove blanks at line endings. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-09usb-bsd: fix a file descriptor leakBlue Swirl1-32/+39
Fix a file descriptor leak reported by cppcheck: [/src/qemu/usb-bsd.c:392]: (error) Resource leak: bfd [/src/qemu/usb-bsd.c:388]: (error) Resource leak: dfd Rearrange the code to avoid descriptor leaks. Also add braces as needed. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-09alsaaudio: add endianness support for VoiceInMichael Walle1-7/+27
Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: malc <av1474@comtv.ru>
2011-01-09ossaudio: add endianness support for VoiceInMichael Walle1-5/+15
Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: malc <av1474@comtv.ru>
2011-01-08tcg/mips: fix branch target change during code retranslationAurelien Jarno1-1/+1
TCG on MIPS was trying to avoid changing the branch offset, but didn't due to a stupid typo. Fix it. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-08tcg/arm: fix qemu_st64 for big endian targetsAurelien Jarno1-1/+1
Due to a typo, qemu_st64 doesn't properly byteswap the 32-bit low word of a 64 bit word before saving it. This patch fixes that. Acked-by: Andrzej Zaborowski <balrogg@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-08tcg/arm: fix branch target change during code retranslationAurelien Jarno1-8/+20
QEMU uses code retranslation to restore the CPU state when an exception happens. For it to work the retranslation must not modify the generated code. This is what is currently implemented in ARM TCG. However on CPU that don't have icache/dcache/memory synchronised like ARM, this requirement is stronger and code retranslation must not modify the generated code "atomically", as the cache line might be flushed at any moment (interrupt, exception, task switching), even if not triggered by QEMU. The probability for this to happen is very low, and depends on cache size and associativiy, machine load, interrupts, so the symptoms are might happen randomly. This requirement is currently not followed in tcg/arm, for the load/store code, which basically has the following structure: 1) tlb access code is written 2) conditional fast path code is written 3) branch is written with a temporary target 4) slow path code is written 5) branch target is updated The cache lines corresponding to the retranslated code is not flushed after code retranslation as the generated code is supposed to be the same. However if the cache line corresponding to the branch instruction is flushed between step 3 and 5, and is not flushed again before the code is executed again, the branch target is wrong. In the guest, the symptoms are MMU page fault at a random addresses, which leads to kernel page fault or segmentation faults. The patch fixes this issue by avoiding writing the branch target until it is known, that is by writing only the branch instruction first, and later only the offset. This fixes booting linux guests on ARM hosts (tested: arm, i386, mips, mipsel, sh4, sparc). Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-08Merge branch 'linux-user-for-upstream' of git://gitorious.org/qemu-maemo/qemuAurelien Jarno13-46/+238
* 'linux-user-for-upstream' of git://gitorious.org/qemu-maemo/qemu: Remove dead code for ARM semihosting commandline handling Fix commandline handling for ARM semihosted executables linux-user: Fix incorrect NaN detection in ARM nwfpe emulation softfloat: Implement floatx80_is_any_nan() and float128_is_any_nan() linux-user: Implement FS_IOC_FIEMAP ioctl linux-user: Support ioctls whose parameter size is not constant linux-user: Implement sync_file_range{,2} syscalls
2011-01-07Remove dead code for ARM semihosting commandline handlingWolfgang Schildbach4-6/+0
There are some bits in the code which were used to store the commandline for the semihosting call. These bits are now write-only and can be removed. Signed-off-by: Wolfgang Schildbach <wschi@dolby.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2011-01-07Fix commandline handling for ARM semihosted executablesWolfgang Schildbach1-30/+49
Use the copy of the command line that loader_build_argptr() sets up in guest memory as the command line to return from the ARM SYS_GET_CMDLINE semihosting call. Previously we were using a pointer to memory which had already been freed before the guest program started. This fixes https://bugs.launchpad.net/qemu/+bug/673613 . Signed-off-by: Wolfgang Schildbach <wschi@dolby.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2011-01-07linux-user: Fix incorrect NaN detection in ARM nwfpe emulationPeter Maydell1-7/+7
The code in the linux-user ARM nwfpe emulation was incorrectly checking only for quiet NaNs when it should have been checking for any kind of NaN. This is probably because the code in question was taken from the Linux kernel, whose copy of the softfloat library had been modified so that float*_is_nan() returned true for all NaNs, not just quiet ones. The qemu equivalent function is float*_is_any_nan(), so use that. NB that this code is really obsolete since nobody uses FPE for actual arithmetic now; this is just cleanup following the recent renaming of the NaN related functions. Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>