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()
1325 struct scsi_target *starget; in ahd_platform_free() local
1331 starget = ahd->platform_data->starget[i]; in ahd_platform_free()
1332 if (starget != NULL) { in ahd_platform_free()
1333 ahd->platform_data->starget[i] = NULL; in ahd_platform_free()
1678 struct scsi_target *starget; in ahd_send_async() local
1703 starget = ahd->platform_data->starget[target]; in ahd_send_async()
1704 if (starget == NULL) in ahd_send_async()
1708 (spi_dt(starget) ? MSG_EXT_PPR_DT_REQ : 0) in ahd_send_async()
1709 + (spi_qas(starget) ? MSG_EXT_PPR_QAS_REQ : 0) in ahd_send_async()
1710 + (spi_iu(starget) ? MSG_EXT_PPR_IU_REQ : 0) in ahd_send_async()
1711 + (spi_rd_strm(starget) ? MSG_EXT_PPR_RD_STRM : 0) in ahd_send_async()
1712 + (spi_pcomp_en(starget) ? MSG_EXT_PPR_PCOMP_EN : 0) in ahd_send_async()
1713 + (spi_rti(starget) ? MSG_EXT_PPR_RTI : 0) in ahd_send_async()
1714 + (spi_wr_flow(starget) ? MSG_EXT_PPR_WR_FLOW : 0) in ahd_send_async()
1715 + (spi_hold_mcs(starget) ? MSG_EXT_PPR_HOLD_MCS : 0); in ahd_send_async()
1717 if (tinfo->curr.period == spi_period(starget) in ahd_send_async()
1718 && tinfo->curr.width == spi_width(starget) in ahd_send_async()
1719 && tinfo->curr.offset == spi_offset(starget) in ahd_send_async()
1724 spi_period(starget) = tinfo->curr.period; in ahd_send_async()
1725 spi_width(starget) = tinfo->curr.width; in ahd_send_async()
1726 spi_offset(starget) = tinfo->curr.offset; in ahd_send_async()
1727 spi_dt(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_DT_REQ ? 1 : 0; in ahd_send_async()
1728 spi_qas(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_QAS_REQ ? 1 : 0; in ahd_send_async()
1729 spi_iu(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_IU_REQ ? 1 : 0; in ahd_send_async()
1730 spi_rd_strm(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_RD_STRM ? 1 : 0; in ahd_send_async()
1731 spi_pcomp_en(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_PCOMP_EN ? 1 : 0; in ahd_send_async()
1732 spi_rti(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_RTI ? 1 : 0; in ahd_send_async()
1733 spi_wr_flow(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_WR_FLOW ? 1 : 0; in ahd_send_async()
1734 spi_hold_mcs(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_HOLD_MCS ? 1 : 0; in ahd_send_async()
1735 spi_display_xfer_agreement(starget); in ahd_send_async()
2365 static void ahd_linux_set_width(struct scsi_target *starget, int width) in ahd_linux_set_width() argument
2367 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_width()
2372 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_width()
2373 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_width()
2379 static void ahd_linux_set_period(struct scsi_target *starget, int period) in ahd_linux_set_period() argument
2381 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_period()
2386 starget->channel + 'A', in ahd_linux_set_period()
2387 shost->this_id, starget->id, &tstate); in ahd_linux_set_period()
2404 if (spi_max_width(starget)) { in ahd_linux_set_period()
2414 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_period()
2415 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_period()
2419 if (spi_width(starget) == 0) in ahd_linux_set_period()
2432 static void ahd_linux_set_offset(struct scsi_target *starget, int offset) in ahd_linux_set_offset() argument
2434 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_offset()
2439 starget->channel + 'A', in ahd_linux_set_offset()
2440 shost->this_id, starget->id, &tstate); in ahd_linux_set_offset()
2452 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_offset()
2453 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_offset()
2467 static void ahd_linux_set_dt(struct scsi_target *starget, int dt) in ahd_linux_set_dt() argument
2469 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_dt()
2474 starget->channel + 'A', in ahd_linux_set_dt()
2475 shost->this_id, starget->id, &tstate); in ahd_linux_set_dt()
2488 if (dt && spi_max_width(starget)) { in ahd_linux_set_dt()
2491 ahd_linux_set_width(starget, 1); in ahd_linux_set_dt()
2498 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_dt()
2499 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_dt()
2509 static void ahd_linux_set_qas(struct scsi_target *starget, int qas) in ahd_linux_set_qas() argument
2511 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_qas()
2516 starget->channel + 'A', in ahd_linux_set_qas()
2517 shost->this_id, starget->id, &tstate); in ahd_linux_set_qas()
2537 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_qas()
2538 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_qas()
2548 static void ahd_linux_set_iu(struct scsi_target *starget, int iu) in ahd_linux_set_iu() argument
2550 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_iu()
2555 starget->channel + 'A', in ahd_linux_set_iu()
2556 shost->this_id, starget->id, &tstate); in ahd_linux_set_iu()
2570 if (iu && spi_max_width(starget)) { in ahd_linux_set_iu()
2577 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_iu()
2578 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_iu()
2588 static void ahd_linux_set_rd_strm(struct scsi_target *starget, int rdstrm) in ahd_linux_set_rd_strm() argument
2590 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_rd_strm()
2595 starget->channel + 'A', in ahd_linux_set_rd_strm()
2596 shost->this_id, starget->id, &tstate); in ahd_linux_set_rd_strm()
2610 if (rdstrm && spi_max_width(starget)) in ahd_linux_set_rd_strm()
2613 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_rd_strm()
2614 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_rd_strm()
2624 static void ahd_linux_set_wr_flow(struct scsi_target *starget, int wrflow) in ahd_linux_set_wr_flow() argument
2626 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_wr_flow()
2631 starget->channel + 'A', in ahd_linux_set_wr_flow()
2632 shost->this_id, starget->id, &tstate); in ahd_linux_set_wr_flow()
2646 if (wrflow && spi_max_width(starget)) in ahd_linux_set_wr_flow()
2649 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_wr_flow()
2650 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_wr_flow()
2660 static void ahd_linux_set_rti(struct scsi_target *starget, int rti) in ahd_linux_set_rti() argument
2662 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_rti()
2667 starget->channel + 'A', in ahd_linux_set_rti()
2668 shost->this_id, starget->id, &tstate); in ahd_linux_set_rti()
2690 if (rti && spi_max_width(starget)) in ahd_linux_set_rti()
2693 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_rti()
2694 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_rti()
2704 static void ahd_linux_set_pcomp_en(struct scsi_target *starget, int pcomp) in ahd_linux_set_pcomp_en() argument
2706 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_pcomp_en()
2711 starget->channel + 'A', in ahd_linux_set_pcomp_en()
2712 shost->this_id, starget->id, &tstate); in ahd_linux_set_pcomp_en()
2726 if (pcomp && spi_max_width(starget)) { in ahd_linux_set_pcomp_en()
2743 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_pcomp_en()
2744 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_pcomp_en()
2754 static void ahd_linux_set_hold_mcs(struct scsi_target *starget, int hold) in ahd_linux_set_hold_mcs() argument
2756 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in ahd_linux_set_hold_mcs()
2761 starget->channel + 'A', in ahd_linux_set_hold_mcs()
2762 shost->this_id, starget->id, &tstate); in ahd_linux_set_hold_mcs()
2770 if (hold && spi_max_width(starget)) in ahd_linux_set_hold_mcs()
2773 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, in ahd_linux_set_hold_mcs()
2774 starget->channel + 'A', ROLE_INITIATOR); in ahd_linux_set_hold_mcs()