Update contrib.
     1 // Copyright (c) 2007-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".
 
     8 // Initial Contributors:
 
     9 // Nokia Corporation - initial contribution.
 
    22 #ifndef D32USBDI_ERRORS_H
 
    23 #define D32USBDI_ERRORS_H
 
    25 #ifndef __KERNEL_MODE__
 
    28 #include <kernel/kernel.h>
 
    32 const TInt KErrUsbRequestsPending			= -6640;
 
    33 const TInt KErrUsbBadAddress				= -6641;
 
    34 const TInt KErrUsbNoAddress					= -6642;
 
    35 const TInt KErrUsbSetAddrFailed				= -6643;
 
    36 const TInt KErrUsbNoPower					= -6644;
 
    37 const TInt KErrUsbTooDeep					= -6645;
 
    38 const TInt KErrUsbIOError					= -6646;
 
    39 const TInt KErrUsbNotConfigured				= -6647;
 
    40 const TInt KErrUsbTimeout					= -6648;
 
    41 const TInt KErrUsbStalled					= -6649;
 
    42 const TInt KErrUsbTestFailure				= -6650;
 
    43 const TInt KErrUsbBadState					= -6651;
 
    44 const TInt KErrUsbDeviceSuspended			= -6652;
 
    47 This error is returned when it is discovered that a bundle of USB descriptors
 
    48 has a malformed topological layout.
 
    50 const TInt KErrUsbBadDescriptorTopology		= -6653;
 
    52 // Errors from DevMon events
 
    53 const TInt KErrUsbDeviceRejected			= -6654;	// Should never happen -- the device has been rejected by the stack
 
    54 const TInt KErrUsbDeviceFailed				= -6655;	// The device failed to be configured
 
    55 const TInt KErrUsbBadDevice					= -6656;	// Hardware fault on device, eg. no Ep0
 
    56 const TInt KErrUsbBadHubPosition			= -6657;	// Hub too deep, or bus powered attached to bus powered.
 
    57 const TInt KErrUsbBadHub					= -6658;	// Hardware fault on hub, eg. no Ep0
 
    58 const TInt KErrUsbEventOverflow				= -6659;	// Too many bus events undrained -- one or more events lost
 
    60 // Inform caller of API Misuse
 
    61 const TInt KErrUsbRemoteWakeupAlreadyEnabled  = -6660;
 
    62 const TInt KErrUsbRemoteWakeupAlreadyDisabled = -6661;
 
    63 const TInt KErrUsbAlreadyResumed              = -6662;
 
    66 The following two codes are used to indicate attachment/detachment of some malfunction 
 
    67 USB peripherals, which behaviour don't comply with USB specification. For example, some 
 
    68 hubs drive their upstream port VBus, however such behaviour is not allowed according to USB specification. 
 
    70 const TInt KErrUsbBadDeviceAttached           = -6663;
 
    71 const TInt KEventUsbBadDeviceDetached         = -6664;
 
    75 	_LIT(KUsbHubDriverPanicCat, "USBHubDriver");
 
    76 	enum TUsbHubDriverPanics
 
    78 		EUsbHubDriverNoRollBackAfterFailedDeviceOpen		= 0,
 
    79 		EUsbHubDriverRequestMadeWhileClosed					= 1,
 
    80 		EUsbHubDriverInsufficientSizeToHoldStringDescriptor	= 2,
 
    81 		EUsbHubDriverMultipleNotificationRequests			= 3,
 
    82 		EUsbHubDriverTooManyDeviceHandles					= 4,
 
    83 		EUsbHubDriverAlreadyOpened                          = 5,
 
    86 	_LIT(KUsbdiPanicCat, "USBDI");
 
    89 		ERequestAlreadyPending							= 0,
 
    90 		ETooManyPipeHandles								= 1,
 
    91 		EOutOfBoundsOfLengthArray						= 2,
 
    92 		EBadIsocTransferDescriptorHandle				= 3,
 
    93 		EBadIsocTransferDescriptorWriteHandle			= 4,
 
    94 		EBadIntrTransferDescriptorHandle				= 5,
 
    95 		EBadBulkTransferDescriptorHandle				= 6,
 
    96 		ETransferDescriptorAlignmentOverPageBoundary	= 7,
 
    97 		ETransferDescriptorAlignmentNotPowerOfTwo		= 8,
 
    98 		ETransferDescriptorNoPacketsRequested			= 9,
 
    99 		ETransferDescriptorSavedToMuchData				= 10,
 
   100 		ETransferDescriptorNoPacketsToSave				= 11,
 
   101 		ETransferDescriptorInvalidSaveCall				= 12,
 
   102 		ETransferDescriptorSavedTooManyPackets			= 13,
 
   103 		ETransferDescriptorSavingTooLargeAPacket		= 14,
 
   104 		ETransferDescriptorReceivedTooLargeAPacket		= 15,
 
   105 		ETransferDescriptorPacketNotInBounds			= 16,
 
   106 		ETransferDescriptorTooFewPacketsRequested		= 17,
 
   107 		ETransferDescriptorTooManyPacketsRequested		= 18,
 
   108 		ETransferDescriptorFlagsBadZlp					= 19,
 
   109 		ENoChunkAllocatedForInterface					= 20,
 
   110 		EChunkAlreadyAllocatedForInterface				= 21,
 
   111 		ETransferWrongDescriptorType					= 22,
 
   112 		EIntrBulkTransferBadLength						= 23,
 
   113 		EIsocTransferWrongDescriptorType				= 24,
 
   114 		EIsocTransferNoPacketsRequested					= 25,
 
   115 		EIsocTransferTooManyPackets						= 26,
 
   116 		EIsocTransferPacketTooBig						= 27,
 
   117 		EInterfaceSettingChangeWithPipeOpen				= 28,
 
   118 		EUsbDeviceDeviceStateCancelledWithNoThread		= 29,
 
   119 		ECpuPageSizeIsNotMulipleOfHcdPageSize			= 30,
 
   120 		EPageListRegionSelectionUnderflow				= 31,
 
   121 		EPageListRegionSelectionOverflow				= 32,
 
   122 		EIsocTransferRequestCrossesPageBoundary			= 33,
 
   123 		EIsocTransferResultCrossesPageBoundary			= 34,
 
   124 		EPipeInvalidType								= 35,
 
   125 		ETransferDescriptorRequestedLengthDiffers		= 36,
 
   126 		ETransferDescriptorsAlreadyRegistered			= 37,
 
   127 		EOutOfBoundsOfResultArray						= 38,
 
   128 		EPipeRequestMadeWhileClosed						= 39,
 
   129 		EBadInterfaceHandle                             = 40,
 
   130 		EUsbDeviceMultipleNotificationRequests			= 41,
 
   133 	_LIT(KUsbDescPanicCat, "USBDesc");
 
   137 		This panic is raised when the newly created TUsbGenericDescriptor object 
 
   138 		created during parsing has not set the pointer fields iParent, iFirstChild
 
   139 		and iNextPeer to NULL.
 
   141 		EUsbDescNonNullPointersAfterParsing	= 0,
 
   143 		This panic is raised when attempting to retrieve a wLangId from String
 
   144 		Descriptor Zero using a negative index.
 
   146 		EUsbDescNegativeIndexToLangId		= 1,
 
   151 namespace UsbdiFaults
 
   153 #ifndef __KERNEL_MODE__
 
   154 	_LIT(KUsbdiFaultCat, "USBDI-Fault");
 
   155 #else // __KERNEL_MODE__
 
   156 	static const char* const KUsbdiFaultCat = "USBDI-Fault";
 
   157 #endif // __KERNEL_MODE__
 
   160 		EUsbPipeCloseFailed								= 0,
 
   161 		EUsbDeviceLingeringInterfacesOnDestroy			= 1,
 
   162 		EUsbDeviceLingeringStateNotifyOnDestroy			= 2,
 
   163 		EUsbDeviceCannotDestroySuspendTask				= 3,
 
   164 		EUsbDeviceUnexpectedStateOnStateChange			= 4,
 
   165 		EUsbDeviceUnexpectedSuspensionIssued			= 5,
 
   166 		EUsbDeviceUnexpectedResumeIssued				= 6,
 
   167 		EUsbTransferDescriptorBadHandle					= 7,
 
   168 		EUsbTransferDescriptorBadWriteHandle			= 8,
 
   169 		EUsbTransferDescriptorBadAlignment				= 9,
 
   170 		EUsbTransferDescriptorNoPacketsLeftToStore		= 10,
 
   171 		EUsbTransferDescriptorLengthsArrayBadAlignment	= 11,
 
   172 		EUsbTransferDescriptorIncompleteInitialisation	= 12,
 
   173 		EUsbTransferDescriptorInvalidHeaderOffset		= 13,
 
   174 		EUsbPipeNoHandleOnCancel						= 14,
 
   175 		EUsbPipeTransferCompleteWithoutTransfer			= 15,
 
   176 		EUsbPipeTransferWithoutPageList					= 16,
 
   177 		EUsbPipeFreeTransferHandleFailedAddToPool		= 17,
 
   178 		EUsbPipeTransferCompleteNoThreadForRequest		= 18,
 
   179 		EUsbPipeChannelRequestMadeWithoutChannel		= 19,
 
   180 		EUsbHubDriverSuccessfulAttachButNoDevice		= 20,
 
   181 		EUsbHubDriverPendingEventsAndPendingEventRequest= 21,
 
   182 		EUsbDeviceNoThreadProvided						= 22,
 
   183 		EUsbPageListGoneBeyondHcdPageListBounds			= 23,
 
   184 		EUsbTransferRequestNoThreadProvided				= 24,
 
   185 		EUsbTransferRequestNoRequestProvided			= 25,
 
   186 		EUsbTransferRequestDeletedWhileOutstanding		= 26,
 
   187 		EUsbTransferRequestDeletedWithoutCompleting		= 27,
 
   188 		EUsbTransferRequestFinalisedTwice				= 28,
 
   189 		EUsbTransferRequestCompletedWithoutFinalising	= 29,
 
   190 		EUsbPipeNoTransferRequestForTransfer			= 30,
 
   191 		EUsbDeviceStateChangeRequestButNoThread			= 31,
 
   192 		EUsbPageListInvalidRegion						= 32,
 
   193 		EUsbTransferDescriptorUnexpectedEndOfIsocList	= 33,
 
   194 		EUsbTransferDescriptorUnfillableElement			= 34,
 
   195 		EUsbHubDriverPendingNoneEvent					= 35,
 
   196 		EUsbTransferDescriptorResultsArrayBadAlignment	= 36,
 
   197 		EUsbDeviceTooManyDevicesSignallingInactivity	= 37,
 
   198 		EUsbHubDriverQueuedBusEventNotDeviceAttach		= 38,
 
   199 		EUsbPipeHasHandleButNoInterface					= 39,
 
   200 		EUsbDeviceHasHandleButNoHubDriver				= 40,
 
   201 		EUsbDevMonDeviceAttachDenied					= 41,
 
   202 		EUsbHubDriverZeroInterfaceTokenProduced			= 42,
 
   203 		EUsbInterfaceSuccessfulPipeOpenWithNoPipe		= 43,
 
   206 	_LIT(KUsbDescFaultCat, "USBDesc-Fault");
 
   209 		EUsbDescSuccessButDataLeftUnparsed	= 0,
 
   210 		EUsbDescTreePointersAlreadySet		= 1,
 
   211 		EUsbDescNoTopLevelDescriptorFound	= 2,
 
   212 		EUsbDescRunOffTree					= 3,
 
   213 		EUsbDescTreeMemberHasNoParent		= 4,
 
   217 #endif // D32USBDI_ERRORS_H