History | View | Annotate | Download (52.7 kB)
usb: fix port reset
commit 891fb2cd4592b6fe76106a69e0ca40efbf82726a removed the implicitdetach before (re-)attaching in usb_attach(). Some usb host controllersused that behavior though to do a port reset by a detach+attachsequence.
This patch establishes old behavior by adding a new usb_reset() function...
hw/usb-ohci: Fix OHCI_TD_T1 bit position definition
The OHCI Transfer Descriptor T (DataToggle) bits are 24 and 25;fix an error which accidentally overlaid them both on the same bit.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb-ohci: Honour endpoint maximum packet size
Honour the maximum packet size for endpoints; this applies whensending non-isochronous data and means we transfer only asmuch as the endpoint allows, leaving the transfer descriptoron the list for another go next time around. This allows...
pci: interrupt pin documentation update
Fix up some erroneous comments in code:interrupt pins are named A-D, theinterrupt pin register is always readonlyand isn't zeroed out on reset.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
usb: claim port at device initialization time.
This patch makes qemu assign a port when creating the device, not whenattaching it. For most usb devices this isn't a noticable differencebecause they are in attached state all the time.
The change affects usb-host devices which live in detached state while...
pci: rename pci_register_bar_region() to pci_register_bar()
Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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 topass in the buffer size and second to return the number of...
usb-ohci: convert to MemoryRegion
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
usb-ohci: raise interrupt on attach
Got lost in commit 618c169b577db64ac6589ad48825d2e11760d1a6,add it back in. Also fix codestyle while we are at it.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: Move (initial) call of usb_port_location to usb_fill_port
Cleanup / preparation patch for companion controller support. Note thatas a "side-effect" this patch also fixes the milkymist-softusb controllernot having a port_location set for its ports....
usb: Make port wakeup and complete ops take a USBPort instead of a Device
This makes them consistent with the attach and detach ops, and in generalit makes sense to make portops take a port as argument. This also makesadding support for a companion controller easier / cleaner....
usb: Replace device_destroy bus op with a child_detach port op
Note this fixes 2 things in one go, first of all the device_destroy busop should be a device_detach bus op, as pending async packets from thedevice should be cancelled on detach not on destroy....
usb-ohci: Add support for being a companion controller
To use as a companion controller, use pci-ohci as device and set themasterbus and num-ports properties, ie:
-device usb-ehci,addr=0b.1,multifunction=on,id=ehci0-device pci-ohci,addr=0b.0,multifunction=on,masterbus=ehci0.0,num-ports=4...
hw/usb-ohci.c: Fix handling of remote wakeup corner cases
Correct a number of minor errors in the OHCI wakeup implementation: * when the port is suspended but the controller is not, raise RHSC * when the controller is suspended but the port is not, raise RD...
Merge remote-tracking branch 'mst/for_anthony' into staging
Conflicts: hw/usb-uhci.c
Merge remote-tracking branch 'origin/master' into pci
Conflicts: hw/virtio-pci.c
hw/usb-ohci.c: Ignore writes to HcPeriodCurrentED register
HcPeriodCurrentED is read-only, but Linux writes to it anyway; silentlyignore this rather than printing a warning message.
(Specifically, drivers/usb/host/ohci-hub.c:ohci_rh_resume() writes a0, in at least kernels 2.6.25 through 2.6.39.)...
hw/usb-ohci.c: Implement remote wakeup
Implement the wakeup callback in the OHCI USBPortOps, so that whena downstream device wakes up it correctly causes the OHCI controllerto come out of suspend.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
usb: cancel async packets on unplug
This patch adds USBBusOps struct with (for now) only a single callbackwhich is called when a device is about to be destroyed. The USB Hostadapters are implementing this callback and use it to cancel any asyncrequests which might be in flight before the device actually goes away....
hw/usb-ohci.c: convert to PCIDeviceInfo to initialize ids
use PCIDeviceInfo to initialize ids.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
usb: add usb_handle_packet
Add a usb_handle_packet function, put it into use everywhere.Right now it just calls dev->info->handle_packet(), that willchange in future patches though.
Merge remote branch 'origin/master' into pci
Conflicts: exec.c
ohci: get ohci state via container_of()
usb: move complete callback to port ops
Replace cpu_physical_memory_rw were possible
Using cpu_physical_memory_read, cpu_physical_memory_write and ldub_physimproves readability and allows removing some type casts.
lduw_phys and ldl_phys were not used because both require alignedaddresses. Therefore it is not possible to simply replace existing...
usb-ohci: convert to pci_register_bar_simple()
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
change all other clock references to use nanosecond resolution accessors
This was done with:
sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \ $(git grep -l 'qemu_get_clock\>' ) sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \ $(git grep -l 'qemu_new_timer\>' )...
usb: zap pdev from usbport
It isn't needed any more.
usb: keep track of physical port address.
Add a path string to USBPort. Add usb_port_location() function to setthe physical location of the usb port. Update all drivers implementingusb ports to call it. Update the monitor commands to print it. Wind it...
usb: add speed mask to ports
Add a field to usb ports indicating the speed(s) they areable to handle.
usb: create USBPortOps, move attach there.
Create USBPortOps struct, move the attach function to that struct.
usb: rework attach/detach workflow
Add separate detach callback to USBPortOps, splituhci/ohci/musb/usbhub attach functions into two.
Move common code to the usb_attach() function, onlythe hardware-specific bits remain in the attach/detachcallbacks.
Keep track of the port it is attached to for each usb device....
Record which USBDevice USBPort belongs too.
Ports on root hub will have NULL here. This is needed to reconstructpath from device to its root hub to build device path.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
usb_ohci: Always use little endian
This patch replaces explicit bswaps with endianness hints to themmio layer.
Because we don't depend on the target endianness anymore, we can alsomove the driver over to Makefile.objs.
Signed-off-by: Alexander Graf <agraf@suse.de>...
Add endianness as io mem parameter
As stated before, devices can be little, big or native endian. Thetarget endianness is not of their concern, so we need to push thingsdown a level.
This patch adds a parameter to cpu_register_io_memory that allows adevice to choose its endianness. For now, all devices simply choose...
pci: Replace unneeded type casts in calls of pci_register_bar
There is no need for these type casts (as other existingcode shows). So re-write the first argument withouttype cast (and remove a related TODO comment).
Cc: Michael S. Tsirkin <mst@redhat.com>...
OHCI address decoding fix
Ignore high address bits when PCI memory window is not mapped on a pageboundary.
Signed-off-by: Paul Brook <paul@codesourcery.com>
usb: remove dead assignments, spotted by clang analyzer
Value stored is never read.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix harmless if statements with empty body, spotted by clang
These clang errors are harmless but worth fixing: CC ppc-softmmu/usb-ohci.o/src/qemu/hw/usb-ohci.c:1104:59: error: if statement has empty body [-Wempty-body] ohci->ctrl_head, ohci->ctrl_cur);...
OHCI qdev conversion
Convert remaining OHCI devices to QDEV interface.
Revert "Compile usb-ohci only once"
This reverts commit f1698408f1dcb7548a21828a0b1e2b530fae3af3.
PCI is always little-endian. Having a user-visible "be" property is justplain wrong.
usb: class specific interface requests
Mass Storage Reset and Get Max LUN are class specific requests, butthey were not marked as such in hw/usb-msd.c, moved thereforeClassInterfaceRequest and ClassInterfaceOutRequest from hw/usb-net.cto hw/usb.h.Furthermore there was a problem in hw/usb-ohci.c when using DEBUG...
Compile usb-ohci only once
Push TARGET_WORDS_BIGENDIAN dependency to board level.
Do not use dprintf
dprintf is already claimed by POSIX1, and on at least one systemis implemented as a macro
[1] http://www.opengroup.org/onlinepubs/9699919799/functions/dprintf.html
Signed-off-by: malc <av1474@comtv.ru>
usb-ohci: symbolic names for pci registers
No functional changes. I verified that the generated binarydoes not change.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Juan Quintela <quintela@redhat.com>Acked-by: Glauber Costa <glommer@gmail.com>
qdev: Replace device names containing whitespace
Device names with whitespace require quoting in the shell and in themonitor. Some of the offenders are also overly long. Some have amore convenient alias, some don't.
The place for verbose device names is DeviceInfo member desc. The...
pci: pci.h cleanup: move out stuff not in pci.c
pci.h declares some functions which aren'tdefined in pci.h. Clean up moving thingsto appropriate headers, and update all users.
pci: introduce pcibus_t to represent pci bus address/size instead of uint32_t
This patch is preliminary for 64 bit BAR support.Introduce dedicated type, pcibus_t, to represent pci bus address/sizeinstead of uint32_t.Later this type will be changed to uint64_t....
pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.h
make constants for pci base address match pci_regs.h byrenaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Michael S. Tsirkin <mst@redhat.com>...
v3: don't call reset functions on cpu initialization
There is absolutely no need to call reset functions when initializingdevices. Since we are already registering them, calling qemu_system_reset()should suffice. Actually, it is what happens when we reboot the machine,...
switch usb bus to inplace allocation.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.
The naming convention is goofy and it causes a massive merge problem. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Unexport ticks_per_sec variable. Create get_ticks_per_sec() function
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev/usb: convert ohci.
Drop num_ports argument for usb_ohci_init_pci(), everybodycalls it with num_ports == 3, so it is pointless.
Convert ohci pci device into qdev.TODO: convert non-pci ohci adapters.
You can add a OHCI USB Controller to your virtual pc now using...
qdev/usb: add usb bus support to qdev, convert drivers.
TODO: * make the rest of qemu aware of usb busses and kill the FIXMEs added by this patch....
qdev/usb: make qemu aware of usb busses.
Move usb code from vl.c to usb-bus.c and make it use the new datastructures added by qdev conversion. qemu usb core should be ableto handle multiple USB busses just fine now (untested though).
Kill some usb_*_init() legacy functions, use usb_create_simple()...
usb-ohci: Change casts to DO_UPCAST() for OHCIPCIState
Make CPURead/WriteFunc structure 'const'
Fix most warnings (errors with -Werror) when debugging is enabled
I used the following command to enable debugging:perl -p -i -e 's/^\/\/#define DEBUG/#define DEBUG/g' * /* *//*
Update to a hopefully more future proof FSF address
usb-ohci: Fix endianness issue
This fixes a possible endianness issue in the usb-ohci hw module.hcca.frame and ohci->frame_number are 16bit, so use cpu_to_le16().
Signed-off-by: Michael Buesch <mb@bu3sch.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Revert "Introduce reset notifier order"
This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (andupdates later added users of qemu_register_reset), we solved theproblem it originally addressed less invasively.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
Rename pci_register_io_region() to pci_register_bar()
This function is used to manage a PCI BAR, so make the more genericpci_register_io_region() available to other uses.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Remove io_index argument from cpu_register_io_memory()
The parameter is always zero except when registering the three internalio regions (ROM, unassigned, notdirty). Remove the parameter to reducethe API's power, thus facilitating future change.
Signed-off-by: Avi Kivity <avi@redhat.com>...
Introduce reset notifier order
Add the parameter 'order' to qemu_register_reset and sort callbacks onregistration. On system reset, callbacks with lower order will beinvoked before those with higher order. Update all existing users to thestandard order 0....
Adds SM501 usb host emulation feature.It makes usb keyboard available for sh4/r2d system emulation.
The changes for "hw/usb-ohci.c" are as follows. - 'localmem_base' is introduced as OHCIState struct member. SM501 has a local memory, and it is used to pass and receive data with...
Add and use remaining #defines for PCI device IDs (Stuart Brady)
This patch adds and uses #defines for the remaining hardcoded PCIdevice IDs. It also moves definitions taken from linux/pci_ids.hinto a separate header (hw/pci_ids.h), removes the 'RTL' from...
Add and use #defines for PCI device classes
This patch adds and uses #defines for PCI device classes and subclases,using a new pci_config_set_class() function, similar to the recentlyadded pci_config_set_vendor_id() and pci_config_set_device_id().
Change since v1: fixed compilation of hw/sun4u.c...
Define PCI vendor and device IDs in pci.h (Stuart Brady)
This patch defines PCI vendor and device IDs in pci.h (matching thosefrom Linux's pci_ids.h), and uses those definitions where appropriate.
Change from v1: Introduces pci_config_set_vendor_id() / pci_config_set_device_id()...
USB OHCI: add support for big endian targets
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6368 c046a42c-6fe2-441c-8c8c-71466251a162
Update FSF address in GPL/LGPL boilerplate
The attached patch updates the FSF address in the GPL/LGPL boilerplatein most GPL/LGPLed files, and also in COPYING.LIB.
Signed-off-by: Stuart Brady <stuart.brady@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>...
Change MMIO callbacks to use offsets, not absolute addresses.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5849 c046a42c-6fe2-441c-8c8c-71466251a162
Fix warnings that would be caused by gcc flag -Wwrite-strings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5206 c046a42c-6fe2-441c-8c8c-71466251a162
Fix most warnings that would be caused by gcc flag -Wundef
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5173 c046a42c-6fe2-441c-8c8c-71466251a162
Add statics and missing #includes for prototypes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3683 c046a42c-6fe2-441c-8c8c-71466251a162
Break up vl.h.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
Fix signed/unsigned comparisons in OHCI host.ADS7846 is partially compatible with TSC2046.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3635 c046a42c-6fe2-441c-8c8c-71466251a162
OHCI USB isochronous transfers support (Arnon Gilboa).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3493 c046a42c-6fe2-441c-8c8c-71466251a162
Fix memory corruption after OHCI reset, by Ed Swierk.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3086 c046a42c-6fe2-441c-8c8c-71466251a162
Fix off-by-one memory region sizes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2931 c046a42c-6fe2-441c-8c8c-71466251a162
Unify IRQ handling.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2635 c046a42c-6fe2-441c-8c8c-71466251a162
OHCI USB PXA support (Andrzej Zaborowski).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2490 c046a42c-6fe2-441c-8c8c-71466251a162
SCSI and USB async IO support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2107 c046a42c-6fe2-441c-8c8c-71466251a162
OHCI large packet fix.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1939 c046a42c-6fe2-441c-8c8c-71466251a162
Fix USB root hub hotplugging.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1931 c046a42c-6fe2-441c-8c8c-71466251a162
OHCI USB host emulation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1928 c046a42c-6fe2-441c-8c8c-71466251a162