libertas: fix IEEE PS mode in GSPI driver

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, June 18, 2009 - 3:02 pm

Gitweb:     http://git.kernel.org/linus/b3781c74373489fa325ce64efdf72f6c8567b783
Commit:     b3781c74373489fa325ce64efdf72f6c8567b783
Parent:     68f2d02669f7102be80aae47155f45e18950d223
Author:     Andrey Yurovsky <andrey@cozybit.com>
AuthorDate: Fri Jun 12 12:45:36 2009 -0700
Committer:  John W. Linville <linville@tuxdriver.com>
CommitDate: Mon Jun 15 15:05:51 2009 -0400

    libertas: fix IEEE PS mode in GSPI driver
    
    The card firmware does not set the Command Download Ready interrupt bit
    when IEEE PS mode is enabled, preventing the driver from sending
    commands (such as the command to exit IEEE PS mode) since there is no
    indication that the card is ready to accept commands.
    
    This patch works around the problem by using the the TX Download Ready
    bit in place of the Command Download Ready Bit while in IEEE PS mode.
    TX Download Ready is set in IEEE PS mode.
    
    Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
    Signed-off-by: Javier Cardona <javier@cozybit.com>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/libertas/if_spi.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index f8c2898..dc2a1f6 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -875,7 +875,12 @@ static int lbs_spi_thread(void *data)
 			err = if_spi_c2h_data(card);
 			if (err)
 				goto err;
-		if (hiStatus & IF_SPI_HIST_CMD_DOWNLOAD_RDY) {
+
+		/* workaround: in PS mode, the card does not set the Command
+		 * Download Ready bit, but it sets TX Download Ready. */
+		if (hiStatus & IF_SPI_HIST_CMD_DOWNLOAD_RDY ||
+		   (card->priv->psstate != PS_STATE_FULL_POWER &&
+		    (hiStatus & IF_SPI_HIST_TX_DOWNLOAD_RDY))) {
 			/* This means two things. First of all,
 			 * if there was a previous command sent, the card has
 			 * successfully received it.
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
libertas: fix IEEE PS mode in GSPI driver, Linux Kernel Mailing ..., (Thu Jun 18, 3:02 pm)