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: @internalComponent sl@0: */ sl@0: sl@0: #ifndef USBDI_CHANNEL_H sl@0: #define USBDI_CHANNEL_H sl@0: sl@0: class DUsbInterface; sl@0: class DUsbPageList; sl@0: sl@0: /** sl@0: Logical Device (factory class) for USBDI sl@0: */ sl@0: NONSHARABLE_CLASS(DUsbdiFactory) : public DLogicalDevice sl@0: { sl@0: public: sl@0: DUsbdiFactory(); sl@0: ~DUsbdiFactory(); sl@0: sl@0: private: sl@0: // Inherited from DLogicalDevice sl@0: virtual TInt Install(); sl@0: virtual void GetCaps(TDes8& aDes) const; sl@0: virtual TInt Create(DLogicalChannelBase*& aChannel); sl@0: }; sl@0: sl@0: sl@0: NONSHARABLE_CLASS(DUsbdiChannel) : public DLogicalChannelBase sl@0: { sl@0: public: sl@0: DUsbdiChannel(); sl@0: sl@0: TInt DoCreate(TInt aUnit, const TDesC8* aInfo, const TVersion& aVer); sl@0: TInt Request(TInt aReqNo, TAny* a1, TAny* a2); sl@0: sl@0: virtual void CloseChannel(); sl@0: sl@0: private: sl@0: ~DUsbdiChannel(); sl@0: TInt Close(); sl@0: sl@0: TInt AllocChunk(TInt aRequestSize, TInt* aChunkHandle, TInt* aOffset); sl@0: void CloseChunk(); sl@0: sl@0: TInt HandleControl(TInt aReqNo, TAny* a1, TAny* a2); sl@0: TInt HandleRequest(TInt aReqNo, TRequestStatus* aReq, TAny* a1, TAny* a2); sl@0: TInt HandleCancel(TUint aCancelMask); sl@0: sl@0: private: sl@0: DUsbInterface* iInterface; sl@0: DUsbPageList* iPageList; // Owns the shared chunk sl@0: }; sl@0: sl@0: #endif