os/kernelhwsrv/kernel/eka/include/d32usbdi_errors.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/include/d32usbdi_errors.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,217 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +/**
    1.20 + @file
    1.21 + @publishedPartner
    1.22 + @prototype
    1.23 +*/
    1.24 +
    1.25 +#ifndef D32USBDI_ERRORS_H
    1.26 +#define D32USBDI_ERRORS_H
    1.27 +
    1.28 +#ifndef __KERNEL_MODE__
    1.29 +#include <e32std.h>
    1.30 +#else
    1.31 +#include <kernel/kernel.h>
    1.32 +#endif
    1.33 +
    1.34 +
    1.35 +const TInt KErrUsbRequestsPending			= -6640;
    1.36 +const TInt KErrUsbBadAddress				= -6641;
    1.37 +const TInt KErrUsbNoAddress					= -6642;
    1.38 +const TInt KErrUsbSetAddrFailed				= -6643;
    1.39 +const TInt KErrUsbNoPower					= -6644;
    1.40 +const TInt KErrUsbTooDeep					= -6645;
    1.41 +const TInt KErrUsbIOError					= -6646;
    1.42 +const TInt KErrUsbNotConfigured				= -6647;
    1.43 +const TInt KErrUsbTimeout					= -6648;
    1.44 +const TInt KErrUsbStalled					= -6649;
    1.45 +const TInt KErrUsbTestFailure				= -6650;
    1.46 +const TInt KErrUsbBadState					= -6651;
    1.47 +const TInt KErrUsbDeviceSuspended			= -6652;
    1.48 +
    1.49 +/**
    1.50 +This error is returned when it is discovered that a bundle of USB descriptors
    1.51 +has a malformed topological layout.
    1.52 +*/
    1.53 +const TInt KErrUsbBadDescriptorTopology		= -6653;
    1.54 +
    1.55 +// Errors from DevMon events
    1.56 +const TInt KErrUsbDeviceRejected			= -6654;	// Should never happen -- the device has been rejected by the stack
    1.57 +const TInt KErrUsbDeviceFailed				= -6655;	// The device failed to be configured
    1.58 +const TInt KErrUsbBadDevice					= -6656;	// Hardware fault on device, eg. no Ep0
    1.59 +const TInt KErrUsbBadHubPosition			= -6657;	// Hub too deep, or bus powered attached to bus powered.
    1.60 +const TInt KErrUsbBadHub					= -6658;	// Hardware fault on hub, eg. no Ep0
    1.61 +const TInt KErrUsbEventOverflow				= -6659;	// Too many bus events undrained -- one or more events lost
    1.62 +
    1.63 +// Inform caller of API Misuse
    1.64 +const TInt KErrUsbRemoteWakeupAlreadyEnabled  = -6660;
    1.65 +const TInt KErrUsbRemoteWakeupAlreadyDisabled = -6661;
    1.66 +const TInt KErrUsbAlreadyResumed              = -6662;
    1.67 +
    1.68 +/*
    1.69 +The following two codes are used to indicate attachment/detachment of some malfunction 
    1.70 +USB peripherals, which behaviour don't comply with USB specification. For example, some 
    1.71 +hubs drive their upstream port VBus, however such behaviour is not allowed according to USB specification. 
    1.72 +*/
    1.73 +const TInt KErrUsbBadDeviceAttached           = -6663;
    1.74 +const TInt KEventUsbBadDeviceDetached         = -6664;
    1.75 +
    1.76 +namespace UsbdiPanics
    1.77 +	{
    1.78 +	_LIT(KUsbHubDriverPanicCat, "USBHubDriver");
    1.79 +	enum TUsbHubDriverPanics
    1.80 +		{
    1.81 +		EUsbHubDriverNoRollBackAfterFailedDeviceOpen		= 0,
    1.82 +		EUsbHubDriverRequestMadeWhileClosed					= 1,
    1.83 +		EUsbHubDriverInsufficientSizeToHoldStringDescriptor	= 2,
    1.84 +		EUsbHubDriverMultipleNotificationRequests			= 3,
    1.85 +		EUsbHubDriverTooManyDeviceHandles					= 4,
    1.86 +		EUsbHubDriverAlreadyOpened                          = 5,
    1.87 +		};
    1.88 +
    1.89 +	_LIT(KUsbdiPanicCat, "USBDI");
    1.90 +	enum TUsbdiPanics
    1.91 +		{
    1.92 +		ERequestAlreadyPending							= 0,
    1.93 +		ETooManyPipeHandles								= 1,
    1.94 +		EOutOfBoundsOfLengthArray						= 2,
    1.95 +		EBadIsocTransferDescriptorHandle				= 3,
    1.96 +		EBadIsocTransferDescriptorWriteHandle			= 4,
    1.97 +		EBadIntrTransferDescriptorHandle				= 5,
    1.98 +		EBadBulkTransferDescriptorHandle				= 6,
    1.99 +		ETransferDescriptorAlignmentOverPageBoundary	= 7,
   1.100 +		ETransferDescriptorAlignmentNotPowerOfTwo		= 8,
   1.101 +		ETransferDescriptorNoPacketsRequested			= 9,
   1.102 +		ETransferDescriptorSavedToMuchData				= 10,
   1.103 +		ETransferDescriptorNoPacketsToSave				= 11,
   1.104 +		ETransferDescriptorInvalidSaveCall				= 12,
   1.105 +		ETransferDescriptorSavedTooManyPackets			= 13,
   1.106 +		ETransferDescriptorSavingTooLargeAPacket		= 14,
   1.107 +		ETransferDescriptorReceivedTooLargeAPacket		= 15,
   1.108 +		ETransferDescriptorPacketNotInBounds			= 16,
   1.109 +		ETransferDescriptorTooFewPacketsRequested		= 17,
   1.110 +		ETransferDescriptorTooManyPacketsRequested		= 18,
   1.111 +		ETransferDescriptorFlagsBadZlp					= 19,
   1.112 +		ENoChunkAllocatedForInterface					= 20,
   1.113 +		EChunkAlreadyAllocatedForInterface				= 21,
   1.114 +		ETransferWrongDescriptorType					= 22,
   1.115 +		EIntrBulkTransferBadLength						= 23,
   1.116 +		EIsocTransferWrongDescriptorType				= 24,
   1.117 +		EIsocTransferNoPacketsRequested					= 25,
   1.118 +		EIsocTransferTooManyPackets						= 26,
   1.119 +		EIsocTransferPacketTooBig						= 27,
   1.120 +		EInterfaceSettingChangeWithPipeOpen				= 28,
   1.121 +		EUsbDeviceDeviceStateCancelledWithNoThread		= 29,
   1.122 +		ECpuPageSizeIsNotMulipleOfHcdPageSize			= 30,
   1.123 +		EPageListRegionSelectionUnderflow				= 31,
   1.124 +		EPageListRegionSelectionOverflow				= 32,
   1.125 +		EIsocTransferRequestCrossesPageBoundary			= 33,
   1.126 +		EIsocTransferResultCrossesPageBoundary			= 34,
   1.127 +		EPipeInvalidType								= 35,
   1.128 +		ETransferDescriptorRequestedLengthDiffers		= 36,
   1.129 +		ETransferDescriptorsAlreadyRegistered			= 37,
   1.130 +		EOutOfBoundsOfResultArray						= 38,
   1.131 +		EPipeRequestMadeWhileClosed						= 39,
   1.132 +		EBadInterfaceHandle                             = 40,
   1.133 +		EUsbDeviceMultipleNotificationRequests			= 41,
   1.134 +		};
   1.135 +
   1.136 +	_LIT(KUsbDescPanicCat, "USBDesc");
   1.137 +	enum TUsbDescPanics
   1.138 +		{
   1.139 +		/**
   1.140 +		This panic is raised when the newly created TUsbGenericDescriptor object 
   1.141 +		created during parsing has not set the pointer fields iParent, iFirstChild
   1.142 +		and iNextPeer to NULL.
   1.143 +		*/
   1.144 +		EUsbDescNonNullPointersAfterParsing	= 0,
   1.145 +		/**
   1.146 +		This panic is raised when attempting to retrieve a wLangId from String
   1.147 +		Descriptor Zero using a negative index.
   1.148 +		*/
   1.149 +		EUsbDescNegativeIndexToLangId		= 1,
   1.150 +		};
   1.151 +	}
   1.152 +
   1.153 +
   1.154 +namespace UsbdiFaults
   1.155 +	{
   1.156 +#ifndef __KERNEL_MODE__
   1.157 +	_LIT(KUsbdiFaultCat, "USBDI-Fault");
   1.158 +#else // __KERNEL_MODE__
   1.159 +	static const char* const KUsbdiFaultCat = "USBDI-Fault";
   1.160 +#endif // __KERNEL_MODE__
   1.161 +	enum TUsbdiFaults
   1.162 +		{
   1.163 +		EUsbPipeCloseFailed								= 0,
   1.164 +		EUsbDeviceLingeringInterfacesOnDestroy			= 1,
   1.165 +		EUsbDeviceLingeringStateNotifyOnDestroy			= 2,
   1.166 +		EUsbDeviceCannotDestroySuspendTask				= 3,
   1.167 +		EUsbDeviceUnexpectedStateOnStateChange			= 4,
   1.168 +		EUsbDeviceUnexpectedSuspensionIssued			= 5,
   1.169 +		EUsbDeviceUnexpectedResumeIssued				= 6,
   1.170 +		EUsbTransferDescriptorBadHandle					= 7,
   1.171 +		EUsbTransferDescriptorBadWriteHandle			= 8,
   1.172 +		EUsbTransferDescriptorBadAlignment				= 9,
   1.173 +		EUsbTransferDescriptorNoPacketsLeftToStore		= 10,
   1.174 +		EUsbTransferDescriptorLengthsArrayBadAlignment	= 11,
   1.175 +		EUsbTransferDescriptorIncompleteInitialisation	= 12,
   1.176 +		EUsbTransferDescriptorInvalidHeaderOffset		= 13,
   1.177 +		EUsbPipeNoHandleOnCancel						= 14,
   1.178 +		EUsbPipeTransferCompleteWithoutTransfer			= 15,
   1.179 +		EUsbPipeTransferWithoutPageList					= 16,
   1.180 +		EUsbPipeFreeTransferHandleFailedAddToPool		= 17,
   1.181 +		EUsbPipeTransferCompleteNoThreadForRequest		= 18,
   1.182 +		EUsbPipeChannelRequestMadeWithoutChannel		= 19,
   1.183 +		EUsbHubDriverSuccessfulAttachButNoDevice		= 20,
   1.184 +		EUsbHubDriverPendingEventsAndPendingEventRequest= 21,
   1.185 +		EUsbDeviceNoThreadProvided						= 22,
   1.186 +		EUsbPageListGoneBeyondHcdPageListBounds			= 23,
   1.187 +		EUsbTransferRequestNoThreadProvided				= 24,
   1.188 +		EUsbTransferRequestNoRequestProvided			= 25,
   1.189 +		EUsbTransferRequestDeletedWhileOutstanding		= 26,
   1.190 +		EUsbTransferRequestDeletedWithoutCompleting		= 27,
   1.191 +		EUsbTransferRequestFinalisedTwice				= 28,
   1.192 +		EUsbTransferRequestCompletedWithoutFinalising	= 29,
   1.193 +		EUsbPipeNoTransferRequestForTransfer			= 30,
   1.194 +		EUsbDeviceStateChangeRequestButNoThread			= 31,
   1.195 +		EUsbPageListInvalidRegion						= 32,
   1.196 +		EUsbTransferDescriptorUnexpectedEndOfIsocList	= 33,
   1.197 +		EUsbTransferDescriptorUnfillableElement			= 34,
   1.198 +		EUsbHubDriverPendingNoneEvent					= 35,
   1.199 +		EUsbTransferDescriptorResultsArrayBadAlignment	= 36,
   1.200 +		EUsbDeviceTooManyDevicesSignallingInactivity	= 37,
   1.201 +		EUsbHubDriverQueuedBusEventNotDeviceAttach		= 38,
   1.202 +		EUsbPipeHasHandleButNoInterface					= 39,
   1.203 +		EUsbDeviceHasHandleButNoHubDriver				= 40,
   1.204 +		EUsbDevMonDeviceAttachDenied					= 41,
   1.205 +		EUsbHubDriverZeroInterfaceTokenProduced			= 42,
   1.206 +		EUsbInterfaceSuccessfulPipeOpenWithNoPipe		= 43,
   1.207 +		};
   1.208 +
   1.209 +	_LIT(KUsbDescFaultCat, "USBDesc-Fault");
   1.210 +	enum TUsbDescFaults
   1.211 +		{
   1.212 +		EUsbDescSuccessButDataLeftUnparsed	= 0,
   1.213 +		EUsbDescTreePointersAlreadySet		= 1,
   1.214 +		EUsbDescNoTopLevelDescriptorFound	= 2,
   1.215 +		EUsbDescRunOffTree					= 3,
   1.216 +		EUsbDescTreeMemberHasNoParent		= 4,
   1.217 +		};
   1.218 +	}
   1.219 +
   1.220 +#endif // D32USBDI_ERRORS_H