linklayerprotocols/ethernetnif/EtherPkt/CardCtl.cpp
author Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
Thu, 04 Mar 2010 11:58:36 +0000
branchRCL_3
changeset 6 e7dfaa7b0b8d
permissions -rw-r--r--
Fix for Bug 69 - provide missing source for EtherPkt.drv
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
     2
// All rights reserved.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
     7
//
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
     8
// Initial Contributors:
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    10
//
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    11
// Contributors:
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    12
//
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    13
// Description:
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    14
// Control engine for ethernet packet driver 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    15
// 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    16
//
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    17
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    18
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    19
 @file
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    20
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    21
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    22
#include <nifman.h>
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    23
#include <nifvar.h>
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    24
#include <nifutl.h>
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    25
#include <es_mbuf.h>
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    26
#include <es_ini.h>
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    27
#include <ir_sock.h>
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    28
#include "PKTDRV.H"
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    29
#include "ETHINTER.H"
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    30
#include "Cardctl.h"
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    31
#include <f32file.h>
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    32
#include <e32svr.h>
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    33
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    34
//#define __DebugCardCtl__ 1
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    35
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    36
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    37
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    38
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    39
Create a new CPcCardControlEngine object.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    40
@param aPktDrv Pointer to PC Card Packet Driver.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    41
@return A pointer to CPcCardControlEngine object.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    42
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    43
CPcCardControlEngine *CPcCardControlEngine::NewL(CPcCardPktDrv* aPktDrv)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    44
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    45
	CPcCardControlEngine *cc=new (ELeave) CPcCardControlEngine(aPktDrv);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    46
	CleanupStack::PushL(cc);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    47
	cc->ConstructL();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    48
	CleanupStack::Pop();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    49
	return cc;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    50
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    51
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    52
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    53
Physical device driver settings
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    54
@internalComponent
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    55
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    56
_LIT(KPddSection,"pdd_settings");
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    57
 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    58
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    59
PCMCIA Socket Number
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    60
@internalComponent
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    61
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    62
_LIT(KSocketNumber,"PCMCIA_socket"); 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    63
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    64
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    65
Create the CPcCardControlEngine object.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    66
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    67
void CPcCardControlEngine::ConstructL()
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    68
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    69
	iSender = CPcCardSender::NewL(this);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    70
	iReceiver = CPcCardReceiver::NewL(this);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    71
	iEventHandler = CPcCardEventHandler::NewL(this);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    72
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    73
	LoadDeviceDriversL();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    74
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    75
	CESockIniData* ini = CESockIniData::NewL(ETHER802_CONFIG_FILENAME);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    76
	CleanupStack::PushL(ini);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    77
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    78
	TInt socket;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    79
	if(!ini->FindVar(KPddSection,KSocketNumber,socket))
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    80
		{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    81
		User::Leave(KErrNotFound);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    82
		}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    83
	
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    84
	CleanupStack::PopAndDestroy(ini);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    85
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    86
	TInt error = iCard.Open(socket);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    87
	User::LeaveIfError(error);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    88
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    89
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    90
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    91
Open the Card LDD
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    92
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    93
void CPcCardControlEngine::StartL()
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    94
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    95
	iCardOpen = ETrue;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    96
	iReceiver->QueueRead();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    97
	LinkLayerUp();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    98
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
    99
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   100
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   101
Find and loads the LDD and the PDD if the logical device driver loaded OK.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   102
The driver names are read from the LAN bearer table in commdb.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   103
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   104
void CPcCardControlEngine::LoadDeviceDriversL()
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   105
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   106
	TInt err;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   107
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   108
	//
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   109
	// Get the device driver filenames for loading
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   110
	//
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   111
	TBuf<KCommsDbSvrDefaultTextFieldLength> pddOrLddFileName;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   112
	
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   113
	// LDD first...
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   114
	TBuf<KCommsDbSvrMaxColumnNameLength> columnName=TPtrC(LAN_BEARER);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   115
	columnName.Append(TChar(KSlashChar));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   116
	columnName.Append(TPtrC(LAN_BEARER_LDD_FILENAME));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   117
	
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   118
	err = iNotify->NifNotify()->ReadDes(columnName, pddOrLddFileName); // Get the LDD name from commdb
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   119
	
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   120
	if(err!=KErrNone)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   121
		{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   122
		__FLOG_STATIC(KEther802LogTag1,KEthLogTag3, _L("Could not find LDD filename in commdb - is .cfg file up-to-date?  See ether802.ini for information on required fields in commdb."));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   123
		User::Leave(err);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   124
		}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   125
	
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   126
	err=User::LoadLogicalDevice(pddOrLddFileName);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   127
	if(err != KErrNone && err != KErrAlreadyExists)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   128
		{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   129
		User::Leave(err);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   130
		}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   131
	
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   132
	// ...and now the PDD
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   133
	columnName.Zero();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   134
	columnName.Append(TPtrC(LAN_BEARER));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   135
	columnName.Append(TChar(KSlashChar));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   136
	columnName.Append(TPtrC(LAN_BEARER_PDD_FILENAME));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   137
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   138
	err = iNotify->NifNotify()->ReadDes(columnName, pddOrLddFileName); // Get the PDD filename from commdb
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   139
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   140
	if(err!=KErrNone)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   141
		{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   142
		__FLOG_STATIC(KEther802LogTag1,KEthLogTag3, _L("Could not find PDD filename in commdb - is .cfg file up-to-date?  See ether802.ini for information on required fields in commdb."));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   143
		User::Leave(err);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   144
		}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   145
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   146
	err = User::LoadPhysicalDevice(pddOrLddFileName);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   147
	if (err != KErrNone && err != KErrAlreadyExists)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   148
		{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   149
		User::Leave(err);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   150
		}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   151
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   152
	//
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   153
	// Get device driver names for unloading
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   154
	//
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   155
	columnName.Zero();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   156
	columnName.Append(TPtrC(LAN_BEARER));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   157
	columnName.Append(TChar(KSlashChar));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   158
	columnName.Append(TPtrC(LAN_BEARER_PDD_NAME));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   159
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   160
	err = iNotify->NifNotify()->ReadDes(columnName, iPDDName); // Get the PDD name from commdb (so we can close it when we've finished with it)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   161
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   162
	if(err!=KErrNone)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   163
		{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   164
		__FLOG_STATIC(KEther802LogTag1,KEthLogTag3, _L("Could not find PDD name in commdb - is .cfg file up-to-date?  See ether802.ini for information on required fields in commdb."));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   165
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   166
#ifdef _DEBUG
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   167
		// Not being able to unload the device drivers is not a fatal error, so don't worry too 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   168
		// much if we can't read the field out of commdb in release builds, but if the user is 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   169
		// using a debug nif they ought to get it right...
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   170
		User::Leave(err);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   171
#endif // _DEBUG
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   172
		}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   173
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   174
	// Rather than fiddle around trying to reuse the contents of the descriptor (problems with field name lengths), just zero and start again
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   175
	columnName.Zero();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   176
	columnName.Append(TPtrC(LAN_BEARER));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   177
	columnName.Append(TChar(KSlashChar));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   178
	columnName.Append(TPtrC(LAN_BEARER_LDD_NAME));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   179
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   180
	err = iNotify->NifNotify()->ReadDes(columnName, iLDDName); // Get the LDD name from commdb (so we can close it when we've finished with it)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   181
	
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   182
	if(err!=KErrNone)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   183
		{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   184
		__FLOG_STATIC(KEther802LogTag1,KEthLogTag3, _L("Could not find LDD name in commdb - is .cfg file up-to-date?  See ether802.ini for information on required fields in commdb."));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   185
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   186
#ifdef _DEBUG
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   187
		User::Leave(err);	// see reasoning for LDD above
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   188
#endif // _DEBUG
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   189
		}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   190
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   191
	__FLOG_STATIC(KEther802LogTag1,KEthLogTag3, _L("Device drivers loaded"));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   192
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   193
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   194
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   195
Cancel I/O and close the Card LDD.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   196
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   197
void CPcCardControlEngine::Stop()
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   198
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   199
	// LDD Performs status checks on Read and Write
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   200
	// Completes requests with an error code if they are pending
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   201
	iCard.WriteCancel();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   202
	iSender->EmptyQueue();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   203
	iSender->Cancel();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   204
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   205
	iCard.ReadCancel();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   206
	iCardOpen = EFalse;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   207
	iCard.Close();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   208
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   209
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   210
CPcCardControlEngine::CPcCardControlEngine(CPcCardPktDrv* aPktDrv)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   211
:iCardOpen(EFalse), iNotify(aPktDrv)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   212
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   213
Constructor.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   214
@param aPktDrv Pointer to PC Card Packet Driver.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   215
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   216
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   217
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   218
}		
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   219
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   220
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   221
Destructor.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   222
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   223
CPcCardControlEngine::~CPcCardControlEngine()
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   224
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   225
#ifdef _DEBUG
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   226
	// see reasoning for only doing this in debug builds in LoadPacketDrivers()
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   227
	User::FreeLogicalDevice(iLDDName);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   228
	User::FreePhysicalDevice(iPDDName);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   229
