• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/drivers/scsi/

Lines Matching refs:base

214 	int base;
233 static void sym53c416_set_transfer_counter(int base, unsigned int len)
236 outb(len & 0x0000FF, base + TC_LOW);
237 outb((len & 0x00FF00) >> 8, base + TC_MID);
238 outb((len & 0xFF0000) >> 16, base + TC_HIGH);
244 static __inline__ unsigned int sym53c416_read(int base, unsigned char *buffer, unsigned int len)
256 bytes_left = inb(base + PIO_FIFO_CNT); /* Number of bytes in the PIO FIFO */
259 insl(base + PIO_FIFO_1, buffer, bytes_left >> 2);
267 *(buffer++) = inb(base + PIO_FIFO_1);
273 while(time_before(jiffies, i) && (inb(base + PIO_INT_REG) & EMPTY) && timeout)
274 if(inb(base + PIO_INT_REG) & SCI)
277 if(inb(base + PIO_INT_REG) & EMPTY)
286 static __inline__ unsigned int sym53c416_write(int base, unsigned char *buffer, unsigned int len)
298 bufferfree = PIO_SIZE - inb(base + PIO_FIFO_CNT);
303 outsl(base + PIO_FIFO_1, buffer, bufferfree >> 2);
311 outb(*(buffer++), base + PIO_FIFO_1);
317 while(time_before(jiffies, i) && (inb(base + PIO_INT_REG) & FULL) && timeout)
320 if(inb(base + PIO_INT_REG) & FULL)
331 int base = 0;
339 /* We search the base address of the host adapter which caused the interrupt */
340 for(i = 0; i < host_index && !base; i++)
342 base = hosts[i].base;
345 if(!base)
350 /* Now we have the base address and we can start handling the interrupt */
353 status_reg = inb(base + STATUS_REG);
354 pio_int_reg = inb(base + PIO_INT_REG);
355 int_reg = inb(base + INT_REG);
371 printk(KERN_WARNING "sym53c416: Illegal Command: 0x%02x.\n", inb(base + COMMAND_REG));
430 outb(FLUSH_FIFO, base + COMMAND_REG);
431 sym53c416_set_transfer_counter(base, current_command->request_bufflen);
432 outb(TRANSFER_INFORMATION | PIO_MODE, base + COMMAND_REG);
434 tot_trans = sym53c416_write(base, current_command->request_buffer, current_command->request_bufflen);
441 tot_trans += sym53c416_write(base, SG_ADDRESS(sglist), sglist->length);
456 outb(FLUSH_FIFO, base + COMMAND_REG);
457 sym53c416_set_transfer_counter(base, current_command->request_bufflen);
458 outb(TRANSFER_INFORMATION | PIO_MODE, base + COMMAND_REG);
460 tot_trans = sym53c416_read(base, current_command->request_buffer, current_command->request_bufflen);
467 tot_trans += sym53c416_read(base, SG_ADDRESS(sglist), sglist->length);
487 outb(FLUSH_FIFO, base + COMMAND_REG);
488 outb(INIT_COMM_COMPLETE_SEQ, base + COMMAND_REG);
502 outb(SET_ATN, base + COMMAND_REG);
503 outb(MSG_ACCEPTED, base + COMMAND_REG);
510 current_command->SCp.Status = inb(base + SCSI_FIFO);
511 current_command->SCp.Message = inb(base + SCSI_FIFO);
513 outb(SET_ATN, base + COMMAND_REG);
514 outb(MSG_ACCEPTED, base + COMMAND_REG);
522 static void sym53c416_init(int base, int scsi_id)
524 outb(RESET_CHIP, base + COMMAND_REG);
525 outb(NOOP, base + COMMAND_REG);
526 outb(0x99, base + TOM); /* Time out of 250 ms */
527 outb(0x05, base + STP);
528 outb(0x00, base + SYNC_OFFSET);
529 outb(EPC | scsi_id, base + CONF_REG_1);
530 outb(FE | SCSI2 | TBPA, base + CONF_REG_2);
531 outb(IDMRC | QTE | CDB10 | FSCSI | FCLK, base + CONF_REG_3);
532 outb(0x83 | EAN, base + CONF_REG_4);
533 outb(IE | WSE0, base + CONF_REG_5);
534 outb(0, base + FEATURE_EN);
537 static int sym53c416_probeirq(int base, int scsi_id)
543 inb(base + INT_REG);
547 sym53c416_init(base, scsi_id);
549 outb(NOOP, base + COMMAND_REG);
550 outb(ILLEGAL, base + COMMAND_REG);
551 outb(0x07, base + DEST_BUS_ID);
552 outb(0x00, base + DEST_BUS_ID);
555 while(time_before(jiffies, i) && !(inb(base + STATUS_REG) & SCI))
561 sym53c416_init(base, scsi_id);
565 /* Setup: sym53c416=base,irq */
578 printk(KERN_ERR "sym53c416: usage: sym53c416=<base>[,<irq>]\n");
582 if(hosts[i].base == ints[1])
586 hosts[host_index].base = ints[1];
592 static int sym53c416_test(int base)
594 outb(RESET_CHIP, base + COMMAND_REG);
595 outb(NOOP, base + COMMAND_REG);
596 if(inb(base + COMMAND_REG) != NOOP)
598 if(!inb(base + TC_HIGH) || inb(base + TC_HIGH) == 0xFF)
600 if((inb(base + PIO_INT_REG) & (FULL | EMPTY | CE | OUE | FIE | EIE)) != EMPTY)
618 int *base = probeaddrs;
622 for(; *base; base++) {
623 if (request_region(*base, IO_RANGE, ID)) {
624 if (sym53c416_test(*base)) {
625 ints[1] = *base;
628 release_region(*base, IO_RANGE);
704 if (!request_region(hosts[i].base, IO_RANGE, ID))
706 if (!sym53c416_test(hosts[i].base)) {
707 printk(KERN_WARNING "No sym53c416 found at address 0x%03x\n", hosts[i].base);
713 hosts[i].irq = sym53c416_probeirq(hosts[i].base, hosts[i].scsi_id);
725 shpnt->unique_id = hosts[i].base;
726 shpnt->io_port = hosts[i].base;
730 sym53c416_init(hosts[i].base, hosts[i].scsi_id);
738 release_region(hosts[i].base, IO_RANGE);
746 int base = SChost->io_port;
749 int rev = inb(base + TC_HIGH);
752 if(hosts[i].base == base)
754 sprintf(info, "Symbios Logic 53c416 (rev. %d) at 0x%03x, irq %d, SCSI-ID %d, %s pio", rev, base, irq, scsi_id, (fastpio)? "fast" : "slow");
760 int base;
764 /* Store base register as we can have more than one controller in the system */
765 base = SCpnt->device->host->io_port;
773 outb(scmd_id(SCpnt), base + DEST_BUS_ID); /* Set scsi id target */
774 outb(FLUSH_FIFO, base + COMMAND_REG); /* Flush SCSI and PIO FIFO's */
777 outb(SCpnt->cmnd[i], base + SCSI_FIFO);
779 outb(SEL_WITHOUT_ATN_SEQ, base + COMMAND_REG);
787 int base;
795 base = SCpnt->device->host->io_port;
797 if(hosts[i].base == base)
799 outb(RESET_CHIP, base + COMMAND_REG);
800 outb(NOOP | PIO_MODE, base + COMMAND_REG);
801 outb(RESET_SCSI_BUS, base + COMMAND_REG);
802 sym53c416_init(base, scsi_id);