|
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 |
|
48 |
|
49 TInt TUsbcEndpoint::BufferTotalSize() const |
|
50 { |
|
51 return iDmaBuffers->BufferTotalSize(); |
|
52 } |
|
53 |
|
54 |
|
55 TUint8* TUsbcEndpoint::SetBufferBase(TUint8* aBase) |
|
56 { |
|
57 return iDmaBuffers->SetBufferBase(aBase); |
|
58 } |
|
59 |
|
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__ |