aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2008-03-19 09:25:18 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-03-25 16:41:49 -0400
commitd4ff0ef635b222d5f66dad65e9364d702e5f94e0 (patch)
tree048e3396088a81a945c1af6d0a8493b9f145fd56 /drivers
parentc49c3b77c8c611f562ca4e201d88d3e69465f928 (diff)
libertas: misc power saving adjusts
* firmware for the CF card supports power saving * the driver currenly only accept "iwconfig ethX power on|off", so I fixed what the range wext ioctl reports. * initialize value/flags in lbs_get_power() * get rid of unused parameter psmode in lbs_ps_confirm_sleep() * some minor debug output tweaks Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/libertas/cmd.c10
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c18
-rw-r--r--drivers/net/wireless/libertas/decl.h2
-rw-r--r--drivers/net/wireless/libertas/if_cs.c3
-rw-r--r--drivers/net/wireless/libertas/main.c2
-rw-r--r--drivers/net/wireless/libertas/wext.c24
6 files changed, 23 insertions, 36 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 5e35788946f1..733110a03b56 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1927,10 +1927,6 @@ static int sendconfirmsleep(struct lbs_private *priv, u8 *cmdptr, u16 size)
1927 int ret = 0; 1927 int ret = 0;
1928 1928
1929 lbs_deb_enter(LBS_DEB_HOST); 1929 lbs_deb_enter(LBS_DEB_HOST);
1930
1931 lbs_deb_host("SEND_SLEEPC_CMD: before download, cmd size %d\n",
1932 size);
1933
1934 lbs_deb_hex(LBS_DEB_HOST, "sleep confirm command", cmdptr, size); 1930 lbs_deb_hex(LBS_DEB_HOST, "sleep confirm command", cmdptr, size);
1935 1931
1936 ret = priv->hw_host_to_card(priv, MVMS_CMD, cmdptr, size); 1932 ret = priv->hw_host_to_card(priv, MVMS_CMD, cmdptr, size);
@@ -1953,8 +1949,6 @@ static int sendconfirmsleep(struct lbs_private *priv, u8 *cmdptr, u16 size)
1953 priv->intcounter); 1949 priv->intcounter);
1954 } 1950 }
1955 spin_unlock_irqrestore(&priv->driver_lock, flags); 1951 spin_unlock_irqrestore(&priv->driver_lock, flags);
1956
1957 lbs_deb_host("SEND_SLEEPC_CMD: sent confirm sleep\n");
1958 } 1952 }
1959 1953
1960 lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret); 1954 lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret);
@@ -2006,10 +2000,10 @@ void lbs_ps_wakeup(struct lbs_private *priv, int wait_option)
2006 * @param psmode Power Saving mode 2000 * @param psmode Power Saving mode
2007 * @return n/a 2001 * @return n/a
2008 */ 2002 */
2009void lbs_ps_confirm_sleep(struct lbs_private *priv, u16 psmode) 2003void lbs_ps_confirm_sleep(struct lbs_private *priv)
2010{ 2004{
2011 unsigned long flags =0; 2005 unsigned long flags =0;
2012 u8 allowed = 1; 2006 int allowed = 1;
2013 2007
2014 lbs_deb_enter(LBS_DEB_HOST); 2008 lbs_deb_enter(LBS_DEB_HOST);
2015 2009
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 240feeb1b49b..45de4316bdd7 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -656,11 +656,9 @@ int lbs_process_event(struct lbs_private *priv)
656 eventcause = priv->eventcause >> SBI_EVENT_CAUSE_SHIFT; 656 eventcause = priv->eventcause >> SBI_EVENT_CAUSE_SHIFT;
657 spin_unlock_irq(&priv->driver_lock); 657 spin_unlock_irq(&priv->driver_lock);
658 658
659 lbs_deb_cmd("event cause %d\n", eventcause);
660
661 switch (eventcause) { 659 switch (eventcause) {
662 case MACREG_INT_CODE_LINK_SENSED: 660 case MACREG_INT_CODE_LINK_SENSED:
663 lbs_deb_cmd("EVENT: MACREG_INT_CODE_LINK_SENSED\n"); 661 lbs_deb_cmd("EVENT: link sensed\n");
664 break; 662 break;
665 663
666 case MACREG_INT_CODE_DEAUTHENTICATED: 664 case MACREG_INT_CODE_DEAUTHENTICATED:
@@ -679,7 +677,7 @@ int lbs_process_event(struct lbs_private *priv)
679 break; 677 break;
680 678
681 case MACREG_INT_CODE_PS_SLEEP: 679 case MACREG_INT_CODE_PS_SLEEP:
682 lbs_deb_cmd("EVENT: sleep\n"); 680 lbs_deb_cmd("EVENT: ps sleep\n");
683 681
684 /* handle unexpected PS SLEEP event */ 682 /* handle unexpected PS SLEEP event */
685 if (priv->psstate == PS_STATE_FULL_POWER) { 683 if (priv->psstate == PS_STATE_FULL_POWER) {
@@ -689,17 +687,17 @@ int lbs_process_event(struct lbs_private *priv)
689 } 687 }
690 priv->psstate = PS_STATE_PRE_SLEEP; 688 priv->psstate = PS_STATE_PRE_SLEEP;
691 689
692 lbs_ps_confirm_sleep(priv, (u16) priv->psmode); 690 lbs_ps_confirm_sleep(priv);
693 691
694 break; 692 break;
695 693
696 case MACREG_INT_CODE_HOST_AWAKE: 694 case MACREG_INT_CODE_HOST_AWAKE:
697 lbs_deb_cmd("EVENT: HOST_AWAKE\n"); 695 lbs_deb_cmd("EVENT: host awake\n");
698 lbs_send_confirmwake(priv); 696 lbs_send_confirmwake(priv);
699 break; 697 break;
700 698
701 case MACREG_INT_CODE_PS_AWAKE: 699 case MACREG_INT_CODE_PS_AWAKE:
702 lbs_deb_cmd("EVENT: awake\n"); 700 lbs_deb_cmd("EVENT: ps awake\n");
703 /* handle unexpected PS AWAKE event */ 701 /* handle unexpected PS AWAKE event */
704 if (priv->psstate == PS_STATE_FULL_POWER) { 702 if (priv->psstate == PS_STATE_FULL_POWER) {
705 lbs_deb_cmd( 703 lbs_deb_cmd(
@@ -730,14 +728,16 @@ int lbs_process_event(struct lbs_private *priv)
730 lbs_deb_cmd("EVENT: MULTICAST MIC ERROR\n"); 728 lbs_deb_cmd("EVENT: MULTICAST MIC ERROR\n");
731 handle_mic_failureevent(priv, MACREG_INT_CODE_MIC_ERR_MULTICAST); 729 handle_mic_failureevent(priv, MACREG_INT_CODE_MIC_ERR_MULTICAST);
732 break; 730 break;
731
733 case MACREG_INT_CODE_MIB_CHANGED: 732 case MACREG_INT_CODE_MIB_CHANGED:
733 lbs_deb_cmd("EVENT: MIB CHANGED\n");
734 break;
734 case MACREG_INT_CODE_INIT_DONE: 735 case MACREG_INT_CODE_INIT_DONE:
736 lbs_deb_cmd("EVENT: INIT DONE\n");
735 break; 737 break;
736
737 case MACREG_INT_CODE_ADHOC_BCN_LOST: 738 case MACREG_INT_CODE_ADHOC_BCN_LOST:
738 lbs_deb_cmd("EVENT: ADHOC beacon lost\n"); 739 lbs_deb_cmd("EVENT: ADHOC beacon lost\n");
739 break; 740 break;
740
741 case MACREG_INT_CODE_RSSI_LOW: 741 case MACREG_INT_CODE_RSSI_LOW:
742 lbs_pr_alert("EVENT: rssi low\n"); 742 lbs_pr_alert("EVENT: rssi low\n");
743 break; 743 break;
diff --git a/drivers/net/wireless/libertas/decl.h b/drivers/net/wireless/libertas/decl.h
index 989fb77e66dc..f0a0de9c6f5a 100644
--- a/drivers/net/wireless/libertas/decl.h
+++ b/drivers/net/wireless/libertas/decl.h
@@ -49,7 +49,7 @@ int lbs_set_regiontable(struct lbs_private *priv, u8 region, u8 band);
49int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *); 49int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *);
50 50
51void lbs_ps_sleep(struct lbs_private *priv, int wait_option); 51void lbs_ps_sleep(struct lbs_private *priv, int wait_option);
52void lbs_ps_confirm_sleep(struct lbs_private *priv, u16 psmode); 52void lbs_ps_confirm_sleep(struct lbs_private *priv);
53void lbs_ps_wakeup(struct lbs_private *priv, int wait_option); 53void lbs_ps_wakeup(struct lbs_private *priv, int wait_option);
54 54
55struct chan_freq_power *lbs_find_cfp_by_band_and_channel( 55struct chan_freq_power *lbs_find_cfp_by_band_and_channel(
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index 5a9cadb97503..d17746582160 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -882,6 +882,9 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
882 goto out3; 882 goto out3;
883 } 883 }
884 884
885 /* The firmware for the CF card supports powersave */
886 priv->ps_supported = 1;
887
885 ret = 0; 888 ret = 0;
886 goto out; 889 goto out;
887 890
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 37cc05044cd7..449e84f89ae7 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -803,7 +803,7 @@ static int lbs_thread(void *data)
803 lbs_deb_thread("main_thread: PRE_SLEEP--intcounter=%d currenttxskb=%p dnld_sent=%d cur_cmd=%p, confirm now\n", 803 lbs_deb_thread("main_thread: PRE_SLEEP--intcounter=%d currenttxskb=%p dnld_sent=%d cur_cmd=%p, confirm now\n",
804 priv->intcounter, priv->currenttxskb, priv->dnld_sent, priv->cur_cmd); 804 priv->intcounter, priv->currenttxskb, priv->dnld_sent, priv->cur_cmd);
805 805
806 lbs_ps_confirm_sleep(priv, (u16) priv->psmode); 806 lbs_ps_confirm_sleep(priv);
807 } else { 807 } else {
808 /* workaround for firmware sending 808 /* workaround for firmware sending
809 * deauth/linkloss event immediately 809 * deauth/linkloss event immediately
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 5ccb4e0c8d64..c039db648fac 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -656,13 +656,10 @@ static int lbs_get_range(struct net_device *dev, struct iw_request_info *info,
656 range->num_encoding_sizes = 2; 656 range->num_encoding_sizes = 2;
657 range->max_encoding_tokens = 4; 657 range->max_encoding_tokens = 4;
658 658
659 range->min_pmp = 1000000; 659 /*
660 range->max_pmp = 120000000; 660 * Right now we support only "iwconfig ethX power on|off"
661 range->min_pmt = 1000; 661 */
662 range->max_pmt = 1000000; 662 range->pm_capa = IW_POWER_ON;
663 range->pmp_flags = IW_POWER_PERIOD;
664 range->pmt_flags = IW_POWER_TIMEOUT;
665 range->pm_capa = IW_POWER_PERIOD | IW_POWER_TIMEOUT | IW_POWER_ALL_R;
666 663
667 /* 664 /*
668 * Minimum version we recommend 665 * Minimum version we recommend
@@ -784,21 +781,14 @@ static int lbs_get_power(struct net_device *dev, struct iw_request_info *info,
784 struct iw_param *vwrq, char *extra) 781 struct iw_param *vwrq, char *extra)
785{ 782{
786 struct lbs_private *priv = dev->priv; 783 struct lbs_private *priv = dev->priv;
787 int mode;
788 784
789 lbs_deb_enter(LBS_DEB_WEXT); 785 lbs_deb_enter(LBS_DEB_WEXT);
790 786
791 mode = priv->psmode;
792
793 if ((vwrq->disabled = (mode == LBS802_11POWERMODECAM))
794 || priv->connect_status == LBS_DISCONNECTED)
795 {
796 goto out;
797 }
798
799 vwrq->value = 0; 787 vwrq->value = 0;
788 vwrq->flags = 0;
789 vwrq->disabled = priv->psmode == LBS802_11POWERMODECAM
790 || priv->connect_status == LBS_DISCONNECTED;
800 791
801out:
802 lbs_deb_leave(LBS_DEB_WEXT); 792 lbs_deb_leave(LBS_DEB_WEXT);
803 return 0; 793 return 0;
804} 794}