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