28
|
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 |
|
|
23 |
#ifndef OVERDUMMY_NCMCC
|
|
24 |
#include <commdbconnpref.h>
|
|
25 |
#include <es_enum.h>
|
|
26 |
#endif // OVERDUMMY_NCMCC
|
|
27 |
|
|
28 |
#include <usb/usbncm.h>
|
|
29 |
#include <nifvar.h>
|
|
30 |
#include <cdbcols.h>
|
|
31 |
#include <commdb.h>
|
|
32 |
|
|
33 |
#include "ncmconnectionmanager.h"
|
|
34 |
#include "ncmiapprogresswatcher.h"
|
|
35 |
#include "ncmiapreader.h"
|
|
36 |
#include "ncmdhcpnotifwatcher.h"
|
|
37 |
|
|
38 |
#ifdef OVERDUMMY_NCMCC
|
|
39 |
#include <usb/testncmcc/dummy_ncminternalsrv.h>
|
|
40 |
#else
|
|
41 |
#include "ncminternalsrv.h"
|
|
42 |
#endif // OVERDUMMY_NCMCC
|
|
43 |
|
|
44 |
#include "ncmclasscontroller.h"
|
|
45 |
#include "ncmconnectionmanagerobserver.h"
|
|
46 |
#include "ncmconnectionmanagerhelper.h"
|
|
47 |
|
|
48 |
// For OST tracing
|
|
49 |
#include "OstTraceDefinitions.h"
|
|
50 |
#ifdef OST_TRACE_COMPILER_IN_USE
|
|
51 |
#include "ncmconnectionmanagerTraces.h"
|
|
52 |
#endif
|
|
53 |
|
|
54 |
using namespace UsbNcm;
|
|
55 |
|
|
56 |
#if defined(_DEBUG)
|
|
57 |
_LIT(KNcmConnManagerPanic, "UsbNcmCM"); // must be <=16 chars
|
|
58 |
#endif
|
|
59 |
|
|
60 |
extern const TUint KEthernetFrameSize;
|
|
61 |
|
|
62 |
// Panic codes
|
|
63 |
enum TNcmCMPanicCode
|
|
64 |
{
|
|
65 |
ENcmCMPanicOutstandingRequestFromDevice = 1,
|
|
66 |
ENcmCMPanicNoRegisteredWatcher = 2,
|
|
67 |
ENcmCMEndMark
|
|
68 |
};
|
|
69 |
|
|
70 |
/**
|
|
71 |
* Constructs a CNcmConnectionManager object.
|
|
72 |
* @param[in] aObserver, NCM connection observer
|
|
73 |
* @param[in] aHostMacAddress, the NCM interface MAC address
|
|
74 |
* @param[in] aDataBufferSize, the EndPoint buffer size
|
|
75 |
* @param[in] aNcmInternalSvr, the NCM internal server
|
|
76 |
* @return Ownership of a new CNcmConnectionManager object
|
|
77 |
*/
|
|
78 |
CNcmConnectionManager* CNcmConnectionManager::NewL(
|
|
79 |
MNcmConnectionManagerObserver& aObserver,
|
|
80 |
const TNcmMacAddress& aMacAddress, TUint aDataBufferSize,
|
|
81 |
RNcmInternalSrv& aNcmInternalSvr)
|
|
82 |
{
|
|
83 |
OstTraceFunctionEntry0(CNCMCONNECTIONMANAGER_NEWL_ENTRY);
|
|
84 |
|
|
85 |
CNcmConnectionManager* self = new (ELeave) CNcmConnectionManager(aObserver,
|
|
86 |
aMacAddress, aDataBufferSize, aNcmInternalSvr);
|
|
87 |
CleanupStack::PushL(self);
|
|
88 |
self->ConstructL();
|
|
89 |
CleanupStack::Pop(self);
|
|
90 |
|
|
91 |
OstTraceFunctionExit0(CNCMCONNECTIONMANAGER_NEWL_EXIT);
|
|
92 |
return self;
|
|
93 |
}
|
|
94 |
|
|
95 |
/**
|
|
96 |
* Method to perform second phase construction.
|
|
97 |
*/
|
|
98 |
void CNcmConnectionManager::ConstructL()
|
|
99 |
{
|
|
100 |
OstTraceFunctionEntry0(CNCMCONNECTIONMANAGER_CONSTRUCTL_ENTRY);
|
|
101 |
|
|
102 |
TInt err = RProperty::Define(KUsbmanSvrUid, KKeyNcmSharedState, RProperty::EInt,
|
|
103 |
KAllowAllPolicy, KCommDDPolicy);
|
|
104 |
|
|
105 |
if (KErrNone != err)
|
|
106 |
{
|
|
107 |
OstTrace1( TRACE_ERROR, CNCMCONNECTIONMANAGER_CONSTRUCTL, "Define NCM shared state P&S key fail: err=%d", err );
|
|
108 |
User::Leave(err);
|
|
109 |
}
|
|
110 |
|
|
111 |
User::LeaveIfError(iProperty.Attach(KUsbmanSvrUid, KKeyNcmSharedState));
|
|
112 |
User::LeaveIfError(iProperty.Set(ENcmStateIntial));
|
|
113 |
|
|
114 |
User::LeaveIfError(iSocketServ.Connect());
|
|
115 |
User::LeaveIfError(iConnection.Open(iSocketServ));
|
|
116 |
|
|
117 |
iIapPrgrsWatcher = new (ELeave) CNcmIapProgressWatcher(*this, iConnection);
|
|
118 |
iConnManHelper = new (ELeave) CNcmConnectionManHelper(*this, iConnection);
|
|
119 |
iDhcpNotifWatcher = new (ELeave) CNcmDhcpNotifWatcher(*this, iNcmInternalSvr);
|
|
120 |
iIapReader = new (ELeave) CNcmIapReader(*this, iConnPref);
|
|
121 |
|
|
122 |
OstTraceFunctionExit0(CNCMCONNECTIONMANAGER_CONSTRUCTL_EXIT);
|
|
123 |
}
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Called when NCM connection starting attempt completed
|
|
127 |
*/
|
|
128 |
void CNcmConnectionManager::HandleConnectionCompleteL()
|
|
129 |
{
|
|
130 |
OstTraceFunctionEntry0( CNCMCONNECTIONMANAGER_HANDLECONNECTIONCOMPLETEL_ENTRY );
|
|
131 |
OstTrace0(TRACE_NORMAL, CNCMCONNECTIONMANAGER_HANDLECONNECTIONCOMPLETEL_CHANGE_MTU, "About to change default MTU size!");
|
|
132 |
// Change default MTU size
|
|
133 |
SetCustomMtuL();
|
|
134 |
|
|
135 |
OstTrace0(TRACE_NORMAL, CNCMCONNECTIONMANAGER_HANDLECONNECTIONCOMPLETEL_CONN_NCM_INTERNAL_SVR, "About to connect to internal NCM server!");
|
|
136 |
|
|
137 |
// Connect to internal server in packet driver
|
|
138 |
User::LeaveIfError(iNcmInternalSvr.Connect());
|
|
139 |
|
|
140 |
iNcmInternalSvr.TransferBufferSize(iDataBufferSize);
|
|
141 |
iNcmInternalSvr.SetIapId(iConnPref.IapId());
|
|
142 |
iDhcpNotifWatcher->StartL();
|
|
143 |
OstTraceFunctionExit0( CNCMCONNECTIONMANAGER_HANDLECONNECTIONCOMPLETEL_EXIT );
|
|
144 |
}
|
|
145 |
|
|
146 |
/**
|
|
147 |
* Destructor.
|
|
148 |
*/
|
|
149 |
CNcmConnectionManager::~CNcmConnectionManager()
|
|
150 |
{
|
|
151 |
OstTraceFunctionEntry0(CNCMCONNECTIONMANAGER_CNCMCONNECTIONMANAGER_DESTRUCTOR_ENTRY);
|
|
152 |
|
|
153 |
delete iIapReader;
|
|
154 |
delete iDhcpNotifWatcher;
|
|
155 |
delete iConnManHelper;
|
|
156 |
delete iIapPrgrsWatcher;
|
|
157 |
|
|
158 |
iConnection.Close();
|
|
159 |
iSocketServ.Close();
|
|
160 |
iProperty.Close();
|
|
161 |
|
|
162 |
RProperty::Delete(KKeyNcmSharedState);
|
|
163 |
|
|
164 |
OstTraceFunctionExit0(CNCMCONNECTIONMANAGER_CNCMCONNECTIONMANAGER_DESTRUCTOR_EXIT);
|
|
165 |
}
|
|
166 |
|
|
167 |
/**
|
|
168 |
* Constructor.
|
|
169 |
* @param[in] aObserver, NCM connection observer
|
|
170 |
* @param[in] aHostMacAddress, the NCM interface MAC address
|
|
171 |
* @param[in] aDataBufferSize, the EndPoint buffer size
|
|
172 |
* @param[in] aNcmInternalSvr, the NCM internal server
|
|
173 |
*/
|
|
174 |
CNcmConnectionManager::CNcmConnectionManager(MNcmConnectionManagerObserver& aObserver,
|
|
175 |
const TNcmMacAddress& aHostMacAddress, TUint aDataBufferSize,
|
|
176 |
RNcmInternalSrv& aNcmInternalSvr):
|
|
177 |
iConnMgrObserver(aObserver),
|
|
178 |
iHostMacAddress(aHostMacAddress), iDataBufferSize(aDataBufferSize),
|
|
179 |
iNcmInternalSvr(aNcmInternalSvr)
|
|
180 |
{
|
|
181 |
// No implementation needed.
|
|
182 |
}
|
|
183 |
|
|
184 |
/**
|
|
185 |
*Called by class controller to start the connection building process.
|
|
186 |
*@param aStatus, reference to ncm class controller's iStatus
|
|
187 |
*/
|
|
188 |
void CNcmConnectionManager::Start(TRequestStatus& aStatus)
|
|
189 |
{
|
|
190 |
OstTraceFunctionEntry0(CNCMCONNECTIONMANAGER_START_ENTRY);
|
|
191 |
|
|
192 |
__ASSERT_DEBUG(!iReportStatus,
|
|
193 |
User::Panic(KNcmConnManagerPanic, ENcmCMPanicOutstandingRequestFromDevice));
|
|
194 |
|
|
195 |
aStatus = KRequestPending;
|
|
196 |
iReportStatus = &aStatus;
|
|
197 |
|
|
198 |
Reset();
|
|
199 |
|
|
200 |
// Preparing IAP information
|
|
201 |
iIapReader->Start();
|
|
202 |
OstTraceFunctionExit0(CNCMCONNECTIONMANAGER_START_EXIT);
|
|
203 |
}
|
|
204 |
|
|
205 |
/**
|
|
206 |
* Cancel ongoing starting attempt
|
|
207 |
*/
|
|
208 |
void CNcmConnectionManager::StartCancel()
|
|
209 |
{
|
|
210 |
OstTraceFunctionEntry0(CNCMCONNECTIONMANAGER_STARTCANCEL_ENTRY);
|
|
211 |
|
|
212 |
__ASSERT_DEBUG(iReportStatus,
|
|
213 |
User::Panic(KNcmConnManagerPanic, ENcmCMPanicNoRegisteredWatcher));
|
|
214 |
|
|
215 |
Stop();
|
|
216 |
|
|
217 |
User::RequestComplete(iReportStatus, KErrCancel);
|
|
218 |
|
|
219 |
OstTraceFunctionExit0(CNCMCONNECTIONMANAGER_STARTCANCEL_EXIT);
|
|
220 |
}
|
|
221 |
|
|
222 |
/**
|
|
223 |
* Called by class controller to stop the connection.
|
|
224 |
*/
|
|
225 |
void CNcmConnectionManager::Stop()
|
|
226 |
{
|
|
227 |
OstTraceFunctionEntry0(CNCMCONNECTIONMANAGER_STOP_ENTRY);
|
|
228 |
|
|
229 |
// Cancel any current ongoing operations
|
|
230 |
Reset();
|
|
231 |
|
|
232 |
// Reset shared state
|
|
233 |
iProperty.Set(ENcmStateIntial);
|
|
234 |
|
|
235 |
iConnManHelper->Stop();
|
|
236 |
OstTraceFunctionExit0(CNCMCONNECTIONMANAGER_STOP_EXIT);
|
|
237 |
}
|
|
238 |
|
|
239 |
/**
|
|
240 |
* Reset conneciton manager itself
|
|
241 |
*/
|
|
242 |
void CNcmConnectionManager::Reset()
|
|
243 |
{
|
|
244 |
OstTraceFunctionEntry0(CNCMCONNECTIONMANAGER_RESET_ENTRY);
|
|
245 |
|
|
246 |
iConnComplete = EFalse;
|
|
247 |
|
|
248 |
iIapReader->Cancel();
|
|
249 |
iDhcpNotifWatcher->Cancel();
|
|
250 |
iIapPrgrsWatcher->Cancel();
|
|
251 |
iConnManHelper->Cancel();
|
|
252 |
|
|
253 |
OstTraceFunctionExit0(CNCMCONNECTIONMANAGER_RESET_EXIT);
|
|
254 |
}
|
|
255 |
/**
|
|
256 |
* Change the default MTU size on NCM networking connection
|
|
257 |
*/
|
|
258 |
void CNcmConnectionManager::SetCustomMtuL()
|
|
259 |
{
|
|
260 |
OstTraceFunctionEntry0(CNCMCONNECTIONMANAGER_SETCUSTOMMTUL_ENTRY);
|
|
261 |
|
|
262 |
RSocket socket;
|
|
263 |
User::LeaveIfError(socket.Open(iSocketServ, KAfInet, KSockStream, KProtocolInetTcp,
|
|
264 |
iConnection));
|
|
265 |
|
|
266 |
TPckgBuf<TSoInet6InterfaceInfo> interfaceInfo;
|
|
267 |
TPckgBuf<TConnInterfaceName> interfaceName;
|
|
268 |
|
|
269 |
TUint cnt = 0;
|
|
270 |
iConnection.EnumerateConnections(cnt); // Count all underlying interfaces
|
|
271 |
|
|
272 |
TUint iap = iConnPref.IapId();
|
|
273 |
TInt index = 1;
|
|
274 |
for (index = 1; index <= cnt; index++)
|
|
275 |
{
|
|
276 |
TConnectionInfoBuf info;
|
|
277 |
iConnection.GetConnectionInfo(index, info);
|
|
278 |
if (info().iIapId == iap)
|
|
279 |
{
|
|
280 |
break;
|
|
281 |
}
|
|
282 |
}
|
|
283 |
|
|
284 |
if (index > cnt)
|
|
285 |
{
|
|
286 |
OstTrace0( TRACE_NORMAL, CNCMCONNECTIONMANAGER_SETCUSTOMMTUL, "Can not find an interface based on NCM!" );
|
|
287 |
User::Leave(KErrNotFound);
|
|
288 |
}
|
|
289 |
|
|
290 |
interfaceName().iIndex = index;
|
|
291 |
OstTraceExt2( TRACE_NORMAL, CNCMCONNECTIONMANAGER_SETCUSTOMMTUL_INTER_INFO, ";cnt=%d;interfaceName().iIndex=%u", cnt, interfaceName().iIndex );
|
|
292 |
User::LeaveIfError(iConnection.Control(KCOLProvider, KConnGetInterfaceName, interfaceName));
|
|
293 |
OstTraceExt3( TRACE_NORMAL, CNCMCONNECTIONMANAGER_SETCUSTOMMTUL_NEW_MTU_SIZE, ";Interface Name=%S, ;current MTU=%d. MTU size will be changed to %d!", interfaceName().iName, interfaceInfo().iMtu, KEthernetFrameSize);
|
|
294 |
|
|
295 |
TInt err = socket.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl);
|
|
296 |
if (err != KErrNone)
|
|
297 |
{
|
|
298 |
OstTrace1(TRACE_NORMAL, CNCMCONNECTIONMANAGER_SETCUSTOMMTUL_START_INTER_ENUM, "Failed to set KSoInetEnumInterfaces option [%d]", err);
|
|
299 |
User::LeaveIfError(err);
|
|
300 |
}
|
|
301 |
|
|
302 |
err = KErrNotFound;
|
|
303 |
while (socket.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, interfaceInfo) == KErrNone)
|
|
304 |
{
|
|
305 |
OstTraceExt1(TRACE_NORMAL, CNCMCONNECTIONMANAGER_SETCUSTOMMTUL_INTER_NAME, "InterfaceInfo().iName = %S", interfaceInfo().iName);
|
|
306 |
OstTrace1(TRACE_NORMAL, CNCMCONNECTIONMANAGER_SETCUSTOMMTUL_INTER_MTU, "InterfaceInfo().iMtu = %d", interfaceInfo().iMtu);
|
|
307 |
if (interfaceInfo().iName == interfaceName().iName)
|
|
308 |
{
|
|
309 |
// found the interface
|
|
310 |
err = KErrNone;
|
|
311 |
break;
|
|
312 |
}
|
|
313 |
}
|
|
314 |
if (KErrNone != err)
|
|
315 |
{
|
|
316 |
OstTrace1(TRACE_ERROR, CNCMCONNECTIONMANAGER_SETCUSTOMMTUL_SEARCH_FAIL, "Can not find NCM connection: err=%x", err);
|
|
317 |
User::LeaveIfError(err);
|
|
318 |
}
|
|
319 |
|
|
320 |
// Set new MTU size
|
|
321 |
TPckgBuf<TSoInet6InterfaceInfo> newinterfaceInfo;
|
|
322 |
newinterfaceInfo().iMtu = KEthernetFrameSize;
|
|
323 |
newinterfaceInfo().iDoPrefix = 0;
|
|
324 |
newinterfaceInfo().iDoId = 0;
|
|
325 |
newinterfaceInfo().iDoState = 0;
|
|
326 |
newinterfaceInfo().iDoAnycast = 0;
|
|
327 |
newinterfaceInfo().iDoProxy = 0;
|
|
328 |
newinterfaceInfo().iAlias = interfaceInfo().iAlias;
|
|
329 |
newinterfaceInfo().iDelete = interfaceInfo().iDelete;
|
|
330 |
newinterfaceInfo().iState = interfaceInfo().iState;
|
|
331 |
newinterfaceInfo().iSpeedMetric = interfaceInfo().iSpeedMetric;
|
|
332 |
newinterfaceInfo().iFeatures = interfaceInfo().iFeatures;
|
|
333 |
newinterfaceInfo().iTag = interfaceInfo().iTag;
|
|
334 |
newinterfaceInfo().iName = interfaceInfo().iName;
|
|
335 |
newinterfaceInfo().iSpeedMetric = interfaceInfo().iSpeedMetric;
|
|
336 |
newinterfaceInfo().iFeatures = interfaceInfo().iFeatures;
|
|
337 |
newinterfaceInfo().iHwAddr = interfaceInfo().iHwAddr;
|
|
338 |
newinterfaceInfo().iAddress = interfaceInfo().iAddress;
|
|
339 |
newinterfaceInfo().iNetMask = interfaceInfo().iNetMask;
|
|
340 |
newinterfaceInfo().iDefGate = interfaceInfo().iDefGate;
|
|
341 |
newinterfaceInfo().iNameSer2 = interfaceInfo().iNameSer2;
|
|
342 |
newinterfaceInfo().iNameSer1 = interfaceInfo().iNameSer1;
|
|
343 |
|
|
344 |
OstTrace0( TRACE_NORMAL, CNCMCONNECTIONMANAGER_SETCUSTOMMTUL_PRE_SETMTU, "About to change the default MTU size." );
|
|
345 |
User::LeaveIfError(socket.SetOpt(KSoInetConfigInterface, KSolInetIfCtrl, newinterfaceInfo));
|
|
346 |
|
|
347 |
socket.Close();
|
|
348 |
|
|
349 |
OstTraceFunctionExit0(CNCMCONNECTIONMANAGER_SETCUSTOMMTUL_EXIT);
|
|
350 |
}
|
|
351 |
|
|
352 |
/**
|
|
353 |
* Called by connection watcher when it detects the class fatal error.
|
|
354 |
*/
|
|
355 |
void CNcmConnectionManager::MipsoHandleClassFatalError(TInt aError)
|
|
356 |
{
|
|
357 |
OstTraceFunctionEntryExt( CNCMCONNECTIONMANAGER_MIPSOHANDLECLASSFATALERROR_ENTRY, this );
|
|
358 |
|
|
359 |
Reset();
|
|
360 |
|
|
361 |
__ASSERT_DEBUG(!iReportStatus, User::Panic(KNcmConnManagerPanic, ENcmCMPanicOutstandingRequestFromDevice));
|
|
362 |
|
|
363 |
OstTrace1(TRACE_ERROR, CNCMCONNECTIONMANAGER_MIPSOHANDLECLASSFATALERROR, "NCM connection fatal error occurs: %d", aError);
|
|
364 |
|
|
365 |
iConnMgrObserver.McmoErrorIndication(aError);
|
|
366 |
|
|
367 |
OstTraceFunctionExit1( CNCMCONNECTIONMANAGER_MIPSOHANDLECLASSFATALERROR_EXIT, this );
|
|
368 |
}
|
|
369 |
|
|
370 |
/**
|
|
371 |
* Called by connection help when it get notification the
|
|
372 |
* connection over NCM has been established.
|
|
373 |
*/
|
|
374 |
void CNcmConnectionManager::MicoHandleConnectionComplete(TInt aError)
|
|
375 |
{
|
|
376 |
OstTraceFunctionEntryExt( CNCMCONNECTIONMANAGER_MICOHANDLECONNECTIONCOMPLETE_ENTRY, this );
|
|
377 |
|
|
378 |
// Reset shared state
|
|
379 |
iProperty.Set(ENcmStateIntial);
|
|
380 |
|
|
381 |
if (KErrNone == aError)
|
|
382 |
{
|
|
383 |
TRAPD(err, HandleConnectionCompleteL());
|
|
384 |
User::RequestComplete(iReportStatus, err);
|
|
385 |
}
|
|
386 |
else
|
|
387 |
{
|
|
388 |
// Leave if connection build failed
|
|
389 |
User::RequestComplete(iReportStatus, aError);
|
|
390 |
}
|
|
391 |
|
|
392 |
OstTraceFunctionExit1( CNCMCONNECTIONMANAGER_MICOHANDLECONNECTIONCOMPLETE_EXIT, this );
|
|
393 |
}
|
|
394 |
|
|
395 |
/**
|
|
396 |
* Called by DHCP notification watcher.
|
|
397 |
* When the NCM internal server send DHCP request notification to
|
|
398 |
* the watcher, watcher call this function to do DHCP provisioning
|
|
399 |
* for NCM connection.
|
|
400 |
*/
|
|
401 |
void CNcmConnectionManager::MdnoHandleDhcpNotification(TInt aError)
|
|
402 |
{
|
|
403 |
OstTraceFunctionEntryExt( CNCMCONNECTIONMANAGER_MDNOHANDLEDHCPNOTIFICATION_ENTRY, this );
|
|
404 |
if (KErrNone != aError)
|
|
405 |
{
|
|
406 |
// Report this failure to the observer
|
|
407 |
// Finally this will report to usbman and NCM class will be stopped.
|
|
408 |
iConnMgrObserver.McmoErrorIndication(aError);
|
|
409 |
OstTraceFunctionExit1( CNCMCONNECTIONMANAGER_MDNOHANDLEDHCPNOTIFICATION_EXIT, this );
|
|
410 |
return;
|
|
411 |
}
|
|
412 |
|
|
413 |
// Doing DHCP for NCM
|
|
414 |
aError = KErrNone;
|
|
415 |
|
|
416 |
// Configuring DHCP server to assign the IP address to PC(host)
|
|
417 |
// Using static IP temporarily and will swithch to use DHCP server to do provision.
|
|
418 |
// TRequestStatus stat;
|
|
419 |
// OstTrace0(TRACE_NORMAL, CNCMCONNECTIONMANAGER_MDNOHANDLEDHCPNOTIFICATION_CALL_IOCTL, "About to call to Ioctl()");
|
|
420 |
//
|
|
421 |
// TNcmMacAddress macAddr = iHostMacAddress;
|
|
422 |
// iConnection.Ioctl(KCOLConfiguration, KConnDhcpSetHwAddressParams, stat,
|
|
423 |
// &macAddr);
|
|
424 |
// User::WaitForRequest(stat);
|
|
425 |
// aError = stat.Int();
|
|
426 |
// OstTrace1( TRACE_NORMAL, CNCMCONNECTIONMANAGER_MDNOHANDLEDHCPNOTIFICATION_RETURN_IOCTL, "Return from Ioctl:;aError=%d", aError );
|
|
427 |
|
|
428 |
if (KErrNone == aError)
|
|
429 |
{
|
|
430 |
// Disable timer on interface and wont let interface coming down due to timer expiry.
|
|
431 |
iConnection.SetOpt(KCOLProvider, KConnDisableTimers, ETrue);
|
|
432 |
iIapPrgrsWatcher->Start();
|
|
433 |
}
|
|
434 |
else
|
|
435 |
{
|
|
436 |
// Silent stop the NCM connection.
|
|
437 |
iConnManHelper->Stop();
|
|
438 |
|
|
439 |
// Report this failure to the observer
|
|
440 |
// Finally this will report to usbman and NCM class will be stopped.
|
|
441 |
iConnMgrObserver.McmoErrorIndication(aError);
|
|
442 |
}
|
|
443 |
|
|
444 |
// Set DHCP result to NCM internal server
|
|
445 |
iNcmInternalSvr.SetDhcpResult(aError);
|
|
446 |
OstTraceFunctionExit1( CNCMCONNECTIONMANAGER_MDNOHANDLEDHCPNOTIFICATION_EXIT_DUP1, this );
|
|
447 |
}
|
|
448 |
|
|
449 |
/**
|
|
450 |
* Called by IAP reader.
|
|
451 |
* When IAP reader finished reading NCM IAP preference from CentRep,
|
|
452 |
* it will call this function to start building ethernet connection
|
|
453 |
* using NCM IAP configuration.
|
|
454 |
*/
|
|
455 |
void CNcmConnectionManager::MicoHandleIAPReadingComplete(TInt aError)
|
|
456 |
{
|
|
457 |
OstTraceFunctionEntryExt( CNCMCONNECTIONMANAGER_MICOHANDLEIAPREADINGCOMPLETE_ENTRY, this );
|
|
458 |
if (KErrNone != aError)
|
|
459 |
{
|
|
460 |
OstTrace1( TRACE_ERROR, CNCMCONNECTIONMANAGER_MICOHANDLEIAPREADINGCOMPLETE_IAP_RESULT, "IAP reading failed with error;aError=%d", aError );
|
|
461 |
User::RequestComplete(iReportStatus, aError);
|
|
462 |
|
|
463 |
OstTraceFunctionExit1( CNCMCONNECTIONMANAGER_MICOHANDLEIAPREADINGCOMPLETE_EXIT, this );
|
|
464 |
return;
|
|
465 |
}
|
|
466 |
|
|
467 |
aError = iProperty.Set(ENcmStartRequested);
|
|
468 |
|
|
469 |
if (KErrNone != aError)
|
|
470 |
{
|
|
471 |
OstTrace1( TRACE_ERROR, CNCMCONNECTIONMANAGER_MICOHANDLEIAPREADINGCOMPLETE_SET_SHARED_STATE, "Property set failed with error:;aError=%d", aError );
|
|
472 |
User::RequestComplete(iReportStatus, aError);
|
|
473 |
|
|
474 |
OstTraceFunctionExit1( CNCMCONNECTIONMANAGER_MICOHANDLEIAPREADINGCOMPLETE_EXIT_DUP1, this );
|
|
475 |
return;
|
|
476 |
}
|
|
477 |
|
|
478 |
iConnManHelper->Start(iConnPref);
|
|
479 |
OstTraceFunctionExit1( CNCMCONNECTIONMANAGER_MICOHANDLEIAPREADINGCOMPLETE_EXIT_DUP2, this );
|
|
480 |
}
|