summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_dma.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-07-24 14:41:13 +0200
committerJens Axboe <jens.axboe@oracle.com>2007-10-16 11:20:59 +0200
commit53d412fce05e73dd0b25b0ebfa83c7ee94f16451 (patch)
tree3aca42d6408bfcded0d5e829a9446a1c04af9b21 /drivers/infiniband/hw/ipath/ipath_dma.c
parent51cf22495ae2fe60ba28123e04059cff4ddd9461 (diff)
downloadlinux-stable-53d412fce05e73dd0b25b0ebfa83c7ee94f16451.tar.gz
linux-stable-53d412fce05e73dd0b25b0ebfa83c7ee94f16451.tar.bz2
linux-stable-53d412fce05e73dd0b25b0ebfa83c7ee94f16451.zip
infiniband: sg chaining support
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_dma.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_dma.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_dma.c b/drivers/infiniband/hw/ipath/ipath_dma.c
index f87f003e3ef8..22709a4f8fc8 100644
--- a/drivers/infiniband/hw/ipath/ipath_dma.c
+++ b/drivers/infiniband/hw/ipath/ipath_dma.c
@@ -30,6 +30,7 @@
* SOFTWARE.
*/
+#include <linux/scatterlist.h>
#include <rdma/ib_verbs.h>
#include "ipath_verbs.h"
@@ -96,17 +97,18 @@ static void ipath_dma_unmap_page(struct ib_device *dev,
BUG_ON(!valid_dma_direction(direction));
}
-static int ipath_map_sg(struct ib_device *dev, struct scatterlist *sg, int nents,
- enum dma_data_direction direction)
+static int ipath_map_sg(struct ib_device *dev, struct scatterlist *sgl,
+ int nents, enum dma_data_direction direction)
{
+ struct scatterlist *sg;
u64 addr;
int i;
int ret = nents;
BUG_ON(!valid_dma_direction(direction));
- for (i = 0; i < nents; i++) {
- addr = (u64) page_address(sg[i].page);
+ for_each_sg(sgl, sg, nents, i) {
+ addr = (u64) page_address(sg->page);
/* TODO: handle highmem pages */
if (!addr) {
ret = 0;