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 } |