26 #include "FrameXferBlock.h" |
26 #include "FrameXferBlock.h" |
27 |
27 |
28 #ifndef __KERNEL_MODE__ |
28 #ifndef __KERNEL_MODE__ |
29 #include <e32std.h> // for RChunk |
29 #include <e32std.h> // for RChunk |
30 #endif |
30 #endif |
31 |
|
32 // Enumeration values for control messages |
|
33 enum TWlanControl |
|
34 { |
|
35 EWlanSvControlInitBuffers, // Allocate frame transfer memory for WLAN Mgmt |
|
36 // client |
|
37 EWlanSvControlFreeBuffers // Deallocate memory allocated by |
|
38 // EWlanSvControlInitBuffers |
|
39 }; |
|
40 |
31 |
41 // Open parameters |
32 // Open parameters |
42 struct TOpenParam |
33 struct TOpenParam |
43 { |
34 { |
44 TAny* iPda; // start of PDA data |
35 TAny* iPda; // start of PDA data |
53 TAny* iFirmWare; // firmware data |
44 TAny* iFirmWare; // firmware data |
54 // (pointee must be 32-bit aligned) |
45 // (pointee must be 32-bit aligned) |
55 TUint32 iFirmWareLength; // length of firmware in bytes |
46 TUint32 iFirmWareLength; // length of firmware in bytes |
56 }; |
47 }; |
57 |
48 |
58 // Enumeration values for asynchronous requests. Do not exceed KMaxRequests! |
|
59 enum TWlanRequest |
|
60 { |
|
61 EWlanRequestNotify, // request a notification |
|
62 EWlanRequestFrame, // frame Rx request |
|
63 EWlanRequestSend, // frame Tx request |
|
64 EWlanCommand, // WLAN management command |
|
65 EWlanInitSystem, // internal init |
|
66 EWlanFinitSystem, // internal finit |
|
67 EWlanMaxRequest |
|
68 }; |
|
69 |
|
70 class RWlanLogicalChannel : public RBusLogicalChannel |
49 class RWlanLogicalChannel : public RBusLogicalChannel |
71 { |
50 { |
72 |
|
73 public: |
51 public: |
74 |
52 |
|
53 // Enumeration values for control messages |
|
54 enum TWlanControl |
|
55 { |
|
56 EWlanSvControlInitBuffers, // Allocate frame transfer memory for WLAN Mgmt |
|
57 // client |
|
58 EWlanSvControlFreeBuffers // Deallocate memory allocated by |
|
59 // EWlanSvControlInitBuffers |
|
60 }; |
|
61 |
|
62 // Enumeration values for asynchronous requests. Do not exceed KMaxRequests! |
|
63 enum TWlanRequest |
|
64 { |
|
65 EWlanRequestNotify, // request a notification |
|
66 EWlanRequestFrame, // frame Rx request |
|
67 EWlanRequestSend, // frame Tx request |
|
68 EWlanCommand, // WLAN management command |
|
69 EWlanInitSystem, // internal init |
|
70 EWlanFinitSystem, // internal finit |
|
71 EWlanMaxRequest |
|
72 }; |
|
73 |
|
74 /** |
|
75 * Calls executed in the context of the client's thread, but in |
|
76 * supervisor mode |
|
77 */ |
|
78 enum TControlFast |
|
79 { |
|
80 EWlanControlFastGetRxFrame = 0x0E000000 |
|
81 }; |
|
82 |
|
83 public: |
|
84 |
75 /** |
85 /** |
76 * Opens a channel to the WLAN device driver. |
86 * Opens a channel to the WLAN device driver. |
77 * |
87 * |
78 * @since S60 3.1 |
88 * @since S60 3.1 |
79 * @param aUnit This parameter tells which kind of channel is opened, i.e. |
89 * @param aUnit This parameter tells which kind of channel is opened, i.e. |
151 * Note! The channel must be open and the Configure management commmand |
161 * Note! The channel must be open and the Configure management commmand |
152 * must have been issued before calling this method. |
162 * must have been issued before calling this method. |
153 * |
163 * |
154 * @since S60 3.1 |
164 * @since S60 3.1 |
155 * @param aFrameXferBlock FrameXferBlock to be initialised by |
165 * @param aFrameXferBlock FrameXferBlock to be initialised by |
156 * the device driver. |
166 * the device driver. |
157 * @return KErrNone on success, any other on failure |
167 * @return KErrNone on success, any other on failure |
158 */ |
168 */ |
159 inline TInt InitialiseBuffers( RFrameXferBlock*& aFrameXferBlock ); |
169 inline TInt InitialiseBuffers( RFrameXferBlock*& aFrameXferBlock ); |
160 |
170 |
161 /** |
171 /** |
192 * @since S60 3.1 |
202 * @since S60 3.1 |
193 * Buffers can be released after this call returns |
203 * Buffers can be released after this call returns |
194 */ |
204 */ |
195 inline void CancelRxRequests(); |
205 inline void CancelRxRequests(); |
196 |
206 |
|
207 /** |
|
208 * Gets the next frame (contained in a buffer allocated from |
|
209 * the shared memory) from the Rx queue. |
|
210 * Optionally frees the memory associated to a previously received frame. |
|
211 * |
|
212 * @param aFrameToFree Previously received frame which can now be freed. |
|
213 * NULL if nothing to free. |
|
214 * @return Pointer to the Rx frame to be handled next. |
|
215 * NULL, if there are no frames available. If NULL is returned |
|
216 * the client should re-issue the asynchronous frame Rx request |
|
217 * (i.e. RequestFrame()) |
|
218 */ |
|
219 inline TDataBuffer* GetRxFrame( TDataBuffer* aFrameToFree ); |
|
220 |
197 private: |
221 private: |
198 |
222 |
199 inline TInt InitWlanSystem( TOpenParam& aOpenParam ); |
223 inline TInt InitWlanSystem( TOpenParam& aOpenParam ); |
200 |
224 |
201 private: // data |
225 private: // data |
202 |
|
203 /** |
|
204 * has the WLAN system been initialized |
|
205 */ |
|
206 TBool iWlanSystemInitialized; |
|
207 |
226 |
208 /** |
227 /** |
209 * If a WLAN Management Command is executed asynchronously, this data |
228 * If a WLAN Management Command is executed asynchronously, this data |
210 * member is used to store the Management Command message - thus keeping |
229 * member is used to store the Management Command message - thus keeping |
211 * it valid until the asynchronous request is actually scheduled. |
230 * it valid until the asynchronous request is actually scheduled. |