From ef968cbcfb8d08c94ea2349987808cfdbc4690e0 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 18 Feb 2010 09:34:36 -0800 Subject: [PATCH] compat: backport for ARM dma_sync_single_range_*() helpers This backports for ARM dma_sync_single_range_for_cpu() and dma_sync_single_range_for_device() needed by the b44 Ethernet driver. Signed-off-by: Pavel Roskin Signed-off-by: Luis R. Rodriguez --- include/linux/compat-2.6.27.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/linux/compat-2.6.27.h b/include/linux/compat-2.6.27.h index 657cba06cdf2..e9de41eed5ed 100644 --- a/include/linux/compat-2.6.27.h +++ b/include/linux/compat-2.6.27.h @@ -188,6 +188,30 @@ static inline int iwe_stream_lcp_len(struct iw_request_info *info) return IW_EV_LCP_LEN; } +#ifdef CONFIG_ARM + +/* + * The caller asks to handle a range between offset and offset + size, + * but we process a larger range from 0 to offset + size due to lack of + * offset support. + */ + +static inline void dma_sync_single_range_for_cpu(struct device *dev, + dma_addr_t handle, unsigned long offset, size_t size, + enum dma_data_direction dir) +{ + dma_sync_single_for_cpu(dev, handle, offset + size, dir); +} + +static inline void dma_sync_single_range_for_device(struct device *dev, + dma_addr_t handle, unsigned long offset, size_t size, + enum dma_data_direction dir) +{ + dma_sync_single_for_device(dev, handle, offset + size, dir); +} + +#endif /* arm */ + #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) */ #endif /* LINUX_26_27_COMPAT_H */ -- 2.30.2