equal
deleted
inserted
replaced
1 /* |
1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
3 * All rights reserved. |
3 // This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
4 // under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 // |
7 // |
18 // hostusbmsproxy.cpp |
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
19 // |
10 // |
20 // This file system extension provides a way to access a drive on the MS system in "raw format". |
11 // Contributors: |
21 // It can be used to test large files / drives |
12 // |
|
13 // Description: |
|
14 // This file system extension provides a way to access a drive on the MS system |
|
15 // in "raw format". It can be used to test large files / drives |
22 // |
16 // |
23 |
17 |
24 /** @file |
18 /** @file |
25 @internalTechnology |
19 @internalTechnology |
26 */ |
20 */ |
484 |
478 |
485 __HOSTPRINT1(_L("<<< HOST Write ret=%d"), KErrNone); |
479 __HOSTPRINT1(_L("<<< HOST Write ret=%d"), KErrNone); |
486 return KErrNone; |
480 return KErrNone; |
487 } |
481 } |
488 |
482 |
|
483 |
489 /** |
484 /** |
490 Write to the proxy drive and pass flags to driver |
485 Write to the proxy drive and pass flags to driver |
491 |
486 |
492 @param aPos The address from where the write begins. |
487 @param aPos The address from where the write begins. |
493 @param aLength The length of the write. |
488 @param aLength The length of the write. |
518 __MSFNSLOG |
513 __MSFNSLOG |
519 __HOSTPRINT3(_L("\n>>> HOST Write Pos=0x%lx LBA=0x%lx 0x%x"), |
514 __HOSTPRINT3(_L("\n>>> HOST Write Pos=0x%lx LBA=0x%lx 0x%x"), |
520 aPos, aPos/KBlockSize, aSrc.Length()); |
515 aPos, aPos/KBlockSize, aSrc.Length()); |
521 return iUsbHostMsLun.Write(iMsDataMemMap.GetDataPos(aPos), aSrc.Length(), aSrc); |
516 return iUsbHostMsLun.Write(iMsDataMemMap.GetDataPos(aPos), aSrc.Length(), aSrc); |
522 } |
517 } |
|
518 |
523 |
519 |
524 /** |
520 /** |
525 Get the proxy drive's capabilities information. |
521 Get the proxy drive's capabilities information. |
526 |
522 |
527 @param anInfo A descriptor of the connected drives capabilities. |
523 @param anInfo A descriptor of the connected drives capabilities. |
564 } |
560 } |
565 __HOSTPRINT4(_L("<<< HOST Caps Block[num=0x%x size=0x%x] Media[size=0x%lx WP=0x%x]"), |
561 __HOSTPRINT4(_L("<<< HOST Caps Block[num=0x%x size=0x%x] Media[size=0x%lx WP=0x%x]"), |
566 capsInfo.iNumberOfBlocks, capsInfo.iBlockLength, |
562 capsInfo.iNumberOfBlocks, capsInfo.iBlockLength, |
567 caps().iSize, caps().iMediaAtt); |
563 caps().iSize, caps().iMediaAtt); |
568 } |
564 } |
569 else |
565 else if (KErrNotReady) |
570 { |
566 { |
571 __HOSTPRINT(_L("<<< HOST Caps Media Not Present")); |
567 __HOSTPRINT(_L("<<< HOST Caps Media Not Present")); |
572 c.iType = EMediaNotPresent; |
568 c.iType = EMediaNotPresent; |
573 if(r != KErrNotReady) |
569 r = KErrNone; |
574 r = KErrUnknown; |
570 } |
|
571 else |
|
572 { |
|
573 __HOSTPRINT(_L("<<< HOST Caps Unknown Error")); |
|
574 r = KErrUnknown; |
575 } |
575 } |
576 anInfo = caps.Left(Min(caps.Length(),anInfo.MaxLength())); |
576 anInfo = caps.Left(Min(caps.Length(),anInfo.MaxLength())); |
577 return r; |
577 return r; |
578 } |
578 } |
579 |
|
580 |
579 |
581 |
580 |
582 /** |
581 /** |
583 Format the proxy drive. The drive is assumed to be a single partition. The |
582 Format the proxy drive. The drive is assumed to be a single partition. The |
584 partition size is equivalent to the size of the media. |
583 partition size is equivalent to the size of the media. |