Example #1
0
/* Prototype: int powertecscsi_detect(Scsi_Host_Template * tpnt)
 * Purpose  : initialises PowerTec SCSI driver
 * Params   : tpnt - template for this SCSI adapter
 * Returns  : >0 if host found, 0 otherwise.
 */
static int powertecscsi_detect(Scsi_Host_Template *tpnt)
{
	static const card_ids powertecscsi_cids[] =
			{ POWERTECSCSI_LIST, { 0xffff, 0xffff} };
	struct expansion_card *ec;
	int count = 0, ret;

	ecard_startfind();

	while (1) {
		ec = ecard_find(0, powertecscsi_cids);
		if (!ec)
			break;

		ecard_claim(ec);

		ret = powertecscsi_probe(ec);
		if (ret) {
			ecard_release(ec);
			break;
		}
		++count;
	}
	return count;
}
Example #2
0
int oakscsi_detect(Scsi_Host_Template * tpnt)
{
    int count = 0;
    struct Scsi_Host *instance;

    tpnt->proc_name = "oakscsi";

    memset (ecs, 0, sizeof (ecs));

    ecard_startfind ();

    while(1) {
        if ((ecs[count] = ecard_find(0, oakscsi_cids)) == NULL)
            break;

        instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
        instance->io_port = OAK_ADDRESS(ecs[count]);
        instance->irq = OAK_IRQ(ecs[count]);

	NCR5380_init(instance, 0);
	ecard_claim(ecs[count]);

	instance->n_io_port = 255;
	request_region (instance->io_port, instance->n_io_port, "Oak SCSI");

	if (instance->irq != IRQ_NONE)
	    if (request_irq(instance->irq, do_oakscsi_intr, SA_INTERRUPT, "Oak SCSI", NULL)) {
		printk("scsi%d: IRQ%d not free, interrupts disabled\n",
		    instance->host_no, instance->irq);
		instance->irq = IRQ_NONE;
	    }

	if (instance->irq != IRQ_NONE) {
	    printk("scsi%d: eek! Interrupts enabled, but I don't think\n", instance->host_no);
	    printk("scsi%d: that the board had an interrupt!\n", instance->host_no);
	}

	printk("scsi%d: at port %lX irq", instance->host_no, instance->io_port);
	if (instance->irq == IRQ_NONE)
	    printk ("s disabled");
	else
	    printk (" %d", instance->irq);
	printk(" options CAN_QUEUE=%d  CMD_PER_LUN=%d release=%d",
	    tpnt->can_queue, tpnt->cmd_per_lun, OAKSCSI_PUBLIC_RELEASE);
	printk("\nscsi%d:", instance->host_no);
	NCR5380_print_options(instance);
	printk("\n");

	++count;
    }
#ifdef MODULE
    if(count == 0)
        printk("No oak scsi devices found\n");
#endif
    return count;
}
Example #3
0
int cumanascsi_detect(Scsi_Host_Template * tpnt)
{
    int count = 0;
    struct Scsi_Host *instance;

    tpnt->proc_name = "CumanaSCSI-1";

    memset (ecs, 0, sizeof (ecs));

    while(1) {
    	if((ecs[count] = ecard_find(0, cumanascsi_cids)) == NULL)
    		break;

        instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
        instance->io_port = CUMANA_ADDRESS(ecs[count]);
	instance->irq = CUMANA_IRQ(ecs[count]);

	NCR5380_init(instance, 0);
	ecard_claim(ecs[count]);

	instance->n_io_port = 255;
	request_region (instance->io_port, instance->n_io_port, "CumanaSCSI-1");

        ((struct NCR5380_hostdata *)instance->hostdata)->ctrl = 0;
        outb(0x00, instance->io_port - 577);

	if (instance->irq != IRQ_NONE)
	    if (request_irq(instance->irq, do_cumanascsi_intr, SA_INTERRUPT, "CumanaSCSI-1", NULL)) {
		printk("scsi%d: IRQ%d not free, interrupts disabled\n",
		    instance->host_no, instance->irq);
		instance->irq = IRQ_NONE;
	    }

	if (instance->irq == IRQ_NONE) {
	    printk("scsi%d: interrupts not enabled. for better interactive performance,\n", instance->host_no);
	    printk("scsi%d: please jumper the board for a free IRQ.\n", instance->host_no);
	}

	printk("scsi%d: at port %lX irq", instance->host_no, instance->io_port);
	if (instance->irq == IRQ_NONE)
	    printk ("s disabled");
	else
	    printk (" %d", instance->irq);
	printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d",
	    tpnt->can_queue, tpnt->cmd_per_lun, CUMANASCSI_PUBLIC_RELEASE);
	printk("\nscsi%d:", instance->host_no);
	NCR5380_print_options(instance);
	printk("\n");

	++count;
    }
    return count;
}
Example #4
0
__initfunc(int
ether3_probe(struct device *dev))
{
	struct expansion_card *ec;

	if (!dev)
		return ENODEV;

	ecard_startfind();

	if ((ec = ecard_find(0, ether3_cids)) == NULL)
		return ENODEV;

	ether3_get_dev(dev, ec);

	return ether3_probe1(dev);
}
Example #5
0
static int __init serial_card_init(void)
{
	int card = 0;

	ecard_startfind ();

	do {
		struct expansion_card *ec;
		unsigned long cardaddr;
		int port;

		ec = ecard_find (0, serial_cids);
		if (!ec)
			break;

		cardaddr = MY_BASE_ADDRESS(ec);

		for (port = 0; port < MY_NUMPORTS; port ++) {
			unsigned long address;
			int line;

			address = MY_PORT_ADDRESS(port, cardaddr);

			line = serial_register_onedev (address, ec->irq);
			if (line < 0)
				break;
			serial_ports[serial_pcount] = line;
			serial_addr[serial_pcount] = address;
			serial_pcount += 1;
		}

		if (port) {
			ecard_claim (ec);
			expcard[card] = ec;
		} else
			break;
	} while (++card < MAX_ECARDS);
	return card ? 0 : -ENODEV;
}
Example #6
0
int rapide_init(void)
{
	int i;

	for (i = 0; i < MAX_ECARDS; i++)
		ec[i] = NULL;

	ecard_startfind();

	for (i = 0; ; i++) {
		if ((ec[i] = ecard_find(0, rapide_cids)) == NULL)
			break;

		ecard_claim(ec[i]);
		result[i] = rapide_register(ec[i]);
	}
	for (i = 0; i < MAX_ECARDS; i++)
		if (ec[i] && result[i] < 0) {
			ecard_release(ec[i]);
			ec[i] = NULL;
	}
	return 0;
}
Example #7
0
/* Prototype: int powertecscsi_detect(Scsi_Host_Template * tpnt)
 * Purpose  : initialises PowerTec SCSI driver
 * Params   : tpnt - template for this SCSI adapter
 * Returns  : >0 if host found, 0 otherwise.
 */
