usbdrv/peripheral/public/usbcontrolxferif.h
branchRCL_3
changeset 16 012cc2ee6408
parent 15 f92a4f87e424
equal deleted inserted replaced
15:f92a4f87e424 16:012cc2ee6408
     1 /*
       
     2   Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
       
     3   All rights reserved.
       
     4 
       
     5   This program and the accompanying materials are made available 
       
     6   under the terms of the Eclipse Public License v1.0 which accompanies 
       
     7   this distribution, and is available at 
       
     8   http://www.eclipse.org/legal/epl-v10.html
       
     9 
       
    10   Initial Contributors:
       
    11   Nokia Corporation - initial contribution.
       
    12 
       
    13   Contributors:
       
    14 */
       
    15 
       
    16 #ifndef USBCONTROLXFERIF_H
       
    17 #define USBCONTROLXFERIF_H
       
    18 
       
    19 #include <e32def.h>                 // General types definition
       
    20 
       
    21 /** 
       
    22  * Callback interfaces that used to process packet received from Host
       
    23  * and interfaces through which that PIL or app can send request to PSL
       
    24  */
       
    25 NONSHARABLE_CLASS(MControlTransferIf)
       
    26     {
       
    27     public:
       
    28         // Interface for RX
       
    29         // Transfer direction from Device to Host
       
    30         // This two interface is saying PSL had finished
       
    31         // sending those data to host.
       
    32         virtual void ProcessDataInPacket(TInt aCount,TInt aErrCode) = 0;
       
    33         virtual void ProcessStatusInPacket(TInt aErrCode) = 0;
       
    34         
       
    35         // Transfer direction from Host to Device
       
    36         // they are saying that some data had been recieved from host
       
    37         virtual void ProcessDataOutPacket(TInt aCount,TInt aErrCode) = 0;
       
    38         virtual void ProcessStatusOutPacket(TInt aErrCode) = 0;
       
    39         virtual void ProcessSetupPacket(TInt aCount,TInt aErrCode) = 0;
       
    40         
       
    41         // Interface for TX and Control
       
    42         // Data/Status transfer function
       
    43         virtual TInt ProcessSetupEndpointZeroRead() = 0;
       
    44         virtual TInt ProcessSetupEndpointZeroWrite(const TUint8* aBuffer, TInt aLength, TBool aZlpReqd=EFalse) = 0;
       
    45         virtual TInt ProcessSendEp0ZeroByteStatusPacket() = 0;
       
    46         virtual TInt ProcessStallEndpoint(TInt aRealEndpoint) = 0;
       
    47         
       
    48         // Flow control interface
       
    49         // In case of we can not deliver received packet(setup or data) to a registered client
       
    50         // (because the request callback is not ready), we need PSL stop reporting more packet
       
    51         // to PIL until the pending packet had been process.
       
    52         // this 2 functions is used to notify PSL: you can continue, the pending packet is proceed.
       
    53         virtual void ProcessEp0SetupPacketProceed() = 0;
       
    54         virtual void ProcessEp0DataPacketProceed() = 0;
       
    55     };
       
    56 
       
    57 #endif //USBCONTROLXFERIF_H
       
    58 
       
    59 // End of file
       
    60