patch-2.4.0-test9 linux/drivers/scsi/mac53c94.c

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

diff -u --recursive --new-file v2.4.0-test8/linux/drivers/scsi/mac53c94.c linux/drivers/scsi/mac53c94.c
@@ -47,6 +47,7 @@
 	Scsi_Cmnd *current_req;		/* req we're currently working on */
 	enum fsc_phase phase;		/* what we're currently trying to do */
 	struct dbdma_cmd *dma_cmds;	/* space for dbdma commands, aligned */
+	void	*dma_cmd_space;
 };
 
 static struct fsc_state *all_53c94s;
@@ -113,6 +114,7 @@
 			DBDMA_ALIGN(dma_cmd_space);
 		memset(state->dma_cmds, 0, (host->sg_tablesize + 1)
 		       * sizeof(struct dbdma_cmd));
+		state->dma_cmd_space = dma_cmd_space;
 
 		*prev_statep = state;
 		prev_statep = &state->next;
@@ -130,6 +132,22 @@
 }
 
 int
+mac53c94_release(struct Scsi_Host *host)
+{
+	struct fsc_state *fp = (struct fsc_state *) host->hostdata;
+
+	if (fp == 0)
+		return 0;
+	if (fp->regs)
+		iounmap((void *) fp->regs);
+	if (fp->dma)
+		iounmap((void *) fp->dma);
+	kfree(fp->dma_cmd_space);
+	free_irq(fp->intr, fp);
+	return 0;
+}
+
+int
 mac53c94_queue(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
 {
 	unsigned long flags;
@@ -537,3 +555,7 @@
 		return 0;
 	}
 }
+
+static Scsi_Host_Template driver_template = SCSI_MAC53C94;
+
+#include "scsi_module.c"

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