usbmgmt/usbmgr/device/classdrivers/ncm/classimplementation/ncmpktdrv/pktdrv/inc/ncmpktdrv.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 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 /**
       
    19 @file
       
    20 @internalComponent
       
    21 */
       
    22 #ifndef NCMPKTDRV_H
       
    23 #define NCMPKTDRV_H
       
    24 
       
    25 
       
    26 #include <e32base.h>
       
    27 #ifndef __OVER_DUMMYUSBSCLDD__
       
    28 #include <nifmbuf.h>
       
    29 #include <es_mbuf.h>
       
    30 #include <networking/pktdrv.h>
       
    31 #include <networking/ethinter.h>
       
    32 #else
       
    33 #include <usb/testncm/ethinter.h>
       
    34 #endif
       
    35 
       
    36 class CNcmEngine;
       
    37 class CNcmServer;
       
    38 
       
    39 /**
       
    40 The Ncm packet driver
       
    41 */
       
    42 NONSHARABLE_CLASS(CNcmPktDrv) : public CPktDrvBase
       
    43     {
       
    44 public:
       
    45     CNcmPktDrv(CPktDrvFactory& aFactory);
       
    46     virtual ~CNcmPktDrv();
       
    47     virtual void ConstructL(CLANLinkCommon* aParent);
       
    48 
       
    49     //From CPktDrvBase
       
    50     virtual TInt StartInterface();
       
    51     virtual TInt StopInterface();
       
    52     virtual TInt ResetInterface();
       
    53     virtual TInt SetRxMode(TRxMode AMode);
       
    54     virtual TInt GetRxMode() const;
       
    55     virtual TInt SetInterfaceAddress(const THWAddr&);
       
    56     virtual TUint8* GetInterfaceAddress()const;
       
    57     virtual TInt GetMulticastList(const THWAddr* aAddr, TInt& n) const;
       
    58     virtual TInt SetMulticastList(const THWAddr* aAddr, TInt n);
       
    59     virtual TInt InterfacePowerUp();
       
    60     virtual TInt InterfacePowerDown();
       
    61     virtual TInt InterfaceSleep();
       
    62     virtual TInt InterfaceResume();
       
    63     virtual TInt Notification(enum TAgentToNifEventType aEvent, void* aInfo);
       
    64     virtual TInt Control(TUint aLevel,TUint aName,TDes8& aOption, TAny* aSource=0);
       
    65     virtual TInt Send(RMBufChain& aPkt);
       
    66 
       
    67     //Upcall from Control Object
       
    68     void ReceiveEthFrame(RMBufPacket&);
       
    69     void ResumeSending();
       
    70     void FatalErrorNotification(TInt aError);
       
    71 
       
    72 #ifdef __OVER_DUMMYUSBSCLDD__
       
    73 public:
       
    74     TInt State() const;
       
    75 #endif
       
    76 
       
    77 private:
       
    78     CNcmEngine*        iEngine;
       
    79     CNcmServer*        iNcmServer;
       
    80     };
       
    81 
       
    82 #endif // NCMPKTDRV_H