unload usb-storage driver between games

This commit is contained in:
Chris Danford
2004-02-26 07:28:59 +00:00
parent e4eb43edf0
commit 8b832f11d7
3 changed files with 11 additions and 1 deletions
+2
View File
@@ -235,4 +235,6 @@ void MemoryCardManager::FlushAllDisks()
continue; // skip continue; // skip
m_pDriver->Flush(&m_Device[p]); m_pDriver->Flush(&m_Device[p]);
} }
m_pDriver->ResetUsbDeviceNumbers();
} }
@@ -45,7 +45,8 @@ public:
virtual bool StorageDevicesChanged() = 0; virtual bool StorageDevicesChanged() = 0;
virtual void GetStorageDevices( vector<UsbStorageDevice>& vStorageDevicesOut ) = 0; virtual void GetStorageDevices( vector<UsbStorageDevice>& vStorageDevicesOut ) = 0;
virtual bool MountAndTestWrite( UsbStorageDevice* pDevice ) = 0; // return false if mount or write fails virtual bool MountAndTestWrite( UsbStorageDevice* pDevice ) = 0; // return false if mount or write fails
virtual void Flush( UsbStorageDevice* pDevice ) { } virtual void Flush( UsbStorageDevice* pDevice ) {}
virtual void ResetUsbStorage() {};
}; };
#endif #endif
@@ -254,6 +254,13 @@ void MemoryCardDriver_Linux::Flush( UsbStorageDevice* pDevice )
system( sCommand ); system( sCommand );
} }
void MemoryCardDriver_Linux::ResetUsbStorage()
{
system( "rmmod usb-storage" );
system( "modprobe usb-storage" );
}
/* /*
* Copyright (c) 2003 by the person(s) listed below. All rights reserved. * Copyright (c) 2003 by the person(s) listed below. All rights reserved.
* Chris Danford * Chris Danford