+ iospace = cnt->ControlSpace;
+
+ Log_Debug("OHCI", "Card #%i version is 0x%x", cnt->ID, iospace->HcRevision);
+
+ // Check who had control
+ if( iospace->HcControl & (1 << 8) ) // InterruptRouting
+ {
+ LOG("USB was in the hands of SMM, asking for it back");
+ // SMM has control, ask for it back
+ // - Write '1' to OwnershipChangeRequest
+ // - Wait for InterruptRouting to clear
+ // TODO: Timeout
+ while( iospace->HcControl & (1 << 8) ) ;
+ LOG("Obtained USB");
+ }
+ else if( (iospace->HcControl & 0xC0) != 0x00 ) // UsbReset
+ {
+ LOG("USB was in the hands of the BIOS");
+ // BIOS had control, check for Operational
+ if( (iospace->HcControl & 0xC0) != 0x80 ) // UsbOperational
+ {
+ // - If not, set to resume
+ iospace->HcControl &= ~0xC0; // UsbResume
+ iospace->HcControl |= 0x40; // UsbResume
+ // TODO: Wait
+ }
+ }
+ else
+ {
+ // Cold boot, wait a bit
+ // TODO: Wait for reset time
+ }