os/kernelhwsrv/kernel/eka/include/drivers/usbc.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) 1996-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
// e32\include\drivers\usbc.inl
sl@0
    15
// Kernel side inline header file for USB device driver.
sl@0
    16
// 
sl@0
    17
//
sl@0
    18
sl@0
    19
/**
sl@0
    20
 @file usbc.inl
sl@0
    21
 @internalTechnology
sl@0
    22
*/
sl@0
    23
sl@0
    24
#ifndef __USBC_INL__
sl@0
    25
#define __USBC_INL__
sl@0
    26
sl@0
    27
sl@0
    28
// --- USB Logical Device Driver (LDD) ---
sl@0
    29
//
sl@0
    30
sl@0
    31
TInt TDmaBuf::RxBytesAvailable() const
sl@0
    32
	{
sl@0
    33
	return iTotalRxBytesAvail;
sl@0
    34
	}
sl@0
    35
sl@0
    36
sl@0
    37
TUsbcEndpointInfo* TUsbcEndpoint::EndpointInfo()
sl@0
    38
	{
sl@0
    39
	return &iEndpointInfo;
sl@0
    40
	}
sl@0
    41
sl@0
    42
sl@0
    43
TInt TUsbcEndpoint::RxBytesAvailable() const
sl@0
    44
	{
sl@0
    45
	return iDmaBuffers->RxBytesAvailable();
sl@0
    46
	}
sl@0
    47
sl@0
    48
TInt TUsbcEndpoint::BufferSize() const
sl@0
    49
    {
sl@0
    50
    return iDmaBuffers->BufferSize();
sl@0
    51
    }
sl@0
    52
TInt TUsbcEndpoint::SetBufferAddr( TInt aBufInd, TUint8* aBufAddr)
sl@0
    53
    {
sl@0
    54
    return iDmaBuffers->SetBufferAddr(aBufInd, aBufAddr);
sl@0
    55
    }
sl@0
    56
TInt TUsbcEndpoint::BufferNumber() const
sl@0
    57
    {
sl@0
    58
    return iDmaBuffers->BufferNumber();
sl@0
    59
    }
sl@0
    60
sl@0
    61
void TUsbcEndpoint::SetTransferInfo(TEndpointTransferInfo* aTransferInfo)
sl@0
    62
	{
sl@0
    63
	iTransferInfo = *aTransferInfo;
sl@0
    64
	iBytesTransferred = 0;
sl@0
    65
	}
sl@0
    66
sl@0
    67
sl@0
    68
void TUsbcEndpoint::ResetTransferInfo()
sl@0
    69
	{
sl@0
    70
	iTransferInfo.iDes = NULL;
sl@0
    71
	iTransferInfo.iTransferType = ETransferTypeNone;
sl@0
    72
	iTransferInfo.iTransferSize = 0;
sl@0
    73
	iTransferInfo.iZlpReqd = EFalse;
sl@0
    74
	iBytesTransferred = 0;
sl@0
    75
	}
sl@0
    76
sl@0
    77
sl@0
    78
void TUsbcEndpoint::SetClientReadPending(TBool aVal)
sl@0
    79
	{
sl@0
    80
	iClientReadPending = aVal;
sl@0
    81
	}
sl@0
    82
sl@0
    83
sl@0
    84
TBool TUsbcEndpoint::ClientReadPending()
sl@0
    85
	{
sl@0
    86
	return iClientReadPending;
sl@0
    87
	}
sl@0
    88
sl@0
    89
sl@0
    90
void TUsbcEndpoint::SetClientWritePending(TBool aVal)
sl@0
    91
	{
sl@0
    92
	iClientWritePending = aVal;
sl@0
    93
	}
sl@0
    94
sl@0
    95
sl@0
    96
TBool TUsbcEndpoint::ClientWritePending()
sl@0
    97
	{
sl@0
    98
	return iClientWritePending;
sl@0
    99
	}
sl@0
   100
sl@0
   101
sl@0
   102
void TUsbcEndpoint::SetRealEpNumber(TInt aRealEpNumber)
sl@0
   103
	{
sl@0
   104
	iRealEpNumber = aRealEpNumber;
sl@0
   105
	iRequestCallbackInfo->iRealEpNum = aRealEpNumber;
sl@0
   106
	}
sl@0
   107
sl@0
   108
sl@0
   109
TInt TUsbcEndpoint::RealEpNumber() const
sl@0
   110
	{
sl@0
   111
	return iRealEpNumber;
sl@0
   112
	}
sl@0
   113
sl@0
   114
sl@0
   115
#endif // __USBC_INL__