Lines Matching refs:instance

292 static void NCR5380_print(struct Scsi_Host *instance)  in NCR5380_print()  argument
294 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_print()
341 static void NCR5380_print_phase(struct Scsi_Host *instance) in NCR5380_print_phase() argument
343 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_print_phase()
349 shost_printk(KERN_DEBUG, instance, "REQ not asserted, phase unknown.\n"); in NCR5380_print_phase()
354 shost_printk(KERN_DEBUG, instance, "phase %s\n", phases[i].name); in NCR5380_print_phase()
366 static const char *NCR5380_info(struct Scsi_Host *instance) in NCR5380_info() argument
368 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_info()
387 static int NCR5380_init(struct Scsi_Host *instance, int flags) in NCR5380_init() argument
389 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_init()
394 instance->max_lun = 7; in NCR5380_init()
396 hostdata->host = instance; in NCR5380_init()
397 hostdata->id_mask = 1 << instance->this_id; in NCR5380_init()
418 0, instance->host_no); in NCR5380_init()
424 instance->hostt->name, instance->irq, hostdata->io_port, in NCR5380_init()
425 hostdata->base, instance->can_queue, instance->cmd_per_lun, in NCR5380_init()
426 instance->sg_tablesize, instance->this_id, in NCR5380_init()
468 static int NCR5380_maybe_reset_bus(struct Scsi_Host *instance) in NCR5380_maybe_reset_bus() argument
470 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_maybe_reset_bus()
478 shost_printk(KERN_ERR, instance, "SCSI bus busy, waiting up to five seconds\n"); in NCR5380_maybe_reset_bus()
483 shost_printk(KERN_ERR, instance, "bus busy, attempting abort\n"); in NCR5380_maybe_reset_bus()
484 do_abort(instance, 1); in NCR5380_maybe_reset_bus()
487 shost_printk(KERN_ERR, instance, "bus busy, attempting reset\n"); in NCR5380_maybe_reset_bus()
488 do_reset(instance); in NCR5380_maybe_reset_bus()
499 shost_printk(KERN_ERR, instance, "bus locked solid\n"); in NCR5380_maybe_reset_bus()
513 static void NCR5380_exit(struct Scsi_Host *instance) in NCR5380_exit() argument
515 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_exit()
527 static void complete_cmd(struct Scsi_Host *instance, in complete_cmd() argument
530 struct NCR5380_hostdata *hostdata = shost_priv(instance); in complete_cmd()
532 dsprintk(NDEBUG_QUEUES, instance, "complete_cmd: cmd %p\n", cmd); in complete_cmd()
558 static int NCR5380_queue_command(struct Scsi_Host *instance, in NCR5380_queue_command() argument
561 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_queue_command()
569 shost_printk(KERN_DEBUG, instance, "WRITE attempted with NDEBUG_NO_WRITE set\n"); in NCR5380_queue_command()
580 if (!NCR5380_acquire_dma_irq(instance)) { in NCR5380_queue_command()
600 dsprintk(NDEBUG_QUEUES, instance, "command %p added to %s of queue\n", in NCR5380_queue_command()
608 static inline void maybe_release_dma_irq(struct Scsi_Host *instance) in maybe_release_dma_irq() argument
610 struct NCR5380_hostdata *hostdata = shost_priv(instance); in maybe_release_dma_irq()
618 NCR5380_release_dma_irq(instance); in maybe_release_dma_irq()
633 static struct scsi_cmnd *dequeue_next_cmd(struct Scsi_Host *instance) in dequeue_next_cmd() argument
635 struct NCR5380_hostdata *hostdata = shost_priv(instance); in dequeue_next_cmd()
642 dsprintk(NDEBUG_QUEUES, instance, "dequeue: cmd=%p target=%d busy=0x%02x lun=%llu\n", in dequeue_next_cmd()
647 dsprintk(NDEBUG_QUEUES, instance, in dequeue_next_cmd()
658 dsprintk(NDEBUG_QUEUES, instance, in dequeue_next_cmd()
667 static void requeue_cmd(struct Scsi_Host *instance, struct scsi_cmnd *cmd) in requeue_cmd() argument
669 struct NCR5380_hostdata *hostdata = shost_priv(instance); in requeue_cmd()
693 struct Scsi_Host *instance = hostdata->host; in NCR5380_main() local
701 struct scsi_cmnd *cmd = dequeue_next_cmd(instance); in NCR5380_main()
706 dsprintk(NDEBUG_MAIN, instance, "main: dequeued %p\n", cmd); in NCR5380_main()
721 if (!NCR5380_select(instance, cmd)) { in NCR5380_main()
722 dsprintk(NDEBUG_MAIN, instance, "main: select complete\n"); in NCR5380_main()
724 dsprintk(NDEBUG_MAIN | NDEBUG_QUEUES, instance, in NCR5380_main()
726 requeue_cmd(instance, cmd); in NCR5380_main()
730 dsprintk(NDEBUG_MAIN, instance, "main: performing information transfer\n"); in NCR5380_main()
731 NCR5380_information_transfer(instance); in NCR5380_main()
736 maybe_release_dma_irq(instance); in NCR5380_main()
752 static void NCR5380_dma_complete(struct Scsi_Host *instance) in NCR5380_dma_complete() argument
754 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_dma_complete()
771 dsprintk(NDEBUG_DMA, instance, "read overrun handled\n"); in NCR5380_dma_complete()
779 instance->host_no); in NCR5380_dma_complete()
785 pr_err("scsi%d: BASR %02x\n", instance->host_no, in NCR5380_dma_complete()
788 instance->host_no); in NCR5380_dma_complete()
811 dsprintk(NDEBUG_DMA, instance, in NCR5380_dma_complete()
819 dsprintk(NDEBUG_DMA, instance, in NCR5380_dma_complete()
821 NCR5380_transfer_pio(instance, &p, &cnt, data, 0); in NCR5380_dma_complete()
864 struct Scsi_Host *instance = dev_id; in NCR5380_intr() local
865 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_intr()
877 dsprintk(NDEBUG_INTR, instance, "IRQ %d, BASR 0x%02x, SR 0x%02x, MR 0x%02x\n", in NCR5380_intr()
886 dsprintk(NDEBUG_INTR, instance, "interrupt in DMA mode\n"); in NCR5380_intr()
889 NCR5380_dma_complete(instance); in NCR5380_intr()
901 dsprintk(NDEBUG_INTR, instance, "interrupt with SEL and IO\n"); in NCR5380_intr()
904 NCR5380_reselect(instance); in NCR5380_intr()
915 shost_printk(KERN_WARNING, instance, in NCR5380_intr()
917 bus_reset_cleanup(instance); in NCR5380_intr()
919 dsprintk(NDEBUG_INTR, instance, "unknown interrupt\n"); in NCR5380_intr()
927 dsprintk(NDEBUG_INTR, instance, "interrupt without IRQ bit\n"); in NCR5380_intr()
963 static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd) in NCR5380_select() argument
966 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_select()
972 bool can_disconnect = instance->irq != NO_IRQ && in NCR5380_select()
976 NCR5380_dprint(NDEBUG_ARBITRATION, instance); in NCR5380_select()
977 dsprintk(NDEBUG_ARBITRATION, instance, "starting arbitration, id = %d\n", in NCR5380_select()
978 instance->this_id); in NCR5380_select()
1023 shost_printk(KERN_ERR, instance, in NCR5380_select()
1037 dsprintk(NDEBUG_ARBITRATION, instance, "lost arbitration, deasserting MR_ARBITRATE\n"); in NCR5380_select()
1071 dsprintk(NDEBUG_ARBITRATION, instance, "won arbitration\n"); in NCR5380_select()
1127 dsprintk(NDEBUG_SELECTION, instance, "selecting target %d\n", scmd_id(cmd)); in NCR5380_select()
1140 NCR5380_reselect(instance); in NCR5380_select()
1141 shost_printk(KERN_ERR, instance, "reselection after won arbitration?\n"); in NCR5380_select()
1154 complete_cmd(instance, cmd); in NCR5380_select()
1155 dsprintk(NDEBUG_SELECTION, instance, in NCR5380_select()
1183 shost_printk(KERN_ERR, instance, "select: REQ timeout\n"); in NCR5380_select()
1188 do_abort(instance, 0); in NCR5380_select()
1192 dsprintk(NDEBUG_SELECTION, instance, "target %d selected, going into MESSAGE OUT phase.\n", in NCR5380_select()
1199 NCR5380_transfer_pio(instance, &phase, &len, &data, 0); in NCR5380_select()
1203 complete_cmd(instance, cmd); in NCR5380_select()
1204 dsprintk(NDEBUG_SELECTION, instance, "IDENTIFY message transfer failed\n"); in NCR5380_select()
1209 dsprintk(NDEBUG_SELECTION, instance, "nexus established.\n"); in NCR5380_select()
1246 static void NCR5380_transfer_pio(struct Scsi_Host *instance, in NCR5380_transfer_pio() argument
1250 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_transfer_pio()
1273 dsprintk(NDEBUG_HANDSHAKE, instance, "REQ asserted\n"); in NCR5380_transfer_pio()
1277 dsprintk(NDEBUG_PIO, instance, "phase mismatch\n"); in NCR5380_transfer_pio()
1278 NCR5380_dprint_phase(NDEBUG_PIO, instance); in NCR5380_transfer_pio()
1300 NCR5380_dprint(NDEBUG_PIO, instance); in NCR5380_transfer_pio()
1306 NCR5380_dprint(NDEBUG_PIO, instance); in NCR5380_transfer_pio()
1311 NCR5380_dprint(NDEBUG_PIO, instance); in NCR5380_transfer_pio()
1319 dsprintk(NDEBUG_HANDSHAKE, instance, "REQ negated, handshake complete\n"); in NCR5380_transfer_pio()
1342 dsprintk(NDEBUG_PIO, instance, "residual %d\n", c); in NCR5380_transfer_pio()
1369 static void do_reset(struct Scsi_Host *instance) in do_reset() argument
1371 struct NCR5380_hostdata __maybe_unused *hostdata = shost_priv(instance); in do_reset()
1393 static int do_abort(struct Scsi_Host *instance, unsigned int can_sleep) in do_abort() argument
1395 struct NCR5380_hostdata *hostdata = shost_priv(instance); in do_abort()
1436 NCR5380_transfer_pio(instance, &phase, &len, &msgptr, can_sleep); in do_abort()
1469 static int NCR5380_transfer_dma(struct Scsi_Host *instance, in NCR5380_transfer_dma() argument
1473 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_transfer_dma()
1495 dsprintk(NDEBUG_DMA, instance, "initializing DMA %s: length %d, address %p\n", in NCR5380_transfer_dma()
1641 NCR5380_dma_complete(instance); in NCR5380_transfer_dma()
1659 static void NCR5380_information_transfer(struct Scsi_Host *instance) in NCR5380_information_transfer() argument
1662 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_information_transfer()
1684 NCR5380_dprint_phase(NDEBUG_INFORMATION, instance); in NCR5380_information_transfer()
1726 shost_printk(KERN_DEBUG, instance, "NDEBUG_NO_DATAOUT set, attempted DATAOUT aborted\n"); in NCR5380_information_transfer()
1728 do_abort(instance, 0); in NCR5380_information_transfer()
1730 complete_cmd(instance, cmd); in NCR5380_information_transfer()
1742 dsprintk(NDEBUG_INFORMATION, instance, in NCR5380_information_transfer()
1763 if (NCR5380_transfer_dma(instance, &phase, in NCR5380_information_transfer()
1773 do_reset(instance); in NCR5380_information_transfer()
1774 bus_reset_cleanup(instance); in NCR5380_information_transfer()
1783 NCR5380_transfer_pio(instance, &phase, &len, in NCR5380_information_transfer()
1797 NCR5380_transfer_pio(instance, &phase, &len, &data, 0); in NCR5380_information_transfer()
1809 dsprintk(NDEBUG_QUEUES, instance, in NCR5380_information_transfer()
1821 complete_cmd(instance, cmd); in NCR5380_information_transfer()
1825 dsprintk(NDEBUG_QUEUES, instance, "autosense: adding cmd %p to tail of autosense queue\n", in NCR5380_information_transfer()
1830 complete_cmd(instance, cmd); in NCR5380_information_transfer()
1860 instance, "connected command %p for target %d lun %llu moved to disconnected queue\n", in NCR5380_information_transfer()
1899 dsprintk(NDEBUG_EXTENDED, instance, "receiving extended message\n"); in NCR5380_information_transfer()
1904 NCR5380_transfer_pio(instance, &phase, &len, &data, 1); in NCR5380_information_transfer()
1905 dsprintk(NDEBUG_EXTENDED, instance, "length %d, code 0x%02x\n", in NCR5380_information_transfer()
1917 NCR5380_transfer_pio(instance, &phase, &len, &data, 1); in NCR5380_information_transfer()
1918 dsprintk(NDEBUG_EXTENDED, instance, "message received, residual %d\n", in NCR5380_information_transfer()
1927 shost_printk(KERN_ERR, instance, "error receiving extended message\n"); in NCR5380_information_transfer()
1930 shost_printk(KERN_NOTICE, instance, "extended message code %02x length %d is too long\n", in NCR5380_information_transfer()
1964 NCR5380_transfer_pio(instance, &phase, &len, &data, 0); in NCR5380_information_transfer()
1969 complete_cmd(instance, cmd); in NCR5380_information_transfer()
1982 NCR5380_transfer_pio(instance, &phase, &len, &data, 0); in NCR5380_information_transfer()
1988 NCR5380_transfer_pio(instance, &phase, &len, &data, 0); in NCR5380_information_transfer()
1992 shost_printk(KERN_ERR, instance, "unknown phase\n"); in NCR5380_information_transfer()
1993 NCR5380_dprint(NDEBUG_ANY, instance); in NCR5380_information_transfer()
2007 do_reset(instance); in NCR5380_information_transfer()
2008 bus_reset_cleanup(instance); in NCR5380_information_transfer()
2024 static void NCR5380_reselect(struct Scsi_Host *instance) in NCR5380_reselect() argument
2026 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_reselect()
2042 shost_printk(KERN_WARNING, instance, in NCR5380_reselect()
2059 shost_printk(KERN_ERR, instance, "reselect: !SEL timeout\n"); in NCR5380_reselect()
2074 shost_printk(KERN_ERR, instance, "reselect: REQ timeout\n"); in NCR5380_reselect()
2075 do_abort(instance, 0); in NCR5380_reselect()
2091 NCR5380_transfer_pio(instance, &phase, &len, &data, 0); in NCR5380_reselect()
2094 do_abort(instance, 0); in NCR5380_reselect()
2101 shost_printk(KERN_ERR, instance, "expecting IDENTIFY message, got "); in NCR5380_reselect()
2104 do_abort(instance, 0); in NCR5380_reselect()
2133 dsprintk(NDEBUG_RESELECTION | NDEBUG_QUEUES, instance, in NCR5380_reselect()
2138 shost_printk(KERN_ERR, instance, "target bitmask 0x%02x lun %d not in disconnected queue.\n", in NCR5380_reselect()
2144 if (do_abort(instance, 0) == 0) in NCR5380_reselect()
2175 dsprintk(NDEBUG_RESELECTION, instance, "nexus established, target %d, lun %llu\n", in NCR5380_reselect()
2245 struct Scsi_Host *instance = cmd->device->host; in NCR5380_abort() local
2246 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_abort()
2255 NCR5380_dprint(NDEBUG_ANY, instance); in NCR5380_abort()
2256 NCR5380_dprint_phase(NDEBUG_ANY, instance); in NCR5380_abort()
2259 dsprintk(NDEBUG_ABORT, instance, in NCR5380_abort()
2267 dsprintk(NDEBUG_ABORT, instance, in NCR5380_abort()
2271 complete_cmd(instance, cmd); in NCR5380_abort()
2276 dsprintk(NDEBUG_ABORT, instance, in NCR5380_abort()
2282 complete_cmd(instance, cmd); in NCR5380_abort()
2288 dsprintk(NDEBUG_ABORT, instance, "abort: cmd %p is connected\n", cmd); in NCR5380_abort()
2291 if (do_abort(instance, 0) < 0) { in NCR5380_abort()
2293 complete_cmd(instance, cmd); in NCR5380_abort()
2298 complete_cmd(instance, cmd); in NCR5380_abort()
2303 dsprintk(NDEBUG_ABORT, instance, in NCR5380_abort()
2305 complete_cmd(instance, cmd); in NCR5380_abort()
2310 dsprintk(NDEBUG_ABORT, instance, "abort: failed to abort %p\n", cmd); in NCR5380_abort()
2313 dsprintk(NDEBUG_ABORT, instance, "abort: successfully aborted %p\n", cmd); in NCR5380_abort()
2323 static void bus_reset_cleanup(struct Scsi_Host *instance) in bus_reset_cleanup() argument
2325 struct NCR5380_hostdata *hostdata = shost_priv(instance); in bus_reset_cleanup()
2342 complete_cmd(instance, hostdata->selecting); in bus_reset_cleanup()
2350 complete_cmd(instance, cmd); in bus_reset_cleanup()
2363 complete_cmd(instance, hostdata->connected); in bus_reset_cleanup()
2383 struct Scsi_Host *instance = cmd->device->host; in NCR5380_host_reset() local
2384 struct NCR5380_hostdata *hostdata = shost_priv(instance); in NCR5380_host_reset()
2391 shost_printk(KERN_INFO, instance, __func__); in NCR5380_host_reset()
2393 NCR5380_dprint(NDEBUG_ANY, instance); in NCR5380_host_reset()
2394 NCR5380_dprint_phase(NDEBUG_ANY, instance); in NCR5380_host_reset()
2404 do_reset(instance); in NCR5380_host_reset()
2405 bus_reset_cleanup(instance); in NCR5380_host_reset()