sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @prototype sl@0: */ sl@0: sl@0: #ifndef D32USBDI_ERRORS_H sl@0: #define D32USBDI_ERRORS_H sl@0: sl@0: #ifndef __KERNEL_MODE__ sl@0: #include sl@0: #else sl@0: #include sl@0: #endif sl@0: sl@0: sl@0: const TInt KErrUsbRequestsPending = -6640; sl@0: const TInt KErrUsbBadAddress = -6641; sl@0: const TInt KErrUsbNoAddress = -6642; sl@0: const TInt KErrUsbSetAddrFailed = -6643; sl@0: const TInt KErrUsbNoPower = -6644; sl@0: const TInt KErrUsbTooDeep = -6645; sl@0: const TInt KErrUsbIOError = -6646; sl@0: const TInt KErrUsbNotConfigured = -6647; sl@0: const TInt KErrUsbTimeout = -6648; sl@0: const TInt KErrUsbStalled = -6649; sl@0: const TInt KErrUsbTestFailure = -6650; sl@0: const TInt KErrUsbBadState = -6651; sl@0: const TInt KErrUsbDeviceSuspended = -6652; sl@0: sl@0: /** sl@0: This error is returned when it is discovered that a bundle of USB descriptors sl@0: has a malformed topological layout. sl@0: */ sl@0: const TInt KErrUsbBadDescriptorTopology = -6653; sl@0: sl@0: // Errors from DevMon events sl@0: const TInt KErrUsbDeviceRejected = -6654; // Should never happen -- the device has been rejected by the stack sl@0: const TInt KErrUsbDeviceFailed = -6655; // The device failed to be configured sl@0: const TInt KErrUsbBadDevice = -6656; // Hardware fault on device, eg. no Ep0 sl@0: const TInt KErrUsbBadHubPosition = -6657; // Hub too deep, or bus powered attached to bus powered. sl@0: const TInt KErrUsbBadHub = -6658; // Hardware fault on hub, eg. no Ep0 sl@0: const TInt KErrUsbEventOverflow = -6659; // Too many bus events undrained -- one or more events lost sl@0: sl@0: // Inform caller of API Misuse sl@0: const TInt KErrUsbRemoteWakeupAlreadyEnabled = -6660; sl@0: const TInt KErrUsbRemoteWakeupAlreadyDisabled = -6661; sl@0: const TInt KErrUsbAlreadyResumed = -6662; sl@0: sl@0: /* sl@0: The following two codes are used to indicate attachment/detachment of some malfunction sl@0: USB peripherals, which behaviour don't comply with USB specification. For example, some sl@0: hubs drive their upstream port VBus, however such behaviour is not allowed according to USB specification. sl@0: */ sl@0: const TInt KErrUsbBadDeviceAttached = -6663; sl@0: const TInt KEventUsbBadDeviceDetached = -6664; sl@0: sl@0: namespace UsbdiPanics sl@0: { sl@0: _LIT(KUsbHubDriverPanicCat, "USBHubDriver"); sl@0: enum TUsbHubDriverPanics sl@0: { sl@0: EUsbHubDriverNoRollBackAfterFailedDeviceOpen = 0, sl@0: EUsbHubDriverRequestMadeWhileClosed = 1, sl@0: EUsbHubDriverInsufficientSizeToHoldStringDescriptor = 2, sl@0: EUsbHubDriverMultipleNotificationRequests = 3, sl@0: EUsbHubDriverTooManyDeviceHandles = 4, sl@0: EUsbHubDriverAlreadyOpened = 5, sl@0: }; sl@0: sl@0: _LIT(KUsbdiPanicCat, "USBDI"); sl@0: enum TUsbdiPanics sl@0: { sl@0: ERequestAlreadyPending = 0, sl@0: ETooManyPipeHandles = 1, sl@0: EOutOfBoundsOfLengthArray = 2, sl@0: EBadIsocTransferDescriptorHandle = 3, sl@0: EBadIsocTransferDescriptorWriteHandle = 4, sl@0: EBadIntrTransferDescriptorHandle = 5, sl@0: EBadBulkTransferDescriptorHandle = 6, sl@0: ETransferDescriptorAlignmentOverPageBoundary = 7, sl@0: ETransferDescriptorAlignmentNotPowerOfTwo = 8, sl@0: ETransferDescriptorNoPacketsRequested = 9, sl@0: ETransferDescriptorSavedToMuchData = 10, sl@0: ETransferDescriptorNoPacketsToSave = 11, sl@0: ETransferDescriptorInvalidSaveCall = 12, sl@0: ETransferDescriptorSavedTooManyPackets = 13, sl@0: ETransferDescriptorSavingTooLargeAPacket = 14, sl@0: ETransferDescriptorReceivedTooLargeAPacket = 15, sl@0: ETransferDescriptorPacketNotInBounds = 16, sl@0: ETransferDescriptorTooFewPacketsRequested = 17, sl@0: ETransferDescriptorTooManyPacketsRequested = 18, sl@0: ETransferDescriptorFlagsBadZlp = 19, sl@0: ENoChunkAllocatedForInterface = 20, sl@0: EChunkAlreadyAllocatedForInterface = 21, sl@0: ETransferWrongDescriptorType = 22, sl@0: EIntrBulkTransferBadLength = 23, sl@0: EIsocTransferWrongDescriptorType = 24, sl@0: EIsocTransferNoPacketsRequested = 25, sl@0: EIsocTransferTooManyPackets = 26, sl@0: EIsocTransferPacketTooBig = 27, sl@0: EInterfaceSettingChangeWithPipeOpen = 28, sl@0: EUsbDeviceDeviceStateCancelledWithNoThread = 29, sl@0: ECpuPageSizeIsNotMulipleOfHcdPageSize = 30, sl@0: EPageListRegionSelectionUnderflow = 31, sl@0: EPageListRegionSelectionOverflow = 32, sl@0: EIsocTransferRequestCrossesPageBoundary = 33, sl@0: EIsocTransferResultCrossesPageBoundary = 34, sl@0: EPipeInvalidType = 35, sl@0: ETransferDescriptorRequestedLengthDiffers = 36, sl@0: ETransferDescriptorsAlreadyRegistered = 37, sl@0: EOutOfBoundsOfResultArray = 38, sl@0: EPipeRequestMadeWhileClosed = 39, sl@0: EBadInterfaceHandle = 40, sl@0: EUsbDeviceMultipleNotificationRequests = 41, sl@0: }; sl@0: sl@0: _LIT(KUsbDescPanicCat, "USBDesc"); sl@0: enum TUsbDescPanics sl@0: { sl@0: /** sl@0: This panic is raised when the newly created TUsbGenericDescriptor object sl@0: created during parsing has not set the pointer fields iParent, iFirstChild sl@0: and iNextPeer to NULL. sl@0: */ sl@0: EUsbDescNonNullPointersAfterParsing = 0, sl@0: /** sl@0: This panic is raised when attempting to retrieve a wLangId from String sl@0: Descriptor Zero using a negative index. sl@0: */ sl@0: EUsbDescNegativeIndexToLangId = 1, sl@0: }; sl@0: } sl@0: sl@0: sl@0: namespace UsbdiFaults sl@0: { sl@0: #ifndef __KERNEL_MODE__ sl@0: _LIT(KUsbdiFaultCat, "USBDI-Fault"); sl@0: #else // __KERNEL_MODE__ sl@0: static const char* const KUsbdiFaultCat = "USBDI-Fault"; sl@0: #endif // __KERNEL_MODE__ sl@0: enum TUsbdiFaults sl@0: { sl@0: EUsbPipeCloseFailed = 0, sl@0: EUsbDeviceLingeringInterfacesOnDestroy = 1, sl@0: EUsbDeviceLingeringStateNotifyOnDestroy = 2, sl@0: EUsbDeviceCannotDestroySuspendTask = 3, sl@0: EUsbDeviceUnexpectedStateOnStateChange = 4, sl@0: EUsbDeviceUnexpectedSuspensionIssued = 5, sl@0: EUsbDeviceUnexpectedResumeIssued = 6, sl@0: EUsbTransferDescriptorBadHandle = 7, sl@0: EUsbTransferDescriptorBadWriteHandle = 8, sl@0: EUsbTransferDescriptorBadAlignment = 9, sl@0: EUsbTransferDescriptorNoPacketsLeftToStore = 10, sl@0: EUsbTransferDescriptorLengthsArrayBadAlignment = 11, sl@0: EUsbTransferDescriptorIncompleteInitialisation = 12, sl@0: EUsbTransferDescriptorInvalidHeaderOffset = 13, sl@0: EUsbPipeNoHandleOnCancel = 14, sl@0: EUsbPipeTransferCompleteWithoutTransfer = 15, sl@0: EUsbPipeTransferWithoutPageList = 16, sl@0: EUsbPipeFreeTransferHandleFailedAddToPool = 17, sl@0: EUsbPipeTransferCompleteNoThreadForRequest = 18, sl@0: EUsbPipeChannelRequestMadeWithoutChannel = 19, sl@0: EUsbHubDriverSuccessfulAttachButNoDevice = 20, sl@0: EUsbHubDriverPendingEventsAndPendingEventRequest= 21, sl@0: EUsbDeviceNoThreadProvided = 22, sl@0: EUsbPageListGoneBeyondHcdPageListBounds = 23, sl@0: EUsbTransferRequestNoThreadProvided = 24, sl@0: EUsbTransferRequestNoRequestProvided = 25, sl@0: EUsbTransferRequestDeletedWhileOutstanding = 26, sl@0: EUsbTransferRequestDeletedWithoutCompleting = 27, sl@0: EUsbTransferRequestFinalisedTwice = 28, sl@0: EUsbTransferRequestCompletedWithoutFinalising = 29, sl@0: EUsbPipeNoTransferRequestForTransfer = 30, sl@0: EUsbDeviceStateChangeRequestButNoThread = 31, sl@0: EUsbPageListInvalidRegion = 32, sl@0: EUsbTransferDescriptorUnexpectedEndOfIsocList = 33, sl@0: EUsbTransferDescriptorUnfillableElement = 34, sl@0: EUsbHubDriverPendingNoneEvent = 35, sl@0: EUsbTransferDescriptorResultsArrayBadAlignment = 36, sl@0: EUsbDeviceTooManyDevicesSignallingInactivity = 37, sl@0: EUsbHubDriverQueuedBusEventNotDeviceAttach = 38, sl@0: EUsbPipeHasHandleButNoInterface = 39, sl@0: EUsbDeviceHasHandleButNoHubDriver = 40, sl@0: EUsbDevMonDeviceAttachDenied = 41, sl@0: EUsbHubDriverZeroInterfaceTokenProduced = 42, sl@0: EUsbInterfaceSuccessfulPipeOpenWithNoPipe = 43, sl@0: }; sl@0: sl@0: _LIT(KUsbDescFaultCat, "USBDesc-Fault"); sl@0: enum TUsbDescFaults sl@0: { sl@0: EUsbDescSuccessButDataLeftUnparsed = 0, sl@0: EUsbDescTreePointersAlreadySet = 1, sl@0: EUsbDescNoTopLevelDescriptorFound = 2, sl@0: EUsbDescRunOffTree = 3, sl@0: EUsbDescTreeMemberHasNoParent = 4, sl@0: }; sl@0: } sl@0: sl@0: #endif // D32USBDI_ERRORS_H