2010-09-08 23:36:14

by Steve deRosier

[permalink] [raw]
Subject: [PATCH 1/3] libertas_tf: display debugging output only when debugging is enabled.

From: Mattia Barbon <[email protected]>

Signed-off-by: Mattia Barbon <[email protected]>
Signed-off-by: Steve deRosier <[email protected]>
---
drivers/net/wireless/libertas_tf/cmd.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/libertas_tf/cmd.c b/drivers/net/wireless/libertas_tf/cmd.c
index 8c15e35..1bca11b 100644
--- a/drivers/net/wireless/libertas_tf/cmd.c
+++ b/drivers/net/wireless/libertas_tf/cmd.c
@@ -741,10 +741,12 @@ int lbtf_process_rx_command(struct lbtf_private *priv)
respcmd = le16_to_cpu(resp->command);
result = le16_to_cpu(resp->result);

+#ifdef CONFIG_LIBERTAS_THINFIRM_DEBUG
if (net_ratelimit())
pr_info("libertastf: cmd response 0x%04x, seq %d, size %d\n",
respcmd, le16_to_cpu(resp->seqnum),
le16_to_cpu(resp->size));
+#endif

if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) {
spin_unlock_irqrestore(&priv->driver_lock, flags);
--
1.7.0



2010-09-08 23:36:18

by Steve deRosier

[permalink] [raw]
Subject: [PATCH 3/3] libertas_tf: flush the write queue in if_sdio_update_hw_spec.

From: Mattia Barbon <[email protected]>

After queuing the CMD_GET_HW_SPEC command, force a flush of the
write queue before waiting for the command response.

Signed-off-by: Mattia Barbon <[email protected]>
Signed-off-by: Steve deRosier <[email protected]>
---
drivers/net/wireless/libertas_tf/if_sdio.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/libertas_tf/if_sdio.c b/drivers/net/wireless/libertas_tf/if_sdio.c
index d3d101e..8660229 100644
--- a/drivers/net/wireless/libertas_tf/if_sdio.c
+++ b/drivers/net/wireless/libertas_tf/if_sdio.c
@@ -946,6 +946,8 @@ int if_sdio_update_hw_spec(struct if_sdio_card *card)
goto out;
}

+ flush_workqueue(card->workqueue);
+
/* Wait for and retrieve response */
timeout = jiffies + HZ;
while (wait_cmd_done < 1) {
--
1.7.0


2010-09-08 23:36:16

by Steve deRosier

[permalink] [raw]
Subject: [PATCH 2/3] libertas_tf: fix the check for firmware already running on IGEPv2 boards.

From: Mattia Barbon <[email protected]>

On IGEP boards, the scratch register reports 0x8000 when there is no
firmware running instead of 0x0000.

Signed-off-by: Mattia Barbon <[email protected]>
Signed-off-by: Steve deRosier <[email protected]>
---
drivers/net/wireless/libertas_tf/if_sdio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/libertas_tf/if_sdio.c b/drivers/net/wireless/libertas_tf/if_sdio.c
index d1624e3..d3d101e 100644
--- a/drivers/net/wireless/libertas_tf/if_sdio.c
+++ b/drivers/net/wireless/libertas_tf/if_sdio.c
@@ -738,7 +738,7 @@ static int if_sdio_prog_firmware(struct if_sdio_card *card)
if (scratch == IF_SDIO_FIRMWARE_OK) {
lbtf_deb_sdio("firmware already loaded\n");
goto success;
- } else if ((card->model == IF_SDIO_MODEL_8686) && (scratch > 0)) {
+ } else if ((card->model == IF_SDIO_MODEL_8686) && ((scratch & 0x7fff) != 0)) {
lbtf_deb_sdio("firmware may be running\n");
if( lbtf_reset_fw == 0 ) {
goto success;
--
1.7.0