1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kernel/eka/include/drivers/usbc.inl Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,115 @@
1.4 +// Copyright (c) 1996-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\usbc.inl
1.18 +// Kernel side inline header file for USB device driver.
1.19 +//
1.20 +//
1.21 +
1.22 +/**
1.23 + @file usbc.inl
1.24 + @internalTechnology
1.25 +*/
1.26 +
1.27 +#ifndef __USBC_INL__
1.28 +#define __USBC_INL__
1.29 +
1.30 +
1.31 +// --- USB Logical Device Driver (LDD) ---
1.32 +//
1.33 +
1.34 +TInt TDmaBuf::RxBytesAvailable() const
1.35 + {
1.36 + return iTotalRxBytesAvail;
1.37 + }
1.38 +
1.39 +
1.40 +TUsbcEndpointInfo* TUsbcEndpoint::EndpointInfo()
1.41 + {
1.42 + return &iEndpointInfo;
1.43 + }
1.44 +
1.45 +
1.46 +TInt TUsbcEndpoint::RxBytesAvailable() const
1.47 + {
1.48 + return iDmaBuffers->RxBytesAvailable();
1.49 + }
1.50 +
1.51 +TInt TUsbcEndpoint::BufferSize() const
1.52 + {
1.53 + return iDmaBuffers->BufferSize();
1.54 + }
1.55 +TInt TUsbcEndpoint::SetBufferAddr( TInt aBufInd, TUint8* aBufAddr)
1.56 + {
1.57 + return iDmaBuffers->SetBufferAddr(aBufInd, aBufAddr);
1.58 + }
1.59 +TInt TUsbcEndpoint::BufferNumber() const
1.60 + {
1.61 + return iDmaBuffers->BufferNumber();
1.62 + }
1.63 +
1.64 +void TUsbcEndpoint::SetTransferInfo(TEndpointTransferInfo* aTransferInfo)
1.65 + {
1.66 + iTransferInfo = *aTransferInfo;
1.67 + iBytesTransferred = 0;
1.68 + }
1.69 +
1.70 +
1.71 +void TUsbcEndpoint::ResetTransferInfo()
1.72 + {
1.73 + iTransferInfo.iDes = NULL;
1.74 + iTransferInfo.iTransferType = ETransferTypeNone;
1.75 + iTransferInfo.iTransferSize = 0;
1.76 + iTransferInfo.iZlpReqd = EFalse;
1.77 + iBytesTransferred = 0;
1.78 + }
1.79 +
1.80 +
1.81 +void TUsbcEndpoint::SetClientReadPending(TBool aVal)
1.82 + {
1.83 + iClientReadPending = aVal;
1.84 + }
1.85 +
1.86 +
1.87 +TBool TUsbcEndpoint::ClientReadPending()
1.88 + {
1.89 + return iClientReadPending;
1.90 + }
1.91 +
1.92 +
1.93 +void TUsbcEndpoint::SetClientWritePending(TBool aVal)
1.94 + {
1.95 + iClientWritePending = aVal;
1.96 + }
1.97 +
1.98 +
1.99 +TBool TUsbcEndpoint::ClientWritePending()
1.100 + {
1.101 + return iClientWritePending;
1.102 + }
1.103 +
1.104 +
1.105 +void TUsbcEndpoint::SetRealEpNumber(TInt aRealEpNumber)
1.106 + {
1.107 + iRealEpNumber = aRealEpNumber;
1.108 + iRequestCallbackInfo->iRealEpNum = aRealEpNumber;
1.109 + }
1.110 +
1.111 +
1.112 +TInt TUsbcEndpoint::RealEpNumber() const
1.113 + {
1.114 + return iRealEpNumber;
1.115 + }
1.116 +
1.117 +
1.118 +#endif // __USBC_INL__