diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2009-10-06 22:20:28 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-07 16:39:53 -0400 |
commit | 63f275df64dc69a46bbc21e6a68d5506d2da9c51 (patch) | |
tree | 4d21f47420f0ef155e9e461512d3c6354019c31c /drivers/net/wireless | |
parent | 536b3a7a10c8fd39576a0602bfeca9bbd04658a6 (diff) |
libertas: Use lbs_is_cmd_allowed() check in command handling routines.
lbs_is_cmd_allowed() check is added in __lbs_cmd_async() and
lbs_prepare_and_send_command(). The check is removed from other places.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 34 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/debugfs.c | 46 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/decl.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/scan.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/wext.c | 133 |
5 files changed, 34 insertions, 191 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 3a3e8947e84a..0fb312576b8d 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -75,6 +75,30 @@ static u8 is_command_allowed_in_ps(u16 cmd) | |||
75 | } | 75 | } |
76 | 76 | ||
77 | /** | 77 | /** |
78 | * @brief This function checks if the command is allowed. | ||
79 | * | ||
80 | * @param priv A pointer to lbs_private structure | ||
81 | * @return allowed or not allowed. | ||
82 | */ | ||
83 | |||
84 | static int lbs_is_cmd_allowed(struct lbs_private *priv) | ||
85 | { | ||
86 | int ret = 1; | ||
87 | |||
88 | lbs_deb_enter(LBS_DEB_CMD); | ||
89 | |||
90 | if (!priv->is_auto_deep_sleep_enabled) { | ||
91 | if (priv->is_deep_sleep) { | ||
92 | lbs_deb_cmd("command not allowed in deep sleep\n"); | ||
93 | ret = 0; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | lbs_deb_leave(LBS_DEB_CMD); | ||
98 | return ret; | ||
99 | } | ||
100 | |||
101 | /** | ||
78 | * @brief Updates the hardware details like MAC address and regulatory region | 102 | * @brief Updates the hardware details like MAC address and regulatory region |
79 | * | 103 | * |
80 | * @param priv A pointer to struct lbs_private structure | 104 | * @param priv A pointer to struct lbs_private structure |
@@ -1452,6 +1476,11 @@ int lbs_prepare_and_send_command(struct lbs_private *priv, | |||
1452 | goto done; | 1476 | goto done; |
1453 | } | 1477 | } |
1454 | 1478 | ||
1479 | if (!lbs_is_cmd_allowed(priv)) { | ||
1480 | ret = -EBUSY; | ||
1481 | goto done; | ||
1482 | } | ||
1483 | |||
1455 | cmdnode = lbs_get_cmd_ctrl_node(priv); | 1484 | cmdnode = lbs_get_cmd_ctrl_node(priv); |
1456 | 1485 | ||
1457 | if (cmdnode == NULL) { | 1486 | if (cmdnode == NULL) { |
@@ -2104,6 +2133,11 @@ static struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv, | |||
2104 | goto done; | 2133 | goto done; |
2105 | } | 2134 | } |
2106 | 2135 | ||
2136 | if (!lbs_is_cmd_allowed(priv)) { | ||
2137 | cmdnode = ERR_PTR(-EBUSY); | ||
2138 | goto done; | ||
2139 | } | ||
2140 | |||
2107 | cmdnode = lbs_get_cmd_ctrl_node(priv); | 2141 | cmdnode = lbs_get_cmd_ctrl_node(priv); |
2108 | if (cmdnode == NULL) { | 2142 | if (cmdnode == NULL) { |
2109 | lbs_deb_host("PREP_CMD: cmdnode is NULL\n"); | 2143 | lbs_deb_host("PREP_CMD: cmdnode is NULL\n"); |
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c index 8a7e9319c9e5..893a55ca344a 100644 --- a/drivers/net/wireless/libertas/debugfs.c +++ b/drivers/net/wireless/libertas/debugfs.c | |||
@@ -117,11 +117,6 @@ static ssize_t lbs_sleepparams_write(struct file *file, | |||
117 | if (!buf) | 117 | if (!buf) |
118 | return -ENOMEM; | 118 | return -ENOMEM; |
119 | 119 | ||
120 | if (!lbs_is_cmd_allowed(priv)) { | ||
121 | ret = -EBUSY; | ||
122 | goto out_unlock; | ||
123 | } | ||
124 | |||
125 | buf_size = min(count, len - 1); | 120 | buf_size = min(count, len - 1); |
126 | if (copy_from_user(buf, user_buf, buf_size)) { | 121 | if (copy_from_user(buf, user_buf, buf_size)) { |
127 | ret = -EFAULT; | 122 | ret = -EFAULT; |
@@ -162,11 +157,6 @@ static ssize_t lbs_sleepparams_read(struct file *file, char __user *userbuf, | |||
162 | if (!buf) | 157 | if (!buf) |
163 | return -ENOMEM; | 158 | return -ENOMEM; |
164 | 159 | ||
165 | if (!lbs_is_cmd_allowed(priv)) { | ||
166 | ret = -EBUSY; | ||
167 | goto out_unlock; | ||
168 | } | ||
169 | |||
170 | ret = lbs_cmd_802_11_sleep_params(priv, CMD_ACT_GET, &sp); | 160 | ret = lbs_cmd_802_11_sleep_params(priv, CMD_ACT_GET, &sp); |
171 | if (ret) | 161 | if (ret) |
172 | goto out_unlock; | 162 | goto out_unlock; |
@@ -233,9 +223,6 @@ static ssize_t lbs_threshold_read(uint16_t tlv_type, uint16_t event_mask, | |||
233 | u8 freq; | 223 | u8 freq; |
234 | int events = 0; | 224 | int events = 0; |
235 | 225 | ||
236 | if (!lbs_is_cmd_allowed(priv)) | ||
237 | return -EBUSY; | ||
238 | |||
239 | buf = (char *)get_zeroed_page(GFP_KERNEL); | 226 | buf = (char *)get_zeroed_page(GFP_KERNEL); |
240 | if (!buf) | 227 | if (!buf) |
241 | return -ENOMEM; | 228 | return -ENOMEM; |
@@ -288,9 +275,6 @@ static ssize_t lbs_threshold_write(uint16_t tlv_type, uint16_t event_mask, | |||
288 | char *buf; | 275 | char *buf; |
289 | int ret; | 276 | int ret; |
290 | 277 | ||
291 | if (!lbs_is_cmd_allowed(priv)) | ||
292 | return -EBUSY; | ||
293 | |||
294 | buf = (char *)get_zeroed_page(GFP_KERNEL); | 278 | buf = (char *)get_zeroed_page(GFP_KERNEL); |
295 | if (!buf) | 279 | if (!buf) |
296 | return -ENOMEM; | 280 | return -ENOMEM; |
@@ -460,11 +444,6 @@ static ssize_t lbs_rdmac_read(struct file *file, char __user *userbuf, | |||
460 | if (!buf) | 444 | if (!buf) |
461 | return -ENOMEM; | 445 | return -ENOMEM; |
462 | 446 | ||
463 | if (!lbs_is_cmd_allowed(priv)) { | ||
464 | free_page(addr); | ||
465 | return -EBUSY; | ||
466 | } | ||
467 | |||
468 | offval.offset = priv->mac_offset; | 447 | offval.offset = priv->mac_offset; |
469 | offval.value = 0; | 448 | offval.value = 0; |
470 | 449 | ||
@@ -517,11 +496,6 @@ static ssize_t lbs_wrmac_write(struct file *file, | |||
517 | if (!buf) | 496 | if (!buf) |
518 | return -ENOMEM; | 497 | return -ENOMEM; |
519 | 498 | ||
520 | if (!lbs_is_cmd_allowed(priv)) { | ||
521 | res = -EBUSY; | ||
522 | goto out_unlock; | ||
523 | } | ||
524 | |||
525 | buf_size = min(count, len - 1); | 499 | buf_size = min(count, len - 1); |
526 | if (copy_from_user(buf, userbuf, buf_size)) { | 500 | if (copy_from_user(buf, userbuf, buf_size)) { |
527 | res = -EFAULT; | 501 | res = -EFAULT; |
@@ -558,11 +532,6 @@ static ssize_t lbs_rdbbp_read(struct file *file, char __user *userbuf, | |||
558 | if (!buf) | 532 | if (!buf) |
559 | return -ENOMEM; | 533 | return -ENOMEM; |
560 | 534 | ||
561 | if (!lbs_is_cmd_allowed(priv)) { | ||
562 | free_page(addr); | ||
563 | return -EBUSY; | ||
564 | } | ||
565 | |||
566 | offval.offset = priv->bbp_offset; | 535 | offval.offset = priv->bbp_offset; |
567 | offval.value = 0; | 536 | offval.value = 0; |
568 | 537 | ||
@@ -616,11 +585,6 @@ static ssize_t lbs_wrbbp_write(struct file *file, | |||
616 | if (!buf) | 585 | if (!buf) |
617 | return -ENOMEM; | 586 | return -ENOMEM; |
618 | 587 | ||
619 | if (!lbs_is_cmd_allowed(priv)) { | ||
620 | res = -EBUSY; | ||
621 | goto out_unlock; | ||
622 | } | ||
623 | |||
624 | buf_size = min(count, len - 1); | 588 | buf_size = min(count, len - 1); |
625 | if (copy_from_user(buf, userbuf, buf_size)) { | 589 | if (copy_from_user(buf, userbuf, buf_size)) { |
626 | res = -EFAULT; | 590 | res = -EFAULT; |
@@ -657,11 +621,6 @@ static ssize_t lbs_rdrf_read(struct file *file, char __user *userbuf, | |||
657 | if (!buf) | 621 | if (!buf) |
658 | return -ENOMEM; | 622 | return -ENOMEM; |
659 | 623 | ||
660 | if (!lbs_is_cmd_allowed(priv)) { | ||
661 | free_page(addr); | ||
662 | return -EBUSY; | ||
663 | } | ||
664 | |||
665 | offval.offset = priv->rf_offset; | 624 | offval.offset = priv->rf_offset; |
666 | offval.value = 0; | 625 | offval.value = 0; |
667 | 626 | ||
@@ -715,11 +674,6 @@ static ssize_t lbs_wrrf_write(struct file *file, | |||
715 | if (!buf) | 674 | if (!buf) |
716 | return -ENOMEM; | 675 | return -ENOMEM; |
717 | 676 | ||
718 | if (!lbs_is_cmd_allowed(priv)) { | ||
719 | res = -EBUSY; | ||
720 | goto out_unlock; | ||
721 | } | ||
722 | |||
723 | buf_size = min(count, len - 1); | 677 | buf_size = min(count, len - 1); |
724 | if (copy_from_user(buf, userbuf, buf_size)) { | 678 | if (copy_from_user(buf, userbuf, buf_size)) { |
725 | res = -EFAULT; | 679 | res = -EFAULT; |
diff --git a/drivers/net/wireless/libertas/decl.h b/drivers/net/wireless/libertas/decl.h index 44f0b248ace9..fb91c3639fc1 100644 --- a/drivers/net/wireless/libertas/decl.h +++ b/drivers/net/wireless/libertas/decl.h | |||
@@ -34,7 +34,6 @@ int lbs_process_event(struct lbs_private *priv, u32 event); | |||
34 | void lbs_queue_event(struct lbs_private *priv, u32 event); | 34 | void lbs_queue_event(struct lbs_private *priv, u32 event); |
35 | void lbs_notify_command_response(struct lbs_private *priv, u8 resp_idx); | 35 | void lbs_notify_command_response(struct lbs_private *priv, u8 resp_idx); |
36 | int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep); | 36 | int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep); |
37 | int lbs_is_cmd_allowed(struct lbs_private *priv); | ||
38 | int lbs_enter_auto_deep_sleep(struct lbs_private *priv); | 37 | int lbs_enter_auto_deep_sleep(struct lbs_private *priv); |
39 | int lbs_exit_auto_deep_sleep(struct lbs_private *priv); | 38 | int lbs_exit_auto_deep_sleep(struct lbs_private *priv); |
40 | 39 | ||
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c index e468e155e8be..6c95af3023cc 100644 --- a/drivers/net/wireless/libertas/scan.c +++ b/drivers/net/wireless/libertas/scan.c | |||
@@ -950,11 +950,6 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, | |||
950 | 950 | ||
951 | lbs_deb_enter(LBS_DEB_WEXT); | 951 | lbs_deb_enter(LBS_DEB_WEXT); |
952 | 952 | ||
953 | if (!lbs_is_cmd_allowed(priv)) { | ||
954 | ret = -EBUSY; | ||
955 | goto out; | ||
956 | } | ||
957 | |||
958 | if (!priv->radio_on) { | 953 | if (!priv->radio_on) { |
959 | ret = -EINVAL; | 954 | ret = -EINVAL; |
960 | goto out; | 955 | goto out; |
@@ -1022,12 +1017,6 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info, | |||
1022 | 1017 | ||
1023 | lbs_deb_enter(LBS_DEB_WEXT); | 1018 | lbs_deb_enter(LBS_DEB_WEXT); |
1024 | 1019 | ||
1025 | if (!lbs_is_cmd_allowed(priv)) { | ||
1026 | err = -EBUSY; | ||
1027 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", err); | ||
1028 | return err; | ||
1029 | } | ||
1030 | |||
1031 | /* iwlist should wait until the current scan is finished */ | 1020 | /* iwlist should wait until the current scan is finished */ |
1032 | if (priv->scan_channel) | 1021 | if (priv->scan_channel) |
1033 | return -EAGAIN; | 1022 | return -EAGAIN; |
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index 38a451edb703..69dd19bf9558 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c | |||
@@ -46,32 +46,6 @@ static inline void lbs_cancel_association_work(struct lbs_private *priv) | |||
46 | } | 46 | } |
47 | 47 | ||
48 | /** | 48 | /** |
49 | * @brief This function checks if the command is allowed. | ||
50 | * | ||
51 | * @param priv A pointer to lbs_private structure | ||
52 | * @return allowed or not allowed. | ||
53 | */ | ||
54 | |||
55 | int lbs_is_cmd_allowed(struct lbs_private *priv) | ||
56 | { | ||
57 | int ret = 1; | ||
58 | |||
59 | lbs_deb_enter(LBS_DEB_WEXT); | ||
60 | |||
61 | if (!priv->is_auto_deep_sleep_enabled) { | ||
62 | if (priv->is_deep_sleep) { | ||
63 | lbs_deb_wext("IOCTLS called when station" | ||
64 | "is in deep sleep\n"); | ||
65 | ret = 0; | ||
66 | } | ||
67 | } | ||
68 | |||
69 | lbs_deb_leave(LBS_DEB_WEXT); | ||
70 | return ret; | ||
71 | } | ||
72 | |||
73 | |||
74 | /** | ||
75 | * @brief Find the channel frequency power info with specific channel | 49 | * @brief Find the channel frequency power info with specific channel |
76 | * | 50 | * |
77 | * @param priv A pointer to struct lbs_private structure | 51 | * @param priv A pointer to struct lbs_private structure |
@@ -193,11 +167,6 @@ static int lbs_get_freq(struct net_device *dev, struct iw_request_info *info, | |||
193 | 167 | ||
194 | lbs_deb_enter(LBS_DEB_WEXT); | 168 | lbs_deb_enter(LBS_DEB_WEXT); |
195 | 169 | ||
196 | if (!lbs_is_cmd_allowed(priv)) { | ||
197 | lbs_deb_leave(LBS_DEB_WEXT); | ||
198 | return -EBUSY; | ||
199 | } | ||
200 | |||
201 | cfp = lbs_find_cfp_by_band_and_channel(priv, 0, | 170 | cfp = lbs_find_cfp_by_band_and_channel(priv, 0, |
202 | priv->curbssparams.channel); | 171 | priv->curbssparams.channel); |
203 | 172 | ||
@@ -308,12 +277,6 @@ static int lbs_set_rts(struct net_device *dev, struct iw_request_info *info, | |||
308 | 277 | ||
309 | lbs_deb_enter(LBS_DEB_WEXT); | 278 | lbs_deb_enter(LBS_DEB_WEXT); |
310 | 279 | ||
311 | if (!lbs_is_cmd_allowed(priv)) { | ||
312 | ret = -EBUSY; | ||
313 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); | ||
314 | return ret; | ||
315 | } | ||
316 | |||
317 | if (vwrq->disabled) | 280 | if (vwrq->disabled) |
318 | val = MRVDRV_RTS_MAX_VALUE; | 281 | val = MRVDRV_RTS_MAX_VALUE; |
319 | 282 | ||
@@ -335,11 +298,6 @@ static int lbs_get_rts(struct net_device *dev, struct iw_request_info *info, | |||
335 | 298 | ||
336 | lbs_deb_enter(LBS_DEB_WEXT); | 299 | lbs_deb_enter(LBS_DEB_WEXT); |
337 | 300 | ||
338 | if (!lbs_is_cmd_allowed(priv)) { | ||
339 | ret = -EBUSY; | ||
340 | goto out; | ||
341 | } | ||
342 | |||
343 | ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_RTS_THRESHOLD, &val); | 301 | ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_RTS_THRESHOLD, &val); |
344 | if (ret) | 302 | if (ret) |
345 | goto out; | 303 | goto out; |
@@ -362,12 +320,6 @@ static int lbs_set_frag(struct net_device *dev, struct iw_request_info *info, | |||
362 | 320 | ||
363 | lbs_deb_enter(LBS_DEB_WEXT); | 321 | lbs_deb_enter(LBS_DEB_WEXT); |
364 | 322 | ||
365 | if (!lbs_is_cmd_allowed(priv)) { | ||
366 | ret = -EBUSY; | ||
367 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); | ||
368 | return ret; | ||
369 | } | ||
370 | |||
371 | if (vwrq->disabled) | 323 | if (vwrq->disabled) |
372 | val = MRVDRV_FRAG_MAX_VALUE; | 324 | val = MRVDRV_FRAG_MAX_VALUE; |
373 | 325 | ||
@@ -389,11 +341,6 @@ static int lbs_get_frag(struct net_device *dev, struct iw_request_info *info, | |||
389 | 341 | ||
390 | lbs_deb_enter(LBS_DEB_WEXT); | 342 | lbs_deb_enter(LBS_DEB_WEXT); |
391 | 343 | ||
392 | if (!lbs_is_cmd_allowed(priv)) { | ||
393 | ret = -EBUSY; | ||
394 | goto out; | ||
395 | } | ||
396 | |||
397 | ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_FRAG_THRESHOLD, &val); | 344 | ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_FRAG_THRESHOLD, &val); |
398 | if (ret) | 345 | if (ret) |
399 | goto out; | 346 | goto out; |
@@ -443,11 +390,6 @@ static int lbs_get_txpow(struct net_device *dev, | |||
443 | 390 | ||
444 | lbs_deb_enter(LBS_DEB_WEXT); | 391 | lbs_deb_enter(LBS_DEB_WEXT); |
445 | 392 | ||
446 | if (!lbs_is_cmd_allowed(priv)) { | ||
447 | ret = -EBUSY; | ||
448 | goto out; | ||
449 | } | ||
450 | |||
451 | if (!priv->radio_on) { | 393 | if (!priv->radio_on) { |
452 | lbs_deb_wext("tx power off\n"); | 394 | lbs_deb_wext("tx power off\n"); |
453 | vwrq->value = 0; | 395 | vwrq->value = 0; |
@@ -481,11 +423,6 @@ static int lbs_set_retry(struct net_device *dev, struct iw_request_info *info, | |||
481 | 423 | ||
482 | lbs_deb_enter(LBS_DEB_WEXT); | 424 | lbs_deb_enter(LBS_DEB_WEXT); |
483 | 425 | ||
484 | if (!lbs_is_cmd_allowed(priv)) { | ||
485 | ret = -EBUSY; | ||
486 | goto out; | ||
487 | } | ||
488 | |||
489 | if ((vwrq->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT) | 426 | if ((vwrq->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT) |
490 | return -EOPNOTSUPP; | 427 | return -EOPNOTSUPP; |
491 | 428 | ||
@@ -534,11 +471,6 @@ static int lbs_get_retry(struct net_device *dev, struct iw_request_info *info, | |||
534 | 471 | ||
535 | lbs_deb_enter(LBS_DEB_WEXT); | 472 | lbs_deb_enter(LBS_DEB_WEXT); |
536 | 473 | ||
537 | if (!lbs_is_cmd_allowed(priv)) { | ||
538 | ret = -EBUSY; | ||
539 | goto out; | ||
540 | } | ||
541 | |||
542 | vwrq->disabled = 0; | 474 | vwrq->disabled = 0; |
543 | 475 | ||
544 | if (vwrq->flags & IW_RETRY_LONG) { | 476 | if (vwrq->flags & IW_RETRY_LONG) { |
@@ -907,9 +839,6 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev) | |||
907 | 839 | ||
908 | lbs_deb_enter(LBS_DEB_WEXT); | 840 | lbs_deb_enter(LBS_DEB_WEXT); |
909 | 841 | ||
910 | if (!lbs_is_cmd_allowed(priv)) | ||
911 | return NULL; | ||
912 | |||
913 | priv->wstats.status = priv->mode; | 842 | priv->wstats.status = priv->mode; |
914 | 843 | ||
915 | /* If we're not associated, all quality values are meaningless */ | 844 | /* If we're not associated, all quality values are meaningless */ |
@@ -1010,12 +939,6 @@ static int lbs_set_freq(struct net_device *dev, struct iw_request_info *info, | |||
1010 | 939 | ||
1011 | lbs_deb_enter(LBS_DEB_WEXT); | 940 | lbs_deb_enter(LBS_DEB_WEXT); |
1012 | 941 | ||
1013 | if (!lbs_is_cmd_allowed(priv)) { | ||
1014 | ret = -EBUSY; | ||
1015 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); | ||
1016 | return ret; | ||
1017 | } | ||
1018 | |||
1019 | mutex_lock(&priv->lock); | 942 | mutex_lock(&priv->lock); |
1020 | assoc_req = lbs_get_association_request(priv); | 943 | assoc_req = lbs_get_association_request(priv); |
1021 | if (!assoc_req) { | 944 | if (!assoc_req) { |
@@ -1125,11 +1048,6 @@ static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info, | |||
1125 | 1048 | ||
1126 | lbs_deb_enter(LBS_DEB_WEXT); | 1049 | lbs_deb_enter(LBS_DEB_WEXT); |
1127 | 1050 | ||
1128 | if (!lbs_is_cmd_allowed(priv)) { | ||
1129 | ret = -EBUSY; | ||
1130 | goto out; | ||
1131 | } | ||
1132 | |||
1133 | lbs_deb_wext("vwrq->value %d\n", vwrq->value); | 1051 | lbs_deb_wext("vwrq->value %d\n", vwrq->value); |
1134 | lbs_deb_wext("vwrq->fixed %d\n", vwrq->fixed); | 1052 | lbs_deb_wext("vwrq->fixed %d\n", vwrq->fixed); |
1135 | 1053 | ||
@@ -1188,11 +1106,6 @@ static int lbs_get_rate(struct net_device *dev, struct iw_request_info *info, | |||
1188 | 1106 | ||
1189 | lbs_deb_enter(LBS_DEB_WEXT); | 1107 | lbs_deb_enter(LBS_DEB_WEXT); |
1190 | 1108 | ||
1191 | if (!lbs_is_cmd_allowed(priv)) { | ||
1192 | lbs_deb_leave(LBS_DEB_WEXT); | ||
1193 | return -EBUSY; | ||
1194 | } | ||
1195 | |||
1196 | if (priv->connect_status == LBS_CONNECTED) { | 1109 | if (priv->connect_status == LBS_CONNECTED) { |
1197 | vwrq->value = priv->cur_rate * 500000; | 1110 | vwrq->value = priv->cur_rate * 500000; |
1198 | 1111 | ||
@@ -1219,11 +1132,6 @@ static int lbs_set_mode(struct net_device *dev, | |||
1219 | 1132 | ||
1220 | lbs_deb_enter(LBS_DEB_WEXT); | 1133 | lbs_deb_enter(LBS_DEB_WEXT); |
1221 | 1134 | ||
1222 | if (!lbs_is_cmd_allowed(priv)) { | ||
1223 | ret = -EBUSY; | ||
1224 | goto out; | ||
1225 | } | ||
1226 | |||
1227 | if ( (*uwrq != IW_MODE_ADHOC) | 1135 | if ( (*uwrq != IW_MODE_ADHOC) |
1228 | && (*uwrq != IW_MODE_INFRA) | 1136 | && (*uwrq != IW_MODE_INFRA) |
1229 | && (*uwrq != IW_MODE_AUTO)) { | 1137 | && (*uwrq != IW_MODE_AUTO)) { |
@@ -1465,12 +1373,6 @@ static int lbs_set_encode(struct net_device *dev, | |||
1465 | 1373 | ||
1466 | lbs_deb_enter(LBS_DEB_WEXT); | 1374 | lbs_deb_enter(LBS_DEB_WEXT); |
1467 | 1375 | ||
1468 | if (!lbs_is_cmd_allowed(priv)) { | ||
1469 | ret = -EBUSY; | ||
1470 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); | ||
1471 | return ret; | ||
1472 | } | ||
1473 | |||
1474 | mutex_lock(&priv->lock); | 1376 | mutex_lock(&priv->lock); |
1475 | assoc_req = lbs_get_association_request(priv); | 1377 | assoc_req = lbs_get_association_request(priv); |
1476 | if (!assoc_req) { | 1378 | if (!assoc_req) { |
@@ -1654,12 +1556,6 @@ static int lbs_set_encodeext(struct net_device *dev, | |||
1654 | 1556 | ||
1655 | lbs_deb_enter(LBS_DEB_WEXT); | 1557 | lbs_deb_enter(LBS_DEB_WEXT); |
1656 | 1558 | ||
1657 | if (!lbs_is_cmd_allowed(priv)) { | ||
1658 | ret = -EBUSY; | ||
1659 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); | ||
1660 | return ret; | ||
1661 | } | ||
1662 | |||
1663 | mutex_lock(&priv->lock); | 1559 | mutex_lock(&priv->lock); |
1664 | assoc_req = lbs_get_association_request(priv); | 1560 | assoc_req = lbs_get_association_request(priv); |
1665 | if (!assoc_req) { | 1561 | if (!assoc_req) { |
@@ -1872,12 +1768,6 @@ static int lbs_set_auth(struct net_device *dev, | |||
1872 | 1768 | ||
1873 | lbs_deb_enter(LBS_DEB_WEXT); | 1769 | lbs_deb_enter(LBS_DEB_WEXT); |
1874 | 1770 | ||
1875 | if (!lbs_is_cmd_allowed(priv)) { | ||
1876 | ret = -EBUSY; | ||
1877 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); | ||
1878 | return ret; | ||
1879 | } | ||
1880 | |||
1881 | mutex_lock(&priv->lock); | 1771 | mutex_lock(&priv->lock); |
1882 | assoc_req = lbs_get_association_request(priv); | 1772 | assoc_req = lbs_get_association_request(priv); |
1883 | if (!assoc_req) { | 1773 | if (!assoc_req) { |
@@ -1980,12 +1870,6 @@ static int lbs_get_auth(struct net_device *dev, | |||
1980 | 1870 | ||
1981 | lbs_deb_enter(LBS_DEB_WEXT); | 1871 | lbs_deb_enter(LBS_DEB_WEXT); |
1982 | 1872 | ||
1983 | if (!lbs_is_cmd_allowed(priv)) { | ||
1984 | ret = -EBUSY; | ||
1985 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); | ||
1986 | return ret; | ||
1987 | } | ||
1988 | |||
1989 | switch (dwrq->flags & IW_AUTH_INDEX) { | 1873 | switch (dwrq->flags & IW_AUTH_INDEX) { |
1990 | case IW_AUTH_KEY_MGMT: | 1874 | case IW_AUTH_KEY_MGMT: |
1991 | dwrq->value = priv->secinfo.key_mgmt; | 1875 | dwrq->value = priv->secinfo.key_mgmt; |
@@ -2028,11 +1912,6 @@ static int lbs_set_txpow(struct net_device *dev, struct iw_request_info *info, | |||
2028 | 1912 | ||
2029 | lbs_deb_enter(LBS_DEB_WEXT); | 1913 | lbs_deb_enter(LBS_DEB_WEXT); |
2030 | 1914 | ||
2031 | if (!lbs_is_cmd_allowed(priv)) { | ||
2032 | ret = -EBUSY; | ||
2033 | goto out; | ||
2034 | } | ||
2035 | |||
2036 | if (vwrq->disabled) { | 1915 | if (vwrq->disabled) { |
2037 | lbs_set_radio(priv, RADIO_PREAMBLE_AUTO, 0); | 1916 | lbs_set_radio(priv, RADIO_PREAMBLE_AUTO, 0); |
2038 | goto out; | 1917 | goto out; |
@@ -2152,12 +2031,6 @@ static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info, | |||
2152 | 2031 | ||
2153 | lbs_deb_enter(LBS_DEB_WEXT); | 2032 | lbs_deb_enter(LBS_DEB_WEXT); |
2154 | 2033 | ||
2155 | if (!lbs_is_cmd_allowed(priv)) { | ||
2156 | ret = -EBUSY; | ||
2157 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); | ||
2158 | return ret; | ||
2159 | } | ||
2160 | |||
2161 | if (!priv->radio_on) { | 2034 | if (!priv->radio_on) { |
2162 | ret = -EINVAL; | 2035 | ret = -EINVAL; |
2163 | goto out; | 2036 | goto out; |
@@ -2285,12 +2158,6 @@ static int lbs_set_wap(struct net_device *dev, struct iw_request_info *info, | |||
2285 | 2158 | ||
2286 | lbs_deb_enter(LBS_DEB_WEXT); | 2159 | lbs_deb_enter(LBS_DEB_WEXT); |
2287 | 2160 | ||
2288 | if (!lbs_is_cmd_allowed(priv)) { | ||
2289 | ret = -EBUSY; | ||
2290 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); | ||
2291 | return ret; | ||
2292 | } | ||
2293 | |||
2294 | if (!priv->radio_on) | 2161 | if (!priv->radio_on) |
2295 | return -EINVAL; | 2162 | return -EINVAL; |
2296 | 2163 | ||