Return-path: Received: from mx2.redhat.com ([66.187.237.31]:60762 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754253AbZFPTlF (ORCPT ); Tue, 16 Jun 2009 15:41:05 -0400 Subject: Re: [PATCH v2] libertas: fix IEEE PS mode in GSPI driver From: Dan Williams To: Andrey Yurovsky Cc: linux-wireless@vger.kernel.org, Javier Cardona , libertas-dev@lists.infradead.org In-Reply-To: <1244835936-17188-1-git-send-email-andrey@cozybit.com> References: <1244762625-29618-1-git-send-email-andrey@cozybit.com> <1244835936-17188-1-git-send-email-andrey@cozybit.com> Content-Type: text/plain Date: Tue, 16 Jun 2009 15:40:54 -0400 Message-Id: <1245181254.28992.8.camel@130.81.190.10.in-addr.arpa> Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Fri, 2009-06-12 at 12:45 -0700, Andrey Yurovsky wrote: > 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 > Signed-off-by: Javier Cardona Acked-by: Dan Williams > --- > 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.