summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cyberstorm.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-18 00:24:27 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-18 00:24:27 +0000
commitb9558d5f86c471a125abf1fb3a3882fb053b1f8c (patch)
tree707b53ec64e740a7da87d5f36485e3cd9b1c794e /drivers/scsi/cyberstorm.c
parentb3ac367c7a3e6047abe74817db27e34e759f279f (diff)
Merge with Linux 2.3.41.
Diffstat (limited to 'drivers/scsi/cyberstorm.c')
-rw-r--r--drivers/scsi/cyberstorm.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/drivers/scsi/cyberstorm.c b/drivers/scsi/cyberstorm.c
index 6f89486a5..4d720b99a 100644
--- a/drivers/scsi/cyberstorm.c
+++ b/drivers/scsi/cyberstorm.c
@@ -19,6 +19,7 @@
#include <linux/module.h>
+#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/types.h>
@@ -69,24 +70,28 @@ volatile unsigned char cmd_buffer[16];
int __init cyber_esp_detect(Scsi_Host_Template *tpnt)
{
struct NCR_ESP *esp;
- const struct ConfigDev *esp_dev;
- unsigned int key;
+ struct zorro_dev *z = NULL;
unsigned long address;
-
- if ((key = zorro_find(ZORRO_PROD_PHASE5_BLIZZARD_1220_CYBERSTORM, 0, 0)) ||
- (key = zorro_find(ZORRO_PROD_PHASE5_BLIZZARD_1230_II_FASTLANE_Z3_CYBERSCSI_CYBERSTORM060, 0, 0))){
- esp_dev = zorro_get_board(key);
-
+ while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
+ unsigned long board = z->resource.start;
+ if ((z->id == ZORRO_PROD_PHASE5_BLIZZARD_1220_CYBERSTORM ||
+ z->id == ZORRO_PROD_PHASE5_BLIZZARD_1230_II_FASTLANE_Z3_CYBERSCSI_CYBERSTORM060) &&
+ request_mem_region(board+CYBER_ESP_ADDR,
+ sizeof(struct ESP_regs), "NCR53C9x")) {
/* Figure out if this is a CyberStorm or really a
* Fastlane/Blizzard Mk II by looking at the board size.
* CyberStorm maps 64kB
* (ZORRO_PROD_PHASE5_BLIZZARD_1220_CYBERSTORM does anyway)
*/
- if((unsigned long)esp_dev->cd_BoardSize != 0x10000)
+ if(z->resource.end-board != 0xffff) {
+ release_mem_region(board+CYBER_ESP_ADDR,
+ sizeof(struct ESP_regs));
return 0;
+ }
+ strcpy(z->name, "Cyberstorm SCSI Host Adapter");
- esp = esp_allocate(tpnt, (void *) esp_dev);
+ esp = esp_allocate(tpnt, (void *)board+CYBER_ESP_ADDR);
/* Do command transfer with programmed I/O */
esp->do_pio_cmds = 1;
@@ -121,7 +126,7 @@ int __init cyber_esp_detect(Scsi_Host_Template *tpnt)
* relative to the device (i.e. in the same Zorro
* I/O block).
*/
- address = (unsigned long)ZTWO_VADDR(esp_dev->cd_BoardAddr);
+ address = (unsigned long)ZTWO_VADDR(board);
esp->dregs = (void *)(address + CYBER_DMA_ADDR);
/* ESP register base */
@@ -132,7 +137,6 @@ int __init cyber_esp_detect(Scsi_Host_Template *tpnt)
esp->esp_command_dvma = virt_to_bus(cmd_buffer);
esp->irq = IRQ_AMIGA_PORTS;
- esp->slot = key;
request_irq(IRQ_AMIGA_PORTS, esp_intr, SA_SHIRQ,
"CyberStorm SCSI", esp_intr);
/* Figure out our scsi ID on the bus */
@@ -148,11 +152,10 @@ int __init cyber_esp_detect(Scsi_Host_Template *tpnt)
esp_initialize(esp);
- zorro_config_board(key, 0);
-
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;
+ }
}
return 0;
}
@@ -314,12 +317,11 @@ Scsi_Host_Template driver_template = SCSI_CYBERSTORM;
int cyber_esp_release(struct Scsi_Host *instance)
{
#ifdef MODULE
- unsigned int key;
+ unsigned long address = (unsigned long)((struct NCR_ESP *)instance->hostdata)->edev;
- key = ((struct NCR_ESP *)instance->hostdata)->slot;
esp_deallocate((struct NCR_ESP *)instance->hostdata);
esp_release();
- zorro_unconfig_board(key, 0);
+ release_mem_region(address, sizeof(struct ESP_regs));
free_irq(IRQ_AMIGA_PORTS, esp_intr);
#endif
return 1;