libertas: remove ps_supported flag, use fwcapinfo
PATCH 1/1 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).
--- drivers/net/wireless/libertas/dev.h | 1 - drivers/net/wireless/libertas/if_cs.c | 3 --- drivers/net/wireless/libertas/if_sdio.c | 3 --- drivers/net/wireless/libertas/if_spi.c | 1 - drivers/net/wireless/libertas/if_usb.c | 2 +- drivers/net/wireless/libertas/wext.c | 2 +- 6 files changed, 2 insertions(+), 10 deletions(-)
drivers/net/wireless/libertas/dev.h +0 -1
@@ -260,7 +260,6 @@ struct lbs_private {u16 psmode;/* Wlan802_11PowermodeCAM=disable Wlan802_11PowermodeMAX_PSP=enable */ u32 psstate; -char ps_supported;u8 needtowakeup;struct assoc_request * pending_assoc_req;
drivers/net/wireless/libertas/if_cs.c +0 -3
@@ -933,9 +933,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev) goto out3; } -/* The firmware for the CF card supports powersave */ - priv->ps_supported =1 ; - ret =0 ; goto out;
drivers/net/wireless/libertas/if_sdio.c +0 -3
@@ -1039,9 +1039,6 @@ static int if_sdio_probe(struct sdio_func *func,if (ret) goto err_activate_card; -if (priv->fwcapinfo &FW_CAPINFO_PS ) - priv->ps_supported =1 ; - out:lbs_deb_leave_args (LBS_DEB_SDIO ,"ret %d" , ret);
drivers/net/wireless/libertas/if_spi.c +0 -1
@@ -1117,7 +1117,6 @@ static int __devinit if_spi_probe(struct spi_device *spi) priv->card = card; priv->hw_host_to_card = if_spi_host_to_card; priv->fw_ready =1 ; - priv->ps_supported =1 ;/* Initialize interrupt handling stuff. */ card->run_thread =1 ;
drivers/net/wireless/libertas/if_usb.c +1 -1
@@ -188,7 +188,7 @@ static void if_usb_setup_firmware(struct lbs_private *priv) }else {if (le16_to_cpu (wake_method.method) ==CMD_WAKE_METHOD_COMMAND_INT ) {lbs_deb_usb ("Firmware seems to support PS with wake-via-command\n" ); - priv->ps_supported =1 ; + priv->fwcapinfo &= ~FW_CAPINFO_PS ; }else {/* The versions which boot up this way don't seem to work even if we set it to the command interrupt */
drivers/net/wireless/libertas/wext.c +1 -1
@@ -712,7 +712,7 @@ static int lbs_set_power(struct net_device *dev, struct iw_request_info *info,lbs_deb_enter (LBS_DEB_WEXT ); -if (!priv->ps_supported) { +if (!(priv->fwcapinfo &FW_CAPINFO_PS )) {if (vwrq->disabled)return 0 ;else
Signature · 1 line
1.5.6.3
Quoted 74 lines · Andrey Yurovsky
Power save support depends on the firmware capabilities rather than the card's hardware interface. Use the
FW_CAPINFO_PSbit in the firmware capabilities mask throughout the driver in place of the redundantps_supportedflag and don't make decisions about PS support in the interface drivers (with the exception of a special case in the USB driver).Signed-off-by Andrey Yurovsky <[email protected]>--- drivers/net/wireless/libertas/dev.h | 1 - drivers/net/wireless/libertas/if_cs.c | 3 --- drivers/net/wireless/libertas/if_sdio.c | 3 --- drivers/net/wireless/libertas/if_spi.c | 1 - drivers/net/wireless/libertas/if_usb.c | 2 +- drivers/net/wireless/libertas/wext.c | 2 +- 6 files changed, 2 insertions(+), 10 deletions(-)drivers/net/wireless/libertas/dev.h +0
-1@@ -260,7 +260,6 @@ struct lbs_private {u16 psmode;/* Wlan802_11PowermodeCAM=disable Wlan802_11PowermodeMAX_PSP=enable */ u32 psstate; -char ps_supported;u8 needtowakeup;struct assoc_request * pending_assoc_req;drivers/net/wireless/libertas/if_cs.c +0
-3@@ -933,9 +933,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev) goto out3; } -/* The firmware for the CF card supports powersave */ - priv->ps_supported =1 ; - ret =0 ; goto out;drivers/net/wireless/libertas/if_sdio.c +0
-3@@ -1039,9 +1039,6 @@ static int if_sdio_probe(struct sdio_func *func,if (ret) goto err_activate_card; -if (priv->fwcapinfo &FW_CAPINFO_PS ) - priv->ps_supported =1 ; - out:lbs_deb_leave_args (LBS_DEB_SDIO ,"ret %d" , ret);drivers/net/wireless/libertas/if_spi.c +0
-1@@ -1117,7 +1117,6 @@ static int __devinit if_spi_probe(struct spi_device *spi) priv->card = card; priv->hw_host_to_card = if_spi_host_to_card; priv->fw_ready =1 ; - priv->ps_supported =1 ;/* Initialize interrupt handling stuff. */ card->run_thread =1 ;drivers/net/wireless/libertas/if_usb.c +0
-0
drivers/net/wireless/libertas/if_usb.c static void if_usb_setup_firmware(struct lbs_private *priv) · line 191
Quoted 5 lines
drivers/net/wireless/libertas/if_usb.c +1
-1@@ -188,7 +188,7 @@ static void if_usb_setup_firmware(struct lbs_private *priv) }else {if (le16_to_cpu (wake_method.method) ==CMD_WAKE_METHOD_COMMAND_INT ) {lbs_deb_usb ("Firmware seems to support PS with wake-via-command\n" ); - priv->ps_supported =1 ; + priv->fwcapinfo &= ~FW_CAPINFO_PS ;
This seems odd; wouldn't
priv->fwcapinfo |= FW_CAPINFO_PS;
be the right thing to do here?
Dan
Quoted 16 lines
drivers/net/wireless/libertas/if_usb.c +0
-0}else {/* The versions which boot up this way don't seem to work even if we set it to the command interrupt */ drivers/net/wireless/libertas/wext.c +1
-1@@ -712,7 +712,7 @@ static int lbs_set_power(struct net_device *dev, struct iw_request_info *info,lbs_deb_enter (LBS_DEB_WEXT ); -if (!priv->ps_supported) { +if (!(priv->fwcapinfo &FW_CAPINFO_PS )) {if (vwrq->disabled)return 0 ;else
PATCH v2 1/1 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.
--- drivers/net/wireless/libertas/dev.h | 1 - drivers/net/wireless/libertas/if_cs.c | 3 --- drivers/net/wireless/libertas/if_sdio.c | 3 --- drivers/net/wireless/libertas/if_spi.c | 1 - drivers/net/wireless/libertas/if_usb.c | 3 ++- drivers/net/wireless/libertas/wext.c | 2 +- 6 files changed, 3 insertions(+), 10 deletions(-)
drivers/net/wireless/libertas/dev.h +0 -1
@@ -260,7 +260,6 @@ struct lbs_private {u16 psmode;/* Wlan802_11PowermodeCAM=disable Wlan802_11PowermodeMAX_PSP=enable */ u32 psstate; -char ps_supported;u8 needtowakeup;struct assoc_request * pending_assoc_req;
drivers/net/wireless/libertas/if_cs.c +0 -3
@@ -933,9 +933,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev) goto out3; } -/* The firmware for the CF card supports powersave */ - priv->ps_supported =1 ; - ret =0 ; goto out;
drivers/net/wireless/libertas/if_sdio.c +0 -3
@@ -1039,9 +1039,6 @@ static int if_sdio_probe(struct sdio_func *func,if (ret) goto err_activate_card; -if (priv->fwcapinfo &FW_CAPINFO_PS ) - priv->ps_supported =1 ; - out:lbs_deb_leave_args (LBS_DEB_SDIO ,"ret %d" , ret);
drivers/net/wireless/libertas/if_spi.c +0 -1
@@ -1118,7 +1118,6 @@ static int __devinit if_spi_probe(struct spi_device *spi) priv->card = card; priv->hw_host_to_card = if_spi_host_to_card; priv->fw_ready =1 ; - priv->ps_supported =1 ;/* Initialize interrupt handling stuff. */ card->run_thread =1 ;
drivers/net/wireless/libertas/if_usb.c +2 -1
@@ -185,13 +185,14 @@ static void if_usb_setup_firmware(struct lbs_private *priv) wake_method.action =cpu_to_le16 (CMD_ACT_GET );if (lbs_cmd_with_response (priv,CMD_802_11_FW_WAKE_METHOD , &wake_method)) {lbs_pr_info ("Firmware does not seem to support PS mode\n" ); + priv->fwcapinfo &= ~FW_CAPINFO_PS ; }else {if (le16_to_cpu (wake_method.method) ==CMD_WAKE_METHOD_COMMAND_INT ) {lbs_deb_usb ("Firmware seems to support PS with wake-via-command\n" ); - priv->ps_supported =1 ; }else {/* The versions which boot up this way don't seem to work even if we set it to the command interrupt */ + priv->fwcapinfo &= ~FW_CAPINFO_PS ;lbs_pr_info ("Firmware doesn't wake via command interrupt; disabling PS mode\n" ); } }
drivers/net/wireless/libertas/wext.c +1 -1
@@ -712,7 +712,7 @@ static int lbs_set_power(struct net_device *dev, struct iw_request_info *info,lbs_deb_enter (LBS_DEB_WEXT ); -if (!priv->ps_supported) { +if (!(priv->fwcapinfo &FW_CAPINFO_PS )) {if (vwrq->disabled)return 0 ;else
Signature · 1 line
1.5.6.3
Quoted 10 lines · Andrey Yurovsky
Power save support depends on the firmware capabilities rather than the card's hardware interface. Use the
FW_CAPINFO_PSbit in the firmware capabilities mask throughout the driver in place of the redundantps_supportedflag 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 <[email protected]>
Quoted 101 lines
--- drivers/net/wireless/libertas/dev.h | 1 - drivers/net/wireless/libertas/if_cs.c | 3 --- drivers/net/wireless/libertas/if_sdio.c | 3 --- drivers/net/wireless/libertas/if_spi.c | 1 - drivers/net/wireless/libertas/if_usb.c | 3 ++- drivers/net/wireless/libertas/wext.c | 2 +- 6 files changed, 3 insertions(+), 10 deletions(-)drivers/net/wireless/libertas/dev.h +0
-1@@ -260,7 +260,6 @@ struct lbs_private {u16 psmode;/* Wlan802_11PowermodeCAM=disable Wlan802_11PowermodeMAX_PSP=enable */ u32 psstate; -char ps_supported;u8 needtowakeup;struct assoc_request * pending_assoc_req;drivers/net/wireless/libertas/if_cs.c +0
-3@@ -933,9 +933,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev) goto out3; } -/* The firmware for the CF card supports powersave */ - priv->ps_supported =1 ; - ret =0 ; goto out;drivers/net/wireless/libertas/if_sdio.c +0
-3@@ -1039,9 +1039,6 @@ static int if_sdio_probe(struct sdio_func *func,if (ret) goto err_activate_card; -if (priv->fwcapinfo &FW_CAPINFO_PS ) - priv->ps_supported =1 ; - out:lbs_deb_leave_args (LBS_DEB_SDIO ,"ret %d" , ret);drivers/net/wireless/libertas/if_spi.c +0
-1@@ -1118,7 +1118,6 @@ static int __devinit if_spi_probe(struct spi_device *spi) priv->card = card; priv->hw_host_to_card = if_spi_host_to_card; priv->fw_ready =1 ; - priv->ps_supported =1 ;/* Initialize interrupt handling stuff. */ card->run_thread =1 ;drivers/net/wireless/libertas/if_usb.c +2
-1@@ -185,13 +185,14 @@ static void if_usb_setup_firmware(struct lbs_private *priv) wake_method.action =cpu_to_le16 (CMD_ACT_GET );if (lbs_cmd_with_response (priv,CMD_802_11_FW_WAKE_METHOD , &wake_method)) {lbs_pr_info ("Firmware does not seem to support PS mode\n" ); + priv->fwcapinfo &= ~FW_CAPINFO_PS ; }else {if (le16_to_cpu (wake_method.method) ==CMD_WAKE_METHOD_COMMAND_INT ) {lbs_deb_usb ("Firmware seems to support PS with wake-via-command\n" ); - priv->ps_supported =1 ; }else {/* The versions which boot up this way don't seem to work even if we set it to the command interrupt */ + priv->fwcapinfo &= ~FW_CAPINFO_PS ;lbs_pr_info ("Firmware doesn't wake via command interrupt; disabling PS mode\n" ); } }drivers/net/wireless/libertas/wext.c +1
-1@@ -712,7 +712,7 @@ static int lbs_set_power(struct net_device *dev, struct iw_request_info *info,lbs_deb_enter (LBS_DEB_WEXT ); -if (!priv->ps_supported) { +if (!(priv->fwcapinfo &FW_CAPINFO_PS )) {if (vwrq->disabled)return 0 ;else Signature · 6 lines
1.5.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html