269
|
1 |
// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
|
0
|
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 |
//
|
|
15 |
|
|
16 |
/**
|
|
17 |
@file
|
|
18 |
@internalTechnology
|
|
19 |
*/
|
286
|
20 |
|
|
21 |
#include <e32std.h>
|
|
22 |
#include "mtransport.h"
|
|
23 |
#include "mprotocol.h"
|
|
24 |
#include "mldddevicestatenotification.h"
|
|
25 |
#include "tbulkmm.h"
|
|
26 |
|
|
27 |
#include "drivemanager.h"
|
|
28 |
#include "cusbmassstoragecontroller.h"
|
|
29 |
|
0
|
30 |
#include "cbulkonlytransport.h"
|
|
31 |
#include "cbulkonlytransportusbcldd.h"
|
271
|
32 |
#if !defined(__WINS__) && !defined(__X86__)
|
0
|
33 |
#include "cbulkonlytransportusbcscldd.h"
|
271
|
34 |
#endif
|
286
|
35 |
#include "smassstorage.h"
|
|
36 |
|
|
37 |
#include "OstTraceDefinitions.h"
|
|
38 |
#ifdef OST_TRACE_COMPILER_IN_USE
|
|
39 |
#include "cbulkonlytransportTraces.h"
|
|
40 |
#endif
|
0
|
41 |
|
|
42 |
|
|
43 |
//CBW offsets
|
286
|
44 |
static const TInt KCbwSignatureOffset = 0;
|
|
45 |
static const TInt KCbwTagOffset = 4;
|
|
46 |
static const TInt KCbwDataTransferLengthOffset = 8;
|
|
47 |
static const TInt KCbwFlagOffset = 12;
|
|
48 |
static const TInt KCbwLunOffset = 13;
|
|
49 |
static const TInt KCbwCbLengthOffset = 14;
|
0
|
50 |
|
286
|
51 |
static const TInt KMaxCbwcbLength = 16;
|
0
|
52 |
|
|
53 |
// CSW offsets
|
286
|
54 |
static const TInt KCswSingnatureOffset = 0;
|
|
55 |
static const TInt KCswTagOffset = 4;
|
|
56 |
static const TInt KCswDataResidueOffset = 8;
|
|
57 |
static const TInt KCswStatusOffset = 12;
|
0
|
58 |
|
|
59 |
|
|
60 |
/**
|
|
61 |
This function unpacks into the TUsbRequestHdr class from a descriptor with
|
|
62 |
the alignment that would be introduced on the USB bus.
|
|
63 |
|
|
64 |
@param aBuffer Input buffer
|
|
65 |
@param aTarget Unpacked header.
|
|
66 |
@return Error.
|
|
67 |
*/
|
|
68 |
TInt TUsbRequestHdr::Decode(const TDesC8& aBuffer)
|
286
|
69 |
{
|
|
70 |
if (aBuffer.Length() < static_cast<TInt>(KRequestHdrSize))
|
|
71 |
{
|
|
72 |
OstTrace1(TRACE_SMASSSTORAGE_USB, TUSBREQUESTHDR_DECODE_ERR,
|
|
73 |
"ERROR: USB DEVICE REQUEST invalid length 0x%x", aBuffer.Length());
|
|
74 |
return KErrGeneral;
|
|
75 |
}
|
0
|
76 |
|
286
|
77 |
iRequestType = aBuffer[0];
|
|
78 |
iRequest = static_cast<TEp0Request>(aBuffer[1]);
|
|
79 |
iValue = static_cast<TUint16>(aBuffer[2] + (aBuffer[3] << 8));
|
|
80 |
iIndex = static_cast<TUint16>(aBuffer[4] + (aBuffer[5] << 8));
|
|
81 |
iLength = static_cast<TUint16>(aBuffer[6] + (aBuffer[7] << 8));
|
|
82 |
OstTraceExt5(TRACE_SMASSSTORAGE_USB, TUSBREQUESTHDR_DECODE,
|
|
83 |
"USB DEVICE REQUEST type=0x%x request=0x%x value=%d index=%d length=%d",
|
|
84 |
iRequestType, iRequest, iValue, iIndex, iLength);
|
0
|
85 |
|
286
|
86 |
return KErrNone;
|
|
87 |
}
|
0
|
88 |
|
|
89 |
|
|
90 |
/**
|
|
91 |
This function determines whether data is required by the host in response
|
|
92 |
to a message header.
|
|
93 |
|
286
|
94 |
@return TBool Flag indicating whether a data response required.
|
0
|
95 |
*/
|
|
96 |
TBool TUsbRequestHdr::IsDataResponseRequired() const
|
|
97 |
|
286
|
98 |
{
|
|
99 |
return (iRequestType & 0x80) ? (TBool)ETrue : (TBool)EFalse;
|
|
100 |
}
|
0
|
101 |
|
|
102 |
//-------------------------------------
|
|
103 |
/**
|
|
104 |
Create an object of a class derived from CBulkOnlyTransport (default to CBulkOnlyTransportUsbcLdd object)
|
|
105 |
@param aNumDrives - The number of drives available for MS
|
|
106 |
@param aController - reference to the parent
|
|
107 |
@return pointer to newly created derived class object
|
|
108 |
*/
|
|
109 |
CBulkOnlyTransport* CBulkOnlyTransport::NewL(TInt aNumDrives,CUsbMassStorageController& aController)
|
286
|
110 |
{
|
|
111 |
return NewL(aNumDrives,aController, (CUsbMassStorageController::TTransportldd) 1);
|
|
112 |
}
|
0
|
113 |
|
|
114 |
/**
|
286
|
115 |
Create an object of a class derived from CBulkOnlyTransport
|
0
|
116 |
@param aNumDrives - The number of drives available for MS
|
|
117 |
@param aController - reference to the parent
|
|
118 |
@param aTransportLddFlag - Type of usb client ldd
|
|
119 |
@return pointer to newly created derived class object
|
|
120 |
*/
|
|
121 |
CBulkOnlyTransport* CBulkOnlyTransport::NewL(TInt aNumDrives,CUsbMassStorageController& aController, CUsbMassStorageController::TTransportldd aTransportLddFlag)
|
286
|
122 |
{
|
|
123 |
if (aNumDrives <=0 || static_cast<TUint>(aNumDrives) > KUsbMsMaxDrives)
|
|
124 |
{
|
|
125 |
User::Leave(KErrArgument);
|
|
126 |
}
|
0
|
127 |
|
271
|
128 |
#if !defined(__WINS__) && !defined(__X86__)
|
286
|
129 |
CBulkOnlyTransportUsbcScLdd* scTransport;
|
271
|
130 |
#endif
|
286
|
131 |
CBulkOnlyTransportUsbcLdd* nonscTransport;
|
|
132 |
switch (aTransportLddFlag)
|
|
133 |
{
|
|
134 |
case 1:
|
|
135 |
nonscTransport = new(ELeave) CBulkOnlyTransportUsbcLdd(aNumDrives, aController);
|
|
136 |
OstTrace0(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_NEWL1, "CBulkOnlyTransportUsbcLdd created.");
|
|
137 |
return nonscTransport;
|
271
|
138 |
#if !defined(__WINS__) && !defined(__X86__)
|
286
|
139 |
case 2:
|
|
140 |
scTransport = new(ELeave) CBulkOnlyTransportUsbcScLdd(aNumDrives, aController);
|
|
141 |
OstTrace0(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_NEWL2, "CBulkOnlyTransportUsbcScLdd created.");
|
|
142 |
return scTransport;
|
271
|
143 |
#endif
|
|
144 |
default:
|
286
|
145 |
__ASSERT_DEBUG(EFalse, User::Panic(KUsbMsSvrPncCat, EMsCBulkOnlyTransportNull));
|
|
146 |
return NULL;
|
0
|
147 |
|
286
|
148 |
}
|
|
149 |
}
|
0
|
150 |
|
|
151 |
|
|
152 |
TInt CBulkOnlyTransport::InitialiseTransportL(TInt aTransportLddFlag)
|
286
|
153 |
{
|
|
154 |
TInt ret = KErrNone;
|
|
155 |
MTransportBase* transport;
|
|
156 |
iController.GetTransport(transport);
|
|
157 |
switch (aTransportLddFlag)
|
|
158 |
{
|
271
|
159 |
#if !defined(__WINS__) && !defined(__X86__)
|
286
|
160 |
case 2:
|
|
161 |
ret = ((CBulkOnlyTransportUsbcScLdd*) transport)->Ldd().Open(0);
|
|
162 |
if (ret != KErrNone)
|
|
163 |
{
|
|
164 |
return ret;
|
|
165 |
}
|
|
166 |
else
|
|
167 |
{
|
|
168 |
((CBulkOnlyTransportUsbcScLdd*) transport)->Ldd().Close();
|
|
169 |
CleanupStack::PushL(transport);
|
|
170 |
((CBulkOnlyTransportUsbcScLdd*) transport)->ConstructL();
|
|
171 |
CleanupStack::Pop(transport);
|
|
172 |
return ret;
|
|
173 |
}
|
271
|
174 |
#endif
|
286
|
175 |
case 1:
|
|
176 |
ret = ((CBulkOnlyTransportUsbcLdd*) transport)->Ldd().Open(0);
|
|
177 |
if (ret != KErrNone)
|
|
178 |
{
|
|
179 |
return ret;
|
|
180 |
}
|
|
181 |
else
|
|
182 |
{
|
|
183 |
((CBulkOnlyTransportUsbcLdd*) transport)->Ldd().Close();
|
|
184 |
CleanupStack::PushL(transport);
|
|
185 |
((CBulkOnlyTransportUsbcLdd*) transport)->ConstructL();
|
|
186 |
CleanupStack::Pop(transport);
|
|
187 |
return ret;
|
|
188 |
}
|
|
189 |
default:
|
|
190 |
return KErrNotFound;
|
|
191 |
}
|
|
192 |
}
|
0
|
193 |
|
|
194 |
/**
|
|
195 |
c'tor
|
|
196 |
@param aNumDrives - The number of drives available for MS
|
|
197 |
@param aController - reference to the parent
|
|
198 |
*/
|
|
199 |
CBulkOnlyTransport::CBulkOnlyTransport(TInt aNumDrives,CUsbMassStorageController& aController):
|
286
|
200 |
CActive(EPriorityStandard),
|
|
201 |
iMaxLun(aNumDrives-1),
|
|
202 |
iController(aController),
|
|
203 |
iStallAllowed(ETrue),
|
|
204 |
iInterfaceConfigured(EFalse),
|
|
205 |
iCommandBufPtr(NULL,0),
|
|
206 |
iDataBufPtr(NULL,0),
|
|
207 |
iCswBufPtr(NULL,0),
|
|
208 |
iPaddingBufPtr(NULL,0),
|
|
209 |
iWriteBufPtr(NULL,0),
|
|
210 |
iReadBufPtr(NULL, 0),
|
|
211 |
iCbwBufPtr(NULL,0)
|
|
212 |
{
|
|
213 |
}
|
0
|
214 |
|
|
215 |
/**
|
|
216 |
Destructor
|
|
217 |
*/
|
|
218 |
CBulkOnlyTransport::~CBulkOnlyTransport()
|
286
|
219 |
{
|
|
220 |
}
|
0
|
221 |
|
|
222 |
|
|
223 |
/**
|
|
224 |
Called by the protocol after processing the packet to indicate that more data is required.
|
|
225 |
|
|
226 |
@param aData reference to the data buffer.
|
|
227 |
*/
|
|
228 |
void CBulkOnlyTransport::SetupReadData(TUint aLength)
|
286
|
229 |
{
|
|
230 |
OstTrace1(TRACE_SMASSSTORAGE_BOTDATA, CBULKONLYTRANSPORT_SETUPREADDATA,
|
|
231 |
"BOT SetupReadData Length = 0x%x bytes", aLength);
|
|
232 |
iBufSize = aLength;
|
|
233 |
iReadSetUp = ETrue;
|
|
234 |
}
|
0
|
235 |
|
|
236 |
|
|
237 |
/**
|
|
238 |
Called by the protocol after processing the packet to indicate that data should be written to the host.
|
|
239 |
|
|
240 |
@param aData reference to the data buffer.
|
|
241 |
*/
|
|
242 |
void CBulkOnlyTransport::SetupWriteData(TPtrC8& aData)
|
286
|
243 |
{
|
|
244 |
OstTrace1(TRACE_SMASSSTORAGE_BOTDATA, CBULKONLYTRANSPORT_SETUPWRITEDATA,
|
|
245 |
"BOT SetupWriteData Length = 0x%x bytes", aData.Length());
|
|
246 |
iWriteBufPtr.Set(aData);
|
|
247 |
iWriteSetUp = ETrue;
|
|
248 |
}
|
0
|
249 |
|
|
250 |
|
|
251 |
TInt CBulkOnlyTransport::Start()
|
286
|
252 |
{
|
|
253 |
OstTrace0(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_START, "Start...");
|
|
254 |
if (!iProtocol)
|
|
255 |
{
|
|
256 |
return KErrBadHandle; //protocol should be set up before start
|
|
257 |
}
|
0
|
258 |
|
286
|
259 |
if (IsActive())
|
|
260 |
{
|
|
261 |
OstTrace0(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_START1, "Error: active before start!");
|
|
262 |
return KErrInUse;
|
|
263 |
}
|
0
|
264 |
|
286
|
265 |
TInt err = KErrNone;
|
|
266 |
if ((err = SetupConfigurationDescriptor()) != KErrNone ||
|
|
267 |
(err = SetupInterfaceDescriptors()) != KErrNone )
|
|
268 |
{
|
|
269 |
OstTrace1(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_START2, "Error: descriptors setup failed %d", err);
|
|
270 |
return err;
|
|
271 |
}
|
0
|
272 |
|
286
|
273 |
AllocateEndpointResources();
|
|
274 |
ActivateDeviceStateNotifier(); // activate notifier wich will wait until USB became configured
|
|
275 |
TUsbcDeviceState deviceStatus = EUsbcDeviceStateDefault;
|
|
276 |
err = GetDeviceStatus(deviceStatus);
|
|
277 |
if (err == KErrNone && deviceStatus == EUsbcDeviceStateConfigured)
|
|
278 |
{
|
|
279 |
err = HwStart();
|
|
280 |
}
|
0
|
281 |
|
|
282 |
#ifdef MSDC_MULTITHREADED
|
286
|
283 |
TPtr8 aDes1(NULL,0);
|
|
284 |
TPtr8 aDes2(NULL,0);
|
|
285 |
GetBufferPointers(aDes1, aDes2);
|
|
286 |
iProtocol->InitializeBufferPointers(aDes1, aDes2); // have to pass pointer to memory not offsets to initialise TPtr, and lengths
|
0
|
287 |
#endif
|
|
288 |
|
286
|
289 |
iInterfaceConfigured = ETrue;
|
|
290 |
return err;
|
|
291 |
}
|
0
|
292 |
|
|
293 |
TInt CBulkOnlyTransport::HwStart(TBool aDiscard)
|
286
|
294 |
{
|
|
295 |
TInt lun = MaxLun();
|
|
296 |
OstTrace1(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_HWSTART, "HwStart MAX LUN=%d", lun);
|
|
297 |
do
|
|
298 |
{
|
|
299 |
Controller().DriveManager().Connect(lun);
|
|
300 |
}
|
|
301 |
while(--lun >= 0);
|
|
302 |
|
|
303 |
TInt res = StartControlInterface();
|
|
304 |
|
|
305 |
iCurrentState = ENone;
|
|
306 |
iWriteSetUp=EFalse;
|
|
307 |
iReadSetUp=EFalse;
|
|
308 |
iStarted = ETrue;
|
|
309 |
|
|
310 |
if (aDiscard)
|
|
311 |
{
|
|
312 |
FlushData();
|
|
313 |
}
|
|
314 |
|
|
315 |
ReadCBW();
|
|
316 |
return res;
|
|
317 |
}
|
|
318 |
|
0
|
319 |
|
286
|
320 |
TInt CBulkOnlyTransport::HwStop()
|
|
321 |
{
|
|
322 |
OstTrace0(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_HWSTOP, "HwStop");
|
|
323 |
if (iStarted)
|
|
324 |
{
|
|
325 |
StopBulkOnlyEndpoint();
|
|
326 |
CancelControlInterface();
|
|
327 |
iStarted = EFalse;
|
|
328 |
}
|
|
329 |
return KErrNone;
|
|
330 |
}
|
|
331 |
|
|
332 |
|
|
333 |
void CBulkOnlyTransport::StopBulkOnlyEndpoint()
|
|
334 |
{
|
|
335 |
TInt lun = MaxLun();
|
|
336 |
do
|
|
337 |
{
|
|
338 |
Controller().DriveManager().Disconnect(lun);
|
|
339 |
}
|
|
340 |
while(--lun >= 0);
|
|
341 |
Cancel();
|
|
342 |
iProtocol->Cancel();
|
|
343 |
}
|
|
344 |
|
|
345 |
|
|
346 |
TInt CBulkOnlyTransport::HwSuspend()
|
|
347 |
{
|
|
348 |
OstTrace0(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_HWSUSPEND, "HwSuspend");
|
|
349 |
TInt lun = MaxLun();
|
|
350 |
do
|
|
351 |
{
|
|
352 |
Controller().DriveManager().Disconnect(lun);
|
|
353 |
}
|
|
354 |
while(--lun >= 0);
|
|
355 |
|
|
356 |
return KErrNone;
|
|
357 |
}
|
|
358 |
|
|
359 |
|
|
360 |
TInt CBulkOnlyTransport::HwResume()
|
|
361 |
{
|
|
362 |
OstTrace0(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_HWRESUME, "HwResume");
|
0
|
363 |
TInt lun = MaxLun();
|
|
364 |
do
|
|
365 |
{
|
|
366 |
Controller().DriveManager().Connect(lun);
|
|
367 |
}
|
|
368 |
while(--lun >= 0);
|
|
369 |
|
286
|
370 |
return KErrNone;
|
|
371 |
}
|
0
|
372 |
|
|
373 |
/**
|
|
374 |
Stops the Bulk Only Transport
|
|
375 |
*/
|
|
376 |
TInt CBulkOnlyTransport::Stop()
|
286
|
377 |
{
|
|
378 |
OstTrace0(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_STOP, "Stop");
|
|
379 |
CancelControlInterface();
|
|
380 |
CancelDeviceStateNotifier();
|
|
381 |
Cancel();
|
|
382 |
if (iInterfaceConfigured)
|
|
383 |
{
|
|
384 |
ReleaseInterface();
|
|
385 |
SetupConfigurationDescriptor(ETrue);
|
|
386 |
}
|
|
387 |
iCurrentState = ENone;
|
|
388 |
iInterfaceConfigured = EFalse;
|
0
|
389 |
|
286
|
390 |
return KErrNone;
|
|
391 |
}
|
0
|
392 |
|
|
393 |
|
|
394 |
|
|
395 |
void CBulkOnlyTransport::DoCancel()
|
286
|
396 |
{
|
|
397 |
CancelReadWriteRequests();
|
|
398 |
}
|
0
|
399 |
|
|
400 |
|
|
401 |
void CBulkOnlyTransport::Activate(TInt aReason)
|
|
402 |
{
|
|
403 |
SetActive();
|
|
404 |
TRequestStatus* r = &iStatus;
|
|
405 |
User::RequestComplete(r, aReason);
|
|
406 |
}
|
|
407 |
|
|
408 |
|
|
409 |
void CBulkOnlyTransport::RunL()
|
286
|
410 |
{
|
|
411 |
if (iStatus != KErrNone)
|
|
412 |
{
|
|
413 |
OstTrace1(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_RUNL, "Error %d in RunL, halt endpoints", iStatus.Int());
|
|
414 |
SetPermError(); //halt endpoints for reset recovery
|
|
415 |
return;
|
|
416 |
}
|
|
417 |
switch (iCurrentState)
|
|
418 |
{
|
|
419 |
case EWaitForCBW:
|
|
420 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_RUNL1, "EWaitForCBW");
|
|
421 |
ProcessCbwEvent();
|
|
422 |
break;
|
0
|
423 |
|
286
|
424 |
case EWritingData:
|
|
425 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_RUNL2, "EWritingData");
|
|
426 |
iWriteSetUp = EFalse; //the buffer was used
|
0
|
427 |
|
286
|
428 |
if (iDataResidue && iStallAllowed)
|
|
429 |
{
|
|
430 |
StallEndpointAndWaitForClear();
|
|
431 |
}
|
0
|
432 |
|
286
|
433 |
SendCSW(iCbwTag, iDataResidue, iCmdStatus);
|
|
434 |
break;
|
0
|
435 |
|
286
|
436 |
case EReadingData:
|
|
437 |
{
|
|
438 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_RUNL3, "EReadingData");
|
|
439 |
ProcessReadingDataEvent();
|
|
440 |
}
|
|
441 |
break;
|
0
|
442 |
|
286
|
443 |
case ESendingCSW:
|
|
444 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_RUNL4, "ESendingCSW");
|
|
445 |
ReadCBW();
|
|
446 |
break;
|
0
|
447 |
|
|
448 |
case EPermErr:
|
286
|
449 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_RUNL5, "EPermErr");
|
|
450 |
StallEndpointAndWaitForClear();
|
0
|
451 |
break;
|
|
452 |
|
|
453 |
default:
|
286
|
454 |
SetPermError(); // unexpected state
|
|
455 |
}
|
|
456 |
}
|
0
|
457 |
|
|
458 |
|
|
459 |
/**
|
|
460 |
Decode the CBW received from the host via OutEndpoint
|
|
461 |
|
|
462 |
- If the header is valid, the data content is passed to the parser.
|
|
463 |
- Depending on the command, more data may be transmitted/received.
|
|
464 |
- ...or the CSW is sent (if not a data command).
|
|
465 |
|
|
466 |
*/
|
|
467 |
void CBulkOnlyTransport::DecodeCBW()
|
286
|
468 |
{
|
|
469 |
SetCbwPtr();
|
0
|
470 |
|
286
|
471 |
if (!CheckCBW()) //check if CBW valid and meaningful
|
|
472 |
{
|
0
|
473 |
// CBW not valid or meaningful
|
|
474 |
// Specification says: "If the CBW is not valid, the device shall STALL
|
|
475 |
// the Bulk-In pipe. Also, the device shall either STALL the Bulk-Out pipe,
|
|
476 |
// or the device shall accept and discard any Bulk-Out data. The device
|
|
477 |
// shall maintain this state until a Reset Recovery."
|
|
478 |
// Here we keep bulk-in ep stalled and ignore bulk-out ep.
|
286
|
479 |
SetPermError();
|
|
480 |
ExpireData((TAny*) (iCbwBufPtr.Ptr()));
|
|
481 |
return;
|
|
482 |
}
|
0
|
483 |
|
286
|
484 |
TPtrC8 aData;
|
|
485 |
aData.Set(&iCbwBufPtr[KCbwCbLengthOffset], KMaxCbwcbLength+1); //prepare data for protocol starting form Length
|
|
486 |
TUint lun = static_cast<TUint8>(iCbwBufPtr[13] & 0x0f);
|
0
|
487 |
|
286
|
488 |
iCbwTag = static_cast<TUint32>(iCbwBufPtr[KCbwTagOffset]) |
|
|
489 |
static_cast<TUint32>(iCbwBufPtr[KCbwTagOffset+1]) <<8 |
|
|
490 |
static_cast<TUint32>(iCbwBufPtr[KCbwTagOffset+2]) <<16|
|
|
491 |
static_cast<TUint32>(iCbwBufPtr[KCbwTagOffset+3]) <<24;
|
0
|
492 |
|
286
|
493 |
TInt i = KCbwDataTransferLengthOffset;
|
|
494 |
TUint32 hostDataLength = static_cast<TUint32>(iCbwBufPtr[i ]) |
|
|
495 |
static_cast<TUint32>(iCbwBufPtr[i+1]) <<8 |
|
|
496 |
static_cast<TUint32>(iCbwBufPtr[i+2]) <<16 |
|
|
497 |
static_cast<TUint32>(iCbwBufPtr[i+3]) <<24;
|
0
|
498 |
|
286
|
499 |
TBool dataToHost = iCbwBufPtr[KCbwFlagOffset] & 0x80;
|
0
|
500 |
|
286
|
501 |
OstTrace1(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_DECODECBW,
|
|
502 |
"CBW LUN=%d", lun);
|
|
503 |
OstTraceExt3(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_DECODECBW0,
|
|
504 |
"CBW hostDataLength=0x%x, CBWtag = 0x%x, dataToHost=%d",
|
|
505 |
hostDataLength, iCbwTag, (TUint32)dataToHost);
|
|
506 |
//////////////////////////////////////////////
|
|
507 |
TBool ret = iProtocol->DecodePacket(aData, lun);
|
|
508 |
//////////////////////////////////////////////
|
|
509 |
ExpireData((TAny*) (iCbwBufPtr.Ptr()));
|
0
|
510 |
|
286
|
511 |
iStallAllowed = ETrue;
|
0
|
512 |
|
286
|
513 |
if (!ret)
|
|
514 |
{
|
|
515 |
OstTrace1(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_DECODECBW1, "ERROR: DecodePacket err=%d", ret);
|
|
516 |
iCmdStatus = ECommandFailed;
|
|
517 |
}
|
|
518 |
else
|
|
519 |
{
|
|
520 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW2, "ERROR: DecodePacket OK");
|
|
521 |
iCmdStatus = ECommandPassed;
|
|
522 |
}
|
0
|
523 |
|
286
|
524 |
if (hostDataLength) // Host expected data transfer
|
|
525 |
{
|
|
526 |
if (dataToHost) // send data to host
|
|
527 |
{
|
|
528 |
if (!iWriteSetUp) //write buffer was not set up
|
|
529 |
{
|
|
530 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW3, "Write buffer was not setup");
|
|
531 |
iDataResidue =hostDataLength;
|
|
532 |
OstTrace1(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW4, "DataResidue (write to host)=%d", iDataResidue);
|
0
|
533 |
|
|
534 |
//------------------------------------
|
286
|
535 |
if (hostDataLength <= KBOTMaxBufSize)
|
|
536 |
{
|
|
537 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW5, "Case 4 or 8");
|
|
538 |
SetPaddingBufPtr(hostDataLength);
|
|
539 |
iPaddingBufPtr.FillZ(hostDataLength);
|
|
540 |
TPtrC8 ptr(NULL, 0);
|
|
541 |
ptr.Set((TUint8*)iPaddingBufPtr.Ptr(), hostDataLength);
|
|
542 |
WriteData(iStatus, ptr, hostDataLength, EFalse);
|
|
543 |
iStallAllowed = EFalse;
|
|
544 |
if (iReadSetUp) //read buffer WAS set up - case (8)
|
|
545 |
{
|
|
546 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW6, "It is Case 8");
|
|
547 |
iCmdStatus = EPhaseError;
|
|
548 |
}
|
|
549 |
return;
|
|
550 |
}
|
|
551 |
else
|
0
|
552 |
//------------------------------------
|
286
|
553 |
// Use next block instead of StallEndpointAndWaitForClear(InEndpoint);
|
|
554 |
{
|
|
555 |
SetPaddingBufPtr(hostDataLength);
|
|
556 |
iPaddingBufPtr.FillZ(KBOTMaxBufSize);
|
|
557 |
TUint c =0;
|
|
558 |
TRequestStatus status;
|
|
559 |
while (c<hostDataLength)
|
|
560 |
{
|
|
561 |
TInt len;
|
|
562 |
if (hostDataLength - c > KBOTMaxBufSize)
|
|
563 |
{
|
|
564 |
len = KBOTMaxBufSize;
|
|
565 |
}
|
|
566 |
else
|
|
567 |
{
|
|
568 |
len = hostDataLength - c;
|
|
569 |
}
|
0
|
570 |
|
286
|
571 |
TPtrC8 ptr(NULL, 0);
|
|
572 |
ptr.Set((TUint8*)iPaddingBufPtr.Ptr(), len);
|
|
573 |
WriteUsb(status, ptr, len);
|
|
574 |
User::WaitForRequest(status);
|
|
575 |
c += KBOTMaxBufSize;
|
|
576 |
}
|
|
577 |
}
|
0
|
578 |
|
286
|
579 |
if (iReadSetUp) //read buffer WAS set up - case (8)
|
|
580 |
{
|
|
581 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW7, "Case 8");
|
|
582 |
SendCSW(iCbwTag, hostDataLength, EPhaseError);
|
|
583 |
//don't care to reset any flag - should get reset recovery
|
|
584 |
}
|
|
585 |
else // case (4)
|
|
586 |
{
|
|
587 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW8, "Case 4");
|
|
588 |
SendCSW(iCbwTag, hostDataLength, iCmdStatus);
|
|
589 |
}
|
|
590 |
return;
|
|
591 |
} // if (!iWriteSetUp)
|
0
|
592 |
|
|
593 |
//==================
|
286
|
594 |
TUint32 deviceDataLength = iWriteBufPtr.Length();
|
|
595 |
iDataResidue =hostDataLength - deviceDataLength ;
|
|
596 |
OstTraceExt2(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW9,
|
|
597 |
"Device data length = 0x%x, DataResidue (write to host)=0x%x", deviceDataLength, iDataResidue);
|
0
|
598 |
|
286
|
599 |
if (deviceDataLength < hostDataLength &&
|
|
600 |
hostDataLength < KBOTMaxBufSize )
|
|
601 |
{
|
|
602 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW10, "Case 5 (padding)");
|
|
603 |
SetPaddingBufPtr(hostDataLength);
|
|
604 |
iPaddingBufPtr.Zero();
|
|
605 |
iPaddingBufPtr.Append(iWriteBufPtr);
|
|
606 |
iStallAllowed = EFalse;
|
|
607 |
OstTrace1(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW11,
|
|
608 |
"iPaddingBufPtr.Length = 0x%x",
|
|
609 |
iPaddingBufPtr.Length());
|
|
610 |
TPtrC8 ptr(NULL, 0);
|
|
611 |
ptr.Set((TUint8*)iPaddingBufPtr.Ptr(), hostDataLength);
|
|
612 |
WriteData(iStatus, ptr, hostDataLength, EFalse);
|
|
613 |
return;
|
|
614 |
}
|
0
|
615 |
|
|
616 |
//===================
|
|
617 |
|
286
|
618 |
if (deviceDataLength == hostDataLength) //case (6)[==]
|
|
619 |
{
|
|
620 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW12, "Case 6");
|
|
621 |
WriteData(iStatus, iWriteBufPtr, deviceDataLength);
|
|
622 |
return;
|
|
623 |
}
|
|
624 |
else if (deviceDataLength < hostDataLength) //case (5)[<]
|
|
625 |
{
|
|
626 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW13, "Case 5");
|
|
627 |
WriteData(iStatus, iWriteBufPtr, deviceDataLength, ETrue); // Send ZLP
|
|
628 |
return;
|
|
629 |
}
|
|
630 |
else // deviceDataLength > hostDataLength - case (7)
|
|
631 |
{
|
|
632 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW14, "Case 7");
|
|
633 |
iCmdStatus = EPhaseError;
|
|
634 |
iDataResidue = 0;
|
|
635 |
WriteData(iStatus, iWriteBufPtr, hostDataLength);
|
|
636 |
return;
|
|
637 |
}
|
|
638 |
}
|
|
639 |
else //read data from host
|
|
640 |
{
|
|
641 |
if (!iReadSetUp)
|
|
642 |
{
|
|
643 |
iDataResidue = hostDataLength;
|
|
644 |
OstTrace0(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_DECODECBW15, "Read buffer was not setup");
|
|
645 |
// Use next block instead of StallEndpointAndWaitForClear(OutEndpoint);
|
|
646 |
DiscardData(hostDataLength);
|
0
|
647 |
|
286
|
648 |
if (iWriteSetUp) //case (10)
|
|
649 |
{
|
|
650 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW16, "case 10");
|
|
651 |
SendCSW(iCbwTag, hostDataLength, EPhaseError);
|
|
652 |
}
|
|
653 |
else // case (9)
|
|
654 |
{
|
|
655 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW17, "Case 9");
|
|
656 |
SendCSW(iCbwTag, hostDataLength, iCmdStatus);
|
|
657 |
}
|
0
|
658 |
|
286
|
659 |
return;
|
|
660 |
}
|
0
|
661 |
|
286
|
662 |
TUint32 deviceDataLength = iBufSize;
|
|
663 |
iDataResidue = hostDataLength; // calculate residue later
|
0
|
664 |
|
286
|
665 |
OstTraceExt2(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW18,
|
|
666 |
"deviceDataLength = iBufSize = 0x%x, DataResidue = HDL for now (read from host) =0x%x",
|
|
667 |
deviceDataLength, iDataResidue);
|
0
|
668 |
|
286
|
669 |
if (deviceDataLength <= hostDataLength) // case (11) and (12)
|
|
670 |
{
|
|
671 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW19, "Case 11 or 12");
|
|
672 |
ReadData(deviceDataLength);
|
|
673 |
return;
|
|
674 |
}
|
|
675 |
if (deviceDataLength > hostDataLength) // case (13)
|
|
676 |
{
|
|
677 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW20, "Case 13");
|
0
|
678 |
/**
|
|
679 |
* Comment following line in order to pass compliant test.
|
|
680 |
* As spec said in case 13:"The device may receive data up to a
|
|
681 |
* total of dCBWDataTransferLength."
|
|
682 |
* Here we choose to ignore incoming data.
|
|
683 |
*/
|
286
|
684 |
//StallEndpointAndWaitForClear(OutEndpoint); //Stall Out endpoint
|
0
|
685 |
if (iReadSetUp)
|
|
686 |
{
|
286
|
687 |
WriteToClient(hostDataLength);
|
0
|
688 |
iReadSetUp = EFalse;
|
|
689 |
}
|
|
690 |
SendCSW(iCbwTag, hostDataLength, EPhaseError);
|
286
|
691 |
return;
|
|
692 |
}
|
|
693 |
}
|
|
694 |
}
|
|
695 |
else // Host expected no data transfer
|
|
696 |
{
|
|
697 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW21, "No data transfer expected");
|
|
698 |
iDataResidue = 0;
|
|
699 |
if (iWriteSetUp || iReadSetUp) // case (2) and (3)
|
|
700 |
{
|
|
701 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW22, "Case 2 or 3");
|
|
702 |
SendCSW(iCbwTag, 0, EPhaseError);
|
|
703 |
}
|
|
704 |
else
|
|
705 |
{
|
|
706 |
OstTrace0(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_DECODECBW23, "Case 1");
|
|
707 |
SendCSW(iCbwTag, 0, iCmdStatus); //case (1)
|
|
708 |
}
|
|
709 |
}
|
|
710 |
}
|
0
|
711 |
|
|
712 |
|
|
713 |
/**
|
|
714 |
Check if CBW Valid and Meaningful.
|
|
715 |
|
|
716 |
@return ETrue if CBW is Valid and Meaningful, EFalse otherwise
|
|
717 |
*/
|
|
718 |
TBool CBulkOnlyTransport::CheckCBW()
|
286
|
719 |
{
|
0
|
720 |
//
|
|
721 |
// Check valid
|
|
722 |
//
|
|
723 |
|
|
724 |
// Check length
|
|
725 |
if ((TUint) (iCbwBufPtr.Length()) != KCbwLength)
|
|
726 |
{
|
286
|
727 |
OstTrace1(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_CHECKCBW, "ERROR Bad length: 0x%x != KCbwLength", iCbwBufPtr.Length());
|
|
728 |
return EFalse;
|
0
|
729 |
}
|
|
730 |
|
|
731 |
// Check signature
|
286
|
732 |
TInt i = KCbwSignatureOffset;
|
|
733 |
if (iCbwBufPtr[i ] != 0x55 || // CBW Singature from USB Bulk-Only Transport spec
|
|
734 |
iCbwBufPtr[i+1] != 0x53 ||
|
|
735 |
iCbwBufPtr[i+2] != 0x42 ||
|
|
736 |
iCbwBufPtr[i+3] != 0x43)
|
|
737 |
{
|
|
738 |
OstTraceData(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_CHECKCBW1,
|
|
739 |
"CBW ERROR: Bad signature %s", &iCbwBufPtr[i], 4);
|
|
740 |
return EFalse;
|
|
741 |
}
|
0
|
742 |
|
|
743 |
//
|
|
744 |
// Check meaningful
|
|
745 |
//
|
|
746 |
|
|
747 |
// Check reserved bits ( must be zero )
|
|
748 |
if ((iCbwBufPtr[KCbwLunOffset] & 0xF0) || (iCbwBufPtr[KCbwCbLengthOffset] & 0xE0))
|
286
|
749 |
{
|
|
750 |
OstTrace0(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_CHECKCBW2, "CBW ERROR: Reserved bits not zero");
|
|
751 |
return EFalse;
|
|
752 |
}
|
0
|
753 |
|
286
|
754 |
// check command block length
|
|
755 |
TInt cbwcbLength = iCbwBufPtr[KCbwCbLengthOffset] & 0x1F;
|
|
756 |
if (cbwcbLength >KMaxCbwcbLength)
|
|
757 |
{
|
|
758 |
OstTrace0(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_CHECKCBW3, "CBW ERROR: Incorrect block length");
|
|
759 |
return EFalse;
|
|
760 |
}
|
0
|
761 |
|
286
|
762 |
//check LUN
|
|
763 |
TInt8 lun = static_cast<TUint8>(iCbwBufPtr[KCbwLunOffset] & 0x0f);
|
|
764 |
if (iMaxLun < lun)
|
|
765 |
{
|
|
766 |
OstTrace1(TRACE_SMASSSTORAGE_BOT, CBULKONLYTRANSPORT_CHECKCBW4, "CBW ERROR: bad lun: %d", lun);
|
|
767 |
return EFalse;
|
|
768 |
}
|
0
|
769 |
|
286
|
770 |
return ETrue;
|
|
771 |
}
|
0
|
772 |
|
|
773 |
|
|
774 |
/**
|
|
775 |
Initiate stalling of bulk IN endpoint.
|
|
776 |
Used when protocol wants to force host to initiate a reset recovery.
|
|
777 |
*/
|
|
778 |
void CBulkOnlyTransport::SetPermError()
|
286
|
779 |
{
|
0
|
780 |
iCurrentState = EPermErr;
|
|
781 |
Activate(KErrNone);
|
286
|
782 |
}
|
0
|
783 |
|
|
784 |
|
|
785 |
/**
|
|
786 |
Send data provided by protocol to the host
|
|
787 |
|
|
788 |
@param aLength amount of data (in bytes) to be send to host
|
|
789 |
*/
|
|
790 |
void CBulkOnlyTransport::WriteData(TRequestStatus& aStatus, TPtrC8& aDes, TUint aLength, TBool aZlpRequired)
|
286
|
791 |
{
|
|
792 |
if (IsActive())
|
|
793 |
{
|
|
794 |
__ASSERT_DEBUG(EFalse, User::Panic(KUsbMsSvrPncCat, EMsBulkOnlyStillActive));
|
|
795 |
return;
|
|
796 |
}
|
|
797 |
WriteUsb(aStatus, aDes, aLength, aZlpRequired);
|
|
798 |
iCurrentState = EWritingData;
|
|
799 |
SetActive();
|
|
800 |
}
|
0
|
801 |
|
|
802 |
|
|
803 |
/**
|
|
804 |
Send Command Status Wrapper to the host
|
|
805 |
|
|
806 |
@param aTag Echo of Command Block Tag sent by the host.
|
|
807 |
@param aDataResidue the difference between the amount of data expected by the
|
|
808 |
host, and the actual amount of data processed by the device.
|
|
809 |
@param aStatus indicates the success or failure of the command.
|
|
810 |
*/
|
|
811 |
void CBulkOnlyTransport::SendCSW(TUint aTag, TUint aDataResidue, TCswStatus aStatus)
|
286
|
812 |
{
|
|
813 |
OstTraceExt2(TRACE_SMASSSTORAGE_BOT1, CBULKONLYTRANSPORT_SENDCSW,
|
|
814 |
"CSW DataResidue = 0x%x, Status = %d", aDataResidue, aStatus);
|
0
|
815 |
|
286
|
816 |
if (IsActive())
|
|
817 |
{
|
|
818 |
__ASSERT_DEBUG(EFalse, User::Panic(KUsbMsSvrPncCat, EMsBulkOnlyStillActive));
|
|
819 |
return;
|
|
820 |
}
|
0
|
821 |
|
286
|
822 |
SetCswBufPtr(KCswLength);
|
|
823 |
TInt i = KCswSingnatureOffset;
|
|
824 |
iCswBufPtr[i ] = 0x55; // CSW Singature from USB Bulk-Only Transport spec
|
|
825 |
iCswBufPtr[i+1] = 0x53;
|
|
826 |
iCswBufPtr[i+2] = 0x42;
|
|
827 |
iCswBufPtr[i+3] = 0x53;
|
0
|
828 |
|
286
|
829 |
i = KCswTagOffset;
|
0
|
830 |
|
286
|
831 |
iCswBufPtr[i ] = static_cast<TUint8>((aTag & 0x000000FF));
|
|
832 |
iCswBufPtr[i+1] = static_cast<TUint8>((aTag & 0x0000FF00) >> 8);
|
|
833 |
iCswBufPtr[i+2] = static_cast<TUint8>((aTag & 0x00FF0000) >> 16);
|
|
834 |
iCswBufPtr[i+3] = static_cast<TUint8>((aTag & 0xFF000000) >> 24);
|
0
|
835 |
|
286
|
836 |
i = KCswDataResidueOffset;
|
|
837 |
iCswBufPtr[i ] = static_cast<TUint8>((aDataResidue & 0x000000FF));
|
|
838 |
iCswBufPtr[i+1] = static_cast<TUint8>((aDataResidue & 0x0000FF00) >> 8);
|
|
839 |
iCswBufPtr[i+2] = static_cast<TUint8>((aDataResidue & 0x00FF0000) >> 16);
|
|
840 |
iCswBufPtr[i+3] = static_cast<TUint8>((aDataResidue & 0xFF000000) >> 24);
|
0
|
841 |
|
286
|
842 |
iCswBufPtr[KCswStatusOffset] = static_cast<TUint8>(aStatus);
|
0
|
843 |
|
286
|
844 |
TPtrC8 ptr(NULL, 0);
|
|
845 |
ptr.Set((const TUint8*)iCswBufPtr.Ptr(), KCswLength);
|
0
|
846 |
|
286
|
847 |
WriteUsb(iStatus, ptr, KCswLength);
|
0
|
848 |
|
286
|
849 |
iCurrentState = ESendingCSW;
|
0
|
850 |
|
286
|
851 |
SetActive();
|
|
852 |
}
|
0
|
853 |
|
|
854 |
|
|
855 |
/**
|
|
856 |
Associates the transport with the protocol. Called during initialization of the controller.
|
|
857 |
|
|
858 |
@param aProtocol reference to the protocol
|
|
859 |
*/
|
|
860 |
void CBulkOnlyTransport::RegisterProtocol(MProtocolBase& aProtocol)
|
286
|
861 |
{
|
|
862 |
iProtocol = &aProtocol;
|
|
863 |
}
|
0
|
864 |
|
|
865 |
|
|
866 |
/**
|
|
867 |
Used by CControlInterface
|
|
868 |
|
|
869 |
@return reference to the controller which instantiate the CBulkOnlyTransport
|
|
870 |
*/
|
|
871 |
CUsbMassStorageController& CBulkOnlyTransport::Controller()
|
286
|
872 |
{
|
|
873 |
return iController;
|
|
874 |
}
|
0
|
875 |
|
|
876 |
|
|
877 |
/**
|
|
878 |
@return the number of logical units supported by the device.
|
|
879 |
Logical Unit Numbers on the device shall be numbered contiguously starting from LUN
|
|
880 |
0 to a maximum LUN of 15 (Fh).
|
|
881 |
*/
|
|
882 |
TInt CBulkOnlyTransport::MaxLun()
|
286
|
883 |
{
|
|
884 |
return iMaxLun;
|
|
885 |
}
|
0
|
886 |
|
|
887 |
|
|
888 |
void CBulkOnlyTransport::GetCommandBufPtr(TPtr8& aDes, TUint aLength) // Set pointer to buffer of specified aLength for command
|
286
|
889 |
{
|
|
890 |
aDes.Set(SetCommandBufPtr(aLength));
|
|
891 |
}
|
0
|
892 |
|
|
893 |
void CBulkOnlyTransport::GetReadDataBufPtr(TPtr8& aDes) // Set pointer to buffer into which data is to be read from drive (Read10)
|
286
|
894 |
{
|
|
895 |
aDes.Set(SetDataBufPtr());
|
|
896 |
}
|
0
|
897 |
|
|
898 |
|
|
899 |
void CBulkOnlyTransport::GetWriteDataBufPtr(TPtrC8& aDes) // Set pointer to buffer from which data is to be written to drive (Write10)
|
286
|
900 |
{
|
|
901 |
aDes.Set(iReadBufPtr);
|
|
902 |
}
|
0
|
903 |
|
|
904 |
#ifdef MSDC_MULTITHREADED
|
|
905 |
void CBulkOnlyTransport::ProcessReadData(TAny* aAddress)
|
286
|
906 |
{
|
|
907 |
ExpireData(aAddress);
|
|
908 |
}
|
0
|
909 |
#endif
|
|
910 |
|
|
911 |
|
|
912 |
|
|
913 |
|
|
914 |
|
|
915 |
|
|
916 |
|
|
917 |
|