- /* set up second controller on the Indigo2 */
- if(!sgi_guiness) {
- sgiwd93_host1 = scsi_register(SGIblows, sizeof(struct WD33C93_hostdata));
- if(sgiwd93_host1 != NULL)
- {
- sgiwd93_host1->base = (unsigned long) hregs1;
- sgiwd93_host1->irq = SGI_WD93_1_IRQ;
-
- buf = (uchar *) get_zeroed_page(GFP_KERNEL);
- if (!buf) {
- printk(KERN_WARNING "sgiwd93: Could not allocate memory for host1 buffer.\n");
- scsi_unregister(sgiwd93_host1);
- called = 1;
- return 1; /* We registered host0 so return success*/
- }
- init_hpc_chain(buf);
-
- /* HPC_SCSI_REG1 | 0x03 | KSEG1 */
- regs.SASR = (unsigned char*) KSEG1ADDR(0x1fbc8003);
- regs.SCMD = (unsigned char*) KSEG1ADDR(0x1fbc8007);
- wd33c93_init(sgiwd93_host1, regs, dma_setup, dma_stop,
- WD33C93_FS_16_20);
-
- hdata1 = (struct WD33C93_hostdata *)sgiwd93_host1->hostdata;
- hdata1->no_sync = 0;
- hdata1->dma_bounce_buffer = (uchar *) (KSEG1ADDR(buf));
-
- if (request_irq(SGI_WD93_1_IRQ, sgiwd93_intr, 0, "SGI WD93", (void *) sgiwd93_host1)) {
- printk(KERN_WARNING "sgiwd93: Could not allocate irq %d (for host1).\n", SGI_WD93_1_IRQ);
- wd33c93_release();
- free_page((unsigned long)buf);
- scsi_unregister(sgiwd93_host1);
- /* Fall through since host0 registered OK */
- }
- }
+ return host;
+
+out_free:
+ dma_free_coherent(NULL, PAGE_SIZE, hdata->hd.cpu, hdata->hd.dma);
+ wd33c93_release();
+
+out_unregister:
+ scsi_unregister(host);
+
+ return NULL;
+}
+
+static int __init sgiwd93_detect(struct scsi_host_template *SGIblows)
+{
+ int found = 0;
+
+ SGIblows->proc_name = "SGIWD93";
+ sgiwd93_host = sgiwd93_setup_scsi(SGIblows, 0, SGI_WD93_0_IRQ,
+ &hpc3c0->scsi_chan0,
+ (unsigned char *)hpc3c0->scsi0_ext);
+ if (sgiwd93_host)
+ found++;
+
+ /* Set up second controller on the Indigo2 */
+ if (ip22_is_fullhouse()) {
+ sgiwd93_host1 = sgiwd93_setup_scsi(SGIblows, 1, SGI_WD93_1_IRQ,
+ &hpc3c0->scsi_chan1,
+ (unsigned char *)hpc3c0->scsi1_ext);
+ if (sgiwd93_host1)
+ found++;