|
1 /* |
|
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of the WlanDeepPsModePowerModeMgr class |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 3 % |
|
20 */ |
|
21 |
|
22 #include "config.h" |
|
23 #include "umacdeeppsmodepowermodemgr.h" |
|
24 #include "UmacContextImpl.h" |
|
25 |
|
26 |
|
27 // ================= MEMBER FUNCTIONS ======================= |
|
28 |
|
29 // --------------------------------------------------------------------------- |
|
30 // |
|
31 // --------------------------------------------------------------------------- |
|
32 // |
|
33 WlanDeepPsModePowerModeMgr::WlanDeepPsModePowerModeMgr() |
|
34 { |
|
35 } |
|
36 |
|
37 // --------------------------------------------------------------------------- |
|
38 // |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 WlanDeepPsModePowerModeMgr::~WlanDeepPsModePowerModeMgr() |
|
42 { |
|
43 } |
|
44 |
|
45 // --------------------------------------------------------------------------- |
|
46 // |
|
47 // --------------------------------------------------------------------------- |
|
48 // |
|
49 TPowerMgmtModeChange WlanDeepPsModePowerModeMgr::OnFrameTx( |
|
50 WlanContextImpl& /*aCtxImpl*/, |
|
51 WHA::TQueueId /*aQueueId*/, |
|
52 TUint16 aEtherType, |
|
53 TBool /*aIgnoreThisFrame*/ ) |
|
54 { |
|
55 TPowerMgmtModeChange powerMgmtModeChange( ENoChange ); |
|
56 |
|
57 if ( aEtherType == KEapolType || |
|
58 aEtherType == KWaiType ) |
|
59 { |
|
60 powerMgmtModeChange = EToActive; |
|
61 |
|
62 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
63 ("UMAC: WlanDeepPsModePowerModeMgr::OnFrameTx: EAPOL or WAI frame; change to Active") ); |
|
64 } |
|
65 else |
|
66 { |
|
67 powerMgmtModeChange = EToLightPs; |
|
68 |
|
69 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
70 ("UMAC: WlanDeepPsModePowerModeMgr::OnFrameTx: change to Light PS") ); |
|
71 } |
|
72 |
|
73 return powerMgmtModeChange; |
|
74 } |
|
75 |
|
76 // --------------------------------------------------------------------------- |
|
77 // |
|
78 // --------------------------------------------------------------------------- |
|
79 // |
|
80 TPowerMgmtModeChange WlanDeepPsModePowerModeMgr::OnFrameRx( |
|
81 WlanContextImpl& /*aCtxImpl*/, |
|
82 WHA::TQueueId /*aAccessCategory*/, |
|
83 TUint16 aEtherType, |
|
84 TBool /*aIgnoreThisFrame*/, |
|
85 TUint /*aPayloadLength*/, |
|
86 TDaType aDaType ) |
|
87 { |
|
88 TPowerMgmtModeChange powerMgmtModeChange( ENoChange ); |
|
89 |
|
90 if ( aEtherType == KEapolType || |
|
91 aEtherType == KWaiType ) |
|
92 { |
|
93 powerMgmtModeChange = EToActive; |
|
94 |
|
95 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
96 ("UMAC: WlanDeepPsModePowerModeMgr::OnFrameRx: EAPOL or WAI frame; change to Active") ); |
|
97 } |
|
98 else if ( aDaType == EBroadcastAddress ) |
|
99 { |
|
100 // no action needed |
|
101 |
|
102 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
103 ("UMAC: WlanDeepPsModePowerModeMgr::OnFrameRx: bcast frame; no state change") ); |
|
104 } |
|
105 else |
|
106 { |
|
107 powerMgmtModeChange = EToLightPs; |
|
108 |
|
109 OsTracePrint( KPwrStateTransition, (TUint8*) |
|
110 ("UMAC: WlanDeepPsModePowerModeMgr::OnFrameRx: change to Light PS") ); |
|
111 } |
|
112 |
|
113 return powerMgmtModeChange; |
|
114 } |