13void usbdRebootInner(
void)
15 memPool->m_ohciRegs->HcRhPortStatus[0] = BIT(PORT_RESET);
16 memPool->m_ohciRegs->HcRhPortStatus[1] = BIT(PORT_RESET);
21 if ( memPool->m_delayResets )
23 dev->m_deviceStatus = DEVICE_RESETDELAYED;
27 memPool->m_delayResets = 1;
28 dev->m_deviceStatus = DEVICE_RESETPENDING;
30 if ( dev->m_parent == memPool->m_deviceTreeRoot )
31 memPool->m_ohciRegs->HcRhPortStatus[dev->m_attachedToPortNo - 1] = BIT(PORT_RESET);
33 hubResetDevicePort(dev);
41 for ( dev = tree->m_childListStart; dev; dev = dev->m_next )
43 if ( dev->m_deviceStatus == DEVICE_RESETDELAYED )
48 if ( dev->m_childListStart )
50 if ( (u8)((
int)dev->m_deviceStatus - 7) < 2u )
52 if ( checkDelayedResetsTree(dev) != 0 )
62 memPool->m_delayResets = 0;
64 checkDelayedResetsTree(memPool->m_deviceTreeRoot);
74 for ( portNum = 0, port = memPool->m_deviceTreeRoot->m_childListStart; port; portNum += 1, port = next )
79 status = memPool->m_ohciRegs->HcRhPortStatus[portNum];
80 memPool->m_ohciRegs->HcRhPortStatus[portNum] = C_PORT_FLAGS;
81 if ( (status & BIT(PORT_CONNECTION)) != 0 )
83 if ( port->m_deviceStatus >= (
unsigned int)DEVICE_CONNECTED && ((status & BIT(C_PORT_CONNECTION)) != 0) )
85 if ( port->m_deviceStatus == DEVICE_NOTCONNECTED )
87 port->m_deviceStatus = DEVICE_CONNECTED;
88 addTimerCallback(&port->m_timer, (TimerCallback)hubResetDevice, port, 501);
90 else if ( port->m_deviceStatus == DEVICE_RESETPENDING )
92 if ( (status & BIT(PORT_RESET)) == 0 )
94 port->m_deviceStatus = DEVICE_RESETCOMPLETE;
95 port->m_isLowSpeedDevice = (status & BIT(PORT_LOW_SPEED)) != 0;
96 if ( openDeviceEndpoint(port, NULL, 0) )
97 hubTimedSetFuncAddress(port);