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