Line No. | Rev | Author | Line |
---|---|---|---|
1 | 32 | kaklik | /****************************************************************************** |
2 | |||
3 | MRF24WB0M Driver API Interface |
||
4 | Module for Microchip TCP/IP Stack |
||
5 | -Provides access to MRF24WB0M WiFi controller |
||
6 | -Reference: MRF24WB0M Data sheet, IEEE 802.11 Standard |
||
7 | |||
8 | ******************************************************************************* |
||
9 | FileName: WFApi.h |
||
10 | Dependencies: TCP/IP Stack header files |
||
11 | Processor: PIC18, PIC24F, PIC24H, dsPIC30F, dsPIC33F, PIC32 |
||
12 | Compiler: Microchip C32 v1.10b or higher |
||
13 | Microchip C30 v3.22 or higher |
||
14 | Microchip C18 v3.34 or higher |
||
15 | Company: Microchip Technology, Inc. |
||
16 | |||
17 | Software License Agreement |
||
18 | |||
19 | Copyright (C) 2002-2010 Microchip Technology Inc. All rights reserved. |
||
20 | |||
21 | Microchip licenses to you the right to use, modify, copy, and distribute: |
||
22 | (i) the Software when embedded on a Microchip microcontroller or digital |
||
23 | signal controller product ("Device") which is integrated into |
||
24 | Licensee's product; or |
||
25 | (ii) ONLY the Software driver source files ENC28J60.c, ENC28J60.h, |
||
26 | ENCX24J600.c and ENCX24J600.h ported to a non-Microchip device used in |
||
27 | conjunction with a Microchip ethernet controller for the sole purpose |
||
28 | of interfacing with the ethernet controller. |
||
29 | |||
30 | You should refer to the license agreement accompanying this Software for |
||
31 | additional information regarding your rights and obligations. |
||
32 | |||
33 | THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY |
||
34 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY |
||
35 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND |
||
36 | NON-INFRINGEMENT. IN NO EVENT SHALL MICROCHIP BE LIABLE FOR ANY INCIDENTAL, |
||
37 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST |
||
38 | OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS BY |
||
39 | THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), ANY CLAIMS |
||
40 | FOR INDEMNITY OR CONTRIBUTION, OR OTHER SIMILAR COSTS, WHETHER ASSERTED ON |
||
41 | THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE), BREACH OF WARRANTY, OR |
||
42 | OTHERWISE. |
||
43 | |||
44 | |||
45 | Author Date Comment |
||
46 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
47 | KH 27 Jan 2010 Created for MRF24WB0M |
||
48 | ******************************************************************************/ |
||
49 | |||
50 | #ifndef __WF_API_H_ |
||
51 | #define __WF_API_H_ |
||
52 | |||
53 | /* |
||
54 | ********************************************************************************************************* |
||
55 | * DEFINES |
||
56 | ********************************************************************************************************* |
||
57 | */ |
||
58 | /*-----------------------------*/ |
||
59 | /* WiFi Driver Version Number */ |
||
60 | /*-----------------------------*/ |
||
61 | #define WF_HOST_DRIVER_VERSION_NUMBER "2.5.2" |
||
62 | |||
63 | /* API defines */ |
||
64 | #define WF_MAX_NUM_CHANNELS (14) |
||
65 | #define WF_MAX_NUM_CONNECTION_PROFILES (8) |
||
66 | #define WF_CP_LIST_LENGTH (8) |
||
67 | #define WF_MAX_SSID_LENGTH (32) |
||
68 | #define WF_BSSID_LENGTH (6) |
||
69 | #define WF_RETRY_FOREVER (255) |
||
70 | #define WF_CHANNEL_LIST_LENGTH (14) |
||
71 | #define WF_MAX_SECURITY_KEY_LENGTH (64) |
||
72 | #define WF_NUM_THROTTLE_TABLE_ROWS (4) |
||
73 | |||
74 | #define WF_MIN_NUM_CPID (1) |
||
75 | #define WF_MAX_NUM_CPID (8) |
||
76 | |||
77 | #define WF_NO_CPID_ACTIVE (0) |
||
78 | |||
79 | #define WF_RTS_THRESHOLD_MAX (2347) /* maximum RTS threshold size in bytes */ |
||
80 | |||
81 | #define WF_MAX_NUM_RATES (8) |
||
82 | |||
83 | /* Key size defines */ |
||
84 | #define WF_MIN_WPA_PASS_PHRASE_LENGTH (8) |
||
85 | #define WF_MIN_WPA_PASS_PHRASE_LENGTH (8) |
||
86 | #define WF_MAX_WPA_PASS_PHRASE_LENGTH (64) |
||
87 | #define WF_MAX_WPA2_PASS_PHRASE_LENGTH (64) |
||
88 | #define WF_WPA_KEY_LENGTH (32) |
||
89 | #define WF_WPA2_KEY_LENGTH (32) |
||
90 | |||
91 | /*------------------------------------------------------------------------------*/ |
||
92 | /* These are error codes returned in the result field of a management response. */ |
||
93 | /*------------------------------------------------------------------------------*/ |
||
94 | #define WF_SUCCESS ((UINT16)1) |
||
95 | #define WF_ERROR_INVALID_SUBTYPE ((UINT16)2) |
||
96 | #define WF_ERROR_OPERATION_CANCELLED ((UINT16)3) |
||
97 | #define WF_ERROR_FRAME_END_OF_LINE_OCCURRED ((UINT16)4) |
||
98 | #define WF_ERROR_FRAME_RETRY_LIMIT_EXCEEDED ((UINT16)5) |
||
99 | #define WF_ERROR_EXPECTED_BSS_VALUE_NOT_IN_FRAME ((UINT16)6) |
||
100 | #define WF_ERROR_FRAME_SIZE_EXCEEDS_BUFFER_SIZE ((UINT16)7) |
||
101 | #define WF_ERROR_FRAME_ENCRYPT_FAILED ((UINT16)8) |
||
102 | #define WF_ERROR_INVALID_PARAM ((UINT16)9) |
||
103 | #define WF_ERROR_AUTH_REQ_ISSUED_WHILE_IN_AUTH_STATE ((UINT16)10) |
||
104 | #define WF_ERROR_ASSOC_REQ_ISSUED_WHILE_IN_ASSOC_STATE ((UINT16)11) |
||
105 | #define WF_ERROR_INSUFFICIENT_RESOURCES ((UINT16)12) |
||
106 | #define WF_ERROR_TIMEOUT_OCCURRED ((UINT16)13) |
||
107 | #define WF_ERROR_BAD_EXCHANGE_ENCOUNTERED_IN_FRAME_RECEPTION ((UINT16)14) |
||
108 | #define WF_ERROR_AUTH_REQUEST_REFUSED ((UINT16)15) |
||
109 | #define WF_ERROR_ASSOCIATION_REQUEST_REFUSED ((UINT16)16) |
||
110 | #define WF_ERROR_PRIOR_MGMT_REQUEST_IN_PROGRESS ((UINT16)17) |
||
111 | #define WF_ERROR_NOT_IN_JOINED_STATE ((UINT16)18) |
||
112 | #define WF_ERROR_NOT_IN_ASSOCIATED_STATE ((UINT16)19) |
||
113 | #define WF_ERROR_NOT_IN_AUTHENTICATED_STATE ((UINT16)20) |
||
114 | #define WF_ERROR_SUPPLICANT_FAILED ((UINT16)21) |
||
115 | #define WF_ERROR_UNSUPPORTED_FEATURE ((UINT16)22) |
||
116 | #define WF_ERROR_REQUEST_OUT_OF_SYNC ((UINT16)23) |
||
117 | #define WF_ERROR_CP_INVALID_ELEMENT_TYPE ((UINT16)24) |
||
118 | #define WF_ERROR_CP_INVALID_PROFILE_ID ((UINT16)25) |
||
119 | #define WF_ERROR_CP_INVALID_DATA_LENGTH ((UINT16)26) |
||
120 | #define WF_ERROR_CP_INVALID_SSID_LENGTH ((UINT16)27) |
||
121 | #define WF_ERROR_CP_INVALID_SECURITY_TYPE ((UINT16)28) |
||
122 | #define WF_ERROR_CP_INVALID_SECURITY_KEY_LENGTH ((UINT16)29) |
||
123 | #define WF_ERROR_CP_INVALID_WEP_KEY_ID ((UINT16)30) |
||
124 | #define WF_ERROR_CP_INVALID_NETWORK_TYPE ((UINT16)31) |
||
125 | #define WF_ERROR_CP_INVALID_ADHOC_MODE ((UINT16)32) |
||
126 | #define WF_ERROR_CP_INVALID_SCAN_TYPE ((UINT16)33) |
||
127 | #define WF_ERROR_CP_INVALID_CP_LIST ((UINT16)34) |
||
128 | #define WF_ERROR_CP_INVALID_CHANNEL_LIST_LENGTH ((UINT16)35) |
||
129 | #define WF_ERROR_NOT_CONNECTED ((UINT16)36) |
||
130 | #define WF_ERROR_ALREADY_CONNECTING ((UINT16)37) |
||
131 | #define WF_ERROR_DISCONNECT_FAILED ((UINT16)38) |
||
132 | #define WF_ERROR_NO_STORED_BSS_DESCRIPTOR ((UINT16)39) |
||
133 | #define WF_ERROR_INVALID_MAX_POWER ((UINT16)40) |
||
134 | |||
135 | /*---------------------------------------------------------------------*/ |
||
136 | /* Used for eventNotificationField bit mask in tWFCAElements structure */ |
||
137 | /*---------------------------------------------------------------------*/ |
||
138 | #define WF_NOTIFY_CONNECTION_ATTEMPT_SUCCESSFUL ((UINT8)(0x01)) |
||
139 | #define WF_NOTIFY_CONNECTION_ATTEMPT_FAILED ((UINT8)(0x02)) |
||
140 | #define WF_NOTIFY_CONNECTION_TEMPORARILY_LOST ((UINT8)(0x04)) |
||
141 | #define WF_NOTIFY_CONNECTION_PERMANENTLY_LOST ((UINT8)(0x08)) |
||
142 | #define WF_NOTIFY_CONNECTION_REESTABLISHED ((UINT8)(0x10)) |
||
143 | #define WF_NOTIFY_ALL_EVENTS ((UINT8)(0x1f)) |
||
144 | |||
145 | /*------------------------------------------------------------------------------------------*/ |
||
146 | /* Multicast Filter ID's */ |
||
147 | /* Infrastructure can use 2,3,4,5 and AdHoc can only use 4,5. Use 4,5 which works for both */ |
||
148 | /*------------------------------------------------------------------------------------------*/ |
||
149 | #define WF_MULTICAST_FILTER_1 (4) |
||
150 | #define WF_MULTICAST_FILTER_2 (5) |
||
151 | |||
152 | #define WF_SCAN_ALL ((UINT8)(0xff)) |
||
153 | /* |
||
154 | ********************************************************************************************************* |
||
155 | * DATA TYPES |
||
156 | ********************************************************************************************************* |
||
157 | */ |
||
158 | |||
159 | /*----------------------------------------------------------------------------*/ |
||
160 | /* Events that can be invoked in WF_ProcessEvent(). Note that the */ |
||
161 | /* connection events are optional, all other events the app must be notified. */ |
||
162 | /*----------------------------------------------------------------------------*/ |
||
163 | typedef enum |
||
164 | { |
||
165 | WF_EVENT_CONNECTION_SUCCESSFUL = 1, /* Connection attempt to network successful */ |
||
166 | WF_EVENT_CONNECTION_FAILED = 2, /* Connection attempt failed */ |
||
167 | |||
168 | |||
169 | WF_EVENT_CONNECTION_TEMPORARILY_LOST = 3, /* Connection lost; MRF24WB0M attempting to reconnect */ |
||
170 | WF_EVENT_CONNECTION_PERMANENTLY_LOST = 4, /* Connection lost; MRF24WB0M no longer trying to connect */ |
||
171 | WF_EVENT_CONNECTION_REESTABLISHED = 5, |
||
172 | |||
173 | WF_EVENT_FLASH_UPDATE_SUCCESSFUL = 6, /* Update to FLASH successful */ |
||
174 | WF_EVENT_FLASH_UPDATE_FAILED = 7, /* Update to FLASH failed */ |
||
175 | |||
176 | |||
177 | |||
178 | WF_EVENT_KEY_CALCULATION_COMPLETE = 8, /* Key calculation has completed */ |
||
179 | |||
180 | WF_EVENT_SCAN_RESULTS_READY = 9, /* scan results are ready */ |
||
181 | WF_EVENT_IE_RESULTS_READY = 10, /* IE data ready */ |
||
182 | |||
183 | |||
184 | WF_EVENT_RX_PACKET_RECEIVED = 11 /* Rx data packet has been received by MRF24WB0M */ |
||
185 | |||
186 | } tWFEvents; |
||
187 | |||
188 | typedef struct WFMacStatsStruct |
||
189 | { |
||
190 | /** |
||
191 | Number of frames received with the Protected Frame subfield of the Frame |
||
192 | Control field set to zero and the value of dot11ExcludeUnencrypted causes |
||
193 | that frame to be discarded. |
||
194 | */ |
||
195 | UINT32 MibWEPExcludeCtr; |
||
196 | UINT32 MibTxBytesCtr; // Total number of Tx bytes that have been transmitted |
||
197 | |||
198 | /** |
||
199 | Number of frames successfully transmitted that had the multicast bit set |
||
200 | in the destination MAC address. |
||
201 | */ |
||
202 | UINT32 MibTxMulticastCtr; |
||
203 | /** |
||
204 | Number of Tx frames that failed due to the number of transmits exceeding |
||
205 | the retry count. |
||
206 | */ |
||
207 | UINT32 MibTxFailedCtr; |
||
208 | UINT32 MibTxRtryCtr; // Number of times a transmitted frame needed to be retried |
||
209 | UINT32 MibTxMultRtryCtr; // Number of times a frame was successfully transmitted after more than one retransmission. |
||
210 | UINT32 MibTxSuccessCtr; // Number of Tx frames successfully transmitted. |
||
211 | UINT32 MibRxDupCtr; // Number of frames received where the Sequence Control field indicates a duplicate. |
||
212 | UINT32 MibRxCtsSuccCtr; // Number of CTS frames received in response to an RTS frame. |
||
213 | UINT32 MibRxCtsFailCtr; // Number of times an RTS frame was not received in response to a CTS frame. |
||
214 | UINT32 MibRxAckFailCtr; // Number of times an Ack was not received in response to a Tx frame. |
||
215 | UINT32 MibRxBytesCtr; // Total number of Rx bytes received. |
||
216 | UINT32 MibRxFragCtr; // Number of successful received frames (management or data) |
||
217 | UINT32 MibRxMultCtr; // Number of frames received with the multicast bit set in the destination MAC address. |
||
218 | UINT32 MibRxFCSErrCtr; // Number of frames received with an invalid Frame Checksum (FCS). |
||
219 | |||
220 | /** |
||
221 | Number of frames received where the Protected Frame subfield of the Frame Control Field is set to |
||
222 | one and the WEPOn value for the key mapped to the transmitters MAC address indicates the frame |
||
223 | should not have been encrypted. |
||
224 | */ |
||
225 | UINT32 MibRxWEPUndecryptCtr; |
||
226 | UINT32 MibRxFragAgedCtr; // Number of times that fragments aged out, or were not received in the allowable time. |
||
227 | UINT32 MibRxMICFailureCtr; // Number of MIC failures that have occurred. |
||
228 | } tWFMacStats; |
||
229 | |||
230 | |||
231 | /*-------------------------------------------------------*/ |
||
232 | /* Security Type defines */ |
||
233 | /* Used in WF_CPSet/GetSecurityType WF_CPSet/GetElements */ |
||
234 | /*-------------------------------------------------------*/ |
||
235 | #define WF_SECURITY_OPEN (0) |
||
236 | #define WF_SECURITY_WEP_40 (1) |
||
237 | #define WF_SECURITY_WEP_104 (2) |
||
238 | #define WF_SECURITY_WPA_WITH_KEY (3) |
||
239 | #define WF_SECURITY_WPA_WITH_PASS_PHRASE (4) |
||
240 | #define WF_SECURITY_WPA2_WITH_KEY (5) |
||
241 | #define WF_SECURITY_WPA2_WITH_PASS_PHRASE (6) |
||
242 | #define WF_SECURITY_WPA_AUTO_WITH_KEY (7) |
||
243 | #define WF_SECURITY_WPA_AUTO_WITH_PASS_PHRASE (8) |
||
244 | |||
245 | /*---------------------------------------------------------------------*/ |
||
246 | /* Network Type defines */ |
||
247 | /* Used in WF_CPSet/GetNetworkType, WF_CPSetElements, WF_CPGetElements */ |
||
248 | /*---------------------------------------------------------------------*/ |
||
249 | typedef enum |
||
250 | { |
||
251 | WF_INFRASTRUCTURE = 1, |
||
252 | WF_ADHOC = 2 |
||
253 | } tWFNetworkType; |
||
254 | |||
255 | /*--------------------------------------------------------*/ |
||
256 | /* Ad Hoc behavior defines */ |
||
257 | /* Used in WF_CPSet/GetAdhocBehavor, WF_CPSet/GetElements */ |
||
258 | /*--------------------------------------------------------*/ |
||
259 | typedef enum |
||
260 | { |
||
261 | WF_ADHOC_CONNECT_THEN_START = 0, |
||
262 | WF_ADHOC_CONNECT_ONLY = 1, |
||
263 | WF_ADHOC_START_ONLY = 2 |
||
264 | } tWFAdhocBehavior; |
||
265 | |||
266 | /*----------------------------------------------------*/ |
||
267 | /* Scan type defines */ |
||
268 | /* Used in WF_CASet/GetScanType, WF_CASet/GetElements */ |
||
269 | /*----------------------------------------------------*/ |
||
270 | typedef enum |
||
271 | { |
||
272 | WF_ACTIVE_SCAN = 1, |
||
273 | WF_PASSIVE_SCAN = 2 |
||
274 | } tWFScanTypes; |
||
275 | |||
276 | /*-----------------------------------------------------------------------------------------*/ |
||
277 | /* Beacon Timeout and Deauth defines */ |
||
278 | /* Used in WF_CASet/GetBeaconTimeoutAction, WF_CASet/GetDeauthAction, WF_CASet/GetElements */ |
||
279 | /*-----------------------------------------------------------------------------------------*/ |
||
280 | typedef enum |
||
281 | { |
||
282 | WF_DO_NOT_ATTEMPT_TO_RECONNECT = 0, |
||
283 | WF_ATTEMPT_TO_RECONNECT = 1 |
||
284 | } tWFConnectionLossActions; |
||
285 | |||
286 | typedef enum |
||
287 | { |
||
288 | WF_DISABLED = 0, |
||
289 | WF_ENABLED = 1 |
||
290 | } tWFEnableDisable; |
||
291 | |||
292 | /* eventInfo defines for WF_ProcessEvent(), case WF_EVENT_CONNECTION_FAILED */ |
||
293 | /* Also value for index 3 of WF_CONNECTION_FAILED_EVENT_SUBTYPE */ |
||
294 | typedef enum |
||
295 | { |
||
296 | WF_JOIN_FAILURE = 2, |
||
297 | WF_AUTHENTICATION_FAILURE = 3, |
||
298 | WF_ASSOCIATION_FAILURE = 4, |
||
299 | WF_WEP_HANDSHAKE_FAILURE = 5, |
||
300 | WF_PSK_CALCULATION_FAILURE = 6, |
||
301 | WF_PSK_HANDSHAKE_FAILURE = 7, |
||
302 | WF_ADHOC_JOIN_FAILURE = 8, |
||
303 | WF_SECURITY_MISMATCH_FAILURE = 9, |
||
304 | WF_NO_SUITABLE_AP_FOUND_FAILURE = 10, |
||
305 | WF_RETRY_FOREVER_NOT_SUPPORTED_FAILURE = 11 |
||
306 | |||
307 | } tWFConnectionFailureCodes; |
||
308 | |||
309 | /* eventInfo defines for WF_ProcessEvent(), case WF_EVENT_CONNECTION_TEMPORARILY_LOST */ |
||
310 | typedef enum |
||
311 | { |
||
312 | WF_BEACON_TIMEOUT = 1, |
||
313 | WF_DEAUTH_RECEIVED = 2, |
||
314 | WF_DISASSOCIATE_RECEIVED = 3 |
||
315 | } tWFConnectionLostCodes; |
||
316 | |||
317 | /* Tx Data Rates */ |
||
318 | typedef enum |
||
319 | { |
||
320 | WF_ONE_MBIT_TX_RATE = 0, |
||
321 | WF_TWO_MBIT_TX_RATE = 1 |
||
322 | } tWFTxDataRates; |
||
323 | |||
324 | /* WiFi Device Types */ |
||
325 | typedef enum |
||
326 | { |
||
327 | MRF24WB0M_DEVICE = 1 |
||
328 | } tWFDeviceTypes; |
||
329 | |||
330 | /* Regional Domains */ |
||
331 | typedef enum |
||
332 | { |
||
333 | WF_DOMAIN_FCC = 0, /* Available Channels: 1 - 11 */ |
||
334 | WF_DOMAIN_IC = 1, /* Available Channels: 1 - 11 */ |
||
335 | WF_DOMAIN_ETSI = 2, /* Available Channels: 1 - 13 */ |
||
336 | WF_DOMAIN_SPAIN = 3, /* Available Channels: 1 - 13 */ |
||
337 | WF_DOMAIN_FRANCE = 4, /* Available Channels: 1 - 13 */ |
||
338 | WF_DOMAIN_JAPAN_A = 5, /* Available Channels: 14 */ |
||
339 | WF_DOMAIN_JAPAN_B = 6 /* Available Channels: 1 - 13 */ |
||
340 | } tWFRegDomain; |
||
341 | |||
342 | /* Power save states */ |
||
343 | typedef enum |
||
344 | { |
||
345 | WF_PS_HIBERNATE = 1, |
||
346 | WF_PS_PS_POLL_DTIM_ENABLED = 2, |
||
347 | WF_PS_PS_POLL_DTIM_DISABLED = 3, |
||
348 | WF_PS_OFF = 4 |
||
349 | } tWFPowerSaveState; |
||
350 | |||
351 | typedef enum |
||
352 | { |
||
353 | WF_LOW = 0, |
||
354 | WF_HIGH = 1 |
||
355 | } tWFPinLevel; |
||
356 | |||
357 | /*-----------------------------------------------------------------------*/ |
||
358 | /* defines used for the p_currentCpID value in WF_CMGetConnectionState() */ |
||
359 | /*-----------------------------------------------------------------------*/ |
||
360 | #define WF_CURRENT_CPID_NONE (0) |
||
361 | #define WF_CURRENT_CPID_LIST (0xff) |
||
362 | |||
363 | /* Connection States */ |
||
364 | typedef enum |
||
365 | { |
||
366 | WF_CSTATE_NOT_CONNECTED = 1, |
||
367 | WF_CSTATE_CONNECTION_IN_PROGRESS = 2, |
||
368 | WF_CSTATE_CONNECTED_INFRASTRUCTURE = 3, |
||
369 | WF_CSTATE_CONNECTED_ADHOC = 4, |
||
370 | WF_CSTATE_RECONNECTION_IN_PROGRESS = 5, |
||
371 | WF_CSTATE_CONNECTION_PERMANENTLY_LOST = 6 |
||
372 | } tWFConnectionStates; |
||
373 | |||
374 | /* eventInfo define for WF_ProcessEvent() when no additional info is supplied */ |
||
375 | #define WF_NO_ADDITIONAL_INFO ((UINT16)0xffff) |
||
376 | |||
377 | /*-----------------------------*/ |
||
378 | /* Connection Profile Elements */ |
||
379 | /*-----------------------------*/ |
||
380 | |||
381 | // Connection profile elements structure |
||
382 | typedef struct WFCPElementsStruct |
||
383 | { |
||
384 | /** |
||
385 | SSID, which must be less than or equal to 32 characters. Set to all 0s |
||
386 | if not being used. If ssidLength is 0 this field is ignored. If SSID is |
||
387 | not defined then the MRF24WB0M, when using this profile to connect, will |
||
388 | scan all channels within its regional domain. |
||
389 | |||
390 | Default: SSID not used. |
||
391 | */ |
||
392 | UINT8 ssid[WF_MAX_SSID_LENGTH]; |
||
393 | /** |
||
394 | Basic Service Set Identifier, always 6 bytes. This is the 48-bit MAC of |
||
395 | the SSID. It is an optional field that can be used to specify a specific |
||
396 | SSID if more than one AP exists with the same SSID. This field can also |
||
397 | be used in lieu of the SSID. |
||
398 | |||
399 | Set each byte to 0xFF if BSSID is not going to be used. |
||
400 | Default: BSSID not used (all FFs) |
||
401 | */ |
||
402 | UINT8 bssid[WF_BSSID_LENGTH]; |
||
403 | /** |
||
404 | Number of ASCII bytes in ssid. Set to 0 is SSID is not going to be used. |
||
405 | |||
406 | Default: 0 |
||
407 | */ |
||
408 | UINT8 ssidLength; |
||
409 | /** |
||
410 | Designates the desired security level for the connection. Choices are: |
||
411 | <table> |
||
412 | WF_SECURITY_OPEN No security encryption used. |
||
413 | WF_SECURITY_WEP_40 Use WEP security. |
||
414 | WEP key, using four 5-byte keys will be provided in securityKey. |
||
415 | Note that only open authentication is supported for WEP. |
||
416 | WF_SECURITY_WEP_104 Use WEP security. |
||
417 | WEP key, using four 13-byte keys will be provided in securityKey. |
||
418 | Note that only open authentication is supported for WEP. |
||
419 | WF_SECURITY_WPA_WITH_KEY Use WPA security. |
||
420 | Binary PSK (Pre-shared Key) key will be provided in securityKey. |
||
421 | WF_SECURITY_WPA_WITH_PASS_PHRASE Use WPA security. |
||
422 | ASCII WPA passphrase will be provided in securityKey and, |
||
423 | after a call to WF_CMConnect(), the MRF24WB0M will calculate |
||
424 | the PSK key (which can take up to 30 seconds). |
||
425 | WF_SECURITY_WPA2_WITH_KEY Use WPA-2 security. |
||
426 | Binary WPA-2 key will be provided in securityKey. |
||
427 | WF_SECURITY_WPA2_WITH_PASSPHRASE Use WPA-2 security. |
||
428 | ASCII WPA-2 passphrase will be provided in securityKey and, |
||
429 | after a call to WF_CMConnect(), the MRF24WB0M will calculate |
||
430 | the PSK key (which can take up to 30 seconds). |
||
431 | WF_SECURITY_WPA_AUTO_WITH_KEY Same as WF_SECURITY_WPA_WITH_KEY or WF_SECURITY_WPA2_WITH_KEY |
||
432 | except connection manager will connect to the AP using highest |
||
433 | level security the AP supports (WPA or WPA2). |
||
434 | WF_SECURITY_WPA_AUTO_WITH_PASSPHRASE Same as WF_SECURITY_WPA_WITH_PASS_PHRASE or |
||
435 | WF_SECURITY_WPA2_WITH_PASS_PHRASE except connection manager |
||
436 | will connect to the AP using highest level security the AP |
||
437 | supports (WPA or WPA2). |
||
438 | </table> |
||
439 | Default: WF_SECURITY_OPEN |
||
440 | */ |
||
441 | UINT8 securityType; |
||
442 | /** |
||
443 | Set to NULL if securityType is WF_SECURITY_OPEN. If securityKeyLength is 0 |
||
444 | this field is ignored. |
||
445 | <table> |
||
446 | WEP Keys If using WEP this field must contain 4 keys. Each key must be |
||
447 | either 5 bytes in length (if securityType is WF_SECURITY_WEP_40) |
||
448 | or 13 bytes in length (if securityType is WF_SECURITY_WEP_104). |
||
449 | The keys must be contiguous within this field. For example, if |
||
450 | using 5 bytes keys the first key starts at index 0, the second |
||
451 | key at index 5, the third key at index 10, and the last key at |
||
452 | index 15. Unused keys should be set to all 0s. |
||
453 | WPA/WPA2 Keys If using WPA or WPA2 you can provide the actual binary key or |
||
454 | ASCII passphrase used to generate a key. [64 byte array covers |
||
455 | all cases of keys or passphrases]. If using this field for a |
||
456 | security passphrase the MRF24WB0M will need to calculate the |
||
457 | binary key after the call to WF_CMConnect() this can add about |
||
458 | 30 seconds to the connection time. |
||
459 | </table> |
||
460 | Default: No security key defined |
||
461 | */ |
||
462 | UINT8 securityKey[WF_MAX_SECURITY_KEY_LENGTH]; |
||
463 | /** |
||
464 | Number of bytes used in the securityKey. Set to 0 if securityType is WF_SECURITY_OPEN. |
||
465 | <table> |
||
466 | WEP Keys If securityType is WF_SECURITY_WEP_40 or WF_SECURITY_WEP_104 |
||
467 | then this field is the length of the four WEP keys. |
||
468 | |||
469 | Range is |
||
470 | 20 if securityType is WF_SECURITY_WEP_40 (four 5-byte keys), |
||
471 | 52 if securityType is WF_SECURITY_WEP_104 (four 13-byte keys) |
||
472 | WPA/WPA2 Keys If securityType is one of the WPA or WPA2 choices then this |
||
473 | field is the number of bytes in the binary key or the |
||
474 | passphrase, whichever is being used. |
||
475 | |||
476 | </table> |
||
477 | Default: 0 |
||
478 | */ |
||
479 | UINT8 securityKeyLength; |
||
480 | /** |
||
481 | This field is only used if securityType is WF_SECURITY_WEP. This field |
||
482 | designates which of the four WEP keys defined in securityKey to use when |
||
483 | connecting to a WiFi network. The range is 0 thru 3, with the default |
||
484 | being 0. |
||
485 | */ |
||
486 | UINT8 wepDefaultKeyId; |
||
487 | /** |
||
488 | WF_INFRASTRUCTURE or WF_ADHOC |
||
489 | |||
490 | Default: WF_INFRASTRUCTURE |
||
491 | */ |
||
492 | UINT8 networkType; |
||
493 | /** |
||
494 | Only applicable if networkType is WF_ADHOC. Configures Adhoc behavior. Choices are: |
||
495 | <table> |
||
496 | WF_ADHOC_CONNECT_THEN_START Attempt to connect to existing network. |
||
497 | If that fails, then start a network. |
||
498 | WF_ADHOC_CONNECT_ONLY Connect only to an existing network. |
||
499 | Do not start a network. |
||
500 | WF_ADHOC_START_ONLY Only start a network. |
||
501 | </table> |
||
502 | Default: WF_ADHOC_CONNECT_THEN_START |
||
503 | */ |
||
504 | UINT8 adHocBehavior; |
||
505 | } tWFCPElements; |
||
506 | |||
507 | /*-------------------------------*/ |
||
508 | /* Connection Algorithm Elements */ |
||
509 | /*-------------------------------*/ |
||
510 | typedef struct WFCAElementsStruct |
||
511 | { |
||
512 | /** |
||
513 | This parameter is only used when PS Poll mode is enabled. See |
||
514 | WF_PsPollEnable(). Number of 100ms intervals between instances when the |
||
515 | MRF24WB0M wakes up to received buffered messages from the network. Range |
||
516 | is from 1 (100ms) to 6553.5 sec (~109 min). |
||
517 | |||
518 | Note that the 802.11 standard defines the listen interval in terms of |
||
519 | Beacon Periods, which are typically 100ms. If the MRF24WB0M is communicating |
||
520 | to a network with a network that has Beacon Periods that is not 100ms it |
||
521 | will round up (or down) as needed to match the actual Beacon Period as |
||
522 | closely as possible. |
||
523 | |||
524 | Important Note: If the listenInterval is modified while connected to a |
||
525 | network the MRF24WB0M will automatically reconnect to the network with the |
||
526 | new Beacon Period value. This may cause a temporary loss of data packets. |
||
527 | */ |
||
528 | UINT16 listenInterval; |
||
529 | /** |
||
530 | WF_ACTIVE_SCAN (Probe Requests sent out) or WF_PASSIVE_SCAN (listen only) |
||
531 | |||
532 | Default: WF_ACTIVE_SCAN |
||
533 | */ |
||
534 | UINT8 scanType; |
||
535 | /** |
||
536 | Specifies RSSI restrictions when connecting. This field is only used if: |
||
537 | 1. The Connection Profile has not defined a SSID or BSSID, or |
||
538 | 2. An SSID is defined in the Connection Profile and multiple APs are discovered with the same SSID. |
||
539 | |||
540 | <table> |
||
541 | |||
542 | 1-254 Only connect to a network if the RSSI is greater than or equal to the specified value. |
||
543 | 255 Connect to the highest RSSI found (default) |
||
544 | </table> |
||
545 | */ |
||
546 | UINT8 rssi; |
||
547 | /** |
||
548 | <b>Note: Connection Profile lists are not yet supported. This array should be set to all FFs.</b> |
||
549 | */ |
||
550 | UINT8 connectionProfileList[WF_CP_LIST_LENGTH]; |
||
551 | /** |
||
552 | This field is used to specify the number of retries for the single |
||
553 | connection profile before taking the connection lost action. |
||
554 | |||
555 | Range 1 to 254 or WF_RETRY_FOREVER (255) |
||
556 | |||
557 | Default is 3 |
||
558 | */ |
||
559 | UINT8 listRetryCount; |
||
560 | /** |
||
561 | There are several connection-related events that can occur. The Host has |
||
562 | the option to be notified (or not) when some of these events occur. This |
||
563 | field controls event notification for connection-related events. |
||
564 | <table> |
||
565 | Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 |
||
566 | ----- ----- ----- ----- ----- ----- ----- ----- |
||
567 | Not Not Not Event Event Event Event Event |
||
568 | used used used E D C B A |
||
569 | </table> |
||
570 | The defines for each bit are shown below. |
||
571 | <table> |
||
572 | Event Code #define |
||
573 | ---------- ------- |
||
574 | A WF_NOTIFY_CONNECTION_ATTEMPT_SUCCESSFUL |
||
575 | B WF_NOTIFY_CONNECTION_ATTEMPT_FAILED |
||
576 | C WF_NOTIFY_CONNECTION_TEMPORARILY_LOST |
||
577 | D WF_NOTIFY_CONNECTION_PERMANENTLY_LOST |
||
578 | E WF_NOTIFY_CONNECTION_REESTABLISHED |
||
579 | </table> |
||
580 | If a bit is set, then the host will be notified if the associated event |
||
581 | occurs. If the bit is not set then the host will not be notified if the |
||
582 | associated event occurs. A #define, WF_NOTIFY_ALL_EVENTS, exists as a |
||
583 | shortcut to allow notification for all events. |
||
584 | |||
585 | Note that if an event is not in the above bit mask the application will |
||
586 | always be notified of the event via the call to WF_ProcessEvent(). |
||
587 | |||
588 | Default: WF_NOTIFY_ALL_EVENTS |
||
589 | */ |
||
590 | UINT8 eventNotificationAction; |
||
591 | /** |
||
592 | Specifies the action the Connection Manager should take if a Connection is |
||
593 | lost due to a Beacon Timeout. |
||
594 | If this field is set to WF_ATTEMPT_TO_RECONNECT then the number of attempts |
||
595 | is limited to the value in listRetryCount. |
||
596 | |||
597 | Choices are: |
||
598 | WF_ATTEMPT_TO_RECONNECT or WF_DO_NOT_ATTEMPT_TO_RECONNECT |
||
599 | |||
600 | Default: WF_ATTEMPT_TO_RECONNECT |
||
601 | */ |
||
602 | UINT8 beaconTimeoutAction; |
||
603 | /** |
||
604 | Designates what action the Connection Manager should take if it receives a |
||
605 | Deauthentication message from the AP. |
||
606 | |||
607 | If this field is set to WF_ATTEMPT_TO_RECONNECT then the number of attempts |
||
608 | is limited to the value in listRetryCount. |
||
609 | |||
610 | Choices are: |
||
611 | WF_ATTEMPT_TO_RECONNECT or WF_DO_NOT_ATTEMPT_TO_RECONNECT |
||
612 | |||
613 | Default: WF_ATTEMPT_TO_RECONNECT |
||
614 | */ |
||
615 | UINT8 deauthAction; |
||
616 | /** |
||
617 | List of one or more channels that the MRF24WB0M should utilize when |
||
618 | connecting or scanning. If numChannelsInList is set to 0 then this |
||
619 | parameter should be set to NULL. |
||
620 | |||
621 | Default: All valid channels for the regional domain of the MRF24WB0M (set |
||
622 | at manufacturing). |
||
623 | */ |
||
624 | UINT8 channelList[WF_CHANNEL_LIST_LENGTH]; |
||
625 | /** |
||
626 | Number of channels in channelList. If set to 0 then the MRF24WB0M will |
||
627 | populate the list with all valid channels for the regional domain. |
||
628 | |||
629 | Default: The number of valid channels for the regional domain of the |
||
630 | MRF24WB0M (set at manufacturing). |
||
631 | */ |
||
632 | UINT8 numChannelsInList; |
||
633 | /** |
||
634 | Specifies the number of beacons that can be missed before the action |
||
635 | described in beaconTimeoutAction is taken. |
||
636 | |||
637 | <table> |
||
638 | |||
639 | * Will not indicate this condition to Host |
||
640 | 1-255 Beacons missed before disconnect event occurs and beaconTimeoutAction |
||
641 | occurs. If enabled, host will receive an event message indicating |
||
642 | connection temporarily or permanently lost, and if retrying, a |
||
643 | connection successful event. |
||
644 | </table> |
||
645 | Default: 0 (no monitoring or notification of beacon timeout) |
||
646 | */ |
||
647 | UINT8 beaconTimeout; |
||
648 | /** |
||
649 | The number of times to scan a channel while attempting to find a particular |
||
650 | access point. |
||
651 | |||
652 | Default: 1 |
||
653 | */ |
||
654 | UINT8 scanCount; |
||
655 | UINT8 pad1; |
||
656 | /** |
||
657 | The minimum time (in milliseconds) the connection manager will wait for a |
||
658 | probe response after sending a probe request. If no probe responses are |
||
659 | received in minChannelTime then the connection manager will go on to the |
||
660 | next channel, if any are left to scan, or quit. |
||
661 | |||
662 | Default: 200ms |
||
663 | */ |
||
664 | UINT16 minChannelTime; |
||
665 | /** |
||
666 | If a probe response is received within minChannelTime then the connection |
||
667 | manager will continue to collect any additional probe responses up to |
||
668 | maxChannelTime before going to the next channel in the channelList. Units |
||
669 | are in milliseconds. |
||
670 | |||
671 | Default: 400ms |
||
672 | */ |
||
673 | UINT16 maxChannelTime; |
||
674 | /** |
||
675 | The number of microseconds to delay before transmitting a probe request |
||
676 | following the channel change event. |
||
677 | |||
678 | Default: 20us |
||
679 | */ |
||
680 | UINT16 probeDelay; |
||
681 | } tWFCAElements; |
||
682 | |||
683 | /*-------------------*/ |
||
684 | /* Tx Throttle Table */ |
||
685 | /*-------------------*/ |
||
686 | typedef struct WFThrottleTableStruct |
||
687 | { |
||
688 | UINT8 dataRate[WF_NUM_THROTTLE_TABLE_ROWS]; // WF_ONE_MBIT_TX_RATE or WF_TWO_MBIT_TX_RATE |
||
689 | INT8 txPower[WF_NUM_THROTTLE_TABLE_ROWS]; // -10dB to +10dB |
||
690 | } tWFThrottleTable; |
||
691 | |||
692 | /*--------------------------*/ |
||
693 | /* used in WF_GetDeviceInfo */ |
||
694 | /*--------------------------*/ |
||
695 | typedef struct tWFDeviceInfoStruct |
||
696 | { |
||
697 | UINT8 deviceType; /* MRF24WB0M_DEVICE_TYPE */ |
||
698 | UINT8 romVersion; /* ROM version number */ |
||
699 | UINT8 patchVersion; /* Patch version number */ |
||
700 | } tWFDeviceInfo; |
||
701 | |||
702 | /*--------------*/ |
||
703 | /* Scan Results */ |
||
704 | /*--------------*/ |
||
705 | typedef struct |
||
706 | { |
||
707 | UINT8 bssid[WF_BSSID_LENGTH]; // Network BSSID value |
||
708 | UINT8 ssid[WF_MAX_SSID_LENGTH]; // Network SSID value |
||
709 | |||
710 | /** |
||
711 | Access point configuration |
||
712 | <table> |
||
713 | Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 |
||
714 | ----- ----- ----- ----- ----- ----- ----- ----- |
||
715 | WPA2 WPA Preamble Privacy Reserved Reserved Reserved IE |
||
716 | </table> |
||
717 | |||
718 | <table> |
||
719 | IE 1 if AP broadcasting one or more Information Elements, else 0 |
||
720 | Privacy 0 : AP is open (no security) |
||
721 | 1: AP using security, if neither WPA and WPA2 set then security is WEP. |
||
722 | Preamble 0: AP transmitting with short preamble |
||
723 | 1: AP transmitting with long preamble |
||
724 | WPA Only valid if Privacy is 1. |
||
725 | 0: AP does not support WPA |
||
726 | 1: AP supports WPA |
||
727 | WPA2 Only valid if Privacy is 1. |
||
728 | 0: AP does not support WPA2 |
||
729 | 1: AP supports WPA2 |
||
730 | </table> |
||
731 | */ |
||
732 | UINT8 apConfig; |
||
733 | UINT8 reserved; |
||
734 | UINT16 beaconPeriod; // Network beacon interval |
||
735 | UINT16 atimWindow; // Only valid if bssType = WF_INFRASTRUCTURE |
||
736 | |||
737 | /** |
||
738 | List of Network basic rates. Each rate has the following format: |
||
739 | |||
740 | Bit 7 |
||
741 | * 0 rate is not part of the basic rates set |
||
742 | * 1 rate is part of the basic rates set |
||
743 | |||
744 | Bits 6:0 |
||
745 | Multiple of 500kbps giving the supported rate. For example, a value of 2 |
||
746 | (2 * 500kbps) indicates that 1mbps is a supported rate. A value of 4 in |
||
747 | this field indicates a 2mbps rate (4 * 500kbps). |
||
748 | */ |
||
749 | UINT8 basicRateSet[WF_MAX_NUM_RATES]; |
||
750 | UINT8 rssi; // Signal strength of received frame beacon or probe response |
||
751 | UINT8 numRates; // Number of valid rates in basicRates |
||
752 | UINT8 DtimPeriod; // Part of TIM element |
||
753 | UINT8 bssType; // WF_INFRASTRUCTURE or WF_ADHOC |
||
754 | UINT8 channel; // Channel number |
||
755 | UINT8 ssidLen; // Number of valid characters in ssid |
||
756 | |||
757 | } tWFScanResult; |
||
758 | |||
759 | #if defined(WF_CM_DEBUG) |
||
760 | typedef struct |
||
761 | { |
||
762 | UINT8 byte[12*4]; // Currently, CM has 12 states; 4-byte for each state info entry. |
||
763 | } tWFCMInfoFSMStats; |
||
764 | #endif |
||
765 | |||
766 | /*------------------------*/ |
||
767 | /* if asserts are enabled */ |
||
768 | /*------------------------*/ |
||
769 | #ifdef WF_DEBUG |
||
770 | |||
771 | /*---------------------------------------------------------*/ |
||
772 | /* Module numbers that will be used in the WF_ASSERT macro */ |
||
773 | /*---------------------------------------------------------*/ |
||
774 | typedef enum |
||
775 | { |
||
776 | WF_MODULE_MAIN_DEMO = 0, /* MainDemo.c */ |
||
777 | WF_MODULE_WF_CONFIG = 1, /* WF_Config.c */ |
||
778 | WF_MODULE_WF_EINT = 2, /* WF_Eint.c */ |
||
779 | WF_MODULE_WF_SPI = 3, /* WF_Spi.c */ |
||
780 | WF_MODULE_WF_MAC = 4, /* WFMac.c */ |
||
781 | WF_MODULE_WF_PARAM_MSG = 5, /* WFParamMsg.c */ |
||
782 | WF_MODULE_WF_CONNECTION_PROFILE = 6, /* WFConnectionProfile.c */ |
||
783 | WF_MODULE_WF_CONNECTION_ALGORITHM = 7, /* WFConnectionAlgorithm.c */ |
||
784 | WF_MODULE_WF_CONNECTION_MANAGER = 8, /* WFConnectionManager.c */ |
||
785 | WF_MODULE_WF_DRIVER_COM = 9, /* WFDriverCom.c */ |
||
786 | WF_MODULE_WF_INIT = 10, /* WFInit.c */ |
||
787 | WF_MODULE_WF_DRIVER_RAW = 11, /* WFDriverRaw.c */ |
||
788 | WF_MODULE_WF_MGMT_MSG = 12, /* WFMgmtMsg.c */ |
||
789 | WF_MODULE_MGMT_MSG_TEST = 13, /* WFMgmtMsgTest.c */ |
||
790 | WF_MODULE_WF_TX_POWER = 14, /* WFTxPower.c */ |
||
791 | WF_MODULE_WF_POWER_SAVE = 15, /* WFPowerSave.c */ |
||
792 | WF_MODULE_EVENT_HANDLER = 16, /* WFEventHandler.c */ |
||
793 | WF_MODULE_WF_SCAN = 17, /* WFScan.c */ |
||
794 | WF_MODULE_WF_DATA_TX_RX = 18, /* WFDataTxRx */ |
||
795 | |||
796 | WF_MODULE_IPERF_APP = 100, /* IperfApp.c */ |
||
797 | WF_MODULE_HOST_BRIDGE = 101, /* WFHostBridge.c */ |
||
798 | WF_MODULE_WF_IPERF_CLIENT = 102, /* WF_iperfClient.c */ |
||
799 | WF_MODULE_WF_IPERF_SERVER = 103, /* WF_iperfServer.c */ |
||
800 | WF_MODULE_WF_IPERF_COMMON = 104 /* WF_iperfCommon.c */ |
||
801 | |||
802 | } tWFModuleNumber; |
||
803 | |||
804 | |||
805 | void WF_AssertionFailed(UINT8 moduleNumber, UINT16 lineNumber); |
||
806 | |||
807 | #define WF_ASSERT(expr) \ |
||
808 | if (!(expr)) \ |
||
809 | { \ |
||
810 | WF_AssertionFailed(WF_MODULE_NUMBER, __LINE__); \ |
||
811 | } |
||
812 | /*---------------------------*/ |
||
813 | /* else asserts are disabled */ |
||
814 | /*---------------------------*/ |
||
815 | #else |
||
816 | #define WF_ASSERT(expr) |
||
817 | #endif /* WF_DEBUG */ |
||
818 | |||
819 | |||
820 | /* |
||
821 | ********************************************************************************************************* |
||
822 | * FUNCTION PROTOTYPES |
||
823 | ********************************************************************************************************* |
||
824 | */ |
||
825 | |||
826 | /*--------------------------*/ |
||
827 | /* Initialization Functions */ |
||
828 | /*--------------------------*/ |
||
829 | void WF_Init(void); |
||
830 | |||
831 | /*-------------------*/ |
||
832 | /* Version functions */ |
||
833 | /*-------------------*/ |
||
834 | void WF_GetDeviceInfo(tWFDeviceInfo *p_deviceInfo); |
||
835 | |||
836 | /*----------------------------*/ |
||
837 | /* WF Driver process function */ |
||
838 | /*----------------------------*/ |
||
839 | void WFProcess(void); |
||
840 | |||
841 | |||
842 | /*---------------------------------------*/ |
||
843 | /* WF Driver External Interrupt function */ |
||
844 | /* Must be called when: */ |
||
845 | /* 1) External interrupt is enabled AND */ |
||
846 | /* 2) EXINT line is asserted (low) */ |
||
847 | /*---------------------------------------*/ |
||
848 | void WFEintISR(void); |
||
849 | |||
850 | /*-----------------------*/ |
||
851 | /* MAC Address Functions */ |
||
852 | /*-----------------------*/ |
||
853 | void WF_SetMacAddress(UINT8 *p_mac); |
||
854 | void WF_GetMacAddress(UINT8 *p_mac); |
||
855 | |||
856 | |||
857 | /*------------------------------*/ |
||
858 | /* Connection Profile Functions */ |
||
859 | /*------------------------------*/ |
||
860 | void WF_CPCreate(UINT8 *p_CpId); |
||
861 | void WF_CPDelete(UINT8 CpId); |
||
862 | void WF_CPGetIds(UINT8 *cpIdList); |
||
863 | |||
864 | #if defined(WF_USE_GROUP_SET_GETS) |
||
865 | void WF_CPSetElements(UINT8 CpId, tWFCPElements *p_elements); |
||
866 | void WF_CPGetElements(UINT8 CpId, tWFCPElements *p_elements); |
||
867 | #endif |
||
868 | |||
869 | #if defined(WF_USE_INDIVIDUAL_SET_GETS) |
||
870 | void WF_CPSetSsid(UINT8 CpId, UINT8 *p_ssid, UINT8 ssidLength); |
||
871 | void WF_CPGetSsid(UINT8 CpId, UINT8 *p_ssid, UINT8 *p_ssidLength); |
||
872 | void WF_CPSetBssid(UINT8 CpId, UINT8 *p_bssid); |
||
873 | void WF_CPGetBssid(UINT8 CpId, UINT8 *p_bssid); |
||
874 | void WF_CPSetSecurity(UINT8 CpId, |
||
875 | UINT8 securityType, |
||
876 | UINT8 wepKeyIndex, |
||
877 | UINT8 *p_securityKey, |
||
878 | UINT8 securityKeyLength); |
||
879 | void WF_CPGetSecurity(UINT8 CpId, |
||
880 | UINT8 *p_securityType, |
||
881 | UINT8 *p_wepKeyIndex, |
||
882 | UINT8 *p_securityKey, |
||
883 | UINT8 *p_securityKeyLength); |
||
884 | void WF_CPSetDefaultWepKeyIndex(UINT8 CpId, UINT8 defaultWepKeyIndex); |
||
885 | void WF_CPGetDefaultWepKeyIndex(UINT8 CpId, UINT8 *p_defaultWepKeyIndex); |
||
886 | void WF_CPSetNetworkType(UINT8 CpId, UINT8 networkType); |
||
887 | void WF_CPGetNetworkType(UINT8 CpId, UINT8 *p_networkType); |
||
888 | void WF_CPSetAdHocBehavior(UINT8 CpId, UINT8 adHocBehavior); |
||
889 | void WF_CPGetAdHocBehavior(UINT8 CpId, UINT8 *p_adHocBehavior); |
||
890 | |||
891 | #endif /* WF_USE_INDIVIDUAL_SET_GETS */ |
||
892 | |||
893 | /*--------------------------------*/ |
||
894 | /* Connection Algorithm Functions */ |
||
895 | /*--------------------------------*/ |
||
896 | #if defined(WF_USE_GROUP_SET_GETS) |
||
897 | void WF_CASetElements(tWFCAElements *p_elements); |
||
898 | void WF_CAGetElements(tWFCAElements *p_elements); |
||
899 | #endif |
||
900 | |||
901 | #if defined(WF_USE_INDIVIDUAL_SET_GETS) |
||
902 | void WF_CASetScanType(UINT8 scanType); |
||
903 | void WF_CAGetScanType(UINT8 *p_scanType); |
||
904 | void WF_CASetRssi(UINT8 rssi); |
||
905 | void WF_CAGetRssi(UINT8 *p_rssi); |
||
906 | void WF_CASetConnectionProfileList(UINT8 cpList[WF_CP_LIST_LENGTH]); |
||
907 | void WF_CAGetConnectionProfileList(UINT8 cpList[WF_CP_LIST_LENGTH]); |
||
908 | void WF_CASetListRetryCount(UINT8 listRetryCount); |
||
909 | void WF_CAGetListRetryCount(UINT8 *p_listRetryCount); |
||
910 | void WF_CASetEventNotificationAction(UINT8 eventNotificationAction); |
||
911 | void WF_CAGetEventNotificationAction(UINT8 *p_eventNotificationAction); |
||
912 | void WF_CASetBeaconTimeoutAction(UINT8 beaconTimeoutAction); |
||
913 | void WF_CAGetBeaconTimeoutAction(UINT8 *p_beaconTimeoutAction); |
||
914 | void WF_CASetDeauthAction(UINT8 deauthAction); |
||
915 | void WF_CAGetDeauthAction(UINT8 *p_deauthAction); |
||
916 | void WF_CASetChannelList(UINT8 *p_channelList, UINT8 numChannels); |
||
917 | void WF_CAGetChannelList(UINT8 *p_channelList, UINT8 *p_numChannels); |
||
918 | void WF_CASetListenInterval(UINT16 listenInterval); |
||
919 | void WF_CAGetListenInterval(UINT16 *p_listenInterval); |
||
920 | void WF_CASetBeaconTimeout(UINT8 beaconTimeout); |
||
921 | void WF_CAGetBeaconTimeout(UINT8 *p_beaconTimeout); |
||
922 | void WF_CASetScanCount(UINT8 scanCount); |
||
923 | void WF_CAGetScanCount(UINT8 *p_scanCount); |
||
924 | void WF_CASetMinChannelTime(UINT16 minChannelTime); |
||
925 | void WF_CAGetMinChannelTime(UINT16 *p_minChannelTime); |
||
926 | void WF_CASetMaxChannelTime(UINT16 minChannelTime); |
||
927 | void WF_CAGetMaxChannelTime(UINT16 *p_minChannelTime); |
||
928 | void WF_CASetProbeDelay(UINT16 probeDelay); |
||
929 | void WF_CAGetProbeDelay(UINT16 *p_probeDelay); |
||
930 | #endif /* WF_USE_INDIVIDUAL_SET_GETS */ |
||
931 | |||
932 | /*--------------------------------*/ |
||
933 | /* Connection Manager Functions */ |
||
934 | /*--------------------------------*/ |
||
935 | void WF_CMConnect(UINT8 CpId); |
||
936 | void WF_CMDisconnect(void); |
||
937 | void WF_CMGetConnectionState(UINT8 *p_state, UINT8 *p_currentCpId); |
||
938 | |||
939 | /*----------------------------*/ |
||
940 | /* Tx Power Control Functions */ |
||
941 | /*----------------------------*/ |
||
942 | #if defined(WF_USE_TX_POWER_CONTROL_FUNCTIONS) |
||
943 | void WF_ThrottleTableSet(tWFThrottleTable *p_table); |
||
944 | void WF_ThrottleTableGet(tWFThrottleTable *p_table); |
||
945 | void WF_ThrottleTableEnable(void); |
||
946 | void WF_ThrottleTableDisable(UINT8 txPower); |
||
947 | void WF_ThrottleTableGetState(BOOL *p_state, UINT8 *p_bitRate); |
||
948 | void WF_TxPowerSetMinMax(INT8 minTxPower, INT8 maxTxPower); |
||
949 | void WF_TxPowerGetMinMax(INT8 *p_minTxPower, INT8 *p_maxTxPower); |
||
950 | void WF_TxPowerGetFactoryMax(INT8 *p_factoryMaxTxPower); |
||
951 | #endif |
||
952 | |||
953 | /*----------------------------*/ |
||
954 | /* Power Management Functions */ |
||
955 | /*----------------------------*/ |
||
956 | #if defined(WF_USE_POWER_SAVE_FUNCTIONS) |
||
957 | void WF_PsPollDisable(void); |
||
958 | void WF_PsPollEnable(BOOL rxDtim); |
||
959 | void WF_GetPowerSaveState(UINT8 *p_powerSaveState); |
||
960 | void WF_HibernateEnable(void); |
||
961 | #endif |
||
962 | |||
963 | /*-------------------------*/ |
||
964 | /* RTS Threshold Functions */ |
||
965 | /*-------------------------*/ |
||
966 | void WF_SetRtsThreshold(UINT16 rtsThreshold); |
||
967 | void WF_GetRtsThreshold(UINT16 *p_rtsThreshold); |
||
968 | |||
969 | /*---------------------------*/ |
||
970 | /* Regional Domain Functions */ |
||
971 | /*---------------------------*/ |
||
972 | void WF_SetRegionalDomain(UINT8 regionalDomain); /* see tWFRegDomain enumerated types */ |
||
973 | void WF_GetRegionalDomain(UINT8 *p_regionalDomain); /* see tWFRegDomain enumerated types */ |
||
974 | |||
975 | /*---------------------*/ |
||
976 | /* Multicast Functions */ |
||
977 | /*---------------------*/ |
||
978 | #if defined(WF_USE_MULTICAST_FUNCTIONS) |
||
979 | void WF_SetMultiCastFilter(UINT8 multicastFilterId, UINT8 multicastAddress[6]); |
||
980 | void WF_GetMultiCastFilter(UINT8 multicastFilterId, UINT8 multicastAddress[6]); |
||
981 | #endif |
||
982 | |||
983 | /* MAC Stats */ |
||
984 | void WF_GetMacStats(tWFMacStats *p_macStats); |
||
985 | |||
986 | /*----------------*/ |
||
987 | /* Scan Functions */ |
||
988 | /*----------------*/ |
||
989 | #if defined(WF_USE_SCAN_FUNCTIONS) |
||
990 | void WF_Scan(UINT8 CpId); |
||
991 | void WF_ScanGetResult(UINT8 listIndex, |
||
992 | tWFScanResult *p_scanResult); |
||
993 | #endif /* WF_SCAN_FUNCTIONS */ |
||
994 | |||
995 | /*------------------------------*/ |
||
996 | /* External Interrupt Functions */ |
||
997 | /*------------------------------*/ |
||
998 | void WF_EintInit(void); |
||
999 | void WF_EintEnable(void); |
||
1000 | void WF_EintDisable(void); |
||
1001 | BOOL WF_EintIsDisabled(void); |
||
1002 | void WFEintHandler(void); |
||
1003 | /* WF_EintIsPending - used by the WF Driver to test for whether */ |
||
1004 | /* external interrupts are pending. The pending case is not something */ |
||
1005 | /* that should normally happen. It says we have the interrupt line */ |
||
1006 | /* asserted but the WF_EINT_IF bit is not set, thus, no interrupt generated */ |
||
1007 | BOOL WF_EintIsPending(void); |
||
1008 | |||
1009 | /*---------------*/ |
||
1010 | /* SPI Functions */ |
||
1011 | /*---------------*/ |
||
1012 | void WF_SpiInit(void); |
||
1013 | void WF_SpiEnableChipSelect(void); |
||
1014 | void WF_SpiDisableChipSelect(void); |
||
1015 | void WFSpiTxRx(UINT8 *p_txBuf, |
||
1016 | UINT16 txLen, |
||
1017 | UINT8 *p_rxBuf, |
||
1018 | UINT16 rxLen); |
||
1019 | |||
1020 | #if defined (__18CXX) |
||
1021 | void WFSpiTxRx_Rom(ROM UINT8 *p_txBuf, |
||
1022 | UINT16 txLen, |
||
1023 | UINT8 *p_rxBuf, |
||
1024 | UINT16 rxLen); |
||
1025 | #endif /* __18CXX */ |
||
1026 | |||
1027 | |||
1028 | |||
1029 | #if defined(WF_USE_DATA_TX_RX_FUNCTIONS) |
||
1030 | /*------------*/ |
||
1031 | /* Data Tx/Rx */ |
||
1032 | /*------------*/ |
||
1033 | void WF_TxDataAllocateBuffer(UINT16 txDataPacketLength); |
||
1034 | void WF_TxDataWrite(UINT8 *p_txData, |
||
1035 | UINT16 length, |
||
1036 | UINT16 startIndex); |
||
1037 | void WF_TxDataSendPacket(UINT16 length); |
||
1038 | void WF_RxDataReadPacket(UINT8 *p_rxData, |
||
1039 | UINT16 length, |
||
1040 | UINT16 startIndex); |
||
1041 | void WF_RxDataDeallocateBuffer(void); |
||
1042 | #endif |
||
1043 | |||
1044 | /*--------------------------*/ |
||
1045 | /* Event Handling Functions */ |
||
1046 | /*--------------------------*/ |
||
1047 | /******************************************************************************* |
||
1048 | Function: |
||
1049 | void WF_ProcessEvent(UINT8 event, |
||
1050 | UINT16 eventInfo); |
||
1051 | |||
1052 | Summary: |
||
1053 | Process events from the MRF24WB0M |
||
1054 | |||
1055 | Description: |
||
1056 | |||
1057 | Precondition: |
||
1058 | MACInit must be called first. |
||
1059 | |||
1060 | Parameters: |
||
1061 | event -- The event that occurred |
||
1062 | eventInfo -- Additional information about the event. This is not applicable |
||
1063 | to all events. |
||
1064 | |||
1065 | Returns: |
||
1066 | None. |
||
1067 | |||
1068 | Remarks: |
||
1069 | None. |
||
1070 | *****************************************************************************/ |
||
1071 | void WF_ProcessEvent(UINT8 event, UINT16 eventInfo); |
||
1072 | |||
1073 | #if defined(WF_CM_DEBUG) |
||
1074 | /*--------------------------*/ |
||
1075 | /* CM Info Functions */ |
||
1076 | /*--------------------------*/ |
||
1077 | void WF_CMInfoGetFSMStats(tWFCMInfoFSMStats *p_info); |
||
1078 | #endif |
||
1079 | |||
1080 | #endif /* __WF_API_H_ */ |
||
1081 | |||
1082 | |||
1083 |
Powered by WebSVN v2.8.3