Search Linux Wireless

[PATCH 02/33] wl12xx: reserver buffer for read32()/write32() in struct wl12xx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Kalle Valo <kalle.valo@xxxxxxxxx>

The buffer is needed for DMA safe transfers.

Signed-off-by: Kalle Valo <kalle.valo@xxxxxxxxx>
---

 drivers/net/wireless/wl12xx/spi.h    |    9 ++++-----
 drivers/net/wireless/wl12xx/wl12xx.h |    2 ++
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/spi.h b/drivers/net/wireless/wl12xx/spi.h
index fd3227e..f3f1895 100644
--- a/drivers/net/wireless/wl12xx/spi.h
+++ b/drivers/net/wireless/wl12xx/spi.h
@@ -94,16 +94,15 @@ void wl12xx_set_partition(struct wl12xx *wl,
 
 static inline u32 wl12xx_read32(struct wl12xx *wl, int addr)
 {
-	u32 response;
+	wl12xx_spi_read(wl, addr, &wl->buffer_32, sizeof(wl->buffer_32));
 
-	wl12xx_spi_read(wl, addr, &response, sizeof(u32));
-
-	return response;
+	return wl->buffer_32;
 }
 
 static inline void wl12xx_write32(struct wl12xx *wl, int addr, u32 val)
 {
-	wl12xx_spi_write(wl, addr, &val, sizeof(u32));
+	wl->buffer_32 = val;
+	wl12xx_spi_write(wl, addr, &wl->buffer_32, sizeof(wl->buffer_32));
 }
 
 #endif /* __WL12XX_SPI_H__ */
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index 4864143..f252a11 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -382,6 +382,8 @@ struct wl12xx {
 
 	struct wl12xx_stats stats;
 	struct wl12xx_debugfs debugfs;
+
+	u32 buffer_32;
 };
 
 int wl12xx_plt_start(struct wl12xx *wl);

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux