patch-2.2.13 linux/drivers/scsi/mesh.c

Next file: linux/drivers/scsi/mesh.h
Previous file: linux/drivers/scsi/mac53c94.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.12/linux/drivers/scsi/mesh.c linux/drivers/scsi/mesh.c
@@ -40,6 +40,8 @@
  * - retry arbitration if lost (unless higher levels do this for us)
  */
 
+#define MESH_NEW_STYLE_EH
+
 #if 1
 #undef KERN_DEBUG
 #define KERN_DEBUG KERN_WARNING
@@ -151,10 +153,12 @@
 	u8	msgout[16];
 	struct dbdma_cmd *dma_cmds;	/* space for dbdma commands, aligned */
 	int	clk_freq;
+	struct mesh_target tgts[8];
+#ifndef MESH_NEW_STYLE_EH
 	Scsi_Cmnd *completed_q;
 	Scsi_Cmnd *completed_qtail;
-	struct mesh_target tgts[8];
 	struct tq_struct tqueue;
+#endif
 #ifdef MESH_DBG
 	int	log_ix;
 	int	n_log;
@@ -186,7 +190,9 @@
 static void mesh_dump_regs(struct mesh_state *);
 static void mesh_start(struct mesh_state *);
 static void mesh_start_cmd(struct mesh_state *, Scsi_Cmnd *);
+#ifndef MESH_NEW_STYLE_EH
 static void finish_cmds(void *);
+#endif
 static void add_sdtr_msg(struct mesh_state *);
 static void set_sdtr(struct mesh_state *, int, int);
 static void start_phase(struct mesh_state *);
@@ -284,10 +290,10 @@
 			ms->tgts[tgt].sync_params = ASYNC_PARAMS;
 			ms->tgts[tgt].current_req = 0;
 		}
-
+#ifndef MESH_NEW_STYLE_EH
 		ms->tqueue.routine = finish_cmds;
 		ms->tqueue.data = ms;
-
+#endif
 		*prev_statep = ms;
 		prev_statep = &ms->next;
 
@@ -430,7 +436,9 @@
 	{
 		handle_reset(ms);
 		restore_flags(flags);
+#ifndef MESH_NEW_STYLE_EH
 		finish_cmds(ms);
+#endif
 		ret |= SCSI_RESET_SUCCESS;
 	}
 	return ret;
@@ -679,6 +687,7 @@
 	}
 }
 
+#ifndef MESH_NEW_STYLE_EH
 static void
 finish_cmds(void *data)
 {
@@ -698,6 +707,7 @@
 		spin_unlock_irqrestore(&io_request_lock, flags);
 	}
 }
+#endif /* MESH_NEW_STYLE_EH */
 
 static inline void
 add_sdtr_msg(struct mesh_state *ms)
@@ -1645,7 +1655,9 @@
 static void
 mesh_completed(struct mesh_state *ms, Scsi_Cmnd *cmd)
 {
-#if 1
+#ifdef MESH_NEW_STYLE_EH
+	(*cmd->scsi_done)(cmd);
+#else
 	if (ms->completed_q == NULL)
 		ms->completed_q = cmd;
 	else
@@ -1654,9 +1666,7 @@
 	cmd->host_scribble = NULL;
 	queue_task(&ms->tqueue, &tq_immediate);
 	mark_bh(IMMEDIATE_BH);
-#else
-	(*cmd->scsi_done)(cmd);
-#endif
+#endif /* MESH_NEW_STYLE_EH */
 }
 
 /*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)