author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 07 Jan 2010 13:38:45 +0200 | |
changeset 6 | 0173bcd7697c |
parent 0 | a41df078684a |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 |
// All rights reserved. |
|
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// e32\include\drivers\usbc.inl |
|
15 |
// Kernel side inline header file for USB device driver. |
|
16 |
// |
|
17 |
// |
|
18 |
||
19 |
/** |
|
20 |
@file usbc.inl |
|
21 |
@internalTechnology |
|
22 |
*/ |
|
23 |
||
24 |
#ifndef __USBC_INL__ |
|
25 |
#define __USBC_INL__ |
|
26 |
||
27 |
||
28 |
// --- USB Logical Device Driver (LDD) --- |
|
29 |
// |
|
30 |
||
31 |
TInt TDmaBuf::RxBytesAvailable() const |
|
32 |
{ |
|
33 |
return iTotalRxBytesAvail; |
|
34 |
} |
|
35 |
||
36 |
||
37 |
TUsbcEndpointInfo* TUsbcEndpoint::EndpointInfo() |
|
38 |
{ |
|
39 |
return &iEndpointInfo; |
|
40 |
} |
|
41 |
||
42 |
||
43 |
TInt TUsbcEndpoint::RxBytesAvailable() const |
|
44 |
{ |
|
45 |
return iDmaBuffers->RxBytesAvailable(); |
|
46 |
} |
|
47 |
||
6
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
48 |
TInt TUsbcEndpoint::BufferSize() const |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
49 |
{ |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
50 |
return iDmaBuffers->BufferSize(); |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
51 |
} |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
52 |
TInt TUsbcEndpoint::SetBufferAddr( TInt aBufInd, TUint8* aBufAddr) |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
53 |
{ |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
54 |
return iDmaBuffers->SetBufferAddr(aBufInd, aBufAddr); |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
55 |
} |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
56 |
TInt TUsbcEndpoint::BufferNumber() const |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
57 |
{ |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
58 |
return iDmaBuffers->BufferNumber(); |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
59 |
} |
0 | 60 |
|
61 |
void TUsbcEndpoint::SetTransferInfo(TEndpointTransferInfo* aTransferInfo) |
|
62 |
{ |
|
63 |
iTransferInfo = *aTransferInfo; |
|
64 |
iBytesTransferred = 0; |
|
65 |
} |
|
66 |
||
67 |
||
68 |
void TUsbcEndpoint::ResetTransferInfo() |
|
69 |
{ |
|
70 |
iTransferInfo.iDes = NULL; |
|
71 |
iTransferInfo.iTransferType = ETransferTypeNone; |
|
72 |
iTransferInfo.iTransferSize = 0; |
|
73 |
iTransferInfo.iZlpReqd = EFalse; |
|
74 |
iBytesTransferred = 0; |
|
75 |
} |
|
76 |
||
77 |
||
78 |
void TUsbcEndpoint::SetClientReadPending(TBool aVal) |
|
79 |
{ |
|
80 |
iClientReadPending = aVal; |
|
81 |
} |
|
82 |
||
83 |
||
84 |
TBool TUsbcEndpoint::ClientReadPending() |
|
85 |
{ |
|
86 |
return iClientReadPending; |
|
87 |
} |
|
88 |
||
89 |
||
90 |
void TUsbcEndpoint::SetClientWritePending(TBool aVal) |
|
91 |
{ |
|
92 |
iClientWritePending = aVal; |
|
93 |
} |
|
94 |
||
95 |
||
96 |
TBool TUsbcEndpoint::ClientWritePending() |
|
97 |
{ |
|
98 |
return iClientWritePending; |
|
99 |
} |
|
100 |
||
101 |
||
102 |
void TUsbcEndpoint::SetRealEpNumber(TInt aRealEpNumber) |
|
103 |
{ |
|
104 |
iRealEpNumber = aRealEpNumber; |
|
105 |
iRequestCallbackInfo->iRealEpNum = aRealEpNumber; |
|
106 |
} |
|
107 |
||
108 |
||
109 |
TInt TUsbcEndpoint::RealEpNumber() const |
|
110 |
{ |
|
111 |
return iRealEpNumber; |
|
112 |
} |
|
113 |
||
114 |
||
115 |
#endif // __USBC_INL__ |