diff options
| author | Tomas Winkler <tomas.winkler@intel.com> | 2009-12-15 23:26:26 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2009-12-23 17:13:32 -0500 |
| commit | fe45332ed289d91e57eca11bfd1ca75d6e420ab4 (patch) | |
| tree | 949e268337d8f219eda5b3dcb0a441ee500d351a /drivers/misc | |
| parent | 0df828f670b1fd8c469f3d60472ddca0d0f51fcf (diff) | |
iwmc3200top: simplify imwct_tx
1. remove address argument since we use same address IWMC_SDIO_DATA_ADDR in
all cases
2. add __iwmct_tx - non locking tx function for already locked contexts
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/misc')
| -rw-r--r-- | drivers/misc/iwmc3200top/fw-download.c | 4 | ||||
| -rw-r--r-- | drivers/misc/iwmc3200top/iwmc3200top.h | 4 | ||||
| -rw-r--r-- | drivers/misc/iwmc3200top/main.c | 34 |
3 files changed, 19 insertions, 23 deletions
diff --git a/drivers/misc/iwmc3200top/fw-download.c b/drivers/misc/iwmc3200top/fw-download.c index 07055afef858..9dbaeb574e63 100644 --- a/drivers/misc/iwmc3200top/fw-download.c +++ b/drivers/misc/iwmc3200top/fw-download.c | |||
| @@ -228,7 +228,7 @@ static int iwmct_download_section(struct iwmct_priv *priv, const u8 *p_sec, | |||
| 228 | hdr->cmd = cpu_to_le32(cmd); | 228 | hdr->cmd = cpu_to_le32(cmd); |
| 229 | /* send it down */ | 229 | /* send it down */ |
| 230 | /* TODO: add more proper sending and error checking */ | 230 | /* TODO: add more proper sending and error checking */ |
| 231 | ret = iwmct_tx(priv, 0, parser->buf, trans_size); | 231 | ret = iwmct_tx(priv, parser->buf, trans_size); |
| 232 | if (ret != 0) { | 232 | if (ret != 0) { |
| 233 | LOG_INFO(priv, FW_DOWNLOAD, | 233 | LOG_INFO(priv, FW_DOWNLOAD, |
| 234 | "iwmct_tx returned %d\n", ret); | 234 | "iwmct_tx returned %d\n", ret); |
| @@ -280,7 +280,7 @@ static int iwmct_kick_fw(struct iwmct_priv *priv, bool jump) | |||
| 280 | LOG_HEXDUMP(FW_DOWNLOAD, parser->buf, sizeof(*hdr)); | 280 | LOG_HEXDUMP(FW_DOWNLOAD, parser->buf, sizeof(*hdr)); |
| 281 | /* send it down */ | 281 | /* send it down */ |
| 282 | /* TODO: add more proper sending and error checking */ | 282 | /* TODO: add more proper sending and error checking */ |
| 283 | ret = iwmct_tx(priv, 0, parser->buf, IWMC_SDIO_BLK_SIZE); | 283 | ret = iwmct_tx(priv, parser->buf, IWMC_SDIO_BLK_SIZE); |
| 284 | if (ret) | 284 | if (ret) |
| 285 | LOG_INFO(priv, FW_DOWNLOAD, "iwmct_tx returned %d", ret); | 285 | LOG_INFO(priv, FW_DOWNLOAD, "iwmct_tx returned %d", ret); |
| 286 | 286 | ||
diff --git a/drivers/misc/iwmc3200top/iwmc3200top.h b/drivers/misc/iwmc3200top/iwmc3200top.h index 43bd510e1872..740ff0738ea8 100644 --- a/drivers/misc/iwmc3200top/iwmc3200top.h +++ b/drivers/misc/iwmc3200top/iwmc3200top.h | |||
| @@ -196,9 +196,7 @@ struct iwmct_priv { | |||
| 196 | struct list_head read_req_list; | 196 | struct list_head read_req_list; |
| 197 | }; | 197 | }; |
| 198 | 198 | ||
| 199 | extern int iwmct_tx(struct iwmct_priv *priv, unsigned int addr, | 199 | extern int iwmct_tx(struct iwmct_priv *priv, void *src, int count); |
| 200 | void *src, int count); | ||
| 201 | |||
| 202 | extern int iwmct_fw_load(struct iwmct_priv *priv); | 200 | extern int iwmct_fw_load(struct iwmct_priv *priv); |
| 203 | 201 | ||
| 204 | extern void iwmct_dbg_init_params(struct iwmct_priv *drv); | 202 | extern void iwmct_dbg_init_params(struct iwmct_priv *drv); |
diff --git a/drivers/misc/iwmc3200top/main.c b/drivers/misc/iwmc3200top/main.c index 38627949ff54..dd0a3913bf6d 100644 --- a/drivers/misc/iwmc3200top/main.c +++ b/drivers/misc/iwmc3200top/main.c | |||
| @@ -49,6 +49,20 @@ MODULE_LICENSE("GPL"); | |||
| 49 | MODULE_AUTHOR(DRIVER_COPYRIGHT); | 49 | MODULE_AUTHOR(DRIVER_COPYRIGHT); |
| 50 | MODULE_FIRMWARE(FW_NAME(FW_API_VER)); | 50 | MODULE_FIRMWARE(FW_NAME(FW_API_VER)); |
| 51 | 51 | ||
| 52 | |||
| 53 | static inline int __iwmct_tx(struct iwmct_priv *priv, void *src, int count) | ||
| 54 | { | ||
| 55 | return sdio_memcpy_toio(priv->func, IWMC_SDIO_DATA_ADDR, src, count); | ||
| 56 | |||
| 57 | } | ||
| 58 | int iwmct_tx(struct iwmct_priv *priv, void *src, int count) | ||
| 59 | { | ||
| 60 | int ret; | ||
| 61 | sdio_claim_host(priv->func); | ||
| 62 | ret = __iwmct_tx(priv, src, count); | ||
| 63 | sdio_release_host(priv->func); | ||
| 64 | return ret; | ||
| 65 | } | ||
| 52 | /* | 66 | /* |
| 53 | * This workers main task is to wait for OP_OPR_ALIVE | 67 | * This workers main task is to wait for OP_OPR_ALIVE |
| 54 | * from TOP FW until ALIVE_MSG_TIMOUT timeout is elapsed. | 68 | * from TOP FW until ALIVE_MSG_TIMOUT timeout is elapsed. |
| @@ -158,27 +172,12 @@ int iwmct_send_hcmd(struct iwmct_priv *priv, u8 *cmd, u16 len) | |||
| 158 | } | 172 | } |
| 159 | 173 | ||
| 160 | memcpy(buf, cmd, len); | 174 | memcpy(buf, cmd, len); |
| 161 | 175 | ret = iwmct_tx(priv, buf, FW_HCMD_BLOCK_SIZE); | |
| 162 | sdio_claim_host(priv->func); | ||
| 163 | ret = sdio_memcpy_toio(priv->func, IWMC_SDIO_DATA_ADDR, buf, | ||
| 164 | FW_HCMD_BLOCK_SIZE); | ||
| 165 | sdio_release_host(priv->func); | ||
| 166 | 176 | ||
| 167 | kfree(buf); | 177 | kfree(buf); |
| 168 | return ret; | 178 | return ret; |
| 169 | } | 179 | } |
| 170 | 180 | ||
| 171 | int iwmct_tx(struct iwmct_priv *priv, unsigned int addr, | ||
| 172 | void *src, int count) | ||
| 173 | { | ||
| 174 | int ret; | ||
| 175 | |||
| 176 | sdio_claim_host(priv->func); | ||
| 177 | ret = sdio_memcpy_toio(priv->func, addr, src, count); | ||
| 178 | sdio_release_host(priv->func); | ||
| 179 | |||
| 180 | return ret; | ||
| 181 | } | ||
| 182 | 181 | ||
| 183 | static void iwmct_irq_read_worker(struct work_struct *ws) | 182 | static void iwmct_irq_read_worker(struct work_struct *ws) |
| 184 | { | 183 | { |
| @@ -273,8 +272,7 @@ static void iwmct_irq_read_worker(struct work_struct *ws) | |||
| 273 | 272 | ||
| 274 | if (barker & BARKER_DNLOAD_SYNC_MSK) { | 273 | if (barker & BARKER_DNLOAD_SYNC_MSK) { |
| 275 | /* Send the same barker back */ | 274 | /* Send the same barker back */ |
| 276 | ret = sdio_memcpy_toio(priv->func, IWMC_SDIO_DATA_ADDR, | 275 | ret = __iwmct_tx(priv, buf, iosize); |
| 277 | buf, iosize); | ||
| 278 | if (ret) { | 276 | if (ret) { |
| 279 | LOG_ERROR(priv, IRQ, | 277 | LOG_ERROR(priv, IRQ, |
| 280 | "error %d echoing barker\n", ret); | 278 | "error %d echoing barker\n", ret); |
