|
1 /* |
|
2 * Copyright (c) 2002-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: Declaration of the WlanManagementSideUmacCb class. |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 17 % |
|
20 */ |
|
21 |
|
22 #ifndef WLANMANAGEMENTSIDEUMACB_H |
|
23 #define WLANMANAGEMENTSIDEUMACB_H |
|
24 |
|
25 class TDataBuffer; |
|
26 struct TMacAddress; |
|
27 |
|
28 /** |
|
29 * Callback interface class for oid completion and stuff |
|
30 */ |
|
31 class WlanManagementSideUmacCb |
|
32 { |
|
33 public: // Types |
|
34 |
|
35 struct SOidOutputData |
|
36 { |
|
37 public: |
|
38 |
|
39 TUint32 iOidId; |
|
40 TAny* iBufferSupplied; |
|
41 TUint32 iLengthOfBufferSupplied; |
|
42 |
|
43 const TAny* iOidData; |
|
44 TUint32 iLengthOfDataInBytes; |
|
45 |
|
46 SOidOutputData() |
|
47 : iOidId( 0 ), |
|
48 iBufferSupplied( NULL ), |
|
49 iLengthOfBufferSupplied( 0 ), |
|
50 iOidData( NULL ), |
|
51 iLengthOfDataInBytes( 0 ) {}; |
|
52 |
|
53 private: |
|
54 |
|
55 /** Prohibit assignment operator */ |
|
56 SOidOutputData& operator= ( const SOidOutputData& aObj ); |
|
57 /** Prohibit copy constructor */ |
|
58 SOidOutputData( const SOidOutputData& ); |
|
59 }; |
|
60 |
|
61 public: |
|
62 |
|
63 // dtor |
|
64 virtual ~WlanManagementSideUmacCb(); |
|
65 |
|
66 void Attach( WlanManagementSideUmacCb& aSelf ); |
|
67 void Detach(); |
|
68 |
|
69 /** |
|
70 * Called from statemachine when oid has been completed. |
|
71 * Triggers handling of a new oid |
|
72 * @param aOid OID handled |
|
73 * @param aReason completion code |
|
74 */ |
|
75 virtual void OnOidCompleted( TInt aReason, SOidOutputData& OidOutputData ); |
|
76 |
|
77 /** |
|
78 * Sets the Tx offset for every frame type which can be transmitted |
|
79 * |
|
80 * @since S60 5.0 |
|
81 * @param aEthernetFrameTxOffset Tx offset for Ethernet frames and Ethernet |
|
82 * Test frames |
|
83 * @param aDot11FrameTxOffset Tx offset for 802.11 frames |
|
84 * @param aSnapFrameTxOffset Tx offset for SNAP frames |
|
85 */ |
|
86 virtual void SetMgmtSideTxOffsets( |
|
87 TUint32 aEthernetFrameTxOffset, |
|
88 TUint32 aDot11FrameTxOffset, |
|
89 TUint32 aSnapFrameTxOffset ); |
|
90 |
|
91 /** |
|
92 * Gets buffer for Rx data |
|
93 * @param aLengthinBytes Requested buffer length |
|
94 * @return buffer for Rx data upon success |
|
95 * NULL otherwise |
|
96 */ |
|
97 virtual TUint8* GetBufferForRxData( TUint aLengthinBytes ); |
|
98 |
|
99 /** |
|
100 * Get DMA xfer suitable Tx buffer for UMAC's internal use |
|
101 * |
|
102 * @since S60 3.1 |
|
103 * @returns begin of the memory that can be used for DMA xfer |
|
104 */ |
|
105 virtual TUint8* DmaPrivateTxMemory(); |
|
106 |
|
107 /** |
|
108 * Completes a data read operation from management side |
|
109 * |
|
110 * @param aBufferStart first element of the array that holds pointers to |
|
111 * Rx frame meta headers |
|
112 * @param aNumOfBuffers number of meta header pointers in the array |
|
113 */ |
|
114 virtual void MgmtDataReceiveComplete( |
|
115 const TDataBuffer*& aBufferStart, |
|
116 TUint32 aNumOfBuffers ); |
|
117 |
|
118 /** |
|
119 * Completes a data write operation from management side |
|
120 * @param aErr completion code |
|
121 */ |
|
122 virtual void MgmtPathWriteComplete( TInt aErr ); |
|
123 |
|
124 /** |
|
125 * Sends a indication to the management side |
|
126 * @param aIndication indication code |
|
127 */ |
|
128 virtual void OnInDicationEvent( TIndication aIndication ); |
|
129 |
|
130 /** |
|
131 * Frees the specified Rx frame buffer |
|
132 * |
|
133 * @param aBufferToFree The buffer to free |
|
134 */ |
|
135 virtual void MarkRxBufFree( TUint8* aBufferToFree ); |
|
136 |
|
137 virtual void RegisterTimeout( |
|
138 TUint32 aTimeoutInMicroSeconds, |
|
139 TWlanTimer aTimer = EWlanDefaultTimer ); |
|
140 virtual void CancelTimeout( TWlanTimer aTimer = EWlanDefaultTimer ); |
|
141 |
|
142 virtual void RegisterDfc( TAny* aCntx ); |
|
143 virtual void CancelDfc(); |
|
144 |
|
145 /** |
|
146 * Allocates Rx frame meta header |
|
147 * @return Rx frame meta header upon success |
|
148 * NULL otherwise |
|
149 */ |
|
150 virtual TDataBuffer* GetRxFrameMetaHeader(); |
|
151 |
|
152 /** |
|
153 * Deallocates Rx frame meta header |
|
154 * @param aMetaHeader Meta header to deallocate |
|
155 */ |
|
156 virtual void FreeRxFrameMetaHeader( TDataBuffer* aMetaHeader ); |
|
157 |
|
158 protected: |
|
159 |
|
160 WlanManagementSideUmacCb() : iSelf( NULL ) {}; |
|
161 |
|
162 private: |
|
163 |
|
164 // Prohibit copy constructor |
|
165 WlanManagementSideUmacCb( const WlanManagementSideUmacCb& ); |
|
166 // Prohibit assigment operator |
|
167 WlanManagementSideUmacCb& operator= ( const WlanManagementSideUmacCb& ); |
|
168 |
|
169 private: // Data |
|
170 |
|
171 /** pointer to self */ |
|
172 WlanManagementSideUmacCb* iSelf; |
|
173 }; |
|
174 |
|
175 #endif // WLANMANAGEMENTSIDEUMACB_H |