wlan_bearer/wlanldd/wlan_symbian/wlanldd_symbian/inc/EtherCardIoc.h
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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 the License "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:   This header provides the IO Control and Event codes.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 6 %
       
    20 */
       
    21 
       
    22 #if !defined(__ETHERIOC_H__)
       
    23 #define __ETHERIOC_H__
       
    24 
       
    25 /**
       
    26 IOControl options. 
       
    27 */
       
    28 const TUint8 KIoControlNullCommand=0x00; //Test use only
       
    29 const TUint8 KIoControlResetCard=0x01;
       
    30 const TUint8 KIoControlPowerUpCard=0x02;
       
    31 const TUint8 KIoControlPowerDownCard=0x03;
       
    32 const TUint8 KIoControlGetStats=0x04;
       
    33 const TUint8 KIoControlResetStats=0x05;
       
    34 const TUint8 KIoControlGetStatus=0x06;
       
    35 const TUint8 KIoControlSetParameters=0x07;
       
    36 const TUint8 KIoControlSetMACAddress=0x08;
       
    37 
       
    38 /**
       
    39 GetEvent options. 
       
    40 */
       
    41 
       
    42 const TUint8 KEventNull=0x00; //Test use only
       
    43 const TUint8 KEventEmergencyPowerDown=0x01;
       
    44 const TUint8 KEventNormalPowerDown=0x02;
       
    45 const TUint8 KEventPCCardReady=0x04;
       
    46 const TUint8 KEventMediaOpen=0x08;
       
    47 
       
    48 // Card configuration - speed settings.
       
    49 const TUint8 KEthSpeedUnknown=0x00;
       
    50 const TUint8 KEthSpeedAuto=0x01;
       
    51 const TUint8 KEthSpeed10BaseT=0x02;
       
    52 const TUint8 KEthSpeed100BaseTX=0x03;
       
    53 const TUint8 KEthSpeedDefault=KEthSpeedAuto;
       
    54 
       
    55 // Card configuration - duplex settings.
       
    56 const TUint8 KEthDuplexUnknown=0x00;
       
    57 const TUint8 KEthDuplexAuto=0x01;
       
    58 const TUint8 KEthDuplexFull=0x02;
       
    59 const TUint8 KEthDuplexHalf=0x03;
       
    60 const TUint8 KEthDuplexDefault=KEthDuplexAuto;
       
    61 
       
    62 // Card configuration - rx mode settings.
       
    63 const TUint8 KEthRxModeUnknown=0x00;
       
    64 const TUint8 KEthRxModeStation=0x01;
       
    65 const TUint8 KEthRxModeBroadcast=0x02;
       
    66 const TUint8 KEthRxModeMulticast=0x03;
       
    67 const TUint8 KEthRxModePromisuous=0x04;
       
    68 const TUint8 KEthRxModeDefault=KEthRxModeMulticast;
       
    69 
       
    70 // Card parameter - general no change indicator.
       
    71 const TUint8 KEthNoChange=0x00;
       
    72 const TUint8 KEthNoSetting=0x00;
       
    73 const TUint8 KEthModeOn=0x01;
       
    74 const TUint8 KEthModeOff=0x02;
       
    75 
       
    76 /**
       
    77 Default Ethernet Address. 
       
    78 */
       
    79 const TUint8 KDefEtherAddByte0=0x31; // MSB
       
    80 const TUint8 KDefEtherAddByte1=0x32;
       
    81 const TUint8 KDefEtherAddByte2=0x33;
       
    82 const TUint8 KDefEtherAddByte3=0x34;
       
    83 const TUint8 KDefEtherAddByte4=0x35;
       
    84 const TUint8 KDefEtherAddByte5=0x36; // LSB
       
    85 
       
    86 const TUint KEthernetAddressLength=6;
       
    87 
       
    88 // Card configuration - status alternatives.
       
    89 const TUint8 KEthCardReady=0x00;
       
    90 const TUint8 KEthCardNotReady=0xFF;
       
    91 
       
    92 // Card configuration - precise status alternatives.
       
    93 const TUint8 KIoControlCardNotPresent=0x01;
       
    94 const TUint8 KIoControlCardNotReady=0x02;
       
    95 const TUint8 KIoControlCardBad=0x03;
       
    96 const TUint8 KIoControlCardReady=0x04;
       
    97 
       
    98 /**
       
    99  *  Ethernet card statistics class.
       
   100  *
       
   101  *  @since S60 v3.1
       
   102  */
       
   103 class TPddPcCardStatistics
       
   104 	{
       
   105 
       
   106 public:
       
   107 	inline TPddPcCardStatistics() { Init(); }
       
   108 	inline void Init()
       
   109 		{
       
   110 		iTxErrReclaim = iTxErrStatusOverflow = iTxErrMaxCollisions = 0;
       
   111 		iTxErrUnderrun = iTxErrJabber = 0;
       
   112 		iRxErrOverflow = iRxErrLength = iRxErrFrame = 0;
       
   113 		iRxErrCrc = iRxErrPacketDropped = 0;
       
   114 		iBadSSD = iUpperBytesOK = iCarrierLost = 0;
       
   115 		iSqeErrors = iMultiCollFrames = iSingleCollFrames = iLateCollisions = 0;
       
   116 		iRxOverruns = iFramesXmittedOK = iFramesRcvdOK = iFramesDeferred = 0;
       
   117 		iUpperFramesOK = iBytesRcvdOK = iBytesXmittedOK = 0;
       
   118 		iBadSSD = iUpperBytesOK = 0;
       
   119 		iNumRxPackets = iNumTxPackets = iNumRxBytes = iNumTxBytes = 0; 
       
   120 		}
       
   121 public:
       
   122 	// Driver statistics 
       
   123 	TUint iTxErrReclaim;
       
   124 	TUint iTxErrStatusOverflow;
       
   125 	TUint iTxErrMaxCollisions;
       
   126 	TUint iTxErrUnderrun;
       
   127 	TUint iTxErrJabber;
       
   128 	TUint iRxErrOverflow;
       
   129 	TUint iRxErrLength;
       
   130 	TUint iRxErrFrame;
       
   131 	TUint iRxErrCrc;
       
   132 	TUint iRxErrPacketDropped;
       
   133 
       
   134 	// Adapter statistics 
       
   135 	TUint iCarrierLost;
       
   136 	TUint iSqeErrors;
       
   137 	TUint iMultiCollFrames;
       
   138 	TUint iSingleCollFrames;
       
   139 	TUint iLateCollisions;
       
   140 	TUint iRxOverruns;
       
   141 	TUint iFramesXmittedOK;
       
   142 	TUint iFramesRcvdOK;
       
   143 	TUint iFramesDeferred;
       
   144 	TUint iUpperFramesOK;
       
   145 	TUint iBytesRcvdOK;
       
   146 	TUint iBytesXmittedOK;
       
   147 	TUint iBadSSD;
       
   148 	TUint iUpperBytesOK;
       
   149 
       
   150 	// Derived adapter statistics 
       
   151 	TUint iNumRxPackets;
       
   152 	TUint iNumTxPackets;
       
   153 	TUint iNumRxBytes;
       
   154 	TUint iNumTxBytes;
       
   155 	};
       
   156 
       
   157 /**
       
   158  *  Ethernet card configuration class.
       
   159  *
       
   160  *  @since S60 v3.1
       
   161  */
       
   162 class TEtherConfig
       
   163 	{
       
   164 
       
   165 public:
       
   166 	TUint8 iStatus;
       
   167 	TUint8 iEthSpeed;
       
   168 	TUint8 iEthDuplex;
       
   169 	TUint8 iEthAddress[KEthernetAddressLength];
       
   170 	};
       
   171 
       
   172 /**
       
   173  *  Ethernet parameters class.
       
   174  *
       
   175  *  @since S60 v3.1
       
   176  */
       
   177 class TEtherParams
       
   178 	{
       
   179 
       
   180 public:
       
   181 	inline TEtherParams()
       
   182 		:	iEthSpeed(KEthNoChange), iEthDuplex(KEthNoChange), iRxMode(KEthNoChange),
       
   183 			iSwFullDuplexMode(KEthNoChange), iIntLoopbackMode(KEthNoChange),
       
   184 			iIntAppendCRCMode(KEthNoChange), iPadFramesMode(KEthNoChange)
       
   185 		{}
       
   186 public:
       
   187 	TUint8 iCommand;
       
   188 	TUint8 iEthSpeed;
       
   189 	TUint8 iEthDuplex;
       
   190 	TUint8 iRxMode;
       
   191 	TUint8 iSwFullDuplexMode;
       
   192 	TUint8 iIntLoopbackMode;
       
   193 	TUint8 iIntAppendCRCMode;
       
   194 	TUint8 iPadFramesMode;
       
   195 	};
       
   196 
       
   197 #endif