async_tx: kill ASYNC_TX_ASSUME_COHERENT
[linux-2.6.git] / crypto / async_tx / async_memcpy.c
index a973f4e..e8c8956 100644 (file)
@@ -35,8 +35,7 @@
  * @src: src page
  * @offset: offset in pages to start transaction
  * @len: length in bytes
- * @flags: ASYNC_TX_ASSUME_COHERENT, ASYNC_TX_ACK, ASYNC_TX_DEP_ACK,
- *     ASYNC_TX_KMAP_SRC, ASYNC_TX_KMAP_DST
+ * @flags: ASYNC_TX_ACK, ASYNC_TX_DEP_ACK,
  * @depend_tx: memcpy depends on the result of this transaction
  * @cb_fn: function to call when the memcpy completes
  * @cb_param: parameter to pass to the callback routine
@@ -56,20 +55,15 @@ async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset,
 
        if (tx) { /* run the memcpy asynchronously */
                dma_addr_t addr;
-               enum dma_data_direction dir;
 
                pr_debug("%s: (async) len: %zu\n", __FUNCTION__, len);
 
-               dir = (flags & ASYNC_TX_ASSUME_COHERENT) ?
-                       DMA_NONE : DMA_FROM_DEVICE;
-
-               addr = dma_map_page(device->dev, dest, dest_offset, len, dir);
+               addr = dma_map_page(device->dev, dest, dest_offset, len,
+                                   DMA_FROM_DEVICE);
                tx->tx_set_dest(addr, tx, 0);
 
-               dir = (flags & ASYNC_TX_ASSUME_COHERENT) ?
-                       DMA_NONE : DMA_TO_DEVICE;
-
-               addr = dma_map_page(device->dev, src, src_offset, len, dir);
+               addr = dma_map_page(device->dev, src, src_offset, len,
+                                   DMA_TO_DEVICE);
                tx->tx_set_src(addr, tx, 0);
 
                async_tx_submit(chan, tx, flags, depend_tx, cb_fn, cb_param);
@@ -88,23 +82,13 @@ async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset,
                                        __FUNCTION__);
                }
 
-               if (flags & ASYNC_TX_KMAP_DST)
-                       dest_buf = kmap_atomic(dest, KM_USER0) + dest_offset;
-               else
-                       dest_buf = page_address(dest) + dest_offset;
-
-               if (flags & ASYNC_TX_KMAP_SRC)
-                       src_buf = kmap_atomic(src, KM_USER0) + src_offset;
-               else
-                       src_buf = page_address(src) + src_offset;
+               dest_buf = kmap_atomic(dest, KM_USER0) + dest_offset;
+               src_buf = kmap_atomic(src, KM_USER1) + src_offset;
 
                memcpy(dest_buf, src_buf, len);
 
-               if (flags & ASYNC_TX_KMAP_DST)
-                       kunmap_atomic(dest_buf, KM_USER0);
-
-               if (flags & ASYNC_TX_KMAP_SRC)
-                       kunmap_atomic(src_buf, KM_USER0);
+               kunmap_atomic(dest_buf, KM_USER0);
+               kunmap_atomic(src_buf, KM_USER1);
 
                async_tx_sync_epilog(flags, depend_tx, cb_fn, cb_param);
        }