Some changes in the USB xHCI device
- The retry timer now calls process_transfer_ring() for enabled slots only. - On USB3-only ports ignore device speed setup and try to enable super-speed mode.
This commit is contained in:
parent
1f911bca60
commit
a3cbba7006
@ -258,16 +258,6 @@ usb_device_c* usb_device_c::find_device(Bit8u addr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bx_bool usb_device_c::set_speed(int speed)
|
|
||||||
{
|
|
||||||
if ((speed >= d.minspeed) && (speed <= d.maxspeed)) {
|
|
||||||
d.speed = speed;
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generic USB packet handler
|
// Generic USB packet handler
|
||||||
|
|
||||||
#define SETUP_STATE_IDLE 0
|
#define SETUP_STATE_IDLE 0
|
||||||
|
@ -191,7 +191,16 @@ public:
|
|||||||
bx_bool get_connected() {return d.connected;}
|
bx_bool get_connected() {return d.connected;}
|
||||||
usbdev_type get_type() {return d.type;}
|
usbdev_type get_type() {return d.type;}
|
||||||
int get_speed() {return d.speed;}
|
int get_speed() {return d.speed;}
|
||||||
bx_bool set_speed(int speed);
|
bx_bool set_speed(int speed)
|
||||||
|
{
|
||||||
|
if ((speed >= d.minspeed) && (speed <= d.maxspeed)) {
|
||||||
|
d.speed = speed;
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Bit8u get_address() {return d.addr;}
|
Bit8u get_address() {return d.addr;}
|
||||||
void set_async_mode(bx_bool async) {d.async_mode = async;}
|
void set_async_mode(bx_bool async) {d.async_mode = async;}
|
||||||
void set_event_handler(void *dev, USBCallback *cb, int port)
|
void set_event_handler(void *dev, USBCallback *cb, int port)
|
||||||
|
@ -3011,10 +3011,12 @@ void bx_usb_xhci_c::xhci_timer(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
for (slot=1; slot<MAX_SLOTS; slot++) {
|
for (slot=1; slot<MAX_SLOTS; slot++) {
|
||||||
for (ep=1; ep<32; ep++) {
|
if (BX_XHCI_THIS hub.slots[slot].enabled) {
|
||||||
if (BX_XHCI_THIS hub.slots[slot].ep_context[ep].retry) {
|
for (ep=1; ep<32; ep++) {
|
||||||
if (--BX_XHCI_THIS hub.slots[slot].ep_context[ep].retry_counter <= 0) {
|
if (BX_XHCI_THIS hub.slots[slot].ep_context[ep].retry) {
|
||||||
BX_XHCI_THIS process_transfer_ring(slot, ep);
|
if (--BX_XHCI_THIS hub.slots[slot].ep_context[ep].retry_counter <= 0) {
|
||||||
|
BX_XHCI_THIS process_transfer_ring(slot, ep);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3160,11 +3162,12 @@ void bx_usb_xhci_c::usb_set_connect_status(Bit8u port, int type, bx_bool connect
|
|||||||
usb_set_connect_status(port, type, 0);
|
usb_set_connect_status(port, type, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((device->get_speed() != USB_SPEED_SUPER) &&
|
if (BX_XHCI_THIS hub.usb_port[port].is_usb3) {
|
||||||
BX_XHCI_THIS hub.usb_port[port].is_usb3) {
|
if (!device->set_speed(USB_SPEED_SUPER)) {
|
||||||
BX_PANIC(("Only super-speed devices supported on USB3 port."));
|
BX_PANIC(("Only super-speed devices supported on USB3 port."));
|
||||||
usb_set_connect_status(port, type, 0);
|
usb_set_connect_status(port, type, 0);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
switch (device->get_speed()) {
|
switch (device->get_speed()) {
|
||||||
case USB_SPEED_LOW:
|
case USB_SPEED_LOW:
|
||||||
|
Loading…
Reference in New Issue
Block a user