Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220965
b: refs/heads/master
c: 731b203
h: refs/heads/master
i:
  220963: 137dd02
v: v3
  • Loading branch information
Paul Fox authored and John W. Linville committed Oct 29, 2010
1 parent 31ec3c5 commit 7a99852
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4fc4fbd1d9a05fa4f348b499aca3a6f8d3c9bbe6
refs/heads/master: 731b2034999bbfe86c9074f1b0d611940bf7c323
32 changes: 29 additions & 3 deletions trunk/drivers/net/wireless/libertas/if_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,18 +684,40 @@ static int if_sdio_prog_firmware(struct if_sdio_card *card)

lbs_deb_enter(LBS_DEB_SDIO);

/*
* Disable interrupts
*/
sdio_claim_host(card->func);
sdio_writeb(card->func, 0x00, IF_SDIO_H_INT_MASK, &ret);
sdio_release_host(card->func);

sdio_claim_host(card->func);
scratch = if_sdio_read_scratch(card, &ret);
sdio_release_host(card->func);

lbs_deb_sdio("firmware status = %#x\n", scratch);
lbs_deb_sdio("scratch ret = %d\n", ret);

if (ret)
goto out;

lbs_deb_sdio("firmware status = %#x\n", scratch);

/*
* The manual clearly describes that FEDC is the right code to use
* to detect firmware presence, but for SD8686 it is not that simple.
* Scratch is also used to store the RX packet length, so we lose
* the FEDC value early on. So we use a non-zero check in order
* to validate firmware presence.
* Additionally, the SD8686 in the Gumstix always has the high scratch
* bit set, even when the firmware is not loaded. So we have to
* exclude that from the test.
*/
if (scratch == IF_SDIO_FIRMWARE_OK) {
lbs_deb_sdio("firmware already loaded\n");
goto success;
} else if ((card->model == MODEL_8686) && (scratch & 0x7fff)) {
lbs_deb_sdio("firmware may be running\n");
goto success;
}

ret = lbs_get_firmware(&card->func->dev, lbs_helper_name, lbs_fw_name,
Expand All @@ -709,10 +731,14 @@ static int if_sdio_prog_firmware(struct if_sdio_card *card)
if (ret)
goto out;

lbs_deb_sdio("Helper firmware loaded\n");

ret = if_sdio_prog_real(card, mainfw);
if (ret)
goto out;

lbs_deb_sdio("Firmware loaded\n");

success:
sdio_claim_host(card->func);
sdio_set_block_size(card->func, IF_SDIO_BLOCK_SIZE);
Expand Down Expand Up @@ -1042,8 +1068,6 @@ static int if_sdio_probe(struct sdio_func *func,
priv->exit_deep_sleep = if_sdio_exit_deep_sleep;
priv->reset_deep_sleep_wakeup = if_sdio_reset_deep_sleep_wakeup;

priv->fw_ready = 1;

sdio_claim_host(func);

/*
Expand All @@ -1064,6 +1088,8 @@ static int if_sdio_probe(struct sdio_func *func,
if (ret)
goto reclaim;

priv->fw_ready = 1;

/*
* FUNC_INIT is required for SD8688 WLAN/BT multiple functions
*/
Expand Down

0 comments on commit 7a99852

Please sign in to comment.