|
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 DWlanLogicalDevice class. |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 14 % |
|
20 */ |
|
21 |
|
22 #ifndef WLANLOGICALDEVICE_H |
|
23 #define WLANLOGICALDEVICE_H |
|
24 |
|
25 #include "RWlanLogicalChannel.h" |
|
26 #include "Umac.h" |
|
27 |
|
28 #ifdef RD_WLAN_DDK |
|
29 #include "osa.h" |
|
30 #endif |
|
31 |
|
32 |
|
33 class WlanChunk; |
|
34 |
|
35 /** |
|
36 * Device factory for logical channel |
|
37 * @since S60 v3.1 |
|
38 */ |
|
39 class DWlanLogicalDevice : public DLogicalDevice |
|
40 #ifdef RD_WLAN_DDK |
|
41 , public WlanObject |
|
42 #endif |
|
43 { |
|
44 |
|
45 public: |
|
46 |
|
47 // Interface integrity version check class |
|
48 class TCaps |
|
49 { |
|
50 public: |
|
51 TVersion iVersion; |
|
52 }; |
|
53 |
|
54 DWlanLogicalDevice(); |
|
55 |
|
56 virtual ~DWlanLogicalDevice(); |
|
57 |
|
58 /** |
|
59 * Second stage constructor for derived objects. |
|
60 * This must at least set a name for the driver object. |
|
61 * |
|
62 * @since S60 3.1 |
|
63 * @return KErrNone or standard error code. |
|
64 */ |
|
65 virtual TInt Install(); |
|
66 |
|
67 /** |
|
68 * Gets the driver's capabilities. |
|
69 * This is called in the response to an RDevice::GetCaps() request. |
|
70 * |
|
71 * @since S60 3.1 |
|
72 * @param aDes A user-side descriptor into which capabilities information is to be wriiten. |
|
73 */ |
|
74 virtual void GetCaps(TDes8& aDes) const; |
|
75 |
|
76 /** |
|
77 * Called by the kernel's device driver framework to create a Logical Channel. |
|
78 * This is called in the context of the user thread (client) which requested the creation of a Logical Channel |
|
79 * (e.g. through a call to RBusLogicalChannel::DoCreate). |
|
80 * The thread is in a critical section. |
|
81 * |
|
82 * @since S60 3.1 |
|
83 * @param aChannel Set to point to the created Logical Channel |
|
84 * @return KErrNone or standard error code. |
|
85 */ |
|
86 virtual TInt Create(DLogicalChannelBase*& aChannel); |
|
87 |
|
88 /** |
|
89 * Returns ETrue if cached frame transfer memory shall be used and |
|
90 * EFalse otherwise |
|
91 * |
|
92 * @return See above |
|
93 */ |
|
94 TBool UseCachedMemory() const; |
|
95 |
|
96 /** |
|
97 * Sets the type of frame transfer memory (cached / non-cached) that shall |
|
98 * be used. |
|
99 * |
|
100 * @param aValue If ETrue, cached frame transfer memory shall be used |
|
101 * If EFalse, cached frame transfer memory shall not be used |
|
102 */ |
|
103 void UseCachedMemory( TBool aValue ); |
|
104 |
|
105 /** |
|
106 * Sets the number of extra bytes required to align Rx buffer start |
|
107 * address, to be returned to WHA layer, to allocation unit boundary |
|
108 */ |
|
109 void SetRxBufAlignmentPadding( TInt aRxBufAlignmentPadding ); |
|
110 |
|
111 /** |
|
112 * Returns the number of extra bytes required to align Rx buffer start |
|
113 * address, to be returned to WHA layer, to allocation unit boundary |
|
114 * @return See above |
|
115 */ |
|
116 TInt RxBufAlignmentPadding() const; |
|
117 |
|
118 private: // Methods |
|
119 |
|
120 // Prohibit copy constructor. |
|
121 DWlanLogicalDevice ( const DWlanLogicalDevice & ); |
|
122 // Prohibit assigment operator. |
|
123 DWlanLogicalDevice & operator= ( const DWlanLogicalDevice & ); |
|
124 |
|
125 private: // Data |
|
126 |
|
127 Umac iUmac; |
|
128 |
|
129 /** Our dynamic DFC queue. Own */ |
|
130 TDynamicDfcQue* iDfcQ; |
|
131 |
|
132 #ifndef RD_WLAN_DDK |
|
133 /** |
|
134 * mutex used to protect LDD from simultaneous execution by several |
|
135 * different threads. Own |
|
136 */ |
|
137 DMutex* iMutex; |
|
138 #else |
|
139 /** |
|
140 * OS abstraction object |
|
141 */ |
|
142 WlanOsa* iOsa; |
|
143 #endif |
|
144 |
|
145 /** |
|
146 * ETrue if cached frame transfer memory shall be used, |
|
147 * EFalse otherwise |
|
148 */ |
|
149 TBool iUseCachedMemory; |
|
150 |
|
151 /** |
|
152 * shared memory chunk for frame transfer between user and kernel address |
|
153 * spaces. Own |
|
154 */ |
|
155 DChunk* iSharedMemoryChunk; |
|
156 |
|
157 /** Rx frame memory pool manager. Own */ |
|
158 WlanChunk* iRxFrameMemoryPool; |
|
159 |
|
160 /** |
|
161 * number of extra bytes required to align Rx buffer start address |
|
162 * to be returned to WHA layer to allocation unit boundary |
|
163 */ |
|
164 TInt iRxBufAlignmentPadding; |
|
165 }; |
|
166 |
|
167 #endif // WLANLOGICALDEVICE_H |