by Doug Ledford, hch and alan.
int
mptscsih_slave_attach(Scsi_Device *device)
{
- struct Scsi_Host *host = device->host;
VirtDevice *pTarget;
- MPT_SCSI_HOST *hd;
- int ii, max;
-
- hd = (MPT_SCSI_HOST *)host->hostdata;
- if (hd->Targets != NULL) {
- if (hd->is_spi)
- max = MPT_MAX_SCSI_DEVICES;
- else
- max = MPT_MAX_FC_DEVICES<256 ? MPT_MAX_FC_DEVICES : 255;
--
- for (ii=0; ii < max; ii++) {
- pTarget = hd->Targets[ii];
- if (pTarget && !(pTarget->tflags & MPT_TARGET_FLAGS_Q_YES)) {
- scsi_adjust_queue_depth(device, 0, 1);
- }
- }
+ pTarget = device->hostdata;
+ if (!device->tagged_supported ||
+ !(pTarget->tflags & MPT_TARGET_FLAGS_Q_YES)) {
+ scsi_adjust_queue_depth(device, 0, 1);
+ } else {
+ scsi_adjust_queue_depth(device, MSG_SIMPLE_TAG,
+ device->host->can_queue >> 1);
}
return 0;
}
#else
extern int x_scsi_bios_param(Disk *, kdev_t, int *);
#endif
+extern int x_scsi_slave_attach(Scsi_Device *);
extern void x_scsi_taskmgmt_bh(void *);
+ extern int x_scsi_slave_attach(Scsi_Device *);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
#define PROC_SCSI_DECL
#define MPT_SCSIHOST { \
PROC_SCSI_DECL \
- name: "MPT SCSI Host", \
- detect: x_scsi_detect, \
- release: x_scsi_release, \
- info: x_scsi_info, \
- queuecommand: x_scsi_queuecommand, \
- eh_abort_handler: x_scsi_abort, \
- eh_device_reset_handler: x_scsi_dev_reset, \
- eh_bus_reset_handler: x_scsi_bus_reset, \
- eh_host_reset_handler: x_scsi_host_reset, \
- bios_param: x_scsi_bios_param, \
- slave_attach: x_scsi_slave_attach, \
- can_queue: MPT_SCSI_CAN_QUEUE, \
- this_id: -1, \
- sg_tablesize: MPT_SCSI_SG_DEPTH, \
- max_sectors: MPT_SCSI_MAX_SECTORS, \
- cmd_per_lun: MPT_SCSI_CMD_PER_LUN, \
- unchecked_isa_dma: 0, \
- use_clustering: ENABLE_CLUSTERING, \
+ .name = "MPT SCSI Host", \
+ .detect = x_scsi_detect, \
+ .release = x_scsi_release, \
+ .info = x_scsi_info, \
+ .queuecommand = x_scsi_queuecommand, \
+ .slave_attach = x_scsi_slave_attach, \
+ .eh_abort_handler = x_scsi_abort, \
+ .eh_device_reset_handler = x_scsi_dev_reset, \
+ .eh_bus_reset_handler = x_scsi_bus_reset, \
+ .eh_host_reset_handler = x_scsi_host_reset, \
+ .bios_param = x_scsi_bios_param, \
+ .can_queue = MPT_SCSI_CAN_QUEUE, \
+ .this_id = -1, \
+ .sg_tablesize = MPT_SCSI_SG_DEPTH, \
+ .max_sectors = MPT_SCSI_MAX_SECTORS, \
+ .cmd_per_lun = MPT_SCSI_CMD_PER_LUN, \
+ .use_clustering = ENABLE_CLUSTERING, \
++ .slave_attach x_scsi_slave_attach, \
}
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,1) */
}
- int
- NCR53c406a_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)){
- int i;
- unsigned long flags = 0;
+ static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
+ {
+ int i;
+
+ VDEB(printk("NCR53c406a_queue called\n"));
+ DEB(printk("cmd=%02x, cmd_len=%02x, target=%02x, lun=%02x, bufflen=%d\n", SCpnt->cmnd[0], SCpnt->cmd_len, SCpnt->target, SCpnt->lun, SCpnt->request_bufflen));
- VDEB(printk("NCR53c406a_queue called\n"));
- DEB(printk("cmd=%02x, cmd_len=%02x, target=%02x, lun=%02x, bufflen=%d\n",
- SCpnt->cmnd[0],
- SCpnt->cmd_len,
- SCpnt->target,
- SCpnt->lun,
- SCpnt->request_bufflen));
-
#if 0
- VDEB(for(i=0; i<SCpnt->cmd_len; i++)
- printk("cmd[%d]=%02x ", i, SCpnt->cmnd[i]));
- VDEB(printk("\n"));
+ VDEB(for (i = 0; i < SCpnt->cmd_len; i++)
+ printk("cmd[%d]=%02x ", i, SCpnt->cmnd[i]));
+ VDEB(printk("\n"));
#endif
-
- current_SC = SCpnt;
- current_SC->scsi_done = done;
- current_SC->SCp.phase = command_ph;
- current_SC->SCp.Status = 0;
- current_SC->SCp.Message = 0;
-
- save_flags(flags);
- cli();
- REG0;
- outb(SCpnt->target, DEST_ID); /* set destination */
- outb(FLUSH_FIFO, CMD_REG); /* reset the fifos */
-
- for(i=0; i<SCpnt->cmd_len; i++){
- outb(SCpnt->cmnd[i], SCSI_FIFO);
- }
- outb(SELECT_NO_ATN, CMD_REG);
- restore_flags(flags);
-
- rtrc(1);
- return 0;
+
+ current_SC = SCpnt;
+ current_SC->scsi_done = done;
+ current_SC->SCp.phase = command_ph;
+ current_SC->SCp.Status = 0;
+ current_SC->SCp.Message = 0;
+
+ /* We are locked here already by the mid layer */
+ REG0;
+ outb(SCpnt->target, DEST_ID); /* set destination */
+ outb(FLUSH_FIFO, CMD_REG); /* reset the fifos */
+
+ for (i = 0; i < SCpnt->cmd_len; i++) {
+ outb(SCpnt->cmnd[i], SCSI_FIFO);
+ }
+ outb(SELECT_NO_ATN, CMD_REG);
+
+ rtrc(1);
+ return 0;
+ }
+
+ static int NCR53c406a_abort(Scsi_Cmnd * SCpnt)
+ {
+ DEB(printk("NCR53c406a_abort called\n"));
+ return FAILED; /* Don't know how to abort */
+ }
+
+ static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt)
+ {
+ DEB(printk("NCR53c406a_reset called\n"));
+ outb(C4_IMG, CONFIG4); /* Select reg set 0 */
+ outb(CHIP_RESET, CMD_REG);
+ outb(SCSI_NOP, CMD_REG); /* required after reset */
+ outb(SCSI_RESET, CMD_REG);
+ chip_init();
+
+ rtrc(2);
+ return SUCCESS;
}
- int
- NCR53c406a_abort(Scsi_Cmnd *SCpnt){
- DEB(printk("NCR53c406a_abort called\n"));
- return SCSI_ABORT_SNOOZE; /* Don't know how to abort */
+ static int NCR53c406a_device_reset(Scsi_Cmnd * SCpnt)
+ {
+ return FAILED;
}
- int
- NCR53c406a_reset(Scsi_Cmnd *SCpnt, unsigned int ignored){
- DEB(printk("NCR53c406a_reset called\n"));
- outb(C4_IMG, CONFIG4); /* Select reg set 0 */
- outb(CHIP_RESET, CMD_REG);
- outb(SCSI_NOP, CMD_REG); /* required after reset */
- outb(SCSI_RESET, CMD_REG);
- chip_init();
-
- rtrc(2);
- if (irq_level)
- return SCSI_RESET_PENDING; /* should get an interrupt */
- else
- return SCSI_RESET_WAKEUP; /* won't get any interrupts */
+ static int NCR53c406a_bus_reset(Scsi_Cmnd * SCpnt)
+ {
+ return FAILED;
}
- int
- NCR53c406a_biosparm(struct scsi_device *sdev, struct block_device *bdev,
- sector_t capacity, int* info_array){
- int size;
-
- DEB(printk("NCR53c406a_biosparm called\n"));
-
- size = capacity;
- info_array[0] = 64; /* heads */
- info_array[1] = 32; /* sectors */
- info_array[2] = size>>11; /* cylinders */
- if (info_array[2] > 1024) { /* big disk */
- info_array[0] = 255;
- info_array[1] = 63;
- info_array[2] = size / (255*63);
- }
- return 0;
- }
-
- static void
- do_NCR53c406a_intr(int unused, void *dev_id, struct pt_regs *regs){
- unsigned long flags;
- struct Scsi_Host * dev = dev_id;
-
- spin_lock_irqsave(dev->host_lock, flags);
- NCR53c406a_intr(0, dev_id, regs);
- spin_unlock_irqrestore(dev->host_lock, flags);
-static int NCR53c406a_biosparm(Scsi_Disk * disk, struct block_device *dev, int *info_array)
++static int NCR53c406a_biosparm(Scsi_Disk * disk, struct block_device *dev,
++ sector_t capacity, int *info_array)
+ {
+ int size;
+
+ DEB(printk("NCR53c406a_biosparm called\n"));
+
- size = disk->capacity;
++ size = capacity;
+ info_array[0] = 64; /* heads */
+ info_array[1] = 32; /* sectors */
+ info_array[2] = size >> 11; /* cylinders */
+ if (info_array[2] > 1024) { /* big disk */
+ info_array[0] = 255;
+ info_array[1] = 63;
+ info_array[2] = size / (255 * 63);
+ }
+ return 0;
+ }
+
+ static void do_NCR53c406a_intr(int unused, void *dev_id, struct pt_regs *regs)
+ {
+ unsigned long flags;
+ struct Scsi_Host *dev = dev_id;
+
+ spin_lock_irqsave(dev->host_lock, flags);
+ NCR53c406a_intr(0, dev_id, regs);
+ spin_unlock_irqrestore(dev->host_lock, flags);
}
- static void
- NCR53c406a_intr(int unused, void *dev_id, struct pt_regs *regs){
- DEB(unsigned char fifo_size;)
- DEB(unsigned char seq_reg;)
- unsigned char status, int_reg;
- unsigned long flags = 0;
+ static void NCR53c406a_intr(int unused, void *dev_id, struct pt_regs *regs)
+ {
+ DEB(unsigned char fifo_size;
+ )
+ DEB(unsigned char seq_reg;
+ )
+ unsigned char status, int_reg;
#if USE_PIO
- unsigned char pio_status;
- struct scatterlist *sglist;
- unsigned int sgcount;
+ unsigned char pio_status;
+ struct scatterlist *sglist;
+ unsigned int sgcount;
#endif
-
- VDEB(printk("NCR53c406a_intr called\n"));
-
- save_flags(flags);
- cli();
+
+ VDEB(printk("NCR53c406a_intr called\n"));
+
#if USE_PIO
- REG1;
- pio_status = inb(PIO_STATUS);
+ REG1;
+ pio_status = inb(PIO_STATUS);
#endif
- REG0;
- status = inb(STAT_REG);
- DEB(seq_reg = inb(SEQ_REG));
- int_reg = inb(INT_REG);
- DEB(fifo_size = inb(FIFO_FLAGS) & 0x1f);
- restore_flags(flags);
-
+ REG0;
+ status = inb(STAT_REG);
+ DEB(seq_reg = inb(SEQ_REG));
+ int_reg = inb(INT_REG);
+ DEB(fifo_size = inb(FIFO_FLAGS) & 0x1f);
+
#if NCR53C406A_DEBUG
- printk("status=%02x, seq_reg=%02x, int_reg=%02x, fifo_size=%02x",
- status, seq_reg, int_reg, fifo_size);
+ printk("status=%02x, seq_reg=%02x, int_reg=%02x, fifo_size=%02x", status, seq_reg, int_reg, fifo_size);
#if (USE_DMA)
- printk("\n");
+ printk("\n");
#else
- printk(", pio=%02x\n", pio_status);
- #endif /* USE_DMA */
- #endif /* NCR53C406A_DEBUG */
-
- if(int_reg & 0x80){ /* SCSI reset intr */
- rtrc(3);
- DEB(printk("NCR53c406a: reset intr received\n"));
- current_SC->SCp.phase = idle;
- current_SC->result = DID_RESET << 16;
- current_SC->scsi_done(current_SC);
- return;
- }
-
+ printk(", pio=%02x\n", pio_status);
+ #endif /* USE_DMA */
+ #endif /* NCR53C406A_DEBUG */
+
+ if (int_reg & 0x80) { /* SCSI reset intr */
+ rtrc(3);
+ DEB(printk("NCR53c406a: reset intr received\n"));
+ current_SC->SCp.phase = idle;
+ current_SC->result = DID_RESET << 16;
+ current_SC->scsi_done(current_SC);
+ return;
+ }
#if USE_PIO
- if(pio_status & 0x80) {
- printk("NCR53C406A: Warning: PIO error!\n");
- current_SC->SCp.phase = idle;
- current_SC->result = DID_ERROR << 16;
- current_SC->scsi_done(current_SC);
- return;
- }
- #endif /* USE_PIO */
-
- if(status & 0x20) { /* Parity error */
- printk("NCR53c406a: Warning: parity error!\n");
- current_SC->SCp.phase = idle;
- current_SC->result = DID_PARITY << 16;
- current_SC->scsi_done(current_SC);
- return;
- }
-
- if(status & 0x40) { /* Gross error */
- printk("NCR53c406a: Warning: gross error!\n");
- current_SC->SCp.phase = idle;
- current_SC->result = DID_ERROR << 16;
- current_SC->scsi_done(current_SC);
- return;
- }
-
- if(int_reg & 0x20){ /* Disconnect */
- DEB(printk("NCR53c406a: disconnect intr received\n"));
- if(current_SC->SCp.phase != message_in){ /* Unexpected disconnect */
- current_SC->result = DID_NO_CONNECT << 16;
- }
- else{ /* Command complete, return status and message */
- current_SC->result = (current_SC->SCp.Status & 0xff)
- | ((current_SC->SCp.Message & 0xff) << 8) | (DID_OK << 16);
- }
-
- rtrc(0);
- current_SC->SCp.phase = idle;
- current_SC->scsi_done( current_SC );
- return;
- }
-
- switch(status & 0x07){ /* scsi phase */
- case 0x00: /* DATA-OUT */
- if(int_reg & 0x10){ /* Target requesting info transfer */
- rtrc(5);
- current_SC->SCp.phase = data_out;
- VDEB(printk("NCR53c406a: Data-Out phase\n"));
- outb(FLUSH_FIFO, CMD_REG);
- LOAD_DMA_COUNT(current_SC->request_bufflen); /* Max transfer size */
+ if (pio_status & 0x80) {
+ printk("NCR53C406A: Warning: PIO error!\n");
+ current_SC->SCp.phase = idle;
+ current_SC->result = DID_ERROR << 16;
+ current_SC->scsi_done(current_SC);
+ return;
+ }
+ #endif /* USE_PIO */
+
+ if (status & 0x20) { /* Parity error */
+ printk("NCR53c406a: Warning: parity error!\n");
+ current_SC->SCp.phase = idle;
+ current_SC->result = DID_PARITY << 16;
+ current_SC->scsi_done(current_SC);
+ return;
+ }
+
+ if (status & 0x40) { /* Gross error */
+ printk("NCR53c406a: Warning: gross error!\n");
+ current_SC->SCp.phase = idle;
+ current_SC->result = DID_ERROR << 16;
+ current_SC->scsi_done(current_SC);
+ return;
+ }
+
+ if (int_reg & 0x20) { /* Disconnect */
+ DEB(printk("NCR53c406a: disconnect intr received\n"));
+ if (current_SC->SCp.phase != message_in) { /* Unexpected disconnect */
+ current_SC->result = DID_NO_CONNECT << 16;
+ } else { /* Command complete, return status and message */
+ current_SC->result = (current_SC->SCp.Status & 0xff)
+ | ((current_SC->SCp.Message & 0xff) << 8) | (DID_OK << 16);
+ }
+
+ rtrc(0);
+ current_SC->SCp.phase = idle;
+ current_SC->scsi_done(current_SC);
+ return;
+ }
+
+ switch (status & 0x07) { /* scsi phase */
+ case 0x00: /* DATA-OUT */
+ if (int_reg & 0x10) { /* Target requesting info transfer */
+ rtrc(5);
+ current_SC->SCp.phase = data_out;
+ VDEB(printk("NCR53c406a: Data-Out phase\n"));
+ outb(FLUSH_FIFO, CMD_REG);
+ LOAD_DMA_COUNT(current_SC->request_bufflen); /* Max transfer size */
#if USE_DMA /* No s/g support for DMA */
- NCR53c406a_dma_write(current_SC->request_buffer,
- current_SC->request_bufflen);
- #endif /* USE_DMA */
- outb(TRANSFER_INFO | DMA_OP, CMD_REG);
+ NCR53c406a_dma_write(current_SC->request_buffer, current_SC->request_bufflen);
+ #endif /* USE_DMA */
+ outb(TRANSFER_INFO | DMA_OP, CMD_REG);
#if USE_PIO
- if (!current_SC->use_sg) /* Don't use scatter-gather */
- NCR53c406a_pio_write(current_SC->request_buffer,
- current_SC->request_bufflen);
- else { /* use scatter-gather */
- sgcount = current_SC->use_sg;
- sglist = current_SC->request_buffer;
- while( sgcount-- ) {
- NCR53c406a_pio_write(page_address(sglist->page) + sglist->offset, sglist->length);
- sglist++;
- }
- }
- REG0;
- #endif /* USE_PIO */
- }
- break;
-
- case 0x01: /* DATA-IN */
- if(int_reg & 0x10){ /* Target requesting info transfer */
- rtrc(6);
- current_SC->SCp.phase = data_in;
- VDEB(printk("NCR53c406a: Data-In phase\n"));
- outb(FLUSH_FIFO, CMD_REG);
- LOAD_DMA_COUNT(current_SC->request_bufflen); /* Max transfer size */
+ if (!current_SC->use_sg) /* Don't use scatter-gather */
+ NCR53c406a_pio_write(current_SC->request_buffer, current_SC->request_bufflen);
+ else { /* use scatter-gather */
+ sgcount = current_SC->use_sg;
+ sglist = current_SC->request_buffer;
+ while (sgcount--) {
+ NCR53c406a_pio_write(page_address(sglist->page) + sglist->offset, sglist->length);
+ sglist++;
+ }
+ }
+ REG0;
+ #endif /* USE_PIO */
+ }
+ break;
+
+ case 0x01: /* DATA-IN */
+ if (int_reg & 0x10) { /* Target requesting info transfer */
+ rtrc(6);
+ current_SC->SCp.phase = data_in;
+ VDEB(printk("NCR53c406a: Data-In phase\n"));
+ outb(FLUSH_FIFO, CMD_REG);
+ LOAD_DMA_COUNT(current_SC->request_bufflen); /* Max transfer size */
#if USE_DMA /* No s/g support for DMA */
- NCR53c406a_dma_read(current_SC->request_buffer,
- current_SC->request_bufflen);
- #endif /* USE_DMA */
- outb(TRANSFER_INFO | DMA_OP, CMD_REG);
+ NCR53c406a_dma_read(current_SC->request_buffer, current_SC->request_bufflen);
+ #endif /* USE_DMA */
+ outb(TRANSFER_INFO | DMA_OP, CMD_REG);
#if USE_PIO
- if (!current_SC->use_sg) /* Don't use scatter-gather */
- NCR53c406a_pio_read(current_SC->request_buffer,
- current_SC->request_bufflen);
- else { /* Use scatter-gather */
- sgcount = current_SC->use_sg;
- sglist = current_SC->request_buffer;
- while( sgcount-- ) {
- NCR53c406a_pio_read(page_address(sglist->page) + sglist->offset, sglist->length);
- sglist++;
- }
- }
- REG0;
- #endif /* USE_PIO */
- }
- break;
-
- case 0x02: /* COMMAND */
- current_SC->SCp.phase = command_ph;
- printk("NCR53c406a: Warning: Unknown interrupt occurred in command phase!\n");
- break;
-
- case 0x03: /* STATUS */
- rtrc(7);
- current_SC->SCp.phase = status_ph;
- VDEB(printk("NCR53c406a: Status phase\n"));
- outb(FLUSH_FIFO, CMD_REG);
- outb(INIT_CMD_COMPLETE, CMD_REG);
- break;
-
- case 0x04: /* Reserved */
- case 0x05: /* Reserved */
- printk("NCR53c406a: WARNING: Reserved phase!!!\n");
- break;
-
- case 0x06: /* MESSAGE-OUT */
- DEB(printk("NCR53c406a: Message-Out phase\n"));
- current_SC->SCp.phase = message_out;
- outb(SET_ATN, CMD_REG); /* Reject the message */
- outb(MSG_ACCEPT, CMD_REG);
- break;
-
- case 0x07: /* MESSAGE-IN */
- rtrc(4);
- VDEB(printk("NCR53c406a: Message-In phase\n"));
- current_SC->SCp.phase = message_in;
-
- current_SC->SCp.Status = inb(SCSI_FIFO);
- current_SC->SCp.Message = inb(SCSI_FIFO);
-
- VDEB(printk("SCSI FIFO size=%d\n", inb(FIFO_FLAGS) & 0x1f));
- DEB(printk("Status = %02x Message = %02x\n",
- current_SC->SCp.Status, current_SC->SCp.Message));
-
- if(current_SC->SCp.Message == SAVE_POINTERS ||
- current_SC->SCp.Message == DISCONNECT) {
- outb(SET_ATN, CMD_REG); /* Reject message */
- DEB(printk("Discarding SAVE_POINTERS message\n"));
- }
- outb(MSG_ACCEPT, CMD_REG);
- break;
- }
+ if (!current_SC->use_sg) /* Don't use scatter-gather */
+ NCR53c406a_pio_read(current_SC->request_buffer, current_SC->request_bufflen);
+ else { /* Use scatter-gather */
+ sgcount = current_SC->use_sg;
+ sglist = current_SC->request_buffer;
+ while (sgcount--) {
+ NCR53c406a_pio_read(page_address(sglist->page) + sglist->offset, sglist->length);
+ sglist++;
+ }
+ }
+ REG0;
+ #endif /* USE_PIO */
+ }
+ break;
+
+ case 0x02: /* COMMAND */
+ current_SC->SCp.phase = command_ph;
+ printk("NCR53c406a: Warning: Unknown interrupt occurred in command phase!\n");
+ break;
+
+ case 0x03: /* STATUS */
+ rtrc(7);
+ current_SC->SCp.phase = status_ph;
+ VDEB(printk("NCR53c406a: Status phase\n"));
+ outb(FLUSH_FIFO, CMD_REG);
+ outb(INIT_CMD_COMPLETE, CMD_REG);
+ break;
+
+ case 0x04: /* Reserved */
+ case 0x05: /* Reserved */
+ printk("NCR53c406a: WARNING: Reserved phase!!!\n");
+ break;
+
+ case 0x06: /* MESSAGE-OUT */
+ DEB(printk("NCR53c406a: Message-Out phase\n"));
+ current_SC->SCp.phase = message_out;
+ outb(SET_ATN, CMD_REG); /* Reject the message */
+ outb(MSG_ACCEPT, CMD_REG);
+ break;
+
+ case 0x07: /* MESSAGE-IN */
+ rtrc(4);
+ VDEB(printk("NCR53c406a: Message-In phase\n"));
+ current_SC->SCp.phase = message_in;
+
+ current_SC->SCp.Status = inb(SCSI_FIFO);
+ current_SC->SCp.Message = inb(SCSI_FIFO);
+
+ VDEB(printk("SCSI FIFO size=%d\n", inb(FIFO_FLAGS) & 0x1f));
+ DEB(printk("Status = %02x Message = %02x\n", current_SC->SCp.Status, current_SC->SCp.Message));
+
+ if (current_SC->SCp.Message == SAVE_POINTERS || current_SC->SCp.Message == DISCONNECT) {
+ outb(SET_ATN, CMD_REG); /* Reject message */
+ DEB(printk("Discarding SAVE_POINTERS message\n"));
+ }
+ outb(MSG_ACCEPT, CMD_REG);
+ break;
+ }
}
#ifndef IRQ_LEV
* Use SG_NONE if DMA mode is enabled!
*/
#define NCR53c406a { \
- proc_name: "NCR53c406a" /* proc_name */, \
- name: "NCR53c406a" /* name */, \
- detect: NCR53c406a_detect /* detect */, \
- info: NCR53c406a_info /* info */, \
- command: NCR53c406a_command /* command */, \
- queuecommand: NCR53c406a_queue /* queuecommand */, \
- abort: NCR53c406a_abort /* abort */, \
- reset: NCR53c406a_reset /* reset */, \
- bios_param: NCR53c406a_biosparm /* biosparm */, \
- can_queue: 1 /* can_queue */, \
- this_id: 7 /* SCSI ID of the chip */, \
- sg_tablesize: 32 /*SG_ALL*/ /*SG_NONE*/, \
- cmd_per_lun: 1 /* commands per lun */, \
- unchecked_isa_dma: 1 /* unchecked_isa_dma */, \
- use_clustering: ENABLE_CLUSTERING \
+ proc_name: "NCR53c406a" /* proc_name */, \
+ name: "NCR53c406a" /* name */, \
+ detect: NCR53c406a_detect /* detect */, \
+ info: NCR53c406a_info /* info */, \
+ command: NCR53c406a_command /* command */, \
+ queuecommand: NCR53c406a_queue /* queuecommand */, \
+ eh_abort_handler: NCR53c406a_abort /* abort */, \
+ eh_bus_reset_handler: NCR53c406a_bus_reset /* reset */, \
+ eh_device_reset_handler: NCR53c406a_device_reset /* reset */, \
+ eh_host_reset_handler: NCR53c406a_host_reset /* reset */, \
+ bios_param: NCR53c406a_biosparm /* biosparm */, \
+ can_queue: 1 /* can_queue */, \
+ this_id: 7 /* SCSI ID of the chip */, \
+ sg_tablesize: 32 /*SG_ALL*/ /*SG_NONE*/, \
+ cmd_per_lun: 1 /* commands per lun */, \
+ unchecked_isa_dma: 1 /* unchecked_isa_dma */, \
+ use_clustering: ENABLE_CLUSTERING \
}
- int NCR53c406a_detect(Scsi_Host_Template *);
- const char* NCR53c406a_info(struct Scsi_Host *);
-
- int NCR53c406a_command(Scsi_Cmnd *);
- int NCR53c406a_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
- int NCR53c406a_abort(Scsi_Cmnd *);
- int NCR53c406a_reset(Scsi_Cmnd *, unsigned int);
- int NCR53c406a_biosparm(struct scsi_device *, struct block_device *,
- sector_t capacity, int []);
-
- #endif /* _NCR53C406A_H */
-
- /*
- * Overrides for Emacs so that we get a uniform tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 4
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * c-continued-statement-offset: 4
- * c-continued-brace-offset: 0
- * indent-tabs-mode: nil
- * tab-width: 8
- * End:
- */
-
+ static int NCR53c406a_detect(Scsi_Host_Template *);
+ static const char *NCR53c406a_info(struct Scsi_Host *);
-
+ static int NCR53c406a_command(Scsi_Cmnd *);
+ static int NCR53c406a_queue(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
+ static int NCR53c406a_abort(Scsi_Cmnd *);
+ static int NCR53c406a_bus_reset(Scsi_Cmnd *);
+ static int NCR53c406a_device_reset(Scsi_Cmnd *);
+ static int NCR53c406a_host_reset(Scsi_Cmnd *);
-static int NCR53c406a_biosparm(Disk *, struct block_device *, int[]);
++static int NCR53c406a_biosparm(Disk *, struct block_device *, sector_t, int[]);
+
+ #endif /* _NCR53C406A_H */
* and matching the H_C_S coordinates to what DOS uses.
*/
- int dtc_biosparam(struct scsi_device *sdev, struct block_device *dev,
- sector_t capacity, int * ip)
-static int dtc_biosparam(Disk * disk, struct block_device *dev, int *ip)
++static int dtc_biosparam(struct scsi_device *sdev, struct block_device *dev,
++ sector_t capacity, int *ip)
{
- int size = capacity;
- int size = disk->capacity;
++ int size = capacity;
- ip[0] = 64;
- ip[1] = 32;
- ip[2] = size >> 11;
- return 0;
+ ip[0] = 64;
+ ip[1] = 32;
+ ip[2] = size >> 11;
+ return 0;
}
#ifndef DTC3280_H
#define DTC3280_H
- #ifndef ASM
- int dtc_abort(Scsi_Cmnd *);
- int dtc_biosparam(struct scsi_device *, struct block_device *,
- sector_t, int*);
- int dtc_detect(Scsi_Host_Template *);
- int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
- int dtc_reset(Scsi_Cmnd *, unsigned int reset_flags);
- int dtc_proc_info (char *buffer, char **start, off_t offset,
+ static int dtc_abort(Scsi_Cmnd *);
-static int dtc_biosparam(Disk *, struct block_device *, int*);
++static int dtc_biosparam(Disk *, struct block_device *,
++ sector_t, int*);
+ static int dtc_detect(Scsi_Host_Template *);
+ static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
+ static int dtc_bus_reset(Scsi_Cmnd *);
+ static int dtc_device_reset(Scsi_Cmnd *);
+ static int dtc_host_reset(Scsi_Cmnd *);
+ static int dtc_proc_info (char *buffer, char **start, off_t offset,
int length, int hostno, int inout);
- #ifndef NULL
- #define NULL 0
- #endif
-
#ifndef CMD_PER_LUN
#define CMD_PER_LUN 2
#endif
int eata2x_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int eata2x_abort(Scsi_Cmnd *);
int eata2x_reset(Scsi_Cmnd *);
-int eata2x_biosparam(Disk *, struct block_device *, int *);
+int eata2x_biosparam(struct scsi_device *, struct block_device *,
+ sector_t, int *);
static int eata2x_slave_attach(Scsi_Device *);
- #define EATA_VERSION "7.22.00"
+ #define EATA_VERSION "7.70.00"
#define EATA { \
name: "EATA/DMA 2.0x rev. " EATA_VERSION " ", \
#endif
#if DEBUG_RESET
- if (called_once) fd_mcs_print_info( current_SC );
- called_once = 1;
+ if (called_once)
+ fd_mcs_print_info(current_SC);
+ called_once = 1;
#endif
-
- outb( 1, SCSI_Cntl_port );
- do_pause( 2 );
- outb( 0, SCSI_Cntl_port );
- do_pause( 115 );
- outb( 0, SCSI_Mode_Cntl_port );
- outb( PARITY_MASK, TMC_Cntl_port );
-
- /* Unless this is the very first call (i.e., SCPnt == NULL), everything
- is probably hosed at this point. We will, however, try to keep
- things going by informing the high-level code that we need help. */
-
- return SCSI_RESET_WAKEUP;
- }
+
+ spin_lock_irqsave(shpnt->host_lock, flags);
+
+ outb(1, SCSI_Cntl_port);
+ do_pause(2);
+ outb(0, SCSI_Cntl_port);
+ do_pause(115);
+ outb(0, SCSI_Mode_Cntl_port);
+ outb(PARITY_MASK, TMC_Cntl_port);
+
+ /* Unless this is the very first call (i.e., SCPnt == NULL), everything
+ is probably hosed at this point. We will, however, try to keep
+ things going by informing the high-level code that we need help. */
+
+ spin_unlock_irqrestore(shpnt->host_lock, flags);
+ return SUCCESS;
+ }
-#include "sd.h"
#include <scsi/scsi_ioctl.h>
- int fd_mcs_biosparam(struct scsi_device *sdev, struct block_device *bdev,
- sector_t capacity, int *info_array )
- {
- unsigned char buf[512 + sizeof( int ) * 2];
- int size = capacity;
- int *sizes = (int *)buf;
- unsigned char *data = (unsigned char *)(sizes + 2);
- unsigned char do_read[] = { READ_6, 0, 0, 0, 1, 0 };
- int retcode;
-
- /* BIOS >= 3.4 for MCA cards */
- /* This algorithm was provided by Future Domain (much thanks!). */
-
- sizes[0] = 0; /* zero bytes out */
- sizes[1] = 512; /* one sector in */
- memcpy( data, do_read, sizeof( do_read ) );
- retcode = kernel_scsi_ioctl(sdev,
- SCSI_IOCTL_SEND_COMMAND,
- (void *)buf );
- if (!retcode /* SCSI command ok */
- && data[511] == 0xaa && data[510] == 0x55 /* Partition table valid */
- && data[0x1c2]) { /* Partition type */
-
- /* The partition table layout is as follows:
-
- Start: 0x1b3h
- Offset: 0 = partition status
- 1 = starting head
- 2 = starting sector and cylinder (word, encoded)
- 4 = partition type
- 5 = ending head
- 6 = ending sector and cylinder (word, encoded)
- 8 = starting absolute sector (double word)
- c = number of sectors (double word)
- Signature: 0x1fe = 0x55aa
-
- So, this algorithm assumes:
- 1) the first partition table is in use,
- 2) the data in the first entry is correct, and
- 3) partitions never divide cylinders
-
- Note that (1) may be FALSE for NetBSD (and other BSD flavors),
- as well as for Linux. Note also, that Linux doesn't pay any
- attention to the fields that are used by this algorithm -- it
- only uses the absolute sector data. Recent versions of Linux's
- fdisk(1) will fill this data in correctly, and forthcoming
- versions will check for consistency.
-
- Checking for a non-zero partition type is not part of the
- Future Domain algorithm, but it seemed to be a reasonable thing
- to do, especially in the Linux and BSD worlds. */
-
- info_array[0] = data[0x1c3] + 1; /* heads */
- info_array[1] = data[0x1c4] & 0x3f; /* sectors */
- } else {
-
- /* Note that this new method guarantees that there will always be
- less than 1024 cylinders on a platter. This is good for drives
- up to approximately 7.85GB (where 1GB = 1024 * 1024 kB). */
-
- if ((unsigned int)size >= 0x7e0000U) {
- info_array[0] = 0xff; /* heads = 255 */
- info_array[1] = 0x3f; /* sectors = 63 */
- } else if ((unsigned int)size >= 0x200000U) {
- info_array[0] = 0x80; /* heads = 128 */
- info_array[1] = 0x3f; /* sectors = 63 */
- } else {
- info_array[0] = 0x40; /* heads = 64 */
- info_array[1] = 0x20; /* sectors = 32 */
- }
- }
- /* For both methods, compute the cylinders */
- info_array[2] = (unsigned int)size / (info_array[0] * info_array[1] );
-
-
- return 0;
- }
- static int fd_mcs_biosparam(Scsi_Disk * disk, struct block_device *bdev, int *info_array) {
++ static int fd_mcs_biosparam(Scsi_Disk * disk, struct block_device *bdev,
++ sector_t capacity, int *info_array) {
+ unsigned char buf[512 + sizeof(int) * 2];
- int size = disk->capacity;
++ int size = capacity;
+ int *sizes = (int *) buf;
+ unsigned char *data = (unsigned char *) (sizes + 2);
+ unsigned char do_read[] = { READ_6, 0, 0, 0, 1, 0 };
+ int retcode;
+
+ /* BIOS >= 3.4 for MCA cards */
+ /* This algorithm was provided by Future Domain (much thanks!). */
+
+ sizes[0] = 0; /* zero bytes out */
+ sizes[1] = 512; /* one sector in */
+ memcpy(data, do_read, sizeof(do_read));
+ retcode = kernel_scsi_ioctl(disk->device, SCSI_IOCTL_SEND_COMMAND, (void *) buf);
+ if (!retcode /* SCSI command ok */
+ && data[511] == 0xaa && data[510] == 0x55 /* Partition table valid */
+ && data[0x1c2]) { /* Partition type */
+
+ /* The partition table layout is as follows:
+
+ Start: 0x1b3h
+ Offset: 0 = partition status
+ 1 = starting head
+ 2 = starting sector and cylinder (word, encoded)
+ 4 = partition type
+ 5 = ending head
+ 6 = ending sector and cylinder (word, encoded)
+ 8 = starting absolute sector (double word)
+ c = number of sectors (double word)
+ Signature: 0x1fe = 0x55aa
+
+ So, this algorithm assumes:
+ 1) the first partition table is in use,
+ 2) the data in the first entry is correct, and
+ 3) partitions never divide cylinders
+
+ Note that (1) may be FALSE for NetBSD (and other BSD flavors),
+ as well as for Linux. Note also, that Linux doesn't pay any
+ attention to the fields that are used by this algorithm -- it
+ only uses the absolute sector data. Recent versions of Linux's
+ fdisk(1) will fill this data in correctly, and forthcoming
+ versions will check for consistency.
+
+ Checking for a non-zero partition type is not part of the
+ Future Domain algorithm, but it seemed to be a reasonable thing
+ to do, especially in the Linux and BSD worlds. */
+
+ info_array[0] = data[0x1c3] + 1; /* heads */
+ info_array[1] = data[0x1c4] & 0x3f; /* sectors */
+ } else {
+
+ /* Note that this new method guarantees that there will always be
+ less than 1024 cylinders on a platter. This is good for drives
+ up to approximately 7.85GB (where 1GB = 1024 * 1024 kB). */
+
+ if ((unsigned int) size >= 0x7e0000U) {
+ info_array[0] = 0xff; /* heads = 255 */
+ info_array[1] = 0x3f; /* sectors = 63 */
+ } else if ((unsigned int) size >= 0x200000U) {
+ info_array[0] = 0x80; /* heads = 128 */
+ info_array[1] = 0x3f; /* sectors = 63 */
+ } else {
+ info_array[0] = 0x40; /* heads = 64 */
+ info_array[1] = 0x20; /* sectors = 32 */
+ }
+ }
+ /* For both methods, compute the cylinders */
+ info_array[2] = (unsigned int) size / (info_array[0] * info_array[1]);
-
- return 0;
- }
-
/* Eventually this will go into an include file, but this will be later */
- static Scsi_Host_Template driver_template = FD_MCS;
+ static Scsi_Host_Template driver_template = FD_MCS;
#include "scsi_module.c"
#ifndef _FD_MCS_H
#define _FD_MCS_H
- extern int fd_mcs_detect( Scsi_Host_Template * );
- extern int fd_mcs_release( struct Scsi_Host * );
- extern int fd_mcs_command( Scsi_Cmnd * );
- extern int fd_mcs_abort( Scsi_Cmnd * );
- extern int fd_mcs_reset( Scsi_Cmnd *, unsigned int );
- extern int fd_mcs_queue( Scsi_Cmnd *, void (*done)(Scsi_Cmnd *) );
- extern int fd_mcs_biosparam( struct scsi_device *, struct block_device *,
- sector_t, int * );
- extern int fd_mcs_proc_info( char *, char **, off_t, int, int, int );
- extern const char *fd_mcs_info(struct Scsi_Host *);
+ static int fd_mcs_detect(Scsi_Host_Template *);
+ static int fd_mcs_release(struct Scsi_Host *);
+ static int fd_mcs_command(Scsi_Cmnd *);
+ static int fd_mcs_abort(Scsi_Cmnd *);
+ static int fd_mcs_bus_reset(Scsi_Cmnd *);
+ static int fd_mcs_device_reset(Scsi_Cmnd *);
+ static int fd_mcs_host_reset(Scsi_Cmnd *);
+ static int fd_mcs_queue(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
-static int fd_mcs_biosparam(Disk *, struct block_device *, int *);
++static int fd_mcs_biosparam(Disk *, struct block_device *,
++ sector_t, int *);
+ static int fd_mcs_proc_info(char *, char **, off_t, int, int, int);
+ static const char *fd_mcs_info(struct Scsi_Host *);
#define FD_MCS {\
- proc_name: "fd_mcs", \
- proc_info: fd_mcs_proc_info, \
- detect: fd_mcs_detect, \
- release: fd_mcs_release, \
- info: fd_mcs_info, \
- command: fd_mcs_command, \
- queuecommand: fd_mcs_queue, \
- abort: fd_mcs_abort, \
- reset: fd_mcs_reset, \
- bios_param: fd_mcs_biosparam, \
- can_queue: 1, \
- this_id: 7, \
- sg_tablesize: 64, \
- cmd_per_lun: 1, \
- use_clustering: DISABLE_CLUSTERING }
-
- #endif /* _FD_MCS_H */
+ proc_name: "fd_mcs", \
+ proc_info: fd_mcs_proc_info, \
+ detect: fd_mcs_detect, \
+ release: fd_mcs_release, \
+ info: fd_mcs_info, \
+ command: fd_mcs_command, \
+ queuecommand: fd_mcs_queue, \
+ eh_abort_handler: fd_mcs_abort, \
+ eh_bus_reset_handler: fd_mcs_bus_reset, \
+ eh_host_reset_handler: fd_mcs_host_reset, \
+ eh_device_reset_handler: fd_mcs_device_reset, \
+ bios_param: fd_mcs_biosparam, \
+ can_queue: 1, \
+ this_id: 7, \
+ sg_tablesize: 64, \
+ cmd_per_lun: 1, \
+ use_clustering: DISABLE_CLUSTERING \
+ }
+
+ #endif /* _FD_MCS_H */
#endif
#ifndef ASM
- int generic_NCR5380_abort(Scsi_Cmnd *);
- int generic_NCR5380_detect(Scsi_Host_Template *);
- int generic_NCR5380_release_resources(struct Scsi_Host *);
- int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
- int generic_NCR5380_bus_reset(Scsi_Cmnd *);
- int generic_NCR5380_host_reset(Scsi_Cmnd *);
- int generic_NCR5380_device_reset(Scsi_Cmnd *);
- int notyet_generic_proc_info (char *buffer ,char **start, off_t offset,
+ static int generic_NCR5380_abort(Scsi_Cmnd *);
+ static int generic_NCR5380_detect(Scsi_Host_Template *);
+ static int generic_NCR5380_release_resources(struct Scsi_Host *);
+ static int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
+ static int generic_NCR5380_bus_reset(Scsi_Cmnd *);
+ static int generic_NCR5380_host_reset(Scsi_Cmnd *);
+ static int generic_NCR5380_device_reset(Scsi_Cmnd *);
+ static int notyet_generic_proc_info (char *buffer ,char **start, off_t offset,
int length, int hostno, int inout);
- const char* generic_NCR5380_info(struct Scsi_Host *);
- #ifdef BIOSPARAM
- int generic_NCR5380_biosparam(struct scsi_device *, struct block_device *,
- sector_t, int *);
- #endif
-
- int generic_NCR5380_proc_info(char* buffer, char** start, off_t offset, int length, int hostno, int inout);
-
- #ifndef NULL
- #define NULL 0
- #endif
+ static const char* generic_NCR5380_info(struct Scsi_Host *);
-static int generic_NCR5380_biosparam(Disk *, struct block_device *, int *);
-
++static int generic_NCR5380_biosparam(Disk *, struct block_device *, sector_t, int *);
+ static int generic_NCR5380_proc_info(char* buffer, char** start, off_t offset, int length, int hostno, int inout);
#ifndef CMD_PER_LUN
#define CMD_PER_LUN 2
#ifndef ASM
- int pas16_abort(Scsi_Cmnd *);
- int pas16_biosparam(struct scsi_device *, struct block_device *,
- sector_t, int*);
- int pas16_detect(Scsi_Host_Template *);
- int pas16_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
- int pas16_bus_reset(Scsi_Cmnd *);
- int pas16_host_reset(Scsi_Cmnd *);
- int pas16_device_reset(Scsi_Cmnd *);
- int pas16_proc_info (char *buffer ,char **start, off_t offset,
+ static int pas16_abort(Scsi_Cmnd *);
-static int pas16_biosparam(Disk *, struct block_device *, int*);
++static int pas16_biosparam(struct scsi_device *, struct block_device *,
++ sector_t, int*);
+ static int pas16_detect(Scsi_Host_Template *);
+ static int pas16_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
+ static int pas16_bus_reset(Scsi_Cmnd *);
+ static int pas16_host_reset(Scsi_Cmnd *);
+ static int pas16_device_reset(Scsi_Cmnd *);
+ static int pas16_proc_info (char *buffer ,char **start, off_t offset,
int length, int hostno, int inout);
#ifndef NULL
}
- /*----------------------------------------------------------------*/
- /* return bios parameters */
- int qlogicfas_biosparam(struct scsi_device * sdev,
- struct block_device *dev,
- sector_t capacity, int ip[])
+ /*
+ * Return bios parameters
+ */
+
-int qlogicfas_biosparam(Disk * disk, struct block_device *dev, int ip[])
++int qlogicfas_biosparam(struct scsi_device * disk,
++ struct block_device *dev,
++ sector_t capacity, int ip[])
{
/* This should mimic the DOS Qlogic driver's behavior exactly */
ip[0] = 0x40;
ip[1] = 0x20;
- ip[2] = (unsigned long)capacity / (ip[0] * ip[1]);
- ip[2] = (unsigned long) disk->capacity / (ip[0] * ip[1]);
++ ip[2] = (unsigned long) capacity / (ip[0] * ip[1]);
if (ip[2] > 1024) {
ip[0] = 0xff;
ip[1] = 0x3f;
- ip[2] = (unsigned long)capacity / (ip[0] * ip[1]);
- ip[2] = (unsigned long) disk->capacity / (ip[0] * ip[1]);
++ ip[2] = (unsigned long) capacity / (ip[0] * ip[1]);
#if 0
if (ip[2] > 1023)
ip[2] = 1023;
#ifndef _QLOGICFAS_H
#define _QLOGICFAS_H
- int qlogicfas_detect(Scsi_Host_Template * );
- const char * qlogicfas_info(struct Scsi_Host *);
- int qlogicfas_command(Scsi_Cmnd *);
- int qlogicfas_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
- int qlogicfas_abort(Scsi_Cmnd *);
- int qlogicfas_reset(Scsi_Cmnd *, unsigned int);
- int qlogicfas_biosparam(struct scsi_device *, struct block_device *,
- sector_t, int[]);
-
- #ifndef NULL
- #define NULL (0)
- #endif
-
- #ifdef PCMCIA
- #define __QLINIT __devinit
- #else
- #define __QLINIT __init
- #endif
-
- #define QLOGICFAS { \
- detect: qlogicfas_detect, \
- info: qlogicfas_info, \
- command: qlogicfas_command, \
- queuecommand: qlogicfas_queuecommand, \
- abort: qlogicfas_abort, \
- reset: qlogicfas_reset, \
- bios_param: qlogicfas_biosparam, \
- can_queue: 0, \
- this_id: -1, \
- sg_tablesize: SG_ALL, \
- cmd_per_lun: 1, \
- use_clustering: DISABLE_CLUSTERING \
+ static int qlogicfas_detect(Scsi_Host_Template * );
+ static const char * qlogicfas_info(struct Scsi_Host *);
+ static int qlogicfas_command(Scsi_Cmnd *);
+ static int qlogicfas_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
+ static int qlogicfas_abort(Scsi_Cmnd *);
+ static int qlogicfas_bus_reset(Scsi_Cmnd *);
+ static int qlogicfas_device_reset(Scsi_Cmnd *);
+ static int qlogicfas_host_reset(Scsi_Cmnd *);
-static int qlogicfas_biosparam(Disk *, struct block_device *, int[]);
-
-#define QLOGICFAS { \
- detect: qlogicfas_detect, \
- info: qlogicfas_info, \
- command: qlogicfas_command, \
- queuecommand: qlogicfas_queuecommand, \
- eh_abort_handler: qlogicfas_abort, \
- eh_bus_reset_handler: qlogicfas_bus_reset, \
- eh_device_reset_handler: qlogicfas_device_reset, \
- eh_host_reset_handler: qlogicfas_host_reset, \
- bios_param: qlogicfas_biosparam, \
- can_queue: 0, \
- this_id: -1, \
- sg_tablesize: SG_ALL, \
- cmd_per_lun: 1, \
- use_clustering: DISABLE_CLUSTERING \
++static int qlogicfas_biosparam(struct scsi_disk *, struct block_device *,
++ sector_t, int[]);
}
#endif /* _QLOGICFAS_H */
outb(NOOP | PIO_MODE, base + COMMAND_REG);
outb(RESET_SCSI_BUS, base + COMMAND_REG);
sym53c416_init(base, scsi_id);
- return SCSI_RESET_PENDING;
+ return SUCCESS;
+ }
+
+ static int sym53c416_release(struct Scsi_Host *shost)
+ {
+ if (shost->irq)
+ free_irq(shost->irq, shost);
+ if (shost->io_port && shost->n_io_port)
+ release_region(shost->io_port, shost->n_io_port);
+ return 0;
}
-static int sym53c416_bios_param(Disk *disk, struct block_device *dev, int *ip)
+static int sym53c416_bios_param(struct scsi_device *sdev,
+ struct block_device *dev,
+ sector_t capacity, int *ip)
{
int size;
static int sym53c416_command(Scsi_Cmnd *);
static int sym53c416_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
static int sym53c416_abort(Scsi_Cmnd *);
- static int sym53c416_reset(Scsi_Cmnd *, unsigned int);
+ static int sym53c416_host_reset(Scsi_Cmnd *);
+ static int sym53c416_bus_reset(Scsi_Cmnd *);
+ static int sym53c416_device_reset(Scsi_Cmnd *);
-static int sym53c416_bios_param(Disk *, struct block_device *, int *);
+static int sym53c416_bios_param(struct scsi_device *, struct block_device *,
+ sector_t, int *);
static void sym53c416_setup(char *str, int *ints);
- #define SYM53C416 { \
- proc_name: "sym53c416", \
- name: "Symbios Logic 53c416", \
- detect: sym53c416_detect, \
- info: sym53c416_info, \
- command: sym53c416_command, \
- queuecommand: sym53c416_queuecommand, \
- abort: sym53c416_abort, \
- reset: sym53c416_reset, \
- bios_param: sym53c416_bios_param, \
- can_queue: 1, \
- this_id: SYM53C416_SCSI_ID, \
- sg_tablesize: 32, \
- cmd_per_lun: 1, \
- unchecked_isa_dma: 1, \
- use_clustering: ENABLE_CLUSTERING \
- }
+ #define SYM53C416 { \
+ .proc_name = "sym53c416", \
+ .name = "Symbios Logic 53c416", \
+ .detect = sym53c416_detect, \
+ .info = sym53c416_info, \
+ .command = sym53c416_command, \
+ .queuecommand = sym53c416_queuecommand, \
+ .eh_abort_handler = sym53c416_abort, \
+ .eh_host_reset_handler =sym53c416_host_reset, \
+ .eh_bus_reset_handler = sym53c416_bus_reset, \
+ .eh_device_reset_handler =sym53c416_device_reset,\
+ .release = sym53c416_release, \
+ .bios_param = sym53c416_bios_param, \
+ .can_queue = 1, \
+ .this_id = SYM53C416_SCSI_ID, \
+ .sg_tablesize = 32, \
+ .cmd_per_lun = 1, \
+ .unchecked_isa_dma = 1, \
+ .use_clustering = ENABLE_CLUSTERING \
+ }
#endif
#define T_DATA_REG_OFFSET 0x1e00 /* rw 512 bytes long */
#ifndef ASM
- int t128_abort(Scsi_Cmnd *);
- int t128_biosparam(struct scsi_device *, struct block_device *,
- sector_t, int*);
- int t128_detect(Scsi_Host_Template *);
- int t128_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
- int t128_host_reset(Scsi_Cmnd *);
- int t128_bus_reset(Scsi_Cmnd *);
- int t128_device_reset(Scsi_Cmnd *);
- int t128_proc_info (char *buffer, char **start, off_t offset,
+ static int t128_abort(Scsi_Cmnd *);
-static int t128_biosparam(Disk *, struct block_device *, int*);
++static int t128_biosparam(struct scsi_device *, struct block_device *,
++ sector_t, int*);
+ static int t128_detect(Scsi_Host_Template *);
+ static int t128_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
+ static int t128_host_reset(Scsi_Cmnd *);
+ static int t128_bus_reset(Scsi_Cmnd *);
+ static int t128_device_reset(Scsi_Cmnd *);
+ static int t128_proc_info (char *buffer, char **start, off_t offset,
int length, int hostno, int inout);
#ifndef NULL
int u14_34f_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int u14_34f_abort(Scsi_Cmnd *);
int u14_34f_reset(Scsi_Cmnd *);
-int u14_34f_biosparam(Disk *, struct block_device *, int *);
+int u14_34f_biosparam(struct scsi_device *, struct block_device *,
+ sector_t, int *);
- #define U14_34F_VERSION "7.22.00"
+ #define U14_34F_VERSION "7.70.00"
#define ULTRASTOR_14_34F { \
name: "UltraStor 14F/34F rev. " U14_34F_VERSION " ", \