kernel/eka/include/drivers/usbdi_channel.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     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  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef USBDI_CHANNEL_H
       
    22 #define USBDI_CHANNEL_H
       
    23 
       
    24 class DUsbInterface;
       
    25 class DUsbPageList;
       
    26 
       
    27 /**
       
    28   Logical Device (factory class) for USBDI
       
    29 */
       
    30 NONSHARABLE_CLASS(DUsbdiFactory) : public DLogicalDevice
       
    31 	{
       
    32 public:
       
    33 	DUsbdiFactory();
       
    34 	~DUsbdiFactory();
       
    35 
       
    36 private:
       
    37 	//	Inherited from DLogicalDevice
       
    38 	virtual TInt Install();
       
    39 	virtual void GetCaps(TDes8& aDes) const;
       
    40 	virtual TInt Create(DLogicalChannelBase*& aChannel);
       
    41 	};
       
    42 	
       
    43 
       
    44 NONSHARABLE_CLASS(DUsbdiChannel) : public DLogicalChannelBase
       
    45 	{
       
    46 public:
       
    47 	DUsbdiChannel();
       
    48 
       
    49 	TInt DoCreate(TInt aUnit, const TDesC8* aInfo, const TVersion& aVer);
       
    50 	TInt Request(TInt aReqNo, TAny* a1, TAny* a2);
       
    51 
       
    52 	virtual void CloseChannel();
       
    53 
       
    54 private:
       
    55 	~DUsbdiChannel();
       
    56 	TInt Close();
       
    57 
       
    58 	TInt AllocChunk(TInt aRequestSize, TInt* aChunkHandle, TInt* aOffset);
       
    59 	void CloseChunk();
       
    60 
       
    61 	TInt HandleControl(TInt aReqNo, TAny* a1, TAny* a2);
       
    62 	TInt HandleRequest(TInt aReqNo, TRequestStatus* aReq, TAny* a1, TAny* a2);
       
    63 	TInt HandleCancel(TUint aCancelMask);
       
    64 	
       
    65 private:
       
    66 	DUsbInterface* iInterface;
       
    67 	DUsbPageList* iPageList; // Owns the shared chunk
       
    68 	};
       
    69 
       
    70 #endif