diff -Nru src/common/iscsi_common.h ../../unh_iscsi_cvs_work/unh-iscsi/src/common/iscsi_common.h --- src/common/iscsi_common.h 2004-08-30 10:35:11.000000000 -0700 +++ ../../unh_iscsi_cvs_work/unh-iscsi/src/common/iscsi_common.h 2004-12-01 14:17:37.000000000 -0800 @@ -200,14 +200,14 @@ #ifndef __SCSI_TARGET__ /* Draft 20, Section 10.5.1 Function (field in TMF Request) */ -#define ABORT_TASK 1 -#define ABORT_TASK_SET 2 -#define CLEAR_ACA 3 -#define CLEAR_TASK_SET 4 -#define LUN_RESET 5 -#define TARGET_WARM_RESET 6 -#define TARGET_COLD_RESET 7 -#define TASK_REASSIGN 8 /* Changed to Task - SAI */ +#define ISCSI_ABORT_TASK 1 +#define ISCSI_ABORT_TASK_SET 2 +#define ISCSI_CLEAR_ACA 3 +#define ISCSI_CLEAR_TASK_SET 4 +#define ISCSI_LUN_RESET 5 +#define ISCSI_TARGET_WARM_RESET 6 +#define ISCSI_TARGET_COLD_RESET 7 +#define ISCSI_TASK_REASSIGN 8 /* Changed to Task - SAI */ #endif diff -Nru src/initiator/initiator_error_rec.c ../../unh_iscsi_cvs_work/unh-iscsi/src/initiator/initiator_error_rec.c --- src/initiator/initiator_error_rec.c 2004-09-17 08:43:25.000000000 -0700 +++ ../../unh_iscsi_cvs_work/unh-iscsi/src/initiator/initiator_error_rec.c 2004-12-01 14:15:41.000000000 -0800 @@ -765,7 +765,7 @@ TRACE(TRACE_DEBUG, "Populating task mgt command for connection " "recovery\n"); - task_mgt_command->task_mgt_function = TASK_REASSIGN; + task_mgt_command->task_mgt_function = ISCSI_TASK_REASSIGN; task_mgt_command->task_mgt_response = FUNCTION_REJECTED; task_mgt_command->ref_task_tag = cmd->init_task_tag; @@ -775,7 +775,7 @@ &task_mgt_command->iscsi_cmd; task_mgt_command_hdr->opcode = ISCSI_INIT_TASK_MGMT_CMND; task_mgt_command_hdr->opcode |= I_BIT; - task_mgt_command_hdr->function = TASK_REASSIGN; + task_mgt_command_hdr->function = ISCSI_TASK_REASSIGN; task_mgt_command_hdr->function |= F_BIT; task_mgt_command_hdr->lun = cmd->iscsi_cmd.lun; task_mgt_command_hdr->ref_task_tag = htonl(cmd->init_task_tag); diff -Nru src/initiator/initiator_rx.c ../../unh_iscsi_cvs_work/unh-iscsi/src/initiator/initiator_rx.c --- src/initiator/initiator_rx.c 2004-11-24 10:17:59.000000000 -0800 +++ ../../unh_iscsi_cvs_work/unh-iscsi/src/initiator/initiator_rx.c 2004-12-01 14:22:29.000000000 -0800 @@ -269,7 +269,7 @@ ->SCpnt->device->lun)) { TRACE_ERROR ("DataIn with ITT %u has invalid LUN %u, " - "expected %u\n", local_itt, lun + "expected %u\n", local_itt, lun, related_command->SCpnt->device->lun); } #else @@ -1153,7 +1153,7 @@ } /* Added the TASK REASSIGN handling for connection recovery - SAI */ - if (related_command->task_mgt_function == TASK_REASSIGN) { + if (related_command->task_mgt_function == ISCSI_TASK_REASSIGN) { found = 0; list_for_each_entry(cmd, ¤t_connection->pending_commands, diff -Nru src/initiator/initiator_utilities.c ../../unh_iscsi_cvs_work/unh-iscsi/src/initiator/initiator_utilities.c --- src/initiator/initiator_utilities.c 2004-11-24 10:17:59.000000000 -0800 +++ ../../unh_iscsi_cvs_work/unh-iscsi/src/initiator/initiator_utilities.c 2004-12-01 14:18:42.000000000 -0800 @@ -33,7 +33,7 @@ #include "initiator_utilities.h" #include "initiator_error_rec.h" #include "../common/lun_packing.h" -#include <../drivers/scsi/scsi.h> +#include /* holds bytes of zeros that are sent as pad bytes when needed */ static __u32 pad_bytes = 0; diff -Nru src/initiator/iscsi_initiator.c ../../unh_iscsi_cvs_work/unh-iscsi/src/initiator/iscsi_initiator.c --- src/initiator/iscsi_initiator.c 2004-12-01 14:27:55.000000000 -0800 +++ ../../unh_iscsi_cvs_work/unh-iscsi/src/initiator/iscsi_initiator.c 2004-12-01 14:20:51.000000000 -0800 @@ -36,7 +36,7 @@ #include "initiator_proc_iface.h" #include "../common/lun_packing.h" #include -#include <../drivers/scsi/scsi.h> +#include /* max number of redirects to follow during login on any connection */ #define MAX_REDIRECTION_RETRIES 2 @@ -204,7 +204,7 @@ * n < 0 on error. ***************************************************************************/ static int -iscsi_initiator_detect(Scsi_Host_Template * tmpt) +iscsi_initiator_detect(struct scsi_host_template * tmpt) { int retval = 1; struct Scsi_Host *host = NULL; @@ -1109,7 +1109,7 @@ related_itt = (*related_command)->init_task_tag; - task_mgt_command->task_mgt_function = ABORT_TASK; + task_mgt_command->task_mgt_function = ISCSI_ABORT_TASK; task_mgt_command->task_mgt_response = FUNCTION_REJECTED; @@ -1117,7 +1117,7 @@ task_mgt_command_hdr = (struct iscsi_init_task_mgt_command *) &task_mgt_command->iscsi_cmd; task_mgt_command_hdr->opcode = (ISCSI_INIT_TASK_MGMT_CMND | I_BIT); - task_mgt_command_hdr->function = (ABORT_TASK | F_BIT); + task_mgt_command_hdr->function = (ISCSI_ABORT_TASK | F_BIT); /* Ming Zhang, mingz@ele.uri.edu */ #ifdef K26 @@ -2950,7 +2950,7 @@ /* * A single static instance of this structure for this adaptor type */ -static Scsi_Host_Template driver_template = {\ +static struct scsi_host_template driver_template = {\ proc_info: iscsi_initiator_proc_info,\ name: OUR_NAME,\ detect: iscsi_initiator_detect,\ diff -Nru src/initiator/iscsi_initiator.h ../../unh_iscsi_cvs_work/unh-iscsi/src/initiator/iscsi_initiator.h --- src/initiator/iscsi_initiator.h 2004-12-01 14:27:55.000000000 -0800 +++ ../../unh_iscsi_cvs_work/unh-iscsi/src/initiator/iscsi_initiator.h 2004-12-01 14:21:44.000000000 -0800 @@ -63,7 +63,7 @@ #include #endif -#include +#include #include #include "../common/iscsi_common.h" diff -Nru src/target/iscsi_target.c ../../unh_iscsi_cvs_work/unh-iscsi/src/target/iscsi_target.c --- src/target/iscsi_target.c 2004-12-01 14:27:55.000000000 -0800 +++ ../../unh_iscsi_cvs_work/unh-iscsi/src/target/iscsi_target.c 2004-12-01 14:23:13.000000000 -0800 @@ -3493,7 +3493,7 @@ { struct iscsi_cmnd *ref_command; - if (cmnd->ref_function == ABORT_TASK) { + if (cmnd->ref_function == ISCSI_ABORT_TASK) { printk("ABORT TASK with ITT %u\n", cmnd->ref_task_tag); ref_command = search_tags(conn, cmnd->ref_task_tag, ALL_ONES, 1); if (ref_command == NULL) { @@ -3577,8 +3577,9 @@ * function. For all the other functions this field MUST be set to the * reserved value 0xffffffff." */ - if ((pdu->function != ABORT_TASK) && - (pdu->function != TASK_REASSIGN) && (pdu->ref_task_tag != ALL_ONES)) { + if ((pdu->function != ISCSI_ABORT_TASK) && + (pdu->function != ISCSI_TASK_REASSIGN) && + (pdu->ref_task_tag != ALL_ONES)) { TRACE_ERROR("%s task mgt request with RTT " "%u, should be 0x%08x for function %d\n", current->comm, pdu->ref_task_tag, ALL_ONES, pdu->function); @@ -6992,7 +6993,7 @@ mangle_inquiry_data(struct iscsi_cmnd *iscsi_command, struct iovec *iov, int start_iov, int limit_iov) { - Scsi_Request *req; + struct scsi_request *req; int data_size; int i, j, offset; int ver_desc_start; diff -Nru src/target/scsi_target.c ../../unh_iscsi_cvs_work/unh-iscsi/src/target/scsi_target.c --- src/target/scsi_target.c 2004-12-01 14:27:55.000000000 -0800 +++ ../../unh_iscsi_cvs_work/unh-iscsi/src/target/scsi_target.c 2004-12-01 14:24:07.000000000 -0800 @@ -858,7 +858,7 @@ /* execute function */ switch (msg->message) { - case ABORT_TASK: + case ISCSI_ABORT_TASK: { Target_Scsi_Cmnd *cmnd; cmnd = (Target_Scsi_Cmnd *)msg->value; @@ -888,7 +888,7 @@ break; } - case LUN_RESET: + case ISCSI_LUN_RESET: { /* BAD BAD REALLY BAD */ __u64 lun = *((__u64 *)msg->value); @@ -904,8 +904,8 @@ break; } - case TARGET_WARM_RESET: - case TARGET_COLD_RESET: + case ISCSI_TARGET_WARM_RESET: + case ISCSI_TARGET_COLD_RESET: { spin_lock_irqsave(&target_data.cmd_queue_lock, flags); list_for_each_entry(cmd_curr,&target_data.cmd_queue,link) { @@ -1435,17 +1435,18 @@ unsigned long flags; Target_Scsi_Message *msg; - if ((fn < ABORT_TASK) && (fn > TASK_REASSIGN)) { + if ((fn < ISCSI_ABORT_TASK) && (fn > ISCSI_TASK_REASSIGN)) { printk("rx_task_mgmt_fn: Invalid value %d for Task Mgmt function\n", fn); return NULL; } - if ((fn == ABORT_TASK_SET) || (fn == CLEAR_ACA) || (fn == CLEAR_TASK_SET)) { + if ((fn == ISCSI_ABORT_TASK_SET) || + (fn == ISCSI_CLEAR_ACA) || (fn == ISCSI_CLEAR_TASK_SET)) { printk("rx_task_mgmt_fn: task mgmt function %d not implemented\n", fn); return NULL; } - if ((fn == ABORT_TASK) && (value == NULL)) { + if ((fn == ISCSI_ABORT_TASK) && (value == NULL)) { printk("rx_task_mgmt_fn: Cannot abort a NULL command\n"); return NULL; } diff -Nru src/target/scsi_target.h ../../unh_iscsi_cvs_work/unh-iscsi/src/target/scsi_target.h --- src/target/scsi_target.h 2004-12-01 14:27:55.000000000 -0800 +++ ../../unh_iscsi_cvs_work/unh-iscsi/src/target/scsi_target.h 2004-12-01 14:07:22.000000000 -0800 @@ -135,14 +135,14 @@ /* Values for management functions from * RFC 3720 Section 10.5.1 Function (of TM Request) */ -#define ABORT_TASK 1 /*1000*/ -#define ABORT_TASK_SET 2 /*1001*/ -#define CLEAR_ACA 3 /*1002*/ -#define CLEAR_TASK_SET 4 /*1003*/ -#define LUN_RESET 5 /*1004*/ -#define TARGET_WARM_RESET 6 /*1005*/ -#define TARGET_COLD_RESET 7 -#define TASK_REASSIGN 8 +#define ISCSI_ABORT_TASK 1 /*1000*/ +#define ISCSI_ABORT_TASK_SET 2 /*1001*/ +#define ISCSI_CLEAR_ACA 3 /*1002*/ +#define ISCSI_CLEAR_TASK_SET 4 /*1003*/ +#define ISCSI_LUN_RESET 5 /*1004*/ +#define ISCSI_TARGET_WARM_RESET 6 /*1005*/ +#define ISCSI_TARGET_COLD_RESET 7 +#define ISCSI_TASK_REASSIGN 8 /* command response lengths */