Index: iser_initiator.c
===================================================================
--- iser_initiator.c	(revision 5924)
+++ iser_initiator.c	(working copy)
@@ -38,6 +38,7 @@
 #include <asm/scatterlist.h>
 #include <linux/scatterlist.h>
 #include <scsi/scsi_cmnd.h>
+#include <linux/version.h>
 
 #include "iscsi_iser.h"
 
@@ -379,6 +380,7 @@ int iser_send_command(struct iscsi_iser_
 	else
 		data_buf = &ctask->data[ISER_DIR_OUT];
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
 	if (sc->use_sg) { /* using a scatter list */
 		data_buf->buf  = sc->request_buffer;
 		data_buf->size = sc->use_sg;
@@ -388,7 +390,13 @@ int iser_send_command(struct iscsi_iser_
 		data_buf->buf   = &data_buf->sg_single;
 		data_buf->size  = 1;
 	}
-
+#else
+	if (sc->sc_data_direction != DMA_NONE) {
+		BUG_ON(sc->use_sg == 0);
+		data_buf->buf  = sc->request_buffer;
+		data_buf->size = sc->use_sg;
+	}		
+#endif
 	if (hdr->flags & ISCSI_FLAG_CMD_READ) {
 		err = iser_prepare_read_cmd(ctask, edtl);
 		if (err)
