diff options
Diffstat (limited to 'drivers/net/wireless/libertas/ioctl.c')
-rw-r--r-- | drivers/net/wireless/libertas/ioctl.c | 165 |
1 files changed, 92 insertions, 73 deletions
diff --git a/drivers/net/wireless/libertas/ioctl.c b/drivers/net/wireless/libertas/ioctl.c index a8f76c358992..3f95e97a309e 100644 --- a/drivers/net/wireless/libertas/ioctl.c +++ b/drivers/net/wireless/libertas/ioctl.c | |||
@@ -30,6 +30,7 @@ | |||
30 | static int wlan_set_region(wlan_private * priv, u16 region_code) | 30 | static int wlan_set_region(wlan_private * priv, u16 region_code) |
31 | { | 31 | { |
32 | int i; | 32 | int i; |
33 | int ret = 0; | ||
33 | 34 | ||
34 | for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) { | 35 | for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) { |
35 | // use the region code to search for the index | 36 | // use the region code to search for the index |
@@ -42,17 +43,18 @@ static int wlan_set_region(wlan_private * priv, u16 region_code) | |||
42 | 43 | ||
43 | // if it's unidentified region code | 44 | // if it's unidentified region code |
44 | if (i >= MRVDRV_MAX_REGION_CODE) { | 45 | if (i >= MRVDRV_MAX_REGION_CODE) { |
45 | lbs_pr_debug(1, "region Code not identified\n"); | 46 | lbs_deb_ioctl("region Code not identified\n"); |
46 | LEAVE(); | 47 | ret = -1; |
47 | return -1; | 48 | goto done; |
48 | } | 49 | } |
49 | 50 | ||
50 | if (libertas_set_regiontable(priv, priv->adapter->regioncode, 0)) { | 51 | if (libertas_set_regiontable(priv, priv->adapter->regioncode, 0)) { |
51 | LEAVE(); | 52 | ret = -EINVAL; |
52 | return -EINVAL; | ||
53 | } | 53 | } |
54 | 54 | ||
55 | return 0; | 55 | done: |
56 | lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret); | ||
57 | return ret; | ||
56 | } | 58 | } |
57 | 59 | ||
58 | static inline int hex2int(char c) | 60 | static inline int hex2int(char c) |
@@ -125,8 +127,10 @@ static int wlan_bt_add_ioctl(wlan_private * priv, struct ifreq *req) | |||
125 | char ethaddrs_str[18]; | 127 | char ethaddrs_str[18]; |
126 | char *pos; | 128 | char *pos; |
127 | u8 ethaddr[ETH_ALEN]; | 129 | u8 ethaddr[ETH_ALEN]; |
130 | int ret; | ||
131 | |||
132 | lbs_deb_enter(LBS_DEB_IOCTL); | ||
128 | 133 | ||
129 | ENTER(); | ||
130 | if (copy_from_user(ethaddrs_str, wrq->u.data.pointer, | 134 | if (copy_from_user(ethaddrs_str, wrq->u.data.pointer, |
131 | sizeof(ethaddrs_str))) | 135 | sizeof(ethaddrs_str))) |
132 | return -EFAULT; | 136 | return -EFAULT; |
@@ -136,11 +140,12 @@ static int wlan_bt_add_ioctl(wlan_private * priv, struct ifreq *req) | |||
136 | return -EINVAL; | 140 | return -EINVAL; |
137 | } | 141 | } |
138 | 142 | ||
139 | lbs_pr_debug(1, "BT: adding %s\n", ethaddrs_str); | 143 | lbs_deb_ioctl("BT: adding %s\n", ethaddrs_str); |
140 | LEAVE(); | 144 | ret = libertas_prepare_and_send_command(priv, cmd_bt_access, |
141 | return (libertas_prepare_and_send_command(priv, cmd_bt_access, | ||
142 | cmd_act_bt_access_add, | 145 | cmd_act_bt_access_add, |
143 | cmd_option_waitforrsp, 0, ethaddr)); | 146 | cmd_option_waitforrsp, 0, ethaddr); |
147 | lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret); | ||
148 | return ret; | ||
144 | } | 149 | } |
145 | 150 | ||
146 | /** | 151 | /** |
@@ -156,7 +161,8 @@ static int wlan_bt_del_ioctl(wlan_private * priv, struct ifreq *req) | |||
156 | u8 ethaddr[ETH_ALEN]; | 161 | u8 ethaddr[ETH_ALEN]; |
157 | char *pos; | 162 | char *pos; |
158 | 163 | ||
159 | ENTER(); | 164 | lbs_deb_enter(LBS_DEB_IOCTL); |
165 | |||
160 | if (copy_from_user(ethaddrs_str, wrq->u.data.pointer, | 166 | if (copy_from_user(ethaddrs_str, wrq->u.data.pointer, |
161 | sizeof(ethaddrs_str))) | 167 | sizeof(ethaddrs_str))) |
162 | return -EFAULT; | 168 | return -EFAULT; |
@@ -166,13 +172,14 @@ static int wlan_bt_del_ioctl(wlan_private * priv, struct ifreq *req) | |||
166 | return -EINVAL; | 172 | return -EINVAL; |
167 | } | 173 | } |
168 | 174 | ||
169 | lbs_pr_debug(1, "BT: deleting %s\n", ethaddrs_str); | 175 | lbs_deb_ioctl("BT: deleting %s\n", ethaddrs_str); |
170 | 176 | ||
171 | return (libertas_prepare_and_send_command(priv, | 177 | return (libertas_prepare_and_send_command(priv, |
172 | cmd_bt_access, | 178 | cmd_bt_access, |
173 | cmd_act_bt_access_del, | 179 | cmd_act_bt_access_del, |
174 | cmd_option_waitforrsp, 0, ethaddr)); | 180 | cmd_option_waitforrsp, 0, ethaddr)); |
175 | LEAVE(); | 181 | |
182 | lbs_deb_leave(LBS_DEB_IOCTL); | ||
176 | return 0; | 183 | return 0; |
177 | } | 184 | } |
178 | 185 | ||
@@ -183,7 +190,7 @@ static int wlan_bt_del_ioctl(wlan_private * priv, struct ifreq *req) | |||
183 | */ | 190 | */ |
184 | static int wlan_bt_reset_ioctl(wlan_private * priv) | 191 | static int wlan_bt_reset_ioctl(wlan_private * priv) |
185 | { | 192 | { |
186 | ENTER(); | 193 | lbs_deb_enter(LBS_DEB_IOCTL); |
187 | 194 | ||
188 | lbs_pr_alert( "BT: resetting\n"); | 195 | lbs_pr_alert( "BT: resetting\n"); |
189 | 196 | ||
@@ -192,7 +199,7 @@ static int wlan_bt_reset_ioctl(wlan_private * priv) | |||
192 | cmd_act_bt_access_reset, | 199 | cmd_act_bt_access_reset, |
193 | cmd_option_waitforrsp, 0, NULL)); | 200 | cmd_option_waitforrsp, 0, NULL)); |
194 | 201 | ||
195 | LEAVE(); | 202 | lbs_deb_leave(LBS_DEB_IOCTL); |
196 | return 0; | 203 | return 0; |
197 | } | 204 | } |
198 | 205 | ||
@@ -216,10 +223,10 @@ static int wlan_bt_list_ioctl(wlan_private * priv, struct ifreq *req) | |||
216 | char *pbuf = outstr; | 223 | char *pbuf = outstr; |
217 | int ret; | 224 | int ret; |
218 | 225 | ||
219 | ENTER(); | 226 | lbs_deb_enter(LBS_DEB_IOCTL); |
220 | 227 | ||
221 | if (copy_from_user(outstr, wrq->u.data.pointer, sizeof(outstr))) { | 228 | if (copy_from_user(outstr, wrq->u.data.pointer, sizeof(outstr))) { |
222 | lbs_pr_debug(1, "Copy from user failed\n"); | 229 | lbs_deb_ioctl("Copy from user failed\n"); |
223 | return -1; | 230 | return -1; |
224 | } | 231 | } |
225 | param.id = simple_strtoul(outstr, NULL, 10); | 232 | param.id = simple_strtoul(outstr, NULL, 10); |
@@ -246,11 +253,11 @@ static int wlan_bt_list_ioctl(wlan_private * priv, struct ifreq *req) | |||
246 | wrq->u.data.length = strlen(outstr); | 253 | wrq->u.data.length = strlen(outstr); |
247 | if (copy_to_user(wrq->u.data.pointer, (char *)outstr, | 254 | if (copy_to_user(wrq->u.data.pointer, (char *)outstr, |
248 | wrq->u.data.length)) { | 255 | wrq->u.data.length)) { |
249 | lbs_pr_debug(1, "BT_LIST: Copy to user failed!\n"); | 256 | lbs_deb_ioctl("BT_LIST: Copy to user failed!\n"); |
250 | return -EFAULT; | 257 | return -EFAULT; |
251 | } | 258 | } |
252 | 259 | ||
253 | LEAVE(); | 260 | lbs_deb_leave(LBS_DEB_IOCTL); |
254 | return 0; | 261 | return 0; |
255 | } | 262 | } |
256 | 263 | ||
@@ -278,8 +285,10 @@ static int wlan_fwt_add_ioctl(wlan_private * priv, struct ifreq *req) | |||
278 | char in_str[128]; | 285 | char in_str[128]; |
279 | static struct cmd_ds_fwt_access fwt_access; | 286 | static struct cmd_ds_fwt_access fwt_access; |
280 | char *ptr; | 287 | char *ptr; |
288 | int ret; | ||
289 | |||
290 | lbs_deb_enter(LBS_DEB_IOCTL); | ||
281 | 291 | ||
282 | ENTER(); | ||
283 | if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) | 292 | if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) |
284 | return -EFAULT; | 293 | return -EFAULT; |
285 | 294 | ||
@@ -348,20 +357,22 @@ static int wlan_fwt_add_ioctl(wlan_private * priv, struct ifreq *req) | |||
348 | char ethaddr1_str[18], ethaddr2_str[18]; | 357 | char ethaddr1_str[18], ethaddr2_str[18]; |
349 | eth_addr2str(fwt_access.da, ethaddr1_str); | 358 | eth_addr2str(fwt_access.da, ethaddr1_str); |
350 | eth_addr2str(fwt_access.ra, ethaddr2_str); | 359 | eth_addr2str(fwt_access.ra, ethaddr2_str); |
351 | lbs_pr_debug(1, "FWT_ADD: adding (da:%s,%i,ra:%s)\n", ethaddr1_str, | 360 | lbs_deb_ioctl("FWT_ADD: adding (da:%s,%i,ra:%s)\n", ethaddr1_str, |
352 | fwt_access.dir, ethaddr2_str); | 361 | fwt_access.dir, ethaddr2_str); |
353 | lbs_pr_debug(1, "FWT_ADD: ssn:%u dsn:%u met:%u hop:%u ttl:%u exp:%u slp:%u snr:%u\n", | 362 | lbs_deb_ioctl("FWT_ADD: ssn:%u dsn:%u met:%u hop:%u ttl:%u exp:%u slp:%u snr:%u\n", |
354 | fwt_access.ssn, fwt_access.dsn, fwt_access.metric, | 363 | fwt_access.ssn, fwt_access.dsn, fwt_access.metric, |
355 | fwt_access.hopcount, fwt_access.ttl, fwt_access.expiration, | 364 | fwt_access.hopcount, fwt_access.ttl, fwt_access.expiration, |
356 | fwt_access.sleepmode, fwt_access.snr); | 365 | fwt_access.sleepmode, fwt_access.snr); |
357 | } | 366 | } |
358 | #endif | 367 | #endif |
359 | 368 | ||
360 | LEAVE(); | 369 | ret = libertas_prepare_and_send_command(priv, cmd_fwt_access, |
361 | return (libertas_prepare_and_send_command(priv, cmd_fwt_access, | 370 | cmd_act_fwt_access_add, |
362 | cmd_act_fwt_access_add, | 371 | cmd_option_waitforrsp, 0, |
363 | cmd_option_waitforrsp, 0, | 372 | (void *)&fwt_access); |
364 | (void *)&fwt_access)); | 373 | |
374 | lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret); | ||
375 | return ret; | ||
365 | } | 376 | } |
366 | 377 | ||
367 | /** | 378 | /** |
@@ -376,8 +387,10 @@ static int wlan_fwt_del_ioctl(wlan_private * priv, struct ifreq *req) | |||
376 | char in_str[64]; | 387 | char in_str[64]; |
377 | static struct cmd_ds_fwt_access fwt_access; | 388 | static struct cmd_ds_fwt_access fwt_access; |
378 | char *ptr; | 389 | char *ptr; |
390 | int ret; | ||
391 | |||
392 | lbs_deb_enter(LBS_DEB_IOCTL); | ||
379 | 393 | ||
380 | ENTER(); | ||
381 | if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) | 394 | if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) |
382 | return -EFAULT; | 395 | return -EFAULT; |
383 | 396 | ||
@@ -399,20 +412,21 @@ static int wlan_fwt_del_ioctl(wlan_private * priv, struct ifreq *req) | |||
399 | #ifdef DEBUG | 412 | #ifdef DEBUG |
400 | { | 413 | { |
401 | char ethaddr1_str[18], ethaddr2_str[18]; | 414 | char ethaddr1_str[18], ethaddr2_str[18]; |
402 | lbs_pr_debug(1, "FWT_DEL: line is %s\n", in_str); | 415 | lbs_deb_ioctl("FWT_DEL: line is %s\n", in_str); |
403 | eth_addr2str(fwt_access.da, ethaddr1_str); | 416 | eth_addr2str(fwt_access.da, ethaddr1_str); |
404 | eth_addr2str(fwt_access.ra, ethaddr2_str); | 417 | eth_addr2str(fwt_access.ra, ethaddr2_str); |
405 | lbs_pr_debug(1, "FWT_DEL: removing (da:%s,ra:%s,dir:%d)\n", ethaddr1_str, | 418 | lbs_deb_ioctl("FWT_DEL: removing (da:%s,ra:%s,dir:%d)\n", ethaddr1_str, |
406 | ethaddr2_str, fwt_access.dir); | 419 | ethaddr2_str, fwt_access.dir); |
407 | } | 420 | } |
408 | #endif | 421 | #endif |
409 | 422 | ||
410 | LEAVE(); | 423 | ret = libertas_prepare_and_send_command(priv, |
411 | return (libertas_prepare_and_send_command(priv, | 424 | cmd_fwt_access, |
412 | cmd_fwt_access, | 425 | cmd_act_fwt_access_del, |
413 | cmd_act_fwt_access_del, | 426 | cmd_option_waitforrsp, 0, |
414 | cmd_option_waitforrsp, 0, | 427 | (void *)&fwt_access); |
415 | (void *)&fwt_access)); | 428 | lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret); |
429 | return ret; | ||
416 | } | 430 | } |
417 | 431 | ||
418 | 432 | ||
@@ -453,7 +467,8 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req) | |||
453 | static char out_str[128]; | 467 | static char out_str[128]; |
454 | int ret; | 468 | int ret; |
455 | 469 | ||
456 | ENTER(); | 470 | lbs_deb_enter(LBS_DEB_IOCTL); |
471 | |||
457 | if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) | 472 | if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) |
458 | return -EFAULT; | 473 | return -EFAULT; |
459 | 474 | ||
@@ -465,9 +480,9 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req) | |||
465 | #ifdef DEBUG | 480 | #ifdef DEBUG |
466 | { | 481 | { |
467 | char ethaddr1_str[18]; | 482 | char ethaddr1_str[18]; |
468 | lbs_pr_debug(1, "FWT_LOOKUP: line is %s\n", in_str); | 483 | lbs_deb_ioctl("FWT_LOOKUP: line is %s\n", in_str); |
469 | eth_addr2str(fwt_access.da, ethaddr1_str); | 484 | eth_addr2str(fwt_access.da, ethaddr1_str); |
470 | lbs_pr_debug(1, "FWT_LOOKUP: looking for (da:%s)\n", ethaddr1_str); | 485 | lbs_deb_ioctl("FWT_LOOKUP: looking for (da:%s)\n", ethaddr1_str); |
471 | } | 486 | } |
472 | #endif | 487 | #endif |
473 | 488 | ||
@@ -485,11 +500,11 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req) | |||
485 | wrq->u.data.length = strlen(out_str); | 500 | wrq->u.data.length = strlen(out_str); |
486 | if (copy_to_user(wrq->u.data.pointer, (char *)out_str, | 501 | if (copy_to_user(wrq->u.data.pointer, (char *)out_str, |
487 | wrq->u.data.length)) { | 502 | wrq->u.data.length)) { |
488 | lbs_pr_debug(1, "FWT_LOOKUP: Copy to user failed!\n"); | 503 | lbs_deb_ioctl("FWT_LOOKUP: Copy to user failed!\n"); |
489 | return -EFAULT; | 504 | return -EFAULT; |
490 | } | 505 | } |
491 | 506 | ||
492 | LEAVE(); | 507 | lbs_deb_leave(LBS_DEB_IOCTL); |
493 | return 0; | 508 | return 0; |
494 | } | 509 | } |
495 | 510 | ||
@@ -500,7 +515,7 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req) | |||
500 | */ | 515 | */ |
501 | static int wlan_fwt_reset_ioctl(wlan_private * priv) | 516 | static int wlan_fwt_reset_ioctl(wlan_private * priv) |
502 | { | 517 | { |
503 | lbs_pr_debug(1, "FWT: resetting\n"); | 518 | lbs_deb_ioctl("FWT: resetting\n"); |
504 | 519 | ||
505 | return (libertas_prepare_and_send_command(priv, | 520 | return (libertas_prepare_and_send_command(priv, |
506 | cmd_fwt_access, | 521 | cmd_fwt_access, |
@@ -524,7 +539,8 @@ static int wlan_fwt_list_ioctl(wlan_private * priv, struct ifreq *req) | |||
524 | char *pbuf = out_str; | 539 | char *pbuf = out_str; |
525 | int ret; | 540 | int ret; |
526 | 541 | ||
527 | ENTER(); | 542 | lbs_deb_enter(LBS_DEB_IOCTL); |
543 | |||
528 | if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) | 544 | if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) |
529 | return -EFAULT; | 545 | return -EFAULT; |
530 | 546 | ||
@@ -532,8 +548,8 @@ static int wlan_fwt_list_ioctl(wlan_private * priv, struct ifreq *req) | |||
532 | 548 | ||
533 | #ifdef DEBUG | 549 | #ifdef DEBUG |
534 | { | 550 | { |
535 | lbs_pr_debug(1, "FWT_LIST: line is %s\n", in_str); | 551 | lbs_deb_ioctl("FWT_LIST: line is %s\n", in_str); |
536 | lbs_pr_debug(1, "FWT_LIST: listing id:%i\n", le32_to_cpu(fwt_access.id)); | 552 | lbs_deb_ioctl("FWT_LIST: listing id:%i\n", le32_to_cpu(fwt_access.id)); |
537 | } | 553 | } |
538 | #endif | 554 | #endif |
539 | 555 | ||
@@ -549,11 +565,11 @@ static int wlan_fwt_list_ioctl(wlan_private * priv, struct ifreq *req) | |||
549 | wrq->u.data.length = strlen(out_str); | 565 | wrq->u.data.length = strlen(out_str); |
550 | if (copy_to_user(wrq->u.data.pointer, (char *)out_str, | 566 | if (copy_to_user(wrq->u.data.pointer, (char *)out_str, |
551 | wrq->u.data.length)) { | 567 | wrq->u.data.length)) { |
552 | lbs_pr_debug(1, "FWT_LIST: Copy to user failed!\n"); | 568 | lbs_deb_ioctl("FWT_LIST: Copy to user failed!\n"); |
553 | return -EFAULT; | 569 | return -EFAULT; |
554 | } | 570 | } |
555 | 571 | ||
556 | LEAVE(); | 572 | lbs_deb_leave(LBS_DEB_IOCTL); |
557 | return 0; | 573 | return 0; |
558 | } | 574 | } |
559 | 575 | ||
@@ -573,7 +589,8 @@ static int wlan_fwt_list_route_ioctl(wlan_private * priv, struct ifreq *req) | |||
573 | char *pbuf = out_str; | 589 | char *pbuf = out_str; |
574 | int ret; | 590 | int ret; |
575 | 591 | ||
576 | ENTER(); | 592 | lbs_deb_enter(LBS_DEB_IOCTL); |
593 | |||
577 | if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) | 594 | if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) |
578 | return -EFAULT; | 595 | return -EFAULT; |
579 | 596 | ||
@@ -581,8 +598,8 @@ static int wlan_fwt_list_route_ioctl(wlan_private * priv, struct ifreq *req) | |||
581 | 598 | ||
582 | #ifdef DEBUG | 599 | #ifdef DEBUG |
583 | { | 600 | { |
584 | lbs_pr_debug(1, "FWT_LIST_ROUTE: line is %s\n", in_str); | 601 | lbs_deb_ioctl("FWT_LIST_ROUTE: line is %s\n", in_str); |
585 | lbs_pr_debug(1, "FWT_LIST_ROUTE: listing id:%i\n", le32_to_cpu(fwt_access.id)); | 602 | lbs_deb_ioctl("FWT_LIST_ROUTE: listing id:%i\n", le32_to_cpu(fwt_access.id)); |
586 | } | 603 | } |
587 | #endif | 604 | #endif |
588 | 605 | ||
@@ -608,11 +625,11 @@ static int wlan_fwt_list_route_ioctl(wlan_private * priv, struct ifreq *req) | |||
608 | wrq->u.data.length = strlen(out_str); | 625 | wrq->u.data.length = strlen(out_str); |
609 | if (copy_to_user(wrq->u.data.pointer, (char *)out_str, | 626 | if (copy_to_user(wrq->u.data.pointer, (char *)out_str, |
610 | wrq->u.data.length)) { | 627 | wrq->u.data.length)) { |
611 | lbs_pr_debug(1, "FWT_LIST_ROUTE: Copy to user failed!\n"); | 628 | lbs_deb_ioctl("FWT_LIST_ROUTE: Copy to user failed!\n"); |
612 | return -EFAULT; | 629 | return -EFAULT; |
613 | } | 630 | } |
614 | 631 | ||
615 | LEAVE(); | 632 | lbs_deb_leave(LBS_DEB_IOCTL); |
616 | return 0; | 633 | return 0; |
617 | } | 634 | } |
618 | 635 | ||
@@ -632,7 +649,8 @@ static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req) | |||
632 | char *pbuf = out_str; | 649 | char *pbuf = out_str; |
633 | int ret; | 650 | int ret; |
634 | 651 | ||
635 | ENTER(); | 652 | lbs_deb_enter(LBS_DEB_IOCTL); |
653 | |||
636 | if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) | 654 | if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) |
637 | return -EFAULT; | 655 | return -EFAULT; |
638 | 656 | ||
@@ -641,8 +659,8 @@ static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req) | |||
641 | 659 | ||
642 | #ifdef DEBUG | 660 | #ifdef DEBUG |
643 | { | 661 | { |
644 | lbs_pr_debug(1, "FWT_LIST_NEIGHBOR: line is %s\n", in_str); | 662 | lbs_deb_ioctl("FWT_LIST_NEIGHBOR: line is %s\n", in_str); |
645 | lbs_pr_debug(1, "FWT_LIST_NEIGHBOR: listing id:%i\n", le32_to_cpu(fwt_access.id)); | 663 | lbs_deb_ioctl("FWT_LIST_NEIGHBOR: listing id:%i\n", le32_to_cpu(fwt_access.id)); |
646 | } | 664 | } |
647 | #endif | 665 | #endif |
648 | 666 | ||
@@ -663,11 +681,11 @@ static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req) | |||
663 | wrq->u.data.length = strlen(out_str); | 681 | wrq->u.data.length = strlen(out_str); |
664 | if (copy_to_user(wrq->u.data.pointer, (char *)out_str, | 682 | if (copy_to_user(wrq->u.data.pointer, (char *)out_str, |
665 | wrq->u.data.length)) { | 683 | wrq->u.data.length)) { |
666 | lbs_pr_debug(1, "FWT_LIST_NEIGHBOR: Copy to user failed!\n"); | 684 | lbs_deb_ioctl("FWT_LIST_NEIGHBOR: Copy to user failed!\n"); |
667 | return -EFAULT; | 685 | return -EFAULT; |
668 | } | 686 | } |
669 | 687 | ||
670 | LEAVE(); | 688 | lbs_deb_leave(LBS_DEB_IOCTL); |
671 | return 0; | 689 | return 0; |
672 | } | 690 | } |
673 | 691 | ||
@@ -684,9 +702,9 @@ static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req) | |||
684 | static struct cmd_ds_fwt_access fwt_access; | 702 | static struct cmd_ds_fwt_access fwt_access; |
685 | int ret; | 703 | int ret; |
686 | 704 | ||
687 | ENTER(); | 705 | lbs_deb_enter(LBS_DEB_IOCTL); |
688 | 706 | ||
689 | lbs_pr_debug(1, "FWT: cleaning up\n"); | 707 | lbs_deb_ioctl("FWT: cleaning up\n"); |
690 | 708 | ||
691 | memset(&fwt_access, 0, sizeof(fwt_access)); | 709 | memset(&fwt_access, 0, sizeof(fwt_access)); |
692 | 710 | ||
@@ -700,7 +718,7 @@ static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req) | |||
700 | else | 718 | else |
701 | return -EFAULT; | 719 | return -EFAULT; |
702 | 720 | ||
703 | LEAVE(); | 721 | lbs_deb_leave(LBS_DEB_IOCTL); |
704 | return 0; | 722 | return 0; |
705 | } | 723 | } |
706 | 724 | ||
@@ -716,9 +734,9 @@ static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req) | |||
716 | static struct cmd_ds_fwt_access fwt_access; | 734 | static struct cmd_ds_fwt_access fwt_access; |
717 | int ret; | 735 | int ret; |
718 | 736 | ||
719 | ENTER(); | 737 | lbs_deb_enter(LBS_DEB_IOCTL); |
720 | 738 | ||
721 | lbs_pr_debug(1, "FWT: getting time\n"); | 739 | lbs_deb_ioctl("FWT: getting time\n"); |
722 | 740 | ||
723 | memset(&fwt_access, 0, sizeof(fwt_access)); | 741 | memset(&fwt_access, 0, sizeof(fwt_access)); |
724 | 742 | ||
@@ -732,7 +750,7 @@ static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req) | |||
732 | else | 750 | else |
733 | return -EFAULT; | 751 | return -EFAULT; |
734 | 752 | ||
735 | LEAVE(); | 753 | lbs_deb_leave(LBS_DEB_IOCTL); |
736 | return 0; | 754 | return 0; |
737 | } | 755 | } |
738 | 756 | ||
@@ -748,7 +766,7 @@ static int wlan_mesh_get_ttl_ioctl(wlan_private * priv, struct ifreq *req) | |||
748 | struct cmd_ds_mesh_access mesh_access; | 766 | struct cmd_ds_mesh_access mesh_access; |
749 | int ret; | 767 | int ret; |
750 | 768 | ||
751 | ENTER(); | 769 | lbs_deb_enter(LBS_DEB_IOCTL); |
752 | 770 | ||
753 | memset(&mesh_access, 0, sizeof(mesh_access)); | 771 | memset(&mesh_access, 0, sizeof(mesh_access)); |
754 | 772 | ||
@@ -762,7 +780,7 @@ static int wlan_mesh_get_ttl_ioctl(wlan_private * priv, struct ifreq *req) | |||
762 | else | 780 | else |
763 | return -EFAULT; | 781 | return -EFAULT; |
764 | 782 | ||
765 | LEAVE(); | 783 | lbs_deb_leave(LBS_DEB_IOCTL); |
766 | return 0; | 784 | return 0; |
767 | } | 785 | } |
768 | 786 | ||
@@ -777,7 +795,7 @@ static int wlan_mesh_set_ttl_ioctl(wlan_private * priv, int ttl) | |||
777 | struct cmd_ds_mesh_access mesh_access; | 795 | struct cmd_ds_mesh_access mesh_access; |
778 | int ret; | 796 | int ret; |
779 | 797 | ||
780 | ENTER(); | 798 | lbs_deb_enter(LBS_DEB_IOCTL); |
781 | 799 | ||
782 | if( (ttl > 0xff) || (ttl < 0) ) | 800 | if( (ttl > 0xff) || (ttl < 0) ) |
783 | return -EINVAL; | 801 | return -EINVAL; |
@@ -793,7 +811,7 @@ static int wlan_mesh_set_ttl_ioctl(wlan_private * priv, int ttl) | |||
793 | if (ret != 0) | 811 | if (ret != 0) |
794 | ret = -EFAULT; | 812 | ret = -EFAULT; |
795 | 813 | ||
796 | LEAVE(); | 814 | lbs_deb_leave(LBS_DEB_IOCTL); |
797 | return ret; | 815 | return ret; |
798 | } | 816 | } |
799 | 817 | ||
@@ -815,9 +833,9 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) | |||
815 | wlan_adapter *adapter = priv->adapter; | 833 | wlan_adapter *adapter = priv->adapter; |
816 | struct iwreq *wrq = (struct iwreq *)req; | 834 | struct iwreq *wrq = (struct iwreq *)req; |
817 | 835 | ||
818 | ENTER(); | 836 | lbs_deb_enter(LBS_DEB_IOCTL); |
819 | 837 | ||
820 | lbs_pr_debug(1, "libertas_do_ioctl: ioctl cmd = 0x%x\n", cmd); | 838 | lbs_deb_ioctl("libertas_do_ioctl: ioctl cmd = 0x%x\n", cmd); |
821 | switch (cmd) { | 839 | switch (cmd) { |
822 | case WLAN_SETNONE_GETNONE: /* set WPA mode on/off ioctl #20 */ | 840 | case WLAN_SETNONE_GETNONE: /* set WPA mode on/off ioctl #20 */ |
823 | switch (wrq->u.data.flags) { | 841 | switch (wrq->u.data.flags) { |
@@ -937,7 +955,7 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) | |||
937 | (data, wrq->u.data.pointer, | 955 | (data, wrq->u.data.pointer, |
938 | sizeof(int) * | 956 | sizeof(int) * |
939 | wrq->u.data.length)) { | 957 | wrq->u.data.length)) { |
940 | lbs_pr_debug(1, | 958 | lbs_deb_ioctl( |
941 | "Copy from user failed\n"); | 959 | "Copy from user failed\n"); |
942 | return -EFAULT; | 960 | return -EFAULT; |
943 | } | 961 | } |
@@ -970,7 +988,7 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) | |||
970 | if (copy_to_user(wrq->u.data.pointer, data, | 988 | if (copy_to_user(wrq->u.data.pointer, data, |
971 | sizeof(int) * | 989 | sizeof(int) * |
972 | gpio->header.len)) { | 990 | gpio->header.len)) { |
973 | lbs_pr_debug(1, "Copy to user failed\n"); | 991 | lbs_deb_ioctl("Copy to user failed\n"); |
974 | return -EFAULT; | 992 | return -EFAULT; |
975 | } | 993 | } |
976 | 994 | ||
@@ -984,7 +1002,8 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) | |||
984 | ret = -EINVAL; | 1002 | ret = -EINVAL; |
985 | break; | 1003 | break; |
986 | } | 1004 | } |
987 | LEAVE(); | 1005 | |
1006 | lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret); | ||
988 | return ret; | 1007 | return ret; |
989 | } | 1008 | } |
990 | 1009 | ||