change from USB Debugger branch by Ben, rename variable

This commit is contained in:
Shwartsman 2024-01-10 21:20:43 +02:00
parent cc87b23738
commit 77bbdca17a
2 changed files with 5 additions and 5 deletions

View File

@ -1275,8 +1275,8 @@ bool bx_usb_xhci_c::read_handler(bx_phy_address addr, unsigned len, void *data,
}
}
// Register Port Sets
else if ((offset >= PORT_SET_OFFSET) && (offset < (PORT_SET_OFFSET + (BX_XHCI_THIS hub.n_ports * 16)))) {
unsigned port = (((offset - PORT_SET_OFFSET) >> 4) & 0x3F); // calculate port number
else if ((offset >= XHCI_PORT_SET_OFFSET) && (offset < (XHCI_PORT_SET_OFFSET + (BX_XHCI_THIS hub.n_ports * 16)))) {
unsigned port = (((offset - XHCI_PORT_SET_OFFSET) >> 4) & 0x3F); // calculate port number
if (BX_XHCI_THIS hub.usb_port[port].portsc.pp) {
// the speed field is only valid for USB3 before a port reset. If a reset has not
// taken place after the port is powered, the USB2 ports don't show a valid speed field.
@ -1749,8 +1749,8 @@ bool bx_usb_xhci_c::write_handler(bx_phy_address addr, unsigned len, void *data,
}
}
// Register Port Sets
else if ((offset >= PORT_SET_OFFSET) && (offset < (PORT_SET_OFFSET + (BX_XHCI_THIS hub.n_ports * 16)))) {
unsigned port = (((offset - PORT_SET_OFFSET) >> 4) & 0x3F); // calculate port number
else if ((offset >= XHCI_PORT_SET_OFFSET) && (offset < (XHCI_PORT_SET_OFFSET + (BX_XHCI_THIS hub.n_ports * 16)))) {
unsigned port = (((offset - XHCI_PORT_SET_OFFSET) >> 4) & 0x3F); // calculate port number
switch (offset & 0x0000000F) {
case 0x00:
if (value & (1<<9)) { // port power

View File

@ -120,7 +120,7 @@
#define RUNTIME_OFFSET 0x600
#define PORT_SET_OFFSET (0x400 + OPS_REGS_OFFSET)
#define XHCI_PORT_SET_OFFSET (0x400 + OPS_REGS_OFFSET)
/************************************************************************************************/