os/kernelhwsrv/userlibandfileserver/fileserver/smassstorage/inc/drivemanager.inl
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// Implementations of inline functions declared in drivemanager.h.
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file
sl@0
    20
 @internalTechnology
sl@0
    21
 
sl@0
    22
 @return Current drive mount state
sl@0
    23
*/
sl@0
    24
inline CMassStorageDrive::TMountState CMassStorageDrive::MountState() const
sl@0
    25
	{
sl@0
    26
	return iMountState;
sl@0
    27
	}
sl@0
    28
sl@0
    29
/**
sl@0
    30
Set the mount state
sl@0
    31
*/
sl@0
    32
inline TInt CMassStorageDrive::SetMountDisconnected()
sl@0
    33
	{
sl@0
    34
	return SetMountState(EDisconnected);
sl@0
    35
	}
sl@0
    36
sl@0
    37
/**
sl@0
    38
Set the mount state
sl@0
    39
*/
sl@0
    40
inline TInt CMassStorageDrive::SetMountConnecting()
sl@0
    41
	{
sl@0
    42
	return SetMountState(EConnecting);
sl@0
    43
	}
sl@0
    44
sl@0
    45
/**
sl@0
    46
Set the mount state
sl@0
    47
*/
sl@0
    48
inline TInt CMassStorageDrive::SetMountDisconnecting()
sl@0
    49
	{
sl@0
    50
	return SetMountState(EDisconnecting);
sl@0
    51
	}
sl@0
    52
sl@0
    53
/**
sl@0
    54
Set the mount state
sl@0
    55
*/
sl@0
    56
inline TInt CMassStorageDrive::SetMountConnected()
sl@0
    57
	{
sl@0
    58
	iCritSec.Wait();
sl@0
    59
	return SetMountState(EConnected);
sl@0
    60
	}
sl@0
    61
sl@0
    62
/**
sl@0
    63
 Is Whole Media Access Permitted for Mass Storage Drive
sl@0
    64
 */
sl@0
    65
inline TBool CMassStorageDrive::IsWholeMediaAccess()
sl@0
    66
	{
sl@0
    67
	return iWholeMediaAccess;
sl@0
    68
	}
sl@0
    69
sl@0
    70
#ifndef USB_TRANSFER_PUBLISHER
sl@0
    71
/**
sl@0
    72
@return Cumulative bytes read since the host connected to the drive, 
sl@0
    73
        in multiples of KBytesPerKilobyte rounded to nearest integer value.
sl@0
    74
        The KBytes refers to multiples of 1000, not 1024.
sl@0
    75
*/
sl@0
    76
inline TUint CMassStorageDrive::KBytesRead() const
sl@0
    77
	{
sl@0
    78
	return I64LOW(iBytesRead / (TUint64)1000);
sl@0
    79
	}
sl@0
    80
sl@0
    81
/**
sl@0
    82
@return Cumulative bytes written since the host connected to the drive, 
sl@0
    83
        in multiples of KBytesPerKilobyte rounded to nearest integer value.
sl@0
    84
        The KBytes refer to multiples of 1000, not 1024.
sl@0
    85
*/
sl@0
    86
inline TUint CMassStorageDrive::KBytesWritten() const
sl@0
    87
	{
sl@0
    88
	return I64LOW(iBytesWritten / (TUint64)1000);
sl@0
    89
	}
sl@0
    90
sl@0
    91
#else
sl@0
    92
/**
sl@0
    93
Transfer function for the property
sl@0
    94
sl@0
    95
@return Cumulative bytes read since the host connected to the drive, 
sl@0
    96
        in multiples of KBytesPerKilobyte rounded to nearest integer value.
sl@0
    97
        The KBytes refer to multiples of 1000, not 1024.
sl@0
    98
*/
sl@0
    99
inline TUint CUsbTransferPublisher::GetBytesTransferred(TUint aLun) const
sl@0
   100
{
sl@0
   101
	return I64LOW(iArray[aLun] / (TUint64)1000);
sl@0
   102
}
sl@0
   103
sl@0
   104
#endif // USB_TRANSFER_PUBLISHER