[PATCH] libertas: fix power save issue in libertas_sdio module

Bing Zhao bzhao at marvell.com
Thu Feb 5 01:22:39 EST 2009


The problem: "iwconfig ethX power on" returns error

The cause: "ps_supported" flag was never set for SD8385/8686

The fix: check firmware capabilities returned by GET_HW_SPEC command.
Set "ps_supported" to 1 if FW_CAPINFO_PS bit is on. This fix applies
to SDIO interface only.

Signed-off-by: Bing Zhao <bzhao at marvell.com>
---
 drivers/net/wireless/libertas/defs.h    |    1 +
 drivers/net/wireless/libertas/if_sdio.c |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/libertas/defs.h
b/drivers/net/wireless/libertas/defs.h
index c364e4c..10a43c5 100644
--- a/drivers/net/wireless/libertas/defs.h
+++ b/drivers/net/wireless/libertas/defs.h
@@ -263,6 +263,7 @@ static inline void lbs_deb_hex(unsigned int grp,
const char *prompt, u8 *buf, in
=20
 #define	CMD_F_HOSTCMD		(1 << 0)
 #define FW_CAPINFO_WPA  	(1 << 0)
+#define FW_CAPINFO_PS  		(1 << 1)
 #define FW_CAPINFO_FIRMWARE_UPGRADE	(1 << 13)
 #define FW_CAPINFO_BOOT2_UPGRADE	(1<<14)
 #define FW_CAPINFO_PERSISTENT_CONFIG	(1<<15)
diff --git a/drivers/net/wireless/libertas/if_sdio.c
b/drivers/net/wireless/libertas/if_sdio.c
index 4519d73..9878368 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -209,6 +209,9 @@ static int if_sdio_handle_event(struct if_sdio_card
*card,
 		event =3D sdio_readb(card->func, IF_SDIO_EVENT, &ret);
 		if (ret)
 			goto out;
+
+		/* right shift 3 bits to get the event id */
+		event >>=3D 3;
 	} else {
 		if (size < 4) {
 			lbs_deb_sdio("event packet too small (%d
bytes)\n",
@@ -921,6 +924,9 @@ static int if_sdio_probe(struct sdio_func *func,
 	if (ret)
 		goto err_activate_card;
=20
+	if (priv->fwcapinfo & FW_CAPINFO_PS)
+		priv->ps_supported =3D 1;
+
 out:
 	lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
=20
--=20
1.5.3.6

-----------------------------------------------------------------------




More information about the libertas-dev mailing list