]>
Commit | Line | Data |
---|---|---|
c5c77ba1 JK |
1 | /* ////////////////////////////////////////////////////////////////////////// */ |
2 | /* */ | |
3 | /* Copyright (c) Atmel Corporation. All rights reserved. */ | |
4 | /* */ | |
5 | /* Module Name: wilc_wlan_cfg.c */ | |
6 | /* */ | |
7 | /* */ | |
8 | /* ///////////////////////////////////////////////////////////////////////// */ | |
9 | ||
0c9fc33c | 10 | #include <linux/string.h> |
c5c77ba1 JK |
11 | #include "wilc_wlan_if.h" |
12 | #include "wilc_wlan.h" | |
13 | #include "wilc_wlan_cfg.h" | |
14 | #include "coreconfigurator.h" | |
15 | ||
c5c77ba1 JK |
16 | /******************************************** |
17 | * | |
18 | * Global Data | |
19 | * | |
20 | ********************************************/ | |
7cc386e9 CL |
21 | enum cfg_cmd_type { |
22 | CFG_BYTE_CMD = 0, | |
23 | CFG_HWORD_CMD = 1, | |
24 | CFG_WORD_CMD = 2, | |
25 | CFG_STR_CMD = 3, | |
26 | CFG_BIN_CMD = 4 | |
27 | }; | |
c5c77ba1 | 28 | |
6a707a9e | 29 | struct wilc_mac_cfg { |
c5c77ba1 | 30 | int mac_status; |
51e825f7 CL |
31 | u8 mac_address[7]; |
32 | u8 ip_address[5]; | |
33 | u8 bssid[7]; | |
34 | u8 ssid[34]; | |
35 | u8 firmware_version[129]; | |
36 | u8 supp_rate[24]; | |
37 | u8 wep_key[28]; | |
38 | u8 i_psk[66]; | |
76e6121c | 39 | u8 hw_product_version[33]; |
51e825f7 CL |
40 | u8 phyversion[17]; |
41 | u8 supp_username[21]; | |
42 | u8 supp_password[64]; | |
43 | u8 assoc_req[256]; | |
44 | u8 assoc_rsp[256]; | |
45 | u8 firmware_info[8]; | |
46 | u8 scan_result[256]; | |
47 | u8 scan_result1[256]; | |
6a707a9e | 48 | }; |
c5c77ba1 | 49 | |
6a707a9e | 50 | static struct wilc_mac_cfg g_mac; |
c5c77ba1 | 51 | |
837f9989 | 52 | static struct wilc_cfg_byte g_cfg_byte[] = { |
c5c77ba1 JK |
53 | {WID_BSS_TYPE, 0}, |
54 | {WID_CURRENT_TX_RATE, 0}, | |
55 | {WID_CURRENT_CHANNEL, 0}, | |
56 | {WID_PREAMBLE, 0}, | |
57 | {WID_11G_OPERATING_MODE, 0}, | |
58 | {WID_STATUS, 0}, | |
59 | {WID_SCAN_TYPE, 0}, | |
60 | {WID_KEY_ID, 0}, | |
61 | {WID_QOS_ENABLE, 0}, | |
62 | {WID_POWER_MANAGEMENT, 0}, | |
63 | {WID_11I_MODE, 0}, | |
64 | {WID_AUTH_TYPE, 0}, | |
65 | {WID_SITE_SURVEY, 0}, | |
66 | {WID_LISTEN_INTERVAL, 0}, | |
67 | {WID_DTIM_PERIOD, 0}, | |
68 | {WID_ACK_POLICY, 0}, | |
69 | {WID_BCAST_SSID, 0}, | |
70 | {WID_REKEY_POLICY, 0}, | |
71 | {WID_SHORT_SLOT_ALLOWED, 0}, | |
72 | {WID_START_SCAN_REQ, 0}, | |
73 | {WID_RSSI, 0}, | |
74 | {WID_LINKSPEED, 0}, | |
75 | {WID_AUTO_RX_SENSITIVITY, 0}, | |
76 | {WID_DATAFLOW_CONTROL, 0}, | |
77 | {WID_SCAN_FILTER, 0}, | |
78 | {WID_11N_PROT_MECH, 0}, | |
79 | {WID_11N_ERP_PROT_TYPE, 0}, | |
80 | {WID_11N_ENABLE, 0}, | |
81 | {WID_11N_OPERATING_MODE, 0}, | |
82 | {WID_11N_OBSS_NONHT_DETECTION, 0}, | |
83 | {WID_11N_HT_PROT_TYPE, 0}, | |
84 | {WID_11N_RIFS_PROT_ENABLE, 0}, | |
85 | {WID_11N_SMPS_MODE, 0}, | |
86 | {WID_11N_CURRENT_TX_MCS, 0}, | |
87 | {WID_11N_SHORT_GI_ENABLE, 0}, | |
88 | {WID_RIFS_MODE, 0}, | |
89 | {WID_TX_ABORT_CONFIG, 0}, | |
90 | {WID_11N_IMMEDIATE_BA_ENABLED, 0}, | |
91 | {WID_11N_TXOP_PROT_DISABLE, 0}, | |
92 | {WID_NIL, 0} | |
93 | }; | |
94 | ||
837f9989 | 95 | static struct wilc_cfg_hword g_cfg_hword[] = { |
c5c77ba1 JK |
96 | {WID_LINK_LOSS_THRESHOLD, 0}, |
97 | {WID_RTS_THRESHOLD, 0}, | |
98 | {WID_FRAG_THRESHOLD, 0}, | |
99 | {WID_SHORT_RETRY_LIMIT, 0}, | |
100 | {WID_LONG_RETRY_LIMIT, 0}, | |
101 | {WID_BEACON_INTERVAL, 0}, | |
102 | {WID_RX_SENSE, 0}, | |
103 | {WID_ACTIVE_SCAN_TIME, 0}, | |
104 | {WID_PASSIVE_SCAN_TIME, 0}, | |
105 | {WID_SITE_SURVEY_SCAN_TIME, 0}, | |
106 | {WID_JOIN_START_TIMEOUT, 0}, | |
107 | {WID_AUTH_TIMEOUT, 0}, | |
108 | {WID_ASOC_TIMEOUT, 0}, | |
109 | {WID_11I_PROTOCOL_TIMEOUT, 0}, | |
110 | {WID_EAPOL_RESPONSE_TIMEOUT, 0}, | |
111 | {WID_11N_SIG_QUAL_VAL, 0}, | |
112 | {WID_CCA_THRESHOLD, 0}, | |
113 | {WID_NIL, 0} | |
114 | }; | |
115 | ||
837f9989 | 116 | static struct wilc_cfg_word g_cfg_word[] = { |
c5c77ba1 JK |
117 | {WID_FAILED_COUNT, 0}, |
118 | {WID_RETRY_COUNT, 0}, | |
119 | {WID_MULTIPLE_RETRY_COUNT, 0}, | |
120 | {WID_FRAME_DUPLICATE_COUNT, 0}, | |
121 | {WID_ACK_FAILURE_COUNT, 0}, | |
122 | {WID_RECEIVED_FRAGMENT_COUNT, 0}, | |
123 | {WID_MCAST_RECEIVED_FRAME_COUNT, 0}, | |
124 | {WID_FCS_ERROR_COUNT, 0}, | |
125 | {WID_SUCCESS_FRAME_COUNT, 0}, | |
126 | {WID_TX_FRAGMENT_COUNT, 0}, | |
127 | {WID_TX_MULTICAST_FRAME_COUNT, 0}, | |
128 | {WID_RTS_SUCCESS_COUNT, 0}, | |
129 | {WID_RTS_FAILURE_COUNT, 0}, | |
130 | {WID_WEP_UNDECRYPTABLE_COUNT, 0}, | |
131 | {WID_REKEY_PERIOD, 0}, | |
132 | {WID_REKEY_PACKET_COUNT, 0}, | |
133 | {WID_HW_RX_COUNT, 0}, | |
134 | {WID_GET_INACTIVE_TIME, 0}, | |
135 | {WID_NIL, 0} | |
136 | ||
137 | }; | |
138 | ||
837f9989 | 139 | static struct wilc_cfg_str g_cfg_str[] = { |
c5c77ba1 JK |
140 | {WID_SSID, g_mac.ssid}, /* 33 + 1 bytes */ |
141 | {WID_FIRMWARE_VERSION, g_mac.firmware_version}, | |
142 | {WID_OPERATIONAL_RATE_SET, g_mac.supp_rate}, | |
143 | {WID_BSSID, g_mac.bssid}, /* 6 bytes */ | |
144 | {WID_WEP_KEY_VALUE, g_mac.wep_key}, /* 27 bytes */ | |
145 | {WID_11I_PSK, g_mac.i_psk}, /* 65 bytes */ | |
76e6121c | 146 | {WID_HARDWARE_VERSION, g_mac.hw_product_version}, |
c5c77ba1 JK |
147 | {WID_MAC_ADDR, g_mac.mac_address}, |
148 | {WID_PHY_VERSION, g_mac.phyversion}, | |
149 | {WID_SUPP_USERNAME, g_mac.supp_username}, | |
150 | {WID_SUPP_PASSWORD, g_mac.supp_password}, | |
151 | {WID_SITE_SURVEY_RESULTS, g_mac.scan_result}, | |
152 | {WID_SITE_SURVEY_RESULTS, g_mac.scan_result1}, | |
c5c77ba1 JK |
153 | {WID_ASSOC_REQ_INFO, g_mac.assoc_req}, |
154 | {WID_ASSOC_RES_INFO, g_mac.assoc_rsp}, | |
c5c77ba1 JK |
155 | {WID_FIRMWARE_INFO, g_mac.firmware_version}, |
156 | {WID_IP_ADDRESS, g_mac.ip_address}, | |
157 | {WID_NIL, NULL} | |
158 | }; | |
159 | ||
160 | /******************************************** | |
161 | * | |
162 | * Configuration Functions | |
163 | * | |
164 | ********************************************/ | |
165 | ||
fbc2fe16 | 166 | static int wilc_wlan_cfg_set_byte(u8 *frame, u32 offset, u16 id, u8 val8) |
c5c77ba1 | 167 | { |
51e825f7 | 168 | u8 *buf; |
c5c77ba1 JK |
169 | |
170 | if ((offset + 4) >= MAX_CFG_FRAME_SIZE) | |
171 | return 0; | |
172 | ||
173 | buf = &frame[offset]; | |
174 | ||
51e825f7 CL |
175 | buf[0] = (u8)id; |
176 | buf[1] = (u8)(id >> 8); | |
c5c77ba1 JK |
177 | buf[2] = 1; |
178 | buf[3] = val8; | |
179 | return 4; | |
180 | } | |
181 | ||
fbc2fe16 | 182 | static int wilc_wlan_cfg_set_hword(u8 *frame, u32 offset, u16 id, u16 val16) |
c5c77ba1 | 183 | { |
51e825f7 | 184 | u8 *buf; |
c5c77ba1 JK |
185 | |
186 | if ((offset + 5) >= MAX_CFG_FRAME_SIZE) | |
187 | return 0; | |
188 | ||
189 | buf = &frame[offset]; | |
190 | ||
51e825f7 CL |
191 | buf[0] = (u8)id; |
192 | buf[1] = (u8)(id >> 8); | |
c5c77ba1 | 193 | buf[2] = 2; |
51e825f7 CL |
194 | buf[3] = (u8)val16; |
195 | buf[4] = (u8)(val16 >> 8); | |
c5c77ba1 JK |
196 | |
197 | return 5; | |
198 | } | |
199 | ||
fbc2fe16 | 200 | static int wilc_wlan_cfg_set_word(u8 *frame, u32 offset, u16 id, u32 val32) |
c5c77ba1 | 201 | { |
51e825f7 | 202 | u8 *buf; |
c5c77ba1 JK |
203 | |
204 | if ((offset + 7) >= MAX_CFG_FRAME_SIZE) | |
205 | return 0; | |
206 | ||
207 | buf = &frame[offset]; | |
208 | ||
51e825f7 CL |
209 | buf[0] = (u8)id; |
210 | buf[1] = (u8)(id >> 8); | |
c5c77ba1 | 211 | buf[2] = 4; |
51e825f7 CL |
212 | buf[3] = (u8)val32; |
213 | buf[4] = (u8)(val32 >> 8); | |
214 | buf[5] = (u8)(val32 >> 16); | |
215 | buf[6] = (u8)(val32 >> 24); | |
c5c77ba1 JK |
216 | |
217 | return 7; | |
218 | } | |
219 | ||
fbc2fe16 | 220 | static int wilc_wlan_cfg_set_str(u8 *frame, u32 offset, u16 id, u8 *str, u32 size) |
c5c77ba1 | 221 | { |
51e825f7 | 222 | u8 *buf; |
c5c77ba1 JK |
223 | |
224 | if ((offset + size + 3) >= MAX_CFG_FRAME_SIZE) | |
225 | return 0; | |
226 | ||
227 | buf = &frame[offset]; | |
228 | ||
51e825f7 CL |
229 | buf[0] = (u8)id; |
230 | buf[1] = (u8)(id >> 8); | |
231 | buf[2] = (u8)size; | |
c5c77ba1 JK |
232 | |
233 | if ((str != NULL) && (size != 0)) | |
234 | memcpy(&buf[3], str, size); | |
235 | ||
236 | return (size + 3); | |
237 | } | |
238 | ||
fbc2fe16 | 239 | static int wilc_wlan_cfg_set_bin(u8 *frame, u32 offset, u16 id, u8 *b, u32 size) |
c5c77ba1 | 240 | { |
51e825f7 | 241 | u8 *buf; |
fbc2fe16 | 242 | u32 i; |
51e825f7 | 243 | u8 checksum = 0; |
c5c77ba1 JK |
244 | |
245 | if ((offset + size + 5) >= MAX_CFG_FRAME_SIZE) | |
246 | return 0; | |
247 | ||
248 | buf = &frame[offset]; | |
51e825f7 CL |
249 | buf[0] = (u8)id; |
250 | buf[1] = (u8)(id >> 8); | |
251 | buf[2] = (u8)size; | |
252 | buf[3] = (u8)(size >> 8); | |
c5c77ba1 JK |
253 | |
254 | if ((b != NULL) && (size != 0)) { | |
255 | memcpy(&buf[4], b, size); | |
256 | for (i = 0; i < size; i++) { | |
257 | checksum += buf[i + 4]; | |
258 | } | |
259 | } | |
260 | ||
261 | buf[size + 4] = checksum; | |
262 | ||
263 | return (size + 5); | |
264 | } | |
265 | ||
266 | /******************************************** | |
267 | * | |
268 | * Configuration Response Functions | |
269 | * | |
270 | ********************************************/ | |
271 | ||
51e825f7 | 272 | static void wilc_wlan_parse_response_frame(u8 *info, int size) |
c5c77ba1 | 273 | { |
fbc2fe16 | 274 | u32 wid, len = 0, i = 0; |
c5c77ba1 JK |
275 | |
276 | while (size > 0) { | |
277 | i = 0; | |
278 | wid = info[0] | (info[1] << 8); | |
9e6627ac | 279 | wid = cpu_to_le32(wid); |
e3f16965 | 280 | |
c5c77ba1 JK |
281 | switch ((wid >> 12) & 0x7) { |
282 | case WID_CHAR: | |
283 | do { | |
284 | if (g_cfg_byte[i].id == WID_NIL) | |
285 | break; | |
286 | ||
287 | if (g_cfg_byte[i].id == wid) { | |
288 | g_cfg_byte[i].val = info[3]; | |
289 | break; | |
290 | } | |
291 | i++; | |
292 | } while (1); | |
293 | len = 2; | |
294 | break; | |
295 | ||
296 | case WID_SHORT: | |
297 | do { | |
298 | if (g_cfg_hword[i].id == WID_NIL) | |
299 | break; | |
300 | ||
301 | if (g_cfg_hword[i].id == wid) { | |
9e6627ac | 302 | g_cfg_hword[i].val = cpu_to_le16(info[3] | (info[4] << 8)); |
c5c77ba1 JK |
303 | break; |
304 | } | |
305 | i++; | |
306 | } while (1); | |
307 | len = 3; | |
308 | break; | |
309 | ||
310 | case WID_INT: | |
311 | do { | |
312 | if (g_cfg_word[i].id == WID_NIL) | |
313 | break; | |
314 | ||
315 | if (g_cfg_word[i].id == wid) { | |
9e6627ac | 316 | g_cfg_word[i].val = cpu_to_le32(info[3] | (info[4] << 8) | (info[5] << 16) | (info[6] << 24)); |
c5c77ba1 JK |
317 | break; |
318 | } | |
319 | i++; | |
320 | } while (1); | |
321 | len = 5; | |
322 | break; | |
323 | ||
324 | case WID_STR: | |
325 | do { | |
326 | if (g_cfg_str[i].id == WID_NIL) | |
327 | break; | |
328 | ||
329 | if (g_cfg_str[i].id == wid) { | |
330 | if (wid == WID_SITE_SURVEY_RESULTS) { | |
331 | static int toggle; | |
8dfaafd6 | 332 | |
c5c77ba1 JK |
333 | i += toggle; |
334 | toggle ^= 1; | |
335 | } | |
336 | memcpy(g_cfg_str[i].str, &info[2], (info[2] + 1)); | |
337 | break; | |
338 | } | |
339 | i++; | |
340 | } while (1); | |
341 | len = 1 + info[2]; | |
342 | break; | |
343 | ||
344 | default: | |
345 | break; | |
346 | } | |
347 | size -= (2 + len); | |
348 | info += (2 + len); | |
349 | } | |
c5c77ba1 JK |
350 | } |
351 | ||
51e825f7 | 352 | static int wilc_wlan_parse_info_frame(u8 *info, int size) |
c5c77ba1 | 353 | { |
6a707a9e | 354 | struct wilc_mac_cfg *pd = &g_mac; |
fbc2fe16 | 355 | u32 wid, len; |
c5c77ba1 JK |
356 | int type = WILC_CFG_RSP_STATUS; |
357 | ||
358 | wid = info[0] | (info[1] << 8); | |
c5c77ba1 JK |
359 | |
360 | len = info[2]; | |
e3f16965 | 361 | |
c5c77ba1 JK |
362 | if ((len == 1) && (wid == WID_STATUS)) { |
363 | pd->mac_status = info[3]; | |
364 | type = WILC_CFG_RSP_STATUS; | |
365 | } | |
366 | ||
367 | return type; | |
368 | } | |
369 | ||
c5c77ba1 JK |
370 | /******************************************** |
371 | * | |
372 | * Configuration Exported Functions | |
373 | * | |
374 | ********************************************/ | |
375 | ||
17e8f165 | 376 | int wilc_wlan_cfg_set_wid(u8 *frame, u32 offset, u16 id, u8 *buf, int size) |
c5c77ba1 | 377 | { |
51e825f7 | 378 | u8 type = (id >> 12) & 0xf; |
c5c77ba1 JK |
379 | int ret = 0; |
380 | ||
9e58c36c | 381 | if (type == CFG_BYTE_CMD) { |
c5c77ba1 JK |
382 | if (size >= 1) |
383 | ret = wilc_wlan_cfg_set_byte(frame, offset, id, *buf); | |
9e58c36c | 384 | } else if (type == CFG_HWORD_CMD) { |
c5c77ba1 | 385 | if (size >= 2) |
ec53adfe | 386 | ret = wilc_wlan_cfg_set_hword(frame, offset, id, *((u16 *)buf)); |
9e58c36c | 387 | } else if (type == CFG_WORD_CMD) { |
c5c77ba1 | 388 | if (size >= 4) |
fbc2fe16 | 389 | ret = wilc_wlan_cfg_set_word(frame, offset, id, *((u32 *)buf)); |
9e58c36c | 390 | } else if (type == CFG_STR_CMD) { |
c5c77ba1 | 391 | ret = wilc_wlan_cfg_set_str(frame, offset, id, buf, size); |
9e58c36c | 392 | } else if (type == CFG_BIN_CMD) { |
c5c77ba1 | 393 | ret = wilc_wlan_cfg_set_bin(frame, offset, id, buf, size); |
c5c77ba1 JK |
394 | } |
395 | ||
396 | return ret; | |
397 | } | |
398 | ||
ec1b86bf | 399 | int wilc_wlan_cfg_get_wid(u8 *frame, u32 offset, u16 id) |
c5c77ba1 | 400 | { |
51e825f7 | 401 | u8 *buf; |
c5c77ba1 JK |
402 | |
403 | if ((offset + 2) >= MAX_CFG_FRAME_SIZE) | |
404 | return 0; | |
405 | ||
406 | buf = &frame[offset]; | |
407 | ||
51e825f7 CL |
408 | buf[0] = (u8)id; |
409 | buf[1] = (u8)(id >> 8); | |
c5c77ba1 JK |
410 | |
411 | return 2; | |
412 | } | |
413 | ||
355cca2a | 414 | int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 buffer_size) |
c5c77ba1 | 415 | { |
fbc2fe16 | 416 | u32 type = (wid >> 12) & 0xf; |
c5c77ba1 JK |
417 | int i, ret = 0; |
418 | ||
419 | if (wid == WID_STATUS) { | |
fbc2fe16 | 420 | *((u32 *)buffer) = g_mac.mac_status; |
c5c77ba1 JK |
421 | return 4; |
422 | } | |
423 | ||
424 | i = 0; | |
9e58c36c | 425 | if (type == CFG_BYTE_CMD) { |
c5c77ba1 JK |
426 | do { |
427 | if (g_cfg_byte[i].id == WID_NIL) | |
428 | break; | |
429 | ||
430 | if (g_cfg_byte[i].id == wid) { | |
431 | memcpy(buffer, &g_cfg_byte[i].val, 1); | |
432 | ret = 1; | |
433 | break; | |
434 | } | |
435 | i++; | |
436 | } while (1); | |
9e58c36c | 437 | } else if (type == CFG_HWORD_CMD) { |
c5c77ba1 JK |
438 | do { |
439 | if (g_cfg_hword[i].id == WID_NIL) | |
440 | break; | |
441 | ||
442 | if (g_cfg_hword[i].id == wid) { | |
443 | memcpy(buffer, &g_cfg_hword[i].val, 2); | |
444 | ret = 2; | |
445 | break; | |
446 | } | |
447 | i++; | |
448 | } while (1); | |
9e58c36c | 449 | } else if (type == CFG_WORD_CMD) { |
c5c77ba1 JK |
450 | do { |
451 | if (g_cfg_word[i].id == WID_NIL) | |
452 | break; | |
453 | ||
454 | if (g_cfg_word[i].id == wid) { | |
455 | memcpy(buffer, &g_cfg_word[i].val, 4); | |
456 | ret = 4; | |
457 | break; | |
458 | } | |
459 | i++; | |
460 | } while (1); | |
9e58c36c | 461 | } else if (type == CFG_STR_CMD) { |
c5c77ba1 JK |
462 | do { |
463 | if (g_cfg_str[i].id == WID_NIL) | |
464 | break; | |
465 | ||
466 | if (g_cfg_str[i].id == wid) { | |
fbc2fe16 | 467 | u32 size = g_cfg_str[i].str[0]; |
8dfaafd6 | 468 | |
c5c77ba1 JK |
469 | if (buffer_size >= size) { |
470 | if (g_cfg_str[i].id == WID_SITE_SURVEY_RESULTS) { | |
471 | static int toggle; | |
8dfaafd6 | 472 | |
c5c77ba1 JK |
473 | i += toggle; |
474 | toggle ^= 1; | |
475 | ||
476 | } | |
477 | memcpy(buffer, &g_cfg_str[i].str[1], size); | |
478 | ret = size; | |
479 | } | |
480 | break; | |
481 | } | |
482 | i++; | |
483 | } while (1); | |
c5c77ba1 JK |
484 | } |
485 | ||
486 | return ret; | |
487 | } | |
488 | ||
cd04d221 GL |
489 | int wilc_wlan_cfg_indicate_rx(struct wilc *wilc, u8 *frame, int size, |
490 | struct wilc_cfg_rsp *rsp) | |
c5c77ba1 JK |
491 | { |
492 | int ret = 1; | |
51e825f7 CL |
493 | u8 msg_type; |
494 | u8 msg_id; | |
c5c77ba1 JK |
495 | |
496 | msg_type = frame[0]; | |
497 | msg_id = frame[1]; /* seq no */ | |
c5c77ba1 JK |
498 | frame += 4; |
499 | size -= 4; | |
500 | ||
501 | /** | |
502 | * The valid types of response messages are 'R' (Response), 'I' (Information), and 'N' (Network Information) | |
503 | **/ | |
504 | ||
505 | switch (msg_type) { | |
506 | case 'R': | |
507 | wilc_wlan_parse_response_frame(frame, size); | |
508 | rsp->type = WILC_CFG_RSP; | |
509 | rsp->seq_no = msg_id; | |
510 | break; | |
511 | ||
512 | case 'I': | |
513 | rsp->type = wilc_wlan_parse_info_frame(frame, size); | |
514 | rsp->seq_no = msg_id; | |
515 | /*call host interface info parse as well*/ | |
cd04d221 | 516 | wilc_gnrl_async_info_received(wilc, frame - 4, size + 4); |
c5c77ba1 JK |
517 | break; |
518 | ||
c5c77ba1 | 519 | case 'N': |
cd04d221 | 520 | wilc_network_info_received(wilc, frame - 4, size + 4); |
c5c77ba1 JK |
521 | rsp->type = 0; |
522 | break; | |
523 | ||
c5c77ba1 | 524 | case 'S': |
cd04d221 | 525 | wilc_scan_complete_received(wilc, frame - 4, size + 4); |
c5c77ba1 JK |
526 | break; |
527 | ||
c5c77ba1 | 528 | default: |
c5c77ba1 JK |
529 | rsp->type = 0; |
530 | rsp->seq_no = msg_id; | |
531 | ret = 0; | |
532 | break; | |
533 | } | |
534 | ||
535 | return ret; | |
536 | } | |
537 | ||
bda2b2fb | 538 | int wilc_wlan_cfg_init(void) |
c5c77ba1 | 539 | { |
6a707a9e | 540 | memset((void *)&g_mac, 0, sizeof(struct wilc_mac_cfg)); |
c5c77ba1 JK |
541 | return 1; |
542 | } |