int
powertecscsi_detect(Scsi_Host_Template *tpnt)
{
	static const card_ids powertecscsi_cids[] =
			{ POWERTECSCSI_LIST, { 0xffff, 0xffff} };
	int count = 0;
	struct Scsi_Host *host;
  
	tpnt->proc_dir = &proc_scsi_powertec;
	memset(ecs, 0, sizeof (ecs));

	ecard_startfind();

	while (1) {
	    	PowerTecScsi_Info *info;

		ecs[count] = ecard_find(0, powertecscsi_cids);
		if (!ecs[count])
			break;

		ecard_claim(ecs[count]);

		host = scsi_register(tpnt, sizeof (PowerTecScsi_Info));
		if (!host) {
			ecard_release(ecs[count]);
			break;
		}

		host->io_port = ecard_address(ecs[count], ECARD_IOC, ECARD_FAST);
		host->irq = ecs[count]->irq;
		host->dma_channel = ecs[count]->dma;
		info = (PowerTecScsi_Info *)host->hostdata;

		info->control.term_port = host->io_port + POWERTEC_TERM_CONTROL;
		info->control.terms = term[count] ? POWERTEC_TERM_ENABLE : 0;
		powertecscsi_terminator_ctl(host, info->control.terms);

		info->info.scsi.io_port	=
				host->io_port + POWERTEC_FAS216_OFFSET;
		info->info.scsi.io_shift= POWERTEC_FAS216_SHIFT;
		info->info.scsi.irq		= host->irq;
		info->info.ifcfg.clockrate	= POWERTEC_XTALFREQ;
		info->info.ifcfg.select_timeout	= 255;
		info->info.ifcfg.asyncperiod	= POWERTEC_ASYNC_PERIOD;
		info->info.ifcfg.sync_max_depth	= POWERTEC_SYNC_DEPTH;
		info->info.ifcfg.cntl3		= /*CNTL3_BS8 |*/ CNTL3_FASTSCSI | CNTL3_FASTCLK;
		info->info.ifcfg.disconnect_ok	= 1;
		info->info.ifcfg.wide_max_size	= 0;
		info->info.dma.setup		= powertecscsi_dma_setup;
		info->info.dma.pseudo		= NULL;
		info->info.dma.stop		= powertecscsi_dma_stop;

		ecs[count]->irqaddr	= (unsigned char *)
			    ioaddr(host->io_port + POWERTEC_INTR_STATUS);
		ecs[count]->irqmask	= POWERTEC_INTR_BIT;
		ecs[count]->irq_data	= (void *)
			    (host->io_port + POWERTEC_INTR_CONTROL);
		ecs[count]->ops		= (expansioncard_ops_t *)&powertecscsi_ops;

		request_region(host->io_port + POWERTEC_FAS216_OFFSET,
			       16 << POWERTEC_FAS216_SHIFT, "powertec2-fas");

		if (host->irq != NO_IRQ &&
		    request_irq(host->irq, powertecscsi_intr,
				SA_INTERRUPT, "powertec", host)) {
			printk("scsi%d: IRQ%d not free, interrupts disabled\n",
			       host->host_no, host->irq);
			host->irq = NO_IRQ;
			info->info.scsi.irq = NO_IRQ;
		}

		if (host->dma_channel != NO_DMA &&
		    request_dma(host->dma_channel, "powertec")) {
			printk("scsi%d: DMA%d not free, DMA disabled\n",
			       host->host_no, host->dma_channel);
			host->dma_channel = NO_DMA;
		}

		fas216_init(host);
		++count;
	}
	return count;
}