Browse Source

ath6kl: Restrict memcpy to bounce buffer only for write request

No need to copy received local buffer content to bounce buffer
(DMA buffer) while performing sync READ operation from the chip.

It's applicable for only WRITE operation.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Raja Mani 13 years ago
parent
commit
daa16bc52a
1 changed files with 4 additions and 1 deletions
  1. 4 1
      drivers/net/wireless/ath/ath6kl/sdio.c

+ 4 - 1
drivers/net/wireless/ath/ath6kl/sdio.c

@@ -405,7 +405,10 @@ static int ath6kl_sdio_read_write_sync(struct ath6kl *ar, u32 addr, u8 *buf,
 			return -ENOMEM;
 			return -ENOMEM;
 		mutex_lock(&ar_sdio->dma_buffer_mutex);
 		mutex_lock(&ar_sdio->dma_buffer_mutex);
 		tbuf = ar_sdio->dma_buffer;
 		tbuf = ar_sdio->dma_buffer;
-		memcpy(tbuf, buf, len);
+
+		if (request & HIF_WRITE)
+			memcpy(tbuf, buf, len);
+
 		bounced = true;
 		bounced = true;
 	} else
 	} else
 		tbuf = buf;
 		tbuf = buf;