diff options
Diffstat (limited to 'drivers/scsi/cyberstorm.c')
-rw-r--r-- | drivers/scsi/cyberstorm.c | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/drivers/scsi/cyberstorm.c b/drivers/scsi/cyberstorm.c index e59bb49c4..6f89486a5 100644 --- a/drivers/scsi/cyberstorm.c +++ b/drivers/scsi/cyberstorm.c @@ -17,6 +17,8 @@ * routines in this file used to be inline! */ +#include <linux/module.h> + #include <linux/kernel.h> #include <linux/delay.h> #include <linux/types.h> @@ -64,7 +66,7 @@ volatile unsigned char cmd_buffer[16]; */ /***************************************************************** Detection */ -int cyber_esp_detect(Scsi_Host_Template *tpnt) +int __init cyber_esp_detect(Scsi_Host_Template *tpnt) { struct NCR_ESP *esp; const struct ConfigDev *esp_dev; @@ -127,10 +129,11 @@ int cyber_esp_detect(Scsi_Host_Template *tpnt) /* Set the command buffer */ esp->esp_command = (volatile unsigned char*) cmd_buffer; - esp->esp_command_dvma = virt_to_bus((unsigned long) cmd_buffer); + esp->esp_command_dvma = virt_to_bus(cmd_buffer); esp->irq = IRQ_AMIGA_PORTS; - request_irq(IRQ_AMIGA_PORTS, esp_intr, 0, + esp->slot = key; + request_irq(IRQ_AMIGA_PORTS, esp_intr, SA_SHIRQ, "CyberStorm SCSI", esp_intr); /* Figure out our scsi ID on the bus */ /* The DMA cond flag contains a hardcoded jumper bit @@ -140,15 +143,14 @@ int cyber_esp_detect(Scsi_Host_Template *tpnt) */ esp->scsi_id = 7; - /* Check for differential SCSI-bus */ - /* What is this stuff? */ + /* We don't have a differential SCSI-bus. */ esp->diff = 0; esp_initialize(esp); zorro_config_board(key, 0); - printk("\nESP: Total of %d ESP hosts found, %d actually in use.\n", nesps,esps_in_use); + printk("ESP: Total of %d ESP hosts found, %d actually in use.\n", nesps, esps_in_use); esps_running = esps_in_use; return esps_in_use; } @@ -263,7 +265,7 @@ static void dma_ints_on(struct NCR_ESP *esp) static int dma_irq_p(struct NCR_ESP *esp) { /* It's important to check the DMA IRQ bit in the correct way! */ - return ((esp->eregs->esp_status & ESP_STAT_INTR) && + return ((esp_read(esp->eregs->esp_status) & ESP_STAT_INTR) && ((((struct cyber_dma_registers *)(esp->dregs))->cond_reg) & CYBER_DMA_HNDL_INTR)); } @@ -296,3 +298,29 @@ static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) dma_init_write(esp, addr, count); } } + +#ifdef MODULE + +#define HOSTS_C + +#include "cyberstorm.h" + +Scsi_Host_Template driver_template = SCSI_CYBERSTORM; + +#include "scsi_module.c" + +#endif + +int cyber_esp_release(struct Scsi_Host *instance) +{ +#ifdef MODULE + unsigned int key; + + key = ((struct NCR_ESP *)instance->hostdata)->slot; + esp_deallocate((struct NCR_ESP *)instance->hostdata); + esp_release(); + zorro_unconfig_board(key, 0); + free_irq(IRQ_AMIGA_PORTS, esp_intr); +#endif + return 1; +} |