aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/wext.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/wext.c')
-rw-r--r--drivers/net/wireless/libertas/wext.c54
1 files changed, 51 insertions, 3 deletions
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index be837a0d251..69dd19bf955 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -45,7 +45,6 @@ static inline void lbs_cancel_association_work(struct lbs_private *priv)
45 priv->pending_assoc_req = NULL; 45 priv->pending_assoc_req = NULL;
46} 46}
47 47
48
49/** 48/**
50 * @brief Find the channel frequency power info with specific channel 49 * @brief Find the channel frequency power info with specific channel
51 * 50 *
@@ -709,6 +708,7 @@ static int lbs_set_power(struct net_device *dev, struct iw_request_info *info,
709 struct iw_param *vwrq, char *extra) 708 struct iw_param *vwrq, char *extra)
710{ 709{
711 struct lbs_private *priv = dev->ml_priv; 710 struct lbs_private *priv = dev->ml_priv;
711 int ret = 0;
712 712
713 lbs_deb_enter(LBS_DEB_WEXT); 713 lbs_deb_enter(LBS_DEB_WEXT);
714 714
@@ -737,8 +737,54 @@ static int lbs_set_power(struct net_device *dev, struct iw_request_info *info,
737 "setting power timeout is not supported\n"); 737 "setting power timeout is not supported\n");
738 return -EINVAL; 738 return -EINVAL;
739 } else if ((vwrq->flags & IW_POWER_TYPE) == IW_POWER_PERIOD) { 739 } else if ((vwrq->flags & IW_POWER_TYPE) == IW_POWER_PERIOD) {
740 lbs_deb_wext("setting power period not supported\n"); 740 vwrq->value = vwrq->value / 1000;
741 return -EINVAL; 741 if (!priv->enter_deep_sleep) {
742 lbs_pr_err("deep sleep feature is not implemented "
743 "for this interface driver\n");
744 return -EINVAL;
745 }
746
747 if (priv->connect_status == LBS_CONNECTED) {
748 if ((priv->is_auto_deep_sleep_enabled) &&
749 (vwrq->value == -1000)) {
750 lbs_exit_auto_deep_sleep(priv);
751 return 0;
752 } else {
753 lbs_pr_err("can't use deep sleep cmd in "
754 "connected state\n");
755 return -EINVAL;
756 }
757 }
758
759 if ((vwrq->value < 0) && (vwrq->value != -1000)) {
760 lbs_pr_err("unknown option\n");
761 return -EINVAL;
762 }
763
764 if (vwrq->value > 0) {
765 if (!priv->is_auto_deep_sleep_enabled) {
766 priv->is_activity_detected = 0;
767 priv->auto_deep_sleep_timeout = vwrq->value;
768 lbs_enter_auto_deep_sleep(priv);
769 } else {
770 priv->auto_deep_sleep_timeout = vwrq->value;
771 lbs_deb_debugfs("auto deep sleep: "
772 "already enabled\n");
773 }
774 return 0;
775 } else {
776 if (priv->is_auto_deep_sleep_enabled) {
777 lbs_exit_auto_deep_sleep(priv);
778 /* Try to exit deep sleep if auto */
779 /*deep sleep disabled */
780 ret = lbs_set_deep_sleep(priv, 0);
781 }
782 if (vwrq->value == 0)
783 ret = lbs_set_deep_sleep(priv, 1);
784 else if (vwrq->value == -1000)
785 ret = lbs_set_deep_sleep(priv, 0);
786 return ret;
787 }
742 } 788 }
743 789
744 if (priv->psmode != LBS802_11POWERMODECAM) { 790 if (priv->psmode != LBS802_11POWERMODECAM) {
@@ -752,6 +798,7 @@ static int lbs_set_power(struct net_device *dev, struct iw_request_info *info,
752 } 798 }
753 799
754 lbs_deb_leave(LBS_DEB_WEXT); 800 lbs_deb_leave(LBS_DEB_WEXT);
801
755 return 0; 802 return 0;
756} 803}
757 804
@@ -1000,6 +1047,7 @@ static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info,
1000 u8 rates[MAX_RATES + 1]; 1047 u8 rates[MAX_RATES + 1];
1001 1048
1002 lbs_deb_enter(LBS_DEB_WEXT); 1049 lbs_deb_enter(LBS_DEB_WEXT);
1050
1003 lbs_deb_wext("vwrq->value %d\n", vwrq->value); 1051 lbs_deb_wext("vwrq->value %d\n", vwrq->value);
1004 lbs_deb_wext("vwrq->fixed %d\n", vwrq->fixed); 1052 lbs_deb_wext("vwrq->fixed %d\n", vwrq->fixed);
1005 1053