os/kernelhwsrv/kernel/eka/include/d32usbdi_errors.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @publishedPartner
    19  @prototype
    20 */
    21 
    22 #ifndef D32USBDI_ERRORS_H
    23 #define D32USBDI_ERRORS_H
    24 
    25 #ifndef __KERNEL_MODE__
    26 #include <e32std.h>
    27 #else
    28 #include <kernel/kernel.h>
    29 #endif
    30 
    31 
    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;
    45 
    46 /**
    47 This error is returned when it is discovered that a bundle of USB descriptors
    48 has a malformed topological layout.
    49 */
    50 const TInt KErrUsbBadDescriptorTopology		= -6653;
    51 
    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
    59 
    60 // Inform caller of API Misuse
    61 const TInt KErrUsbRemoteWakeupAlreadyEnabled  = -6660;
    62 const TInt KErrUsbRemoteWakeupAlreadyDisabled = -6661;
    63 const TInt KErrUsbAlreadyResumed              = -6662;
    64 
    65 /*
    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. 
    69 */
    70 const TInt KErrUsbBadDeviceAttached           = -6663;
    71 const TInt KEventUsbBadDeviceDetached         = -6664;
    72 
    73 namespace UsbdiPanics
    74 	{
    75 	_LIT(KUsbHubDriverPanicCat, "USBHubDriver");
    76 	enum TUsbHubDriverPanics
    77 		{
    78 		EUsbHubDriverNoRollBackAfterFailedDeviceOpen		= 0,
    79 		EUsbHubDriverRequestMadeWhileClosed					= 1,
    80 		EUsbHubDriverInsufficientSizeToHoldStringDescriptor	= 2,
    81 		EUsbHubDriverMultipleNotificationRequests			= 3,
    82 		EUsbHubDriverTooManyDeviceHandles					= 4,
    83 		EUsbHubDriverAlreadyOpened                          = 5,
    84 		};
    85 
    86 	_LIT(KUsbdiPanicCat, "USBDI");
    87 	enum TUsbdiPanics
    88 		{
    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,
   131 		};
   132 
   133 	_LIT(KUsbDescPanicCat, "USBDesc");
   134 	enum TUsbDescPanics
   135 		{
   136 		/**
   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.
   140 		*/
   141 		EUsbDescNonNullPointersAfterParsing	= 0,
   142 		/**
   143 		This panic is raised when attempting to retrieve a wLangId from String
   144 		Descriptor Zero using a negative index.
   145 		*/
   146 		EUsbDescNegativeIndexToLangId		= 1,
   147 		};
   148 	}
   149 
   150 
   151 namespace UsbdiFaults
   152 	{
   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__
   158 	enum TUsbdiFaults
   159 		{
   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,
   204 		};
   205 
   206 	_LIT(KUsbDescFaultCat, "USBDesc-Fault");
   207 	enum TUsbDescFaults
   208 		{
   209 		EUsbDescSuccessButDataLeftUnparsed	= 0,
   210 		EUsbDescTreePointersAlreadySet		= 1,
   211 		EUsbDescNoTopLevelDescriptorFound	= 2,
   212 		EUsbDescRunOffTree					= 3,
   213 		EUsbDescTreeMemberHasNoParent		= 4,
   214 		};
   215 	}
   216 
   217 #endif // D32USBDI_ERRORS_H