Age | Commit message (Collapse) | Author | Files | Lines |
|
The low-level cdb_* functions are now only used from within
cmdblock.c, so don't export them.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This is just code movement - no code changes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This adds basic read/write support for SD cards emulated by QEMU.
This code is not expected to work on real hardware, because the
current controller and card initialization is not robust.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Super speed hubs (usb3 spec) have specific initialization
requirements. Add the code necessary to detect and initialize these
hubs.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The floppy Programmed IO code really should yield while the controller
is busy.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The PORT_PS2_CTRLB port is only used by timers - it's just a
historical artifact that it was part of the original ps2 controller.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Some newer cards have the I/O bar at BAR 0, so we need to check
that, too, if we cannot get an address for BAR 2.
Without this patch the new 'megasas-gen2' emulation in qemu
is not detected.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Now that the usb controller drivers all support the realloc method,
use that for all pipe allocations, reallocations, and freeing. This
gives the driver more control over the pipe life cycle.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Support alloc, update, and free from the single exported function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Support alloc, update, and free from the single exported function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Support alloc, update, and free from the single exported function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Instead of exporting both xhci_alloc_pipe() and xhci_update_pipe(),
export only xhci_realloc_pipe() and support alloc, update, and free
from it.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Rename usb_getFreePipe() to usb_get_freelist(). Add usb_is_freelist()
and usb_add_freelist() functions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Also, pass in usbdev to usb_free_pipe().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This is just function renaming - no code implementation changes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This is just function renaming - no code implementation changes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This is just function renaming - no code implementation changes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This is just function renaming - no code implementation changes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Although the a20 functionality was originally implemented in the ps2
controller, that is just a historical artifact. It's a core feature
of modern x86 cpus and the code is better located in the x86.h header.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The usbdev->port field is zero indexed, while the USB spec expects the
port values to start at one.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Move the 100ms (USB_TIME_SIGATT) device detect polling from the
ohci/uhci/usb-hub code to the generic usb_hub_port_setup() code. This
extends the 100ms polling to ehci and xhci controllers. The code in
usb_hub_port_setup() now compares USB_TIME_SIGATT to the start of
usb_enumerate(), which may make boots faster when threads are
disabled.
This patch also changes the meaning of the return code for
hub->op->detect() calls. Now 1 indicates device found, 0 indicates
device not found, and -1 indicates permanent failure.
Also, the xhci controller generic delay of 100ms is replaced with a
20ms root hub power stabilize time. This in combination with the
100ms for USB_TIME_SIGATT should be closer to the USB2 spec (the USB3
spec does not seem to declare an equivalent of USB_TIME_SIGATT).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Now that uhci and ohci will continually poll for a device connect, the
ehci controller only needs to ensure that the default routing is setup
properly before allowing uhci and ohci to be initialized.
This also fixes two error paths in configure_ehci() that were not
properly updating PendingEHCIPorts.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
According to the USB2 specification, a device may take up to 100ms
(USB_TIME_SIGATT) after port power stabilizes to be detected. So,
continually recheck for a device connection event.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
According to the USB2 specification, a device may take up to 100ms
(USB_TIME_SIGATT) after port power stabilizes to be detected. So,
continually recheck for a device connection event.
Technically, the uhci root hub ports are always powered up, but it's
not possible to know how long the machine has been on, so it's better
to be safe here.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Use the connect status bit to determine if a device is connected
instead of the port link state state machine status. This makes the
driver more similar to the other drivers and may help diagnose devices
that take longer to boot up.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Don't perform port power up in the detect code. Instead do it prior
to calling usb_enumerate(). This makes the code more similar to the
usb root hub drivers. It can also reduce the total boot time when
threads are disabled.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Don't perform port power up in the detect code. Instead do it prior
to calling usb_enumerate(). This makes the code more similar to the
ohci and xhci drivers. It can also reduce the total boot time when
threads are disabled.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Add these two functions so that the xhci code is more similar to the
other USB controllers. Also, store the temporary hub structure on the
stack instead of in struct usb_xhci_s.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Move the setup code to the top of the file so that like code is
together and to make the code layout more similar to the other usb
controllers.
This change is purely code movement.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Now that the driver runs exclusively in 32bit mode, avoid using the
scarce low memory resource.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The usb-xhci.c file is only compiled in 32bit mode now, so remove all
the 16bit macros.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Make sure to call usb_desc2pipe() when updating a pipe settings. This
ensures that pipe->devaddr is properly updated.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Make sure to wrap accesses to the usb_pipe struct with GET_LOWFLAT so
that it works in 16bit mode. This bug impacts both ehci and uhci usb
controllers (it should not impact ohci and xhci as those never call
the function in 16bit mode).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The xhci controller had a hardcoded 1 second timeout for both bulk and
control transfers. The 1 second bulk timeout is too small for some
real devices.
Increase both times to 5.1 seconds - according to the USB spec, the
maximum time a command should take is 5 seconds. However, have the
set_address command only wait for 150ms (spec says set_address should
take no more than 50ms).
Introduce usb_xfer_time() to calculate maximum command time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Use msleep() so that interrupts and other threads can occur during the
delay.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
<I/O Base Register, I/O Limit Register> pair and
<Prefetchable Memory Base Register, Prefetchable Memory Limit Register> pair
are both optional.
Do not reserve ranges if the above registers are not implemented.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
|
|
If a pci-2-pci bridge supports hot-plug functionality but there are no devices
connected to it, reserve IO/mem in order to be able to attach devices
later. Do not waste space, use minimum allowed.
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Fix typo in code causing both CONFIG_USB_MOUSE and CONFIG_USB_KEYBOARD
to be effectively disabled if either is disabled.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
An analogous change was made in the LSI scsi driver, commit
7d052575258ad2fc487ca3f9a6b62eff1b767900. Qemu works around guests that don't
correctly enable PCI bus mastering before using virtio queues' DMA (search for
VIRTIO_PCI_BUG_BUS_MASTER / VIRTIO_PCI_FLAG_BUS_MASTER_BUG ), but it'd be
better to be correct.
Signed-off-by: Eric Northup <digitaleric@google.com>
|
|
Extend commit 5f2d17d35b2339526f3b3d580b279ea78e406a25: reset on all error
paths, and also for virtio_blk not just virtio_scsi.
Signed-off-by: Eric Northup <digitaleric@google.com>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Also, the max packet size for super speed devices is 512 bytes (not
256 bytes).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|