userlibandfileserver/fileserver/shostmassstorage/server/transport/cbulkonlytransport.cpp
equal
deleted
inserted
replaced
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Eclipse Public License v1.0" |
4 // under the terms of the License "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
73 |
73 |
74 void CBulkOnlyTransport::ConstructL(TUint aInterfaceId) |
74 void CBulkOnlyTransport::ConstructL(TUint aInterfaceId) |
75 { |
75 { |
76 __MSFNSLOG |
76 __MSFNSLOG |
77 User::LeaveIfError(iInterface.Open(aInterfaceId)); |
77 User::LeaveIfError(iInterface.Open(aInterfaceId)); |
78 iUsbInterfaceHandler = CUsbInterfaceHandler::NewL(iInterface); |
78 iUsbInterfaceHandler = CUsbInterfaceHandler::NewL(iInterface, iBulkPipeIn); |
79 InitialiseTransport(); |
79 InitialiseTransport(); |
80 } |
80 } |
81 |
81 |
82 |
82 |
83 void CBulkOnlyTransport::Resume() |
83 void CBulkOnlyTransport::Resume() |
340 |
340 |
341 TUint32 dataReceived = 0; |
341 TUint32 dataReceived = 0; |
342 r = ProcessInTransferL(dataReceived); |
342 r = ProcessInTransferL(dataReceived); |
343 if (!r) |
343 if (!r) |
344 { |
344 { |
345 |
345 TRAP(r, aResp->DecodeL(data)); |
346 if (dataReceived == 0) |
346 if (dataReceived == 0) |
347 { |
347 { |
|
348 |
|
349 // Some devices are found not to support DataResidue and return zero |
|
350 // bytes received. This state is NOT treated as an error condition |
|
351 // and we assume that all bytes are valid. For SCSI command set |
|
352 // applicable to Mass Storage a device must always return data so |
|
353 // the zero byte condition is not possible with compliant devices. |
|
354 // |
|
355 // List of known non-compliant devices: |
|
356 // 1 Transcend JetFlashV30 VendorID=JetFlash ProductID=TS#GJFV30 |
|
357 // (# is device size in G) |
|
358 |
348 __BOTPRINT1(_L("Warning: No data received"), dataReceived); |
359 __BOTPRINT1(_L("Warning: No data received"), dataReceived); |
349 return KErrCommandNotSupported; |
|
350 } |
360 } |
351 |
|
352 TRAP(r, aResp->DecodeL(data)); |
|
353 } |
361 } |
354 return r; |
362 return r; |
355 } |
363 } |
356 |
364 |
357 |
365 |