Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183239
b: refs/heads/master
c: fe45332
h: refs/heads/master
i:
  183237: 136dfe7
  183235: 7184a60
  183231: b4508de
v: v3
  • Loading branch information
Tomas Winkler authored and David S. Miller committed Dec 23, 2009
1 parent ff58e10 commit 0177349
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 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: 0df828f670b1fd8c469f3d60472ddca0d0f51fcf
refs/heads/master: fe45332ed289d91e57eca11bfd1ca75d6e420ab4
4 changes: 2 additions & 2 deletions trunk/drivers/misc/iwmc3200top/fw-download.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static int iwmct_download_section(struct iwmct_priv *priv, const u8 *p_sec,
hdr->cmd = cpu_to_le32(cmd);
/* send it down */
/* TODO: add more proper sending and error checking */
ret = iwmct_tx(priv, 0, parser->buf, trans_size);
ret = iwmct_tx(priv, parser->buf, trans_size);
if (ret != 0) {
LOG_INFO(priv, FW_DOWNLOAD,
"iwmct_tx returned %d\n", ret);
Expand Down Expand Up @@ -280,7 +280,7 @@ static int iwmct_kick_fw(struct iwmct_priv *priv, bool jump)
LOG_HEXDUMP(FW_DOWNLOAD, parser->buf, sizeof(*hdr));
/* send it down */
/* TODO: add more proper sending and error checking */
ret = iwmct_tx(priv, 0, parser->buf, IWMC_SDIO_BLK_SIZE);
ret = iwmct_tx(priv, parser->buf, IWMC_SDIO_BLK_SIZE);
if (ret)
LOG_INFO(priv, FW_DOWNLOAD, "iwmct_tx returned %d", ret);

Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/misc/iwmc3200top/iwmc3200top.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,7 @@ struct iwmct_priv {
struct list_head read_req_list;
};

extern int iwmct_tx(struct iwmct_priv *priv, unsigned int addr,
void *src, int count);

extern int iwmct_tx(struct iwmct_priv *priv, void *src, int count);
extern int iwmct_fw_load(struct iwmct_priv *priv);

extern void iwmct_dbg_init_params(struct iwmct_priv *drv);
Expand Down
34 changes: 16 additions & 18 deletions trunk/drivers/misc/iwmc3200top/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@ MODULE_LICENSE("GPL");
MODULE_AUTHOR(DRIVER_COPYRIGHT);
MODULE_FIRMWARE(FW_NAME(FW_API_VER));


static inline int __iwmct_tx(struct iwmct_priv *priv, void *src, int count)
{
return sdio_memcpy_toio(priv->func, IWMC_SDIO_DATA_ADDR, src, count);

}
int iwmct_tx(struct iwmct_priv *priv, void *src, int count)
{
int ret;
sdio_claim_host(priv->func);
ret = __iwmct_tx(priv, src, count);
sdio_release_host(priv->func);
return ret;
}
/*
* This workers main task is to wait for OP_OPR_ALIVE
* from TOP FW until ALIVE_MSG_TIMOUT timeout is elapsed.
Expand Down Expand Up @@ -158,27 +172,12 @@ int iwmct_send_hcmd(struct iwmct_priv *priv, u8 *cmd, u16 len)
}

memcpy(buf, cmd, len);

sdio_claim_host(priv->func);
ret = sdio_memcpy_toio(priv->func, IWMC_SDIO_DATA_ADDR, buf,
FW_HCMD_BLOCK_SIZE);
sdio_release_host(priv->func);
ret = iwmct_tx(priv, buf, FW_HCMD_BLOCK_SIZE);

kfree(buf);
return ret;
}

int iwmct_tx(struct iwmct_priv *priv, unsigned int addr,
void *src, int count)
{
int ret;

sdio_claim_host(priv->func);
ret = sdio_memcpy_toio(priv->func, addr, src, count);
sdio_release_host(priv->func);

return ret;
}

static void iwmct_irq_read_worker(struct work_struct *ws)
{
Expand Down Expand Up @@ -273,8 +272,7 @@ static void iwmct_irq_read_worker(struct work_struct *ws)

if (barker & BARKER_DNLOAD_SYNC_MSK) {
/* Send the same barker back */
ret = sdio_memcpy_toio(priv->func, IWMC_SDIO_DATA_ADDR,
buf, iosize);
ret = __iwmct_tx(priv, buf, iosize);
if (ret) {
LOG_ERROR(priv, IRQ,
"error %d echoing barker\n", ret);
Expand Down

0 comments on commit 0177349

Please sign in to comment.