kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0484.cpp
changeset 253 d37db4dcc88d
parent 0 a41df078684a
child 257 3e88ff8f41d5
equal deleted inserted replaced
252:0a40b8675b23 253:d37db4dcc88d
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2007-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".
    17 //
    17 //
    18 
    18 
    19 #include "PBASE-T_USBDI-0484.h"
    19 #include "PBASE-T_USBDI-0484.h"
    20 #include "testpolicy.h"
    20 #include "testpolicy.h"
    21 #include "modelleddevices.h"
    21 #include "modelleddevices.h"
       
    22 #include "OstTraceDefinitions.h"
       
    23 #ifdef OST_TRACE_COMPILER_IN_USE
       
    24 #include "PBASE-T_USBDI-0484Traces.h"
       
    25 #endif
    22 
    26 
    23 
    27 
    24  
    28  
    25 
    29 
    26 namespace NUnitTesting_USBDI
    30 namespace NUnitTesting_USBDI
    35 _LIT(KTestCaseId,"PBASE-T_USBDI-0484");
    39 _LIT(KTestCaseId,"PBASE-T_USBDI-0484");
    36 const TFunctorTestCase<CUT_PBASE_T_USBDI_0484,TBool> CUT_PBASE_T_USBDI_0484::iFunctor(KTestCaseId);	
    40 const TFunctorTestCase<CUT_PBASE_T_USBDI_0484,TBool> CUT_PBASE_T_USBDI_0484::iFunctor(KTestCaseId);	
    37 
    41 
    38 CUT_PBASE_T_USBDI_0484* CUT_PBASE_T_USBDI_0484::NewL(TBool aHostRole)
    42 CUT_PBASE_T_USBDI_0484* CUT_PBASE_T_USBDI_0484::NewL(TBool aHostRole)
    39 	{
    43 	{
       
    44 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0484_NEWL_ENTRY, aHostRole );
    40 	CUT_PBASE_T_USBDI_0484* self = new (ELeave) CUT_PBASE_T_USBDI_0484(aHostRole);
    45 	CUT_PBASE_T_USBDI_0484* self = new (ELeave) CUT_PBASE_T_USBDI_0484(aHostRole);
    41 	CleanupStack::PushL(self);
    46 	CleanupStack::PushL(self);
    42 	self->ConstructL();
    47 	self->ConstructL();
    43 	CleanupStack::Pop(self);
    48 	CleanupStack::Pop(self);
       
    49 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_NEWL_EXIT, ( TUint )( self ) );
    44 	return self;
    50 	return self;
    45 	}
    51 	}
    46 	
    52 	
    47 
    53 
    48 CUT_PBASE_T_USBDI_0484::CUT_PBASE_T_USBDI_0484(TBool aHostRole)
    54 CUT_PBASE_T_USBDI_0484::CUT_PBASE_T_USBDI_0484(TBool aHostRole)
    49 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
    55 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
    50 	iCaseStep(EInProgress)
    56 	iCaseStep(EInProgress)
    51 	{
    57 	{
       
    58 	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_ENTRY, this );
       
    59 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_EXIT, this );
    52 	} 
    60 	} 
    53 
    61 
    54 
    62 
    55 void CUT_PBASE_T_USBDI_0484::ConstructL()
    63 void CUT_PBASE_T_USBDI_0484::ConstructL()
    56 	{
    64 	{
       
    65 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0484_CONSTRUCTL_ENTRY, this );
    57 	BaseBulkConstructL();
    66 	BaseBulkConstructL();
       
    67 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_CONSTRUCTL_EXIT, this );
    58 	}
    68 	}
    59 
    69 
    60 
    70 
    61 CUT_PBASE_T_USBDI_0484::~CUT_PBASE_T_USBDI_0484()
    71 CUT_PBASE_T_USBDI_0484::~CUT_PBASE_T_USBDI_0484()
    62 	{
    72 	{
    63 	LOG_FUNC
    73 	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_ENTRY_DUP01, this );
       
    74 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_EXIT_DUP01, this );
    64 	}
    75 	}
    65 	
    76 	
    66 void CUT_PBASE_T_USBDI_0484::Ep0TransferCompleteL(TInt aCompletionCode)
    77 void CUT_PBASE_T_USBDI_0484::Ep0TransferCompleteL(TInt aCompletionCode)
    67 	{
    78 	{
    68 	LOG_FUNC
    79 	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL_ENTRY, this );
    69 	Cancel();	
    80 	Cancel();	
    70 	
    81 	
    71 	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
    82 	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
    72 	
    83 	
    73 	if(aCompletionCode != KErrNone)
    84 	if(aCompletionCode != KErrNone)
    74 		{	
    85 		{	
    75 		TBuf<256> msg;
    86 		TBuf<256> msg;
    76 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
    87 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
    77 		RDebug::Print(msg);
    88 		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL_DUP01, msg);
    78 		}
    89 		}
    79 
    90 
    80 	if(iCaseStep == EPassed)
    91 	if(iCaseStep == EPassed)
    81 		{	
    92 		{	
    82 		if(aCompletionCode == KErrNone)
    93 		if(aCompletionCode == KErrNone)
    89 	
   100 	
    90 	if(iCaseStep == EFailed)
   101 	if(iCaseStep == EFailed)
    91 		{
   102 		{
    92 		return TestFailed(KErrCompletion);
   103 		return TestFailed(KErrCompletion);
    93 		}
   104 		}
       
   105 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL_EXIT, this );
    94 	}
   106 	}
    95 	
   107 	
    96 	
   108 	
    97 void CUT_PBASE_T_USBDI_0484::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
   109 void CUT_PBASE_T_USBDI_0484::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
    98 	{
   110 	{
       
   111 	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_ENTRY, this );
    99 	Cancel();
   112 	Cancel();
   100 	TInt err(KErrNone);
   113 	TInt err(KErrNone);
   101 	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
   114 	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
   102 
   115 
   103 	if(aTransferId == KBulkTransferId1)
   116 	if(aTransferId == KBulkTransferId1)
   104 		{
   117 		{
   105 		if(iCaseStep == EStalled)
   118 		if(iCaseStep == EStalled)
   106 			{						
   119 			{						
   107 			if(aCompletionCode != KErrUsbStalled)
   120 			if(aCompletionCode != KErrUsbStalled)
   108 				{
   121 				{
   109 				TBuf<256> msg;
   122 				TBuf<256> msg;
   110 				msg.Format(_L("<Error %d> The transfer completed with no errors but should have stalled"),aCompletionCode);
   123 				msg.Format(_L("<Error %d> The transfer completed with no errors but should have stalled"),aCompletionCode);
   111 				RDebug::Print(msg);
   124 				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP01, msg);
   112 				TTestCaseFailed request(KErrCorrupt,msg);
   125 				TTestCaseFailed request(KErrCorrupt,msg);
   113 				return iControlEp0->SendRequest(request,this);
   126 				return iControlEp0->SendRequest(request,this);
   114 				}
   127 				}
   115 			else 
   128 			else 
   116 				{
   129 				{
   118 				err = iTestPipeInterface1BulkIn.ClearRemoteStall();
   131 				err = iTestPipeInterface1BulkIn.ClearRemoteStall();
   119 				if(err != KErrNone)
   132 				if(err != KErrNone)
   120 					{
   133 					{
   121 					TBuf<256> msg;
   134 					TBuf<256> msg;
   122 					msg.Format(_L("<Error %d> The remote stall cannot be cleared"),err);
   135 					msg.Format(_L("<Error %d> The remote stall cannot be cleared"),err);
   123 					RDebug::Print(msg);
   136 					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP02, msg);
   124 					iCaseStep = EFailed;
   137 					iCaseStep = EFailed;
   125 					TTestCaseFailed request(err,msg);
   138 					TTestCaseFailed request(err,msg);
   126 					return iControlEp0->SendRequest(request,this);
   139 					return iControlEp0->SendRequest(request,this);
   127 					}
   140 					}
   128 					
   141 					
   129 				// try to get data now, after EP has been stalled
   142 				// try to get data now, after EP has been stalled
   130 				RDebug::Printf("try to get data now, after EP has been stalled");
   143 				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP03, "try to get data now, after EP has been stalled");
   131 				iInTransfer[0]->TransferIn(KDataPayload1().Length());
   144 				iInTransfer[0]->TransferIn(KDataPayload1().Length());
   132 				iInTransfer[1]->TransferIn(KDataPayload2().Length());
   145 				iInTransfer[1]->TransferIn(KDataPayload2().Length());
   133 				iInTransfer[2]->TransferIn(KDataPayload3().Length());
   146 				iInTransfer[2]->TransferIn(KDataPayload3().Length());
   134 									
   147 									
   135 				iCaseStep = ETransferAfterStall;
   148 				iCaseStep = ETransferAfterStall;
   136 				TEndpointWriteRequest request(1,1,KDataPayload1);// EP1 because 1st writter EP
   149 				TEndpointWriteRequest request(1,1,KDataPayload1);// EP1 because 1st writter EP
   137 				iControlEp0->SendRequest(request,this);	
   150 				iControlEp0->SendRequest(request,this);	
       
   151 				OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_EXIT, this );
   138 				return;		
   152 				return;		
   139 				}
   153 				}
   140 			}
   154 			}
   141 		if(iCaseStep == ETransferAfterStall)
   155 		if(iCaseStep == ETransferAfterStall)
   142 			{
   156 			{
   143 			if(aCompletionCode != KErrNone)
   157 			if(aCompletionCode != KErrNone)
   144 				{
   158 				{
   145 				TBuf<256> msg;
   159 				TBuf<256> msg;
   146 				msg.Format(_L("<Error %d> No data got after EP2 being stalled"),aCompletionCode);
   160 				msg.Format(_L("<Error %d> No data got after EP2 being stalled"),aCompletionCode);
   147 				RDebug::Print(msg);
   161 				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP04, msg);
   148 				iCaseStep = EFailed;
   162 				iCaseStep = EFailed;
   149 				TTestCaseFailed request(err,msg);
   163 				TTestCaseFailed request(err,msg);
   150 				return iControlEp0->SendRequest(request,this);
   164 				return iControlEp0->SendRequest(request,this);
   151 				}	
   165 				}	
   152 				
   166 				
   155 			// Compare the data to what is expected		
   169 			// Compare the data to what is expected		
   156 			if(data.Compare(KDataPayload1) != 0)
   170 			if(data.Compare(KDataPayload1) != 0)
   157 				{
   171 				{
   158 				TBuf<256> msg;
   172 				TBuf<256> msg;
   159 				msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
   173 				msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
   160 				RDebug::Print(msg);
   174 				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP05, msg);
   161 				iCaseStep = EFailed;
   175 				iCaseStep = EFailed;
   162 				TTestCaseFailed request(KErrCompletion,msg);
   176 				TTestCaseFailed request(KErrCompletion,msg);
   163 				return iControlEp0->SendRequest(request,this);
   177 				return iControlEp0->SendRequest(request,this);
   164 				}			 
   178 				}			 
   165 			// Comparison is a match, wait for next transfer
   179 			// Comparison is a match, wait for next transfer
   166 			RDebug::Printf("Comparison is a match, wait for transfer 2");
   180 			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP06, "Comparison is a match, wait for transfer 2");
   167 			User::After(500000);
   181 			User::After(500000);
   168 			TEndpointWriteRequest request(1,1,KDataPayload2);// EP1 because 1st writter EP
   182 			TEndpointWriteRequest request(1,1,KDataPayload2);// EP1 because 1st writter EP
   169 			iControlEp0->SendRequest(request,this);						
   183 			iControlEp0->SendRequest(request,this);						
   170 			}
   184 			}
   171 		}
   185 		}
   173 		{
   187 		{
   174 		if(aCompletionCode != KErrNone)
   188 		if(aCompletionCode != KErrNone)
   175 			{
   189 			{
   176 			TBuf<256> msg;
   190 			TBuf<256> msg;
   177 			msg.Format(_L("<Error %d> No data got after EP2 being stalled"),aCompletionCode);
   191 			msg.Format(_L("<Error %d> No data got after EP2 being stalled"),aCompletionCode);
   178 			RDebug::Print(msg);
   192 			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP07, msg);
   179 			iCaseStep = EFailed;
   193 			iCaseStep = EFailed;
   180 			TTestCaseFailed request(err,msg);
   194 			TTestCaseFailed request(err,msg);
   181 			return iControlEp0->SendRequest(request,this);
   195 			return iControlEp0->SendRequest(request,this);
   182 			}	
   196 			}	
   183 			
   197 			
   186 		// Compare the data to what is expected		
   200 		// Compare the data to what is expected		
   187 		if(data.Compare(KDataPayload2) != 0)
   201 		if(data.Compare(KDataPayload2) != 0)
   188 			{
   202 			{
   189 			TBuf<256> msg;
   203 			TBuf<256> msg;
   190 			msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
   204 			msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
   191 			RDebug::Print(msg);
   205 			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP08, msg);
   192 			iCaseStep = EFailed;
   206 			iCaseStep = EFailed;
   193 			TTestCaseFailed request(KErrCompletion,msg);
   207 			TTestCaseFailed request(KErrCompletion,msg);
   194 			return iControlEp0->SendRequest(request,this);
   208 			return iControlEp0->SendRequest(request,this);
   195 			}			 
   209 			}			 
   196 		// Comparison is a match, wait for next transfer
   210 		// Comparison is a match, wait for next transfer
   197 		RDebug::Printf("Comparison is a match, wait for transfer 3");
   211 		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP09, "Comparison is a match, wait for transfer 3");
   198 		User::After(500000);
   212 		User::After(500000);
   199 		TEndpointWriteRequest request(1,1,KDataPayload3);// EP1 because 1st writter EP
   213 		TEndpointWriteRequest request(1,1,KDataPayload3);// EP1 because 1st writter EP
   200 		iControlEp0->SendRequest(request,this);					
   214 		iControlEp0->SendRequest(request,this);					
   201 		}
   215 		}
   202 	else if(aTransferId == KBulkTransferId3)
   216 	else if(aTransferId == KBulkTransferId3)
   203 		{		
   217 		{		
   204 		if(aCompletionCode != KErrNone)
   218 		if(aCompletionCode != KErrNone)
   205 			{
   219 			{
   206 			TBuf<256> msg;
   220 			TBuf<256> msg;
   207 			msg.Format(_L("<Error %d> No data got after EP2 being stalled"),aCompletionCode);
   221 			msg.Format(_L("<Error %d> No data got after EP2 being stalled"),aCompletionCode);
   208 			RDebug::Print(msg);
   222 			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP10, msg);
   209 			iCaseStep = EFailed;
   223 			iCaseStep = EFailed;
   210 			TTestCaseFailed request(err,msg);
   224 			TTestCaseFailed request(err,msg);
   211 			return iControlEp0->SendRequest(request,this);
   225 			return iControlEp0->SendRequest(request,this);
   212 			}			
   226 			}			
   213 		// else ok, compare data rcvd now
   227 		// else ok, compare data rcvd now
   215 		// Compare the data to what is expected		
   229 		// Compare the data to what is expected		
   216 		if(data.Compare(KDataPayload3) != 0)
   230 		if(data.Compare(KDataPayload3) != 0)
   217 			{
   231 			{
   218 			TBuf<256> msg;
   232 			TBuf<256> msg;
   219 			msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
   233 			msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
   220 			RDebug::Print(msg);
   234 			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP11, msg);
   221 			iCaseStep = EFailed;
   235 			iCaseStep = EFailed;
   222 			TTestCaseFailed request(KErrCompletion,msg);
   236 			TTestCaseFailed request(KErrCompletion,msg);
   223 			return iControlEp0->SendRequest(request,this);
   237 			return iControlEp0->SendRequest(request,this);
   224 			}			 
   238 			}			 
   225 		// Comparison is a match, test passes
   239 		// Comparison is a match, test passes
   227 		TTestCasePassed request;
   241 		TTestCasePassed request;
   228 		return iControlEp0->SendRequest(request,this);
   242 		return iControlEp0->SendRequest(request,this);
   229 		}
   243 		}
   230 	else
   244 	else
   231 		{
   245 		{
   232 		RDebug::Printf("<Error> a transfer completed (id=%d) that was not expected",aTransferId);
   246 		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP12, "<Error> a transfer completed (id=%d) that was not expected",aTransferId);
   233 		return TestFailed(KErrCorrupt);
   247 		return TestFailed(KErrCorrupt);
   234 		}	
   248 		}	
       
   249 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_EXIT_DUP01, this );
   235 	}
   250 	}
   236 
   251 
   237 
   252 
   238 void CUT_PBASE_T_USBDI_0484::DeviceInsertedL(TUint aDeviceHandle)
   253 void CUT_PBASE_T_USBDI_0484::DeviceInsertedL(TUint aDeviceHandle)
   239 	{
   254 	{
   240 	LOG_FUNC
   255 	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_ENTRY, this );
   241 	
   256 	
   242 	Cancel();
   257 	Cancel();
   243 	RDebug::Printf("this - %08x", this);
   258 	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL, "this - %08x", this);
   244 	
   259 	
   245 	TBuf<256> msg;
   260 	TBuf<256> msg;
   246 	TInt err = KErrNone;
   261 	TInt err = KErrNone;
   247 	if(BaseBulkDeviceInsertedL(aDeviceHandle, EFalse) == EDeviceConfigurationError)
   262 	if(BaseBulkDeviceInsertedL(aDeviceHandle, EFalse) == EDeviceConfigurationError)
   248 		// Prepare for response from control transfer to client
   263 		// Prepare for response from control transfer to client
   256 		iInTransfer[0] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,256,*this,KBulkTransferId1);	
   271 		iInTransfer[0] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,256,*this,KBulkTransferId1);	
   257 		iInTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,256,*this,KBulkTransferId2);	
   272 		iInTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,256,*this,KBulkTransferId2);	
   258 		iInTransfer[2] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,256,*this,KBulkTransferId3);	
   273 		iInTransfer[2] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,256,*this,KBulkTransferId3);	
   259 		
   274 		
   260 		// Initialise the descriptors for transfer		
   275 		// Initialise the descriptors for transfer		
   261 		RDebug::Printf("Initialising the transfer descriptors - interface 1");
   276 		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
   262 		err = iUsbInterface1.InitialiseTransferDescriptors();
   277 		err = iUsbInterface1.InitialiseTransferDescriptors();
   263 		if(err != KErrNone)
   278 		if(err != KErrNone)
   264 			{
   279 			{
   265 			_LIT(lit, "<Error %d> Unable to initialise transfer descriptors");
   280 			_LIT(lit, "<Error %d> Unable to initialise transfer descriptors");
   266 			msg.Format(lit,err);
   281 			msg.Format(lit,err);
   267 			}
   282 			}
   268 		}
   283 		}
   269 	if(err != KErrNone)
   284 	if(err != KErrNone)
   270 		{
   285 		{
   271 		RDebug::Print(msg);
   286 		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_DUP02, msg);
   272 		iCaseStep = EFailed;
   287 		iCaseStep = EFailed;
   273 		TTestCaseFailed request(err,msg);
   288 		TTestCaseFailed request(err,msg);
   274 		iControlEp0->SendRequest(request,this);
   289 		iControlEp0->SendRequest(request,this);
   275 		}
   290 		}
   276 	else
   291 	else
   279 		iInTransfer[0]->TransferIn(KDataPayload1().Length());
   294 		iInTransfer[0]->TransferIn(KDataPayload1().Length());
   280 		
   295 		
   281 		TStallEndpointRequest r2(2,1); // Stall endpoint 2 interface 1
   296 		TStallEndpointRequest r2(2,1); // Stall endpoint 2 interface 1
   282 		iControlEp0->SendRequest(r2,this);		
   297 		iControlEp0->SendRequest(r2,this);		
   283 		}
   298 		}
   284 	}
   299 	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_EXIT, this );
   285 	
   300 	}
   286 	}
   301 	
       
   302 	}