#endif
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   230
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   231
	delete iReceiver;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   232
	delete iSender;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   233
	delete iEventHandler;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   234
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   235
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   236
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   237
Upwards notify
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   238
@param aBuffer A Reference to a buffer holding data.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   239
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   240
void CPcCardControlEngine::ProcessReceivedPacket(TDesC8& aBuffer)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   241
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   242
	iNotify->ReadDataAvailable(aBuffer);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   243
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   244
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   245
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   246
Resume Sending is a notification call into NIF from the lower layer telling the NIF that a 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   247
previous sending congestion situation has been cleared and it can accept more downstack data.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   248
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   249
void CPcCardControlEngine::ResumeSending()
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   250
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   251
	iNotify->ResumeSending();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   252
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   253
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   254
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   255
Resume Sending is a notification call into NIF from the lower layer telling the NIF that 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   256
the interface is now up and can accept and transmit data. NIF subsequently calls all the 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   257
bearers' StartSending() methods directly.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   258
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   259
void CPcCardControlEngine::LinkLayerUp()
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   260
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   261
	iNotify->LinkLayerUp();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   262
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   263
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   264
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   265
Sender class handles queueing and takes ownership of the HBuf and the CIOBuffer.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   266
@param aBuffer The data to be send is set.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   267
@return 0 Tells the higher layer to send no more data.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   268
		1 Tells higher layer that it can send more data.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   269
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   270
TInt CPcCardControlEngine::Send(HBufC8* aBuffer)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   271
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   272
	CIOBuffer* buf = NULL;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   273
	TRAPD(err,buf = CIOBuffer::NewL(aBuffer));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   274
	if(err != KErrNone)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   275
		{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   276
		delete aBuffer;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   277
		}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   278
	else
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   279
		{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   280
		err = iSender->Send(buf);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   281
		}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   282
	return err;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   283
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   284
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   285
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   286
Call to LDD or subordinate object to get the Hardware address of the LAN Device
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   287
@return NULL Failure.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   288
		(NULL Terminated Binary String) The Hardware Address of the interface. LAN Device 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   289
		Specific
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   290
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   291
TUint8* CPcCardControlEngine::GetInterfaceAddress()
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   292
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   293
	iConfig.SetMax();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   294
	iCard.Config(iConfig);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   295
	return ((TUint8*)iConfig.Ptr())+2; // The MAC address is located 2 bytes
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   296
					   // from the start of the buffer
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   297
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   298
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   299
#if !defined(__WINS__)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   300
//
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   301
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   302
/** 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   303
ethermac.dat reading - work around for mac address problem 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   304
@internal component
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   305
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   306
_LIT(KEtherMacFileName,"C:\\System\\Data\\EtherMac.dat");
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   307
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   308
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   309
Parse the Machine Address from the File.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   310
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   311
void CPcCardControlEngine::ParseMACFromFileL()
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   312
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   313
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   314
	TBuf8<64> controlBuf;  // the size of this is defined in the driver as 64.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   315
	TBuf8<12> macAddress = 0;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   316
	RFile macFile;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   317
	RFs fileSrv;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   318
	
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   319
	User::LeaveIfError(fileSrv.Connect());
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   320
	User::LeaveIfError(macFile.Open(fileSrv,KEtherMacFileName,EFileRead));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   321
	User::LeaveIfError(macFile.Read(macAddress,12));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   322
	macFile.Close();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   323
	fileSrv.Close();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   324
	controlBuf.SetLength(8);	
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   325
	controlBuf[0] = KEthSpeed10BaseT;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   326
	controlBuf[1] = KEthDuplexHalf;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   327
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   328
	TBuf<20> validChars(_L("0123456789abcdef"));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   329
	TUint8 value;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   330
	TUint8 upper=0;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   331
	TChar c;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   332
	TInt pos; 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   333
	iConfig.SetMax(); // MAC Address fix
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   334
	for(TInt i=0; i<6; i++)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   335
	{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   336
		c = macAddress[2*i];
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   337
		c.LowerCase();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   338
		if((pos = validChars.Locate(c))==KErrNotFound)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   339
		{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   340
			pos = upper;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   341
			break;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   342
		}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   343
		upper = (TUint8)pos;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   344
		c = macAddress[(2*i)+1];
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   345
		c.LowerCase();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   346
		if((pos = validChars.Locate(c))==KErrNotFound)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   347
		{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   348
			User::Leave(KErrNotFound);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   349
		}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   350
		value = (TUint8)pos;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   351
		value = (TUint8)((upper<<4) | value);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   352
		controlBuf.Append(value);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   353
		iConfig[i+2]=value; // MAC Address fix 21/05/01
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   354
	}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   355
	TRequestStatus status = 0;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   356
	
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   357
	User::LeaveIfError(iCard.SetMAC(controlBuf));
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   358
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   359
	User::WaitForRequest(status);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   360
	User::LeaveIfError(status.Int());
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   361
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   362
#endif
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   363
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   364
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   365
Constructor. Generic Buffer class
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   366
Currently used for transmit buffers
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   367
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   368
CIOBuffer::CIOBuffer() : iBufPtr(NULL,0)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   369
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   370
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   371
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   372
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   373
Destructor. Free the HBuf if there is one
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   374
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   375
CIOBuffer::~CIOBuffer()
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   376
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   377
	FreeData();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   378
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   379
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   380
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   381
Creation where we new the HBuf.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   382
@param aSize Length of the Buffer.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   383
@return A pointer to CIOBuffer object.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   384
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   385
CIOBuffer* CIOBuffer::NewL(const TInt aSize)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   386
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   387
	CIOBuffer * self = new (ELeave) CIOBuffer;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   388
	CleanupStack::PushL(self);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   389
	self->ConstructL(aSize);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   390
	CleanupStack::Pop();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   391
	return self;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   392
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   393
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   394
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   395
Construction where we new the HBuf
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   396
@param aSize Length of the Buffer.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   397
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   398
void CIOBuffer::ConstructL(const TInt aSize)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   399
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   400
	iBuf = HBufC8::NewL(aSize);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   401
	TPtr8 temp=iBuf->Des();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   402
	iBufPtr.Set(temp);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   403
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   404
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   405
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   406
HBuf provided. 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   407
@param aBuf The data to be assigned 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   408
@return A pointer to CIOBuffer object.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   409
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   410
CIOBuffer* CIOBuffer::NewL(HBufC8* aBuf)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   411
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   412
	CIOBuffer * self = new (ELeave) CIOBuffer;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   413
	self->Assign(aBuf);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   414
	return self;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   415
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   416
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   417
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   418
Offset 
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   419
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   420
TInt CIOBuffer::LinkOffset()
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   421
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   422
	return _FOFF(CIOBuffer,iLink);	
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   423
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   424
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   425
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   426
Assigns the data from buffer to pointer.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   427
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   428
@param aBuffer The data to be assigned  
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   429
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   430
void CIOBuffer::Assign(HBufC8* aBuffer)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   431
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   432
	FreeData();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   433
	iBuf = aBuffer;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   434
	if(aBuffer)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   435
		{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   436
		TPtr8 temp=iBuf->Des();
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   437
		iBufPtr.Set(temp);
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   438
		}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   439
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   440
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   441
/**
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   442
Frees the data.
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   443
*/
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   444
void CIOBuffer::FreeData()
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   445
{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   446
	if(iBuf)
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   447
		{
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   448
		delete iBuf;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   449
		iBuf = NULL;
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   450
		}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   451
}
e7dfaa7b0b8d Fix for Bug 69 - provide missing source for EtherPkt.drv
Deepak Kumar-Gupta <deepak.kumar-gupta@nokia.com>
parents:
diff changeset
   452