aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorAndrey Yurovsky <andrey@cozybit.com>2009-06-16 16:20:01 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 14:57:41 -0400
commite0d6133cba88759bc760b254c27975330fff6519 (patch)
tree4d512ad8cb6552133a1ceb084957268b19aaeeee /drivers/net/wireless
parentf0f3d388baabdbc613548d6ad8e5da7616b1cbd1 (diff)
libertas: remove ps_supported flag, use fwcapinfo
Power save support depends on the firmware capabilities rather than the card's hardware interface. Use the FW_CAPINFO_PS bit in the firmware capabilities mask throughout the driver in place of the redundant ps_supported flag and don't make decisions about PS support in the interface drivers (with the exception of a special case in the USB driver). V2: put the USB special case in the right place. Signed-off-by: Andrey Yurovsky <andrey@cozybit.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/dev.h1
-rw-r--r--drivers/net/wireless/libertas/if_cs.c3
-rw-r--r--drivers/net/wireless/libertas/if_sdio.c3
-rw-r--r--drivers/net/wireless/libertas/if_spi.c1
-rw-r--r--drivers/net/wireless/libertas/if_usb.c3
-rw-r--r--drivers/net/wireless/libertas/wext.c2
6 files changed, 3 insertions, 10 deletions
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index f9ec69e04734..578c69783589 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -260,7 +260,6 @@ struct lbs_private {
260 u16 psmode; /* Wlan802_11PowermodeCAM=disable 260 u16 psmode; /* Wlan802_11PowermodeCAM=disable
261 Wlan802_11PowermodeMAX_PSP=enable */ 261 Wlan802_11PowermodeMAX_PSP=enable */
262 u32 psstate; 262 u32 psstate;
263 char ps_supported;
264 u8 needtowakeup; 263 u8 needtowakeup;
265 264
266 struct assoc_request * pending_assoc_req; 265 struct assoc_request * pending_assoc_req;
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index 2a5b083bf9bd..f658fd6a2c0c 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -933,9 +933,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
933 goto out3; 933 goto out3;
934 } 934 }
935 935
936 /* The firmware for the CF card supports powersave */
937 priv->ps_supported = 1;
938
939 ret = 0; 936 ret = 0;
940 goto out; 937 goto out;
941 938
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 8cdb88c6ca28..89396a788627 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -1039,9 +1039,6 @@ static int if_sdio_probe(struct sdio_func *func,
1039 if (ret) 1039 if (ret)
1040 goto err_activate_card; 1040 goto err_activate_card;
1041 1041
1042 if (priv->fwcapinfo & FW_CAPINFO_PS)
1043 priv->ps_supported = 1;
1044
1045out: 1042out:
1046 lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); 1043 lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
1047 1044
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 6564282ce476..b213de437ae6 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -1118,7 +1118,6 @@ static int __devinit if_spi_probe(struct spi_device *spi)
1118 priv->card = card; 1118 priv->card = card;
1119 priv->hw_host_to_card = if_spi_host_to_card; 1119 priv->hw_host_to_card = if_spi_host_to_card;
1120 priv->fw_ready = 1; 1120 priv->fw_ready = 1;
1121 priv->ps_supported = 1;
1122 1121
1123 /* Initialize interrupt handling stuff. */ 1122 /* Initialize interrupt handling stuff. */
1124 card->run_thread = 1; 1123 card->run_thread = 1;
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 1844c5adf6e9..92bc8c5f1ca2 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -181,13 +181,14 @@ static void if_usb_setup_firmware(struct lbs_private *priv)
181 wake_method.action = cpu_to_le16(CMD_ACT_GET); 181 wake_method.action = cpu_to_le16(CMD_ACT_GET);
182 if (lbs_cmd_with_response(priv, CMD_802_11_FW_WAKE_METHOD, &wake_method)) { 182 if (lbs_cmd_with_response(priv, CMD_802_11_FW_WAKE_METHOD, &wake_method)) {
183 lbs_pr_info("Firmware does not seem to support PS mode\n"); 183 lbs_pr_info("Firmware does not seem to support PS mode\n");
184 priv->fwcapinfo &= ~FW_CAPINFO_PS;
184 } else { 185 } else {
185 if (le16_to_cpu(wake_method.method) == CMD_WAKE_METHOD_COMMAND_INT) { 186 if (le16_to_cpu(wake_method.method) == CMD_WAKE_METHOD_COMMAND_INT) {
186 lbs_deb_usb("Firmware seems to support PS with wake-via-command\n"); 187 lbs_deb_usb("Firmware seems to support PS with wake-via-command\n");
187 priv->ps_supported = 1;
188 } else { 188 } else {
189 /* The versions which boot up this way don't seem to 189 /* The versions which boot up this way don't seem to
190 work even if we set it to the command interrupt */ 190 work even if we set it to the command interrupt */
191 priv->fwcapinfo &= ~FW_CAPINFO_PS;
191 lbs_pr_info("Firmware doesn't wake via command interrupt; disabling PS mode\n"); 192 lbs_pr_info("Firmware doesn't wake via command interrupt; disabling PS mode\n");
192 } 193 }
193 } 194 }
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 8bc1907458b1..e96451ce470b 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -712,7 +712,7 @@ static int lbs_set_power(struct net_device *dev, struct iw_request_info *info,
712 712
713 lbs_deb_enter(LBS_DEB_WEXT); 713 lbs_deb_enter(LBS_DEB_WEXT);
714 714
715 if (!priv->ps_supported) { 715 if (!(priv->fwcapinfo & FW_CAPINFO_PS)) {
716 if (vwrq->disabled) 716 if (vwrq->disabled)
717 return 0; 717 return 0;
718 else 718 else