userlibandfileserver/fileserver/shostmassstorage/client/rusbhostmsdevice.cpp
changeset 109 b3a1d9898418
parent 0 a41df078684a
child 297 b2826f67641f
equal deleted inserted replaced
102:ef2a444a7410 109:b3a1d9898418
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   202 
   202 
   203 
   203 
   204 EXPORT_C TInt RUsbHostMsDevice::MountLun(TUint32 aLunId, TInt aDriveNum)
   204 EXPORT_C TInt RUsbHostMsDevice::MountLun(TUint32 aLunId, TInt aDriveNum)
   205 	{
   205 	{
   206 	__FNLOG("RUsbHostMsDevice::MountLun");
   206 	__FNLOG("RUsbHostMsDevice::MountLun");
       
   207     __MSDEVPRINT2(_L(">>> RUsbHostMsDevice::MountLun Drv=%d LUN=%d"), aDriveNum, aLunId);
   207 	RFs TheFs;
   208 	RFs TheFs;
   208 	TInt r = TheFs.Connect();
   209 	TInt r = TheFs.Connect();
   209 	if(r == KErrNone)
   210 	if(r == KErrNone)
   210 		{
   211 		{
   211 		TPckgBuf<TMassStorageUnitInfo> unitPkg;
   212 		TPckgBuf<TMassStorageUnitInfo> unitPkg;
   212 		unitPkg().iLunID = aLunId;
   213 		unitPkg().iLunID = aLunId;
   213 
   214 
   214 		r = TheFs.MountProxyDrive(aDriveNum, _L("usbhostms"), &unitPkg, *this);
   215 		r = TheFs.MountProxyDrive(aDriveNum, _L("usbhostms"), &unitPkg, *this);
       
   216         __MSDEVPRINT1(_L("MountProxyDrive %d"), r);
   215 		if(r >= KErrNone)
   217 		if(r >= KErrNone)
   216 			{
   218 			{
   217 			r = TheFs.MountFileSystem(KFileSystem, aDriveNum);
   219 			r = TheFs.MountFileSystem(KFileSystem, aDriveNum);
   218 
   220             __MSDEVPRINT1(_L("MountFileSystem %d"), r);
   219 			if(r != KErrNone && r != KErrNotReady && r != KErrCorrupt)
   221 			if(r != KErrNone && r != KErrNotReady && r != KErrCorrupt && r != KErrNotSupported)
   220 				{
   222 				{
   221 				TheFs.DismountFileSystem(KFileSystem, aDriveNum);
   223 				TheFs.DismountFileSystem(KFileSystem, aDriveNum);
   222 				TheFs.DismountProxyDrive(aDriveNum);
   224 				TheFs.DismountProxyDrive(aDriveNum);
   223 				}
   225 				}
   224 			}
   226 			}
   228 	}
   230 	}
   229 
   231 
   230 EXPORT_C TInt RUsbHostMsDevice::DismountLun(TInt aDriveNum)
   232 EXPORT_C TInt RUsbHostMsDevice::DismountLun(TInt aDriveNum)
   231 	{
   233 	{
   232 	__FNLOG("RUsbHostMsDevice::DismountLun");
   234 	__FNLOG("RUsbHostMsDevice::DismountLun");
       
   235     __MSDEVPRINT1(_L(">>> RUsbHostMsDevice::DismountLun Drv=%d"), aDriveNum);
   233 	RFs TheFs;
   236 	RFs TheFs;
   234 	TInt r;
   237 	TInt r;
   235 	r = TheFs.Connect();
   238 	r = TheFs.Connect();
   236 	if(r == KErrNone)
   239 	if(r == KErrNone)
   237 		{
   240 		{