compat: backport for ARM dma_sync_single_range_*() helpers
authorPavel Roskin <proski@gnu.org>
Thu, 18 Feb 2010 17:34:36 +0000 (09:34 -0800)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Thu, 18 Feb 2010 17:35:18 +0000 (09:35 -0800)
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 <proski@gnu.org>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
include/linux/compat-2.6.27.h

index 657cba06cdf26b374df90021788d5f83482e410c..e9de41eed5ed28493151280010bc05211a11e597 100644 (file)
@@ -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 */