os/kernelhwsrv/kernel/eka/include/drivers/usbcsc.inl
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/include/drivers/usbcsc.inl	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,107 @@
     1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32\include\drivers\usbcsc.inl
    1.18 +// Kernel side inline header file for USB device driver.
    1.19 +// 
    1.20 +//
    1.21 +
    1.22 +/**
    1.23 + @file usbcsc.inl
    1.24 + @internalTechnology
    1.25 +*/
    1.26 +
    1.27 +#ifndef __USBCSC_INL__
    1.28 +#define __USBCSC_INL__
    1.29 + 
    1.30 +
    1.31 +//
    1.32 +// --- USB Logical Device Driver (LDD) ---
    1.33 +//
    1.34 +
    1.35 +TUsbcScEndpointInfo* TUsbcScEndpoint::EndpointInfo()
    1.36 +	{
    1.37 +	return &iEndpointInfo;
    1.38 +	}
    1.39 +
    1.40 +
    1.41 +void TUsbcScEndpoint::SetClientReadPending(TBool aVal)
    1.42 +	{
    1.43 +	iClientReadPending = aVal;
    1.44 +	}
    1.45 +
    1.46 +
    1.47 +TBool TUsbcScEndpoint::ClientReadPending()
    1.48 +	{
    1.49 +	return iClientReadPending;
    1.50 +	}
    1.51 +
    1.52 +
    1.53 +void TUsbcScEndpoint::SetClientWritePending(TBool aVal)
    1.54 +	{
    1.55 +	iClientWritePending = aVal;
    1.56 +	}
    1.57 +
    1.58 +
    1.59 +TBool TUsbcScEndpoint::ClientWritePending()
    1.60 +	{
    1.61 +	return iClientWritePending;
    1.62 +	}
    1.63 +
    1.64 +
    1.65 +void TUsbcScEndpoint::SetRealEpNumber(TInt aRealEpNumber)
    1.66 +	{
    1.67 +	iRealEpNumber = aRealEpNumber;
    1.68 +	iRequestCallbackInfo->iRealEpNum = aRealEpNumber;
    1.69 +	}
    1.70 +
    1.71 +
    1.72 +TInt TUsbcScEndpoint::RealEpNumber() const
    1.73 +	{
    1.74 +	return iRealEpNumber;
    1.75 +	}
    1.76 +TInt TUsbcScEndpoint::EpNumber() const
    1.77 +	{
    1.78 +	return iEndpointNumber;
    1.79 +	}
    1.80 +void TUsbcScEndpoint::StartBuffer()
    1.81 +	{
    1.82 +	iBuffer->StartEndpoint(iRequestCallbackInfo, iEndpointInfo.iFlags);
    1.83 +	}
    1.84 +
    1.85 +void TUsbcScEndpoint::SetBuffer(TUsbcScBuffer* aBuffer)
    1.86 +	{
    1.87 +		__ASSERT_ALWAYS(iBuffer==NULL, Kern::Fault("TUsbcScEndpoint::SetBuffer", __LINE__));
    1.88 +		iBuffer = aBuffer;
    1.89 +	}
    1.90 +
    1.91 +TUsbcScBuffer* TUsbcScEndpoint::GetBuffer()
    1.92 +	{
    1.93 +		__ASSERT_DEBUG(iBuffer!=NULL, Kern::Fault("TUsbcScEndpoint::GetBuffer", __LINE__));
    1.94 +	return iBuffer;
    1.95 +	}
    1.96 +
    1.97 +inline TBool DLddUsbcScChannel::ValidEndpoint(TInt aEndpoint)
    1.98 +	{
    1.99 +	return (aEndpoint <= iNumberOfEndpoints && aEndpoint >= 0);
   1.100 +	}
   1.101 +
   1.102 +inline TBool DLddUsbcScChannel::Configured()
   1.103 +	{
   1.104 +	if (iValidInterface && 
   1.105 +		(iDeviceState == EUsbcDeviceStateConfigured || iDeviceState == EUsbcDeviceStateSuspended))
   1.106 +		return ETrue;
   1.107 +	return EFalse;
   1.108 +	}
   1.109 +
   1.110 +#endif // __USBCSC_INL__