diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriver.h b/stepmania/src/arch/MemoryCard/MemoryCardDriver.h index c57f113d62..2f511c1ab6 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriver.h +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriver.h @@ -9,15 +9,15 @@ struct UsbStorageDevice { // -1 means "don't know" iBus = -1; - iDeviceOnBus = -1; - iPortOnHub = -1; + iPort = -1; + iLevel = -1; iUsbStorageIndex = -1; sSerial = ""; sOsMountDir = ""; }; int iBus; - int iDeviceOnBus; - int iPortOnHub; + int iPort; + int iLevel; CString sSerial; int iUsbStorageIndex; CString sOsMountDir; // WITHOUT trailing slash @@ -28,8 +28,10 @@ struct UsbStorageDevice { if( (iBus!=-1 || other.iBus!=-1) && iBus != other.iBus ) return false; - if( (iDeviceOnBus!=-1 || other.iDeviceOnBus!=-1) && iDeviceOnBus != other.iDeviceOnBus ) - return false; + if( (iPort!=-1 || other.iPort!=-1) && iPort != other.iPort ) + return false; + if( (iLevel!=-1 || other.iLevel!=-1) && iBus != other.iLevel ) + return false; return sOsMountDir==other.sOsMountDir; // every time a device is plugged in, it gets a unique device number } bool operator!=(const UsbStorageDevice& other) const diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp index 94e1e817f9..84fd920909 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp @@ -103,7 +103,7 @@ void MemoryCardDriverThreaded_Linux::MountThreadMain() UsbStorageDeviceEx &old = vOld[i]; if( find(vNew.begin(),vNew.end(),old) == vNew.end() )// didn't find { - LOG->Trace( ssprintf("Disconnected bus %d port %d device %d path %s", old.iBus, old.iPortOnHub, old.iDeviceOnBus, old.sOsMountDir.c_str()) ); + LOG->Trace( ssprintf("Disconnected bus %d port %d device %d path %s", old.iBus, old.iPort, old.iLevel, old.sOsMountDir.c_str()) ); vDisconnects.push_back( &old ); } } @@ -115,7 +115,7 @@ void MemoryCardDriverThreaded_Linux::MountThreadMain() UsbStorageDeviceEx &newd = vNew[i]; if( find(vOld.begin(),vOld.end(),newd) == vOld.end() )// didn't find { - LOG->Trace( ssprintf("Connected bus %d port %d device %d path %s", newd.iBus, newd.iPortOnHub, newd.iDeviceOnBus, newd.sOsMountDir.c_str()) ); + LOG->Trace( ssprintf("Connected bus %d port %d device %d path %s", newd.iBus, newd.iPort, newd.iLevel, newd.sOsMountDir.c_str()) ); vConnects.push_back( &newd ); } } @@ -214,13 +214,13 @@ void GetNewStorageDevices( vector& vDevicesOut ) int iRet, iThrowAway; // T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 - int iBus, iPort, iDevice; - iRet = sscanf( sLine.c_str(), "T: Bus=%d Lev=%d Prnt=%d Port=%d Cnt=%d Dev#=%d Spd=%d MxCh=%d", &iBus, &iThrowAway, &iThrowAway, &iPort, &iThrowAway, &iDevice, &iThrowAway, &iThrowAway ); + int iBus, iLevel, iPort, iDevice; + iRet = sscanf( sLine.c_str(), "T: Bus=%d Lev=%d Prnt=%d Port=%d Cnt=%d Dev#=%d Spd=%d MxCh=%d", &iBus, &iLevel, &iThrowAway, &iPort, &iThrowAway, &iDevice, &iThrowAway, &iThrowAway ); if( iRet == 8 ) { usbd.iBus = iBus; - usbd.iDeviceOnBus = iDevice; - usbd.iPortOnHub = iPort; + usbd.iPort = iPort; + usbd.iLevel = iLevel; continue; // stop processing this line } @@ -241,8 +241,8 @@ void GetNewStorageDevices( vector& vDevicesOut ) if( iClass == 8 ) // storage class { vDevicesOut.push_back( usbd ); - LOG->Trace( "iUsbStorageIndex: %d, iBus: %d, iDeviceOnBus: %d, iPortOnHub: %d", - usbd.iUsbStorageIndex, usbd.iBus, usbd.iDeviceOnBus, usbd.iPortOnHub ); + LOG->Trace( "iUsbStorageIndex: %d, iBus: %d, iLevel: %d, iPort: %d", + usbd.iUsbStorageIndex, usbd.iBus, usbd.iLevel, usbd.iPort ); } continue; // stop processing this line } @@ -286,8 +286,8 @@ void GetNewStorageDevices( vector& vDevicesOut ) if( usbd.sSerial == szSerial ) { usbd.iUsbStorageIndex = i; - LOG->Trace( "iUsbStorageIndex: %d, iBus: %d, iDeviceOnBus: %d, iPortOnHub: %d, sSerial: %s", - usbd.iUsbStorageIndex, usbd.iBus, usbd.iDeviceOnBus, usbd.iPortOnHub, usbd.sSerial.c_str() ); + LOG->Trace( "iUsbStorageIndex: %d, iBus: %d, iLevel: %d, iPort: %d, sSerial: %s", + usbd.iUsbStorageIndex, usbd.iBus, usbd.iLevel, usbd.iPort, usbd.sSerial.c_str() ); break; // done looking for the corresponding device. } } @@ -335,8 +335,8 @@ void GetNewStorageDevices( vector& vDevicesOut ) { usbd.sOsMountDir = sMountPoint; - LOG->Trace( "iUsbStorageIndex: %d, iBus: %d, iDeviceOnBus: %d, iPortOnHub: %d, sOsMountDir: %s", - usbd.iUsbStorageIndex, usbd.iBus, usbd.iDeviceOnBus, usbd.iPortOnHub, usbd.sOsMountDir.c_str() ); + LOG->Trace( "iUsbStorageIndex: %d, iBus: %d, iLevel: %d, iPort: %d, sOsMountDir: %s", + usbd.iUsbStorageIndex, usbd.iBus, usbd.iLevel, usbd.iPort, usbd.sOsMountDir.c_str() ); break; // stop looking for a match }