Lines Matching refs:starget
594 ahd_linux_target_in_softc(struct scsi_target *starget) in DEF_SCSI_QCMD()
597 *((struct ahd_softc **)dev_to_shost(&starget->dev)->hostdata); in DEF_SCSI_QCMD()
600 target_offset = starget->id; in DEF_SCSI_QCMD()
601 if (starget->channel != 0) in DEF_SCSI_QCMD()
604 return &ahd->platform_data->starget[target_offset]; in DEF_SCSI_QCMD()
608 ahd_linux_target_alloc(struct scsi_target *starget) in ahd_linux_target_alloc() argument
611 *((struct ahd_softc **)dev_to_shost(&starget->dev)->hostdata); in ahd_linux_target_alloc()
614 struct scsi_target **ahd_targp = ahd_linux_target_in_softc(starget); in ahd_linux_target_alloc()
618 char channel = starget->channel + 'A'; in ahd_linux_target_alloc()
624 *ahd_targp = starget; in ahd_linux_target_alloc()
627 int flags = sc->device_flags[starget->id]; in ahd_linux_target_alloc()
630 starget->id, &tstate); in ahd_linux_target_alloc()
634 spi_max_iu(starget) = 0; in ahd_linux_target_alloc()
637 spi_rti(starget) = 0; in ahd_linux_target_alloc()
641 spi_max_qas(starget) = 0; in ahd_linux_target_alloc()
644 spi_max_width(starget) = (flags & CFWIDEB) ? 1 : 0; in ahd_linux_target_alloc()
645 spi_min_period(starget) = tinfo->user.period; in ahd_linux_target_alloc()
646 spi_max_offset(starget) = tinfo->user.offset; in ahd_linux_target_alloc()
650 starget->id, &tstate); in ahd_linux_target_alloc()
651 ahd_compile_devinfo(&devinfo, ahd->our_id, starget->id, in ahd_linux_target_alloc()
664 ahd_linux_target_destroy(struct scsi_target *starget) in ahd_linux_target_destroy() argument
666 struct scsi_target **ahd_targp = ahd_linux_target_in_softc(starget); in ahd_linux_target_destroy()
1340 struct scsi_target *starget; in ahd_platform_free() local
1346 starget = ahd->platform_data->starget[i]; in ahd_platform_free()
1347 if (starget != NULL) { in ahd_platform_free()
1348 ahd->platform_data->starget[i] = NULL; in ahd_platform_free()
1693 struct scsi_target *starget; in ahd_send_async() local
1718 starget = ahd->platform_data->starget[target]; in ahd_send_async()
1719 if (starget == NULL) in ahd_send_async()
1723 (spi_dt(starget) ? MSG_EXT_PPR_DT_REQ : 0) in ahd_send_async()
1724 + (spi_qas(starget) ? MSG_EXT_PPR_QAS_REQ : 0) in ahd_send_async()
1725 + (spi_iu(starget) ? MSG_EXT_PPR_IU_REQ : 0) in ahd_send_async()
1726 + (spi_rd_strm(starget) ? MSG_EXT_PPR_RD_STRM : 0) in ahd_send_async()
1727 + (spi_pcomp_en(starget) ? MSG_EXT_PPR_PCOMP_EN : 0) in ahd_send_async()
1728 + (spi_rti(starget) ? MSG_EXT_PPR_RTI : 0) in ahd_send_async()
1729 + (spi_wr_flow(starget) ? MSG_EXT_PPR_WR_FLOW : 0) in ahd_send_async()
1730 + (spi_hold_mcs(starget) ? MSG_EXT_PPR_HOLD_MCS : 0); in ahd_send_async()
1732 if (tinfo->curr.period == spi_period(starget) in ahd_send_async()
1733 && tinfo->curr.width == spi_width(starget) in ahd_send_async()
1734 && tinfo->curr.offset == spi_offset(starget) in ahd_send_async()
1739 spi_period(starget) = tinfo->curr.period; in ahd_send_async()
1740 spi_width(starget) = tinfo->curr.width; in ahd_send_async()
1741 spi_offset(starget) = tinfo->curr.offset; in ahd_send_async()
1742 spi_dt(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_DT_REQ ? 1 : 0; in ahd_send_async()
1743 spi_qas(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_QAS_REQ ? 1 : 0; in ahd_send_async()
1744 spi_iu(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_IU_REQ ? 1 : 0; in ahd_send_async()
1745 spi_rd_strm(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_RD_STRM ? 1 : 0; in ahd_send_async()
1746 spi_pcomp_en(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_PCOMP_EN ? 1 : 0; in ahd_send_async()
1747 spi_rti(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_RTI ? 1 : 0; in ahd_send_async()
1748 spi_wr_flow(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_WR_FLOW ? 1 : 0; in ahd_send_async()
1749 spi_hold_mcs(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_HOLD_MCS ? 1 : 0; in ahd_send_async()
1750 spi_display_xfer_agreement(starget); in ahd_send_async()
2387 static void ahd_linux_set_width(struct scsi_target *starget, int width) in ahd_linux_set_width() argument
2389 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_width()
2394 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_width()
2395 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_width()
2401 static void ahd_linux_set_period(struct scsi_target *starget, int period) in ahd_linux_set_period() argument
2403 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_period()
2408 starget->channel + 'A', in ahd_linux_set_period()
2409 shost->this_id, starget->id, &tstate); in ahd_linux_set_period()
2426 if (spi_max_width(starget)) { in ahd_linux_set_period()
2436 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_period()
2437 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_period()
2441 if (spi_width(starget) == 0) in ahd_linux_set_period()
2454 static void ahd_linux_set_offset(struct scsi_target *starget, int offset) in ahd_linux_set_offset() argument
2456 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_offset()
2461 starget->channel + 'A', in ahd_linux_set_offset()
2462 shost->this_id, starget->id, &tstate); in ahd_linux_set_offset()
2474 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_offset()
2475 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_offset()
2489 static void ahd_linux_set_dt(struct scsi_target *starget, int dt) in ahd_linux_set_dt() argument
2491 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_dt()
2496 starget->channel + 'A', in ahd_linux_set_dt()
2497 shost->this_id, starget->id, &tstate); in ahd_linux_set_dt()
2510 if (dt && spi_max_width(starget)) { in ahd_linux_set_dt()
2513 ahd_linux_set_width(starget, 1); in ahd_linux_set_dt()
2520 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_dt()
2521 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_dt()
2531 static void ahd_linux_set_qas(struct scsi_target *starget, int qas) in ahd_linux_set_qas() argument
2533 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_qas()
2538 starget->channel + 'A', in ahd_linux_set_qas()
2539 shost->this_id, starget->id, &tstate); in ahd_linux_set_qas()
2559 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_qas()
2560 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_qas()
2570 static void ahd_linux_set_iu(struct scsi_target *starget, int iu) in ahd_linux_set_iu() argument
2572 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_iu()
2577 starget->channel + 'A', in ahd_linux_set_iu()
2578 shost->this_id, starget->id, &tstate); in ahd_linux_set_iu()
2592 if (iu && spi_max_width(starget)) { in ahd_linux_set_iu()
2599 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_iu()
2600 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_iu()
2610 static void ahd_linux_set_rd_strm(struct scsi_target *starget, int rdstrm) in ahd_linux_set_rd_strm() argument
2612 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_rd_strm()
2617 starget->channel + 'A', in ahd_linux_set_rd_strm()
2618 shost->this_id, starget->id, &tstate); in ahd_linux_set_rd_strm()
2632 if (rdstrm && spi_max_width(starget)) in ahd_linux_set_rd_strm()
2635 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_rd_strm()
2636 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_rd_strm()
2646 static void ahd_linux_set_wr_flow(struct scsi_target *starget, int wrflow) in ahd_linux_set_wr_flow() argument
2648 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_wr_flow()
2653 starget->channel + 'A', in ahd_linux_set_wr_flow()
2654 shost->this_id, starget->id, &tstate); in ahd_linux_set_wr_flow()
2668 if (wrflow && spi_max_width(starget)) in ahd_linux_set_wr_flow()
2671 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_wr_flow()
2672 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_wr_flow()
2682 static void ahd_linux_set_rti(struct scsi_target *starget, int rti) in ahd_linux_set_rti() argument
2684 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_rti()
2689 starget->channel + 'A', in ahd_linux_set_rti()
2690 shost->this_id, starget->id, &tstate); in ahd_linux_set_rti()
2712 if (rti && spi_max_width(starget)) in ahd_linux_set_rti()
2715 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_rti()
2716 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_rti()
2726 static void ahd_linux_set_pcomp_en(struct scsi_target *starget, int pcomp) in ahd_linux_set_pcomp_en() argument
2728 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_pcomp_en()
2733 starget->channel + 'A', in ahd_linux_set_pcomp_en()
2734 shost->this_id, starget->id, &tstate); in ahd_linux_set_pcomp_en()
2748 if (pcomp && spi_max_width(starget)) { in ahd_linux_set_pcomp_en()
2765 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_pcomp_en()
2766 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_pcomp_en()
2776 static void ahd_linux_set_hold_mcs(struct scsi_target *starget, int hold) in ahd_linux_set_hold_mcs() argument
2778 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_hold_mcs()
2783 starget->channel + 'A', in ahd_linux_set_hold_mcs()
2784 shost->this_id, starget->id, &tstate); in ahd_linux_set_hold_mcs()
2792 if (hold && spi_max_width(starget)) in ahd_linux_set_hold_mcs()
2795 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_hold_mcs()
2796 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_hold_mcs()