Searched refs:starget (Results 1 - 44 of 44) sorted by relevance

/linux-4.4.14/drivers/message/fusion/
H A Dmptspi.c402 static int mptspi_target_alloc(struct scsi_target *starget) mptspi_target_alloc() argument
404 struct Scsi_Host *shost = dev_to_shost(&starget->dev); mptspi_target_alloc()
419 vtarget->id = (u8)starget->id; mptspi_target_alloc()
420 vtarget->channel = (u8)starget->channel; mptspi_target_alloc()
421 vtarget->starget = starget; mptspi_target_alloc()
422 starget->hostdata = vtarget; mptspi_target_alloc()
424 if (starget->channel == 1) { mptspi_target_alloc()
425 if (mptscsih_is_phys_disk(ioc, 0, starget->id) == 0) mptspi_target_alloc()
432 starget->id); mptspi_target_alloc()
435 if (starget->channel == 0 && mptspi_target_alloc()
436 mptspi_is_raid(hd, starget->id)) { mptspi_target_alloc()
439 "RAID Volume @ channel=%d id=%d\n", ioc->name, starget->channel, mptspi_target_alloc()
440 starget->id)); mptspi_target_alloc()
444 ioc->spi_data.nvram[starget->id] != MPT_HOST_NVRAM_INVALID) { mptspi_target_alloc()
445 u32 nvram = ioc->spi_data.nvram[starget->id]; mptspi_target_alloc()
446 spi_min_period(starget) = (nvram & MPT_NVRAM_SYNC_MASK) >> MPT_NVRAM_SYNC_SHIFT; mptspi_target_alloc()
447 spi_max_width(starget) = nvram & MPT_NVRAM_WIDE_DISABLE ? 0 : 1; mptspi_target_alloc()
449 spi_min_period(starget) = ioc->spi_data.minSyncFactor; mptspi_target_alloc()
450 spi_max_width(starget) = ioc->spi_data.maxBusWidth; mptspi_target_alloc()
452 spi_max_offset(starget) = ioc->spi_data.maxSyncOffset; mptspi_target_alloc()
454 spi_offset(starget) = 0; mptspi_target_alloc()
455 spi_period(starget) = 0xFF; mptspi_target_alloc()
456 mptspi_write_width(starget, 0); mptspi_target_alloc()
462 mptspi_target_destroy(struct scsi_target *starget) mptspi_target_destroy() argument
464 kfree(starget->hostdata); mptspi_target_destroy()
465 starget->hostdata = NULL; mptspi_target_destroy()
471 * @starget: SCSI target
476 mptspi_print_write_nego(struct _MPT_SCSI_HOST *hd, struct scsi_target *starget, u32 ii) mptspi_print_write_nego() argument
480 hd->ioc->name, starget->id, ii, mptspi_print_write_nego()
496 * @starget: SCSI target
501 mptspi_print_read_nego(struct _MPT_SCSI_HOST *hd, struct scsi_target *starget, u32 ii) mptspi_print_read_nego() argument
505 hd->ioc->name, starget->id, ii, mptspi_print_read_nego()
518 static int mptspi_read_spi_device_pg0(struct scsi_target *starget, mptspi_read_spi_device_pg0() argument
521 struct Scsi_Host *shost = dev_to_shost(&starget->dev); mptspi_read_spi_device_pg0()
532 if (starget->channel == 0 && mptspi_read_spi_device_pg0()
533 mptspi_is_raid(hd, starget->id)) mptspi_read_spi_device_pg0()
545 starget_printk(KERN_ERR, starget, MYIOC_s_FMT mptspi_read_spi_device_pg0()
563 cfg.pageAddr = starget->id; mptspi_read_spi_device_pg0()
567 starget_printk(KERN_ERR, starget, MYIOC_s_FMT "mpt_config failed\n", ioc->name); mptspi_read_spi_device_pg0()
573 mptspi_print_read_nego(hd, starget, le32_to_cpu(spi_dev_pg0->NegotiatedParameters)); mptspi_read_spi_device_pg0()
580 static u32 mptspi_getRP(struct scsi_target *starget) mptspi_getRP() argument
584 nego |= spi_iu(starget) ? MPI_SCSIDEVPAGE1_RP_IU : 0; mptspi_getRP()
585 nego |= spi_dt(starget) ? MPI_SCSIDEVPAGE1_RP_DT : 0; mptspi_getRP()
586 nego |= spi_qas(starget) ? MPI_SCSIDEVPAGE1_RP_QAS : 0; mptspi_getRP()
587 nego |= spi_hold_mcs(starget) ? MPI_SCSIDEVPAGE1_RP_HOLD_MCS : 0; mptspi_getRP()
588 nego |= spi_wr_flow(starget) ? MPI_SCSIDEVPAGE1_RP_WR_FLOW : 0; mptspi_getRP()
589 nego |= spi_rd_strm(starget) ? MPI_SCSIDEVPAGE1_RP_RD_STRM : 0; mptspi_getRP()
590 nego |= spi_rti(starget) ? MPI_SCSIDEVPAGE1_RP_RTI : 0; mptspi_getRP()
591 nego |= spi_pcomp_en(starget) ? MPI_SCSIDEVPAGE1_RP_PCOMP_EN : 0; mptspi_getRP()
593 nego |= (spi_period(starget) << MPI_SCSIDEVPAGE1_RP_SHIFT_MIN_SYNC_PERIOD) & MPI_SCSIDEVPAGE1_RP_MIN_SYNC_PERIOD_MASK; mptspi_getRP()
594 nego |= (spi_offset(starget) << MPI_SCSIDEVPAGE1_RP_SHIFT_MAX_SYNC_OFFSET) & MPI_SCSIDEVPAGE1_RP_MAX_SYNC_OFFSET_MASK; mptspi_getRP()
595 nego |= spi_width(starget) ? MPI_SCSIDEVPAGE1_RP_WIDE : 0; mptspi_getRP()
600 static void mptspi_read_parameters(struct scsi_target *starget) mptspi_read_parameters() argument
605 mptspi_read_spi_device_pg0(starget, &spi_dev_pg0); mptspi_read_parameters()
609 spi_iu(starget) = (nego & MPI_SCSIDEVPAGE0_NP_IU) ? 1 : 0; mptspi_read_parameters()
610 spi_dt(starget) = (nego & MPI_SCSIDEVPAGE0_NP_DT) ? 1 : 0; mptspi_read_parameters()
611 spi_qas(starget) = (nego & MPI_SCSIDEVPAGE0_NP_QAS) ? 1 : 0; mptspi_read_parameters()
612 spi_wr_flow(starget) = (nego & MPI_SCSIDEVPAGE0_NP_WR_FLOW) ? 1 : 0; mptspi_read_parameters()
613 spi_rd_strm(starget) = (nego & MPI_SCSIDEVPAGE0_NP_RD_STRM) ? 1 : 0; mptspi_read_parameters()
614 spi_rti(starget) = (nego & MPI_SCSIDEVPAGE0_NP_RTI) ? 1 : 0; mptspi_read_parameters()
615 spi_pcomp_en(starget) = (nego & MPI_SCSIDEVPAGE0_NP_PCOMP_EN) ? 1 : 0; mptspi_read_parameters()
616 spi_hold_mcs(starget) = (nego & MPI_SCSIDEVPAGE0_NP_HOLD_MCS) ? 1 : 0; mptspi_read_parameters()
617 spi_period(starget) = (nego & MPI_SCSIDEVPAGE0_NP_NEG_SYNC_PERIOD_MASK) >> MPI_SCSIDEVPAGE0_NP_SHIFT_SYNC_PERIOD; mptspi_read_parameters()
618 spi_offset(starget) = (nego & MPI_SCSIDEVPAGE0_NP_NEG_SYNC_OFFSET_MASK) >> MPI_SCSIDEVPAGE0_NP_SHIFT_SYNC_OFFSET; mptspi_read_parameters()
619 spi_width(starget) = (nego & MPI_SCSIDEVPAGE0_NP_WIDE) ? 1 : 0; mptspi_read_parameters()
726 struct scsi_target *starget; mptspi_slave_alloc() local
743 starget = scsi_target(sdev); mptspi_slave_alloc()
744 vtarget = starget->hostdata; mptspi_slave_alloc()
809 struct scsi_target *starget = scsi_target(sdev); mptspi_slave_destroy() local
810 VirtTarget *vtarget = starget->hostdata; mptspi_slave_destroy()
822 mptspi_write_spi_device_pg1(starget, &pg1); mptspi_slave_destroy()
855 static int mptspi_write_spi_device_pg1(struct scsi_target *starget, mptspi_write_spi_device_pg1() argument
858 struct Scsi_Host *shost = dev_to_shost(&starget->dev); mptspi_write_spi_device_pg1()
873 if (starget->channel == 0 && mptspi_write_spi_device_pg1()
874 mptspi_is_raid(hd, starget->id)) mptspi_write_spi_device_pg1()
881 starget_printk(KERN_ERR, starget, MYIOC_s_FMT mptspi_write_spi_device_pg1()
899 cfg.pageAddr = starget->id; mptspi_write_spi_device_pg1()
914 sdev = scsi_device_lookup_by_target(starget, i); mptspi_write_spi_device_pg1()
926 mptspi_print_write_nego(hd, starget, le32_to_cpu(pg1->RequestedParameters)); mptspi_write_spi_device_pg1()
929 starget_printk(KERN_ERR, starget, MYIOC_s_FMT mptspi_write_spi_device_pg1()
940 static void mptspi_write_offset(struct scsi_target *starget, int offset) mptspi_write_offset() argument
951 if (spi_offset(starget) == -1) mptspi_write_offset()
952 mptspi_read_parameters(starget); mptspi_write_offset()
954 spi_offset(starget) = offset; mptspi_write_offset()
956 nego = mptspi_getRP(starget); mptspi_write_offset()
962 mptspi_write_spi_device_pg1(starget, &pg1); mptspi_write_offset()
965 static void mptspi_write_period(struct scsi_target *starget, int period) mptspi_write_period() argument
976 if (spi_period(starget) == -1) mptspi_write_period()
977 mptspi_read_parameters(starget); mptspi_write_period()
980 spi_iu(starget) = 1; mptspi_write_period()
981 spi_dt(starget) = 1; mptspi_write_period()
983 spi_dt(starget) = 1; mptspi_write_period()
986 spi_period(starget) = period; mptspi_write_period()
988 nego = mptspi_getRP(starget); mptspi_write_period()
994 mptspi_write_spi_device_pg1(starget, &pg1); mptspi_write_period()
997 static void mptspi_write_dt(struct scsi_target *starget, int dt) mptspi_write_dt() argument
1002 if (spi_period(starget) == -1) mptspi_write_dt()
1003 mptspi_read_parameters(starget); mptspi_write_dt()
1005 if (!dt && spi_period(starget) < 10) mptspi_write_dt()
1006 spi_period(starget) = 10; mptspi_write_dt()
1008 spi_dt(starget) = dt; mptspi_write_dt()
1010 nego = mptspi_getRP(starget); mptspi_write_dt()
1017 mptspi_write_spi_device_pg1(starget, &pg1); mptspi_write_dt()
1020 static void mptspi_write_iu(struct scsi_target *starget, int iu) mptspi_write_iu() argument
1025 if (spi_period(starget) == -1) mptspi_write_iu()
1026 mptspi_read_parameters(starget); mptspi_write_iu()
1028 if (!iu && spi_period(starget) < 9) mptspi_write_iu()
1029 spi_period(starget) = 9; mptspi_write_iu()
1031 spi_iu(starget) = iu; mptspi_write_iu()
1033 nego = mptspi_getRP(starget); mptspi_write_iu()
1039 mptspi_write_spi_device_pg1(starget, &pg1); mptspi_write_iu()
1043 static void mptspi_write_##parm(struct scsi_target *starget, int parm)\
1048 spi_##parm(starget) = parm; \
1050 nego = mptspi_getRP(starget); \
1056 mptspi_write_spi_device_pg1(starget, &pg1); \
1065 static void mptspi_write_qas(struct scsi_target *starget, int qas) mptspi_write_qas() argument
1068 struct Scsi_Host *shost = dev_to_shost(&starget->dev); mptspi_write_qas()
1070 VirtTarget *vtarget = starget->hostdata; mptspi_write_qas()
1075 spi_qas(starget) = 0; mptspi_write_qas()
1077 spi_qas(starget) = qas; mptspi_write_qas()
1079 nego = mptspi_getRP(starget); mptspi_write_qas()
1085 mptspi_write_spi_device_pg1(starget, &pg1); mptspi_write_qas()
1088 static void mptspi_write_width(struct scsi_target *starget, int width) mptspi_write_width() argument
1094 spi_dt(starget) = 0; mptspi_write_width()
1095 if (spi_period(starget) < 10) mptspi_write_width()
1096 spi_period(starget) = 10; mptspi_write_width()
1099 spi_width(starget) = width; mptspi_write_width()
1101 nego = mptspi_getRP(starget); mptspi_write_width()
1107 mptspi_write_spi_device_pg1(starget, &pg1); mptspi_write_width()
1135 struct scsi_target *starget = scsi_target(sdev); shost_for_each_device() local
1136 VirtTarget *vtarget = starget->hostdata; shost_for_each_device()
1143 * starget->id is the actual target address */ shost_for_each_device()
1147 starget_printk(KERN_INFO, vtarget->starget, MYIOC_s_FMT shost_for_each_device()
1197 mptspi_deny_binding(struct scsi_target *starget) mptspi_deny_binding() argument
1200 (struct _MPT_SCSI_HOST *)dev_to_shost(starget->dev.parent)->hostdata; mptspi_deny_binding()
1201 return ((mptspi_is_raid(hd, starget->id)) && mptspi_deny_binding()
1202 starget->channel == 0) ? 1 : 0; mptspi_deny_binding()
1268 struct scsi_target *starget; mptspi_dv_renegotiate_work() local
1279 starget = scsi_target(sdev); mptspi_dv_renegotiate_work()
1280 nego = mptspi_getRP(starget); mptspi_dv_renegotiate_work()
1284 mptspi_write_spi_device_pg1(starget, &pg1); mptspi_dv_renegotiate_work()
H A Dmptfc.c98 static int mptfc_target_alloc(struct scsi_target *starget);
101 static void mptfc_target_destroy(struct scsi_target *starget);
479 if (ri->starget) { mptfc_register_dev()
480 vtarget = ri->starget->hostdata; mptfc_register_dev()
517 mptfc_target_destroy(struct scsi_target *starget) mptfc_target_destroy() argument
522 rport = starget_to_rport(starget); mptfc_target_destroy()
526 ri->starget = NULL; mptfc_target_destroy()
528 kfree(starget->hostdata); mptfc_target_destroy()
529 starget->hostdata = NULL; mptfc_target_destroy()
538 mptfc_target_alloc(struct scsi_target *starget) mptfc_target_alloc() argument
548 starget->hostdata = vtarget; mptfc_target_alloc()
551 rport = starget_to_rport(starget); mptfc_target_alloc()
557 ri->starget = starget; mptfc_target_alloc()
563 starget->hostdata = NULL; mptfc_target_alloc()
610 struct scsi_target *starget; mptfc_slave_alloc() local
614 starget = scsi_target(sdev); mptfc_slave_alloc()
615 rport = starget_to_rport(starget); mptfc_slave_alloc()
632 vtarget = starget->hostdata; mptfc_slave_alloc()
1094 struct scsi_target *starget; mptfc_setup_reset() local
1103 starget = ri->starget; mptfc_setup_reset()
1104 if (starget) { mptfc_setup_reset()
1105 vtarget = starget->hostdata; mptfc_setup_reset()
1129 struct scsi_target *starget; mptfc_rescan_devices() local
1158 starget = ri->starget; mptfc_rescan_devices()
1159 if (starget) { mptfc_rescan_devices()
1160 vtarget = starget->hostdata; mptfc_rescan_devices()
H A Dmptsas.c531 return phy_info->port_details->starget; mptsas_get_starget()
538 starget) mptsas_set_starget()
541 phy_info->port_details->starget = starget; mptsas_set_starget()
559 struct scsi_target *starget; mptsas_add_device_component() local
598 starget = scsi_target(sdev); mptsas_add_device_component()
599 rphy = dev_to_rphy(starget->dev.parent); mptsas_add_device_component()
601 sas_info->os.id = starget->id; mptsas_add_device_component()
602 sas_info->os.channel = starget->channel; mptsas_add_device_component()
652 struct scsi_target *starget) mptsas_add_device_component_starget_ir()
666 cfg.pageAddr = starget->id; mptsas_add_device_component_starget_ir()
711 sas_info->volume_id = starget->id; mptsas_add_device_component_starget_ir()
725 starget->id) { mptsas_add_device_component_starget_ir()
733 sas_info->fw.id = starget->id; mptsas_add_device_component_starget_ir()
734 sas_info->os.id = starget->id; mptsas_add_device_component_starget_ir()
735 sas_info->os.channel = starget->channel; mptsas_add_device_component_starget_ir()
751 * @starget:
756 struct scsi_target *starget) mptsas_add_device_component_starget()
763 rphy = dev_to_rphy(starget->dev.parent); mptsas_add_device_component_starget()
764 vtarget = starget->hostdata; mptsas_add_device_component_starget()
920 port_details->starget = mptsas_setup_wide_ports()
1092 mptsas_block_io_starget(struct scsi_target *starget) mptsas_block_io_starget() argument
1094 if (starget) mptsas_block_io_starget()
1095 starget_for_each_device(starget, NULL, mptsas_block_io_sdev); mptsas_block_io_starget()
1123 mptsas_block_io_starget(vtarget->starget); mptsas_target_reset_queue()
1716 mptsas_target_alloc(struct scsi_target *starget) mptsas_target_alloc() argument
1718 struct Scsi_Host *host = dev_to_shost(&starget->dev); mptsas_target_alloc()
1731 vtarget->starget = starget; mptsas_target_alloc()
1734 id = starget->id; mptsas_target_alloc()
1740 if (starget->channel == MPTSAS_RAID_CHANNEL) { mptsas_target_alloc()
1756 rphy = dev_to_rphy(starget->dev.parent); mptsas_target_alloc()
1765 mptsas_set_starget(&p->phy_info[i], starget); mptsas_target_alloc()
1789 starget->hostdata = vtarget; mptsas_target_alloc()
1794 mptsas_target_destroy(struct scsi_target *starget) mptsas_target_destroy() argument
1796 struct Scsi_Host *host = dev_to_shost(&starget->dev); mptsas_target_destroy()
1804 if (!starget->hostdata) mptsas_target_destroy()
1807 vtarget = starget->hostdata; mptsas_target_destroy()
1809 mptsas_del_device_component_by_os(ioc, starget->channel, mptsas_target_destroy()
1810 starget->id); mptsas_target_destroy()
1813 if (starget->channel == MPTSAS_RAID_CHANNEL) mptsas_target_destroy()
1816 rphy = dev_to_rphy(starget->dev.parent); mptsas_target_destroy()
1823 starget_printk(KERN_INFO, starget, MYIOC_s_FMT mptsas_target_destroy()
1836 vtarget->starget = NULL; mptsas_target_destroy()
1837 kfree(starget->hostdata); mptsas_target_destroy()
1838 starget->hostdata = NULL; mptsas_target_destroy()
1850 struct scsi_target *starget; mptsas_slave_alloc() local
1860 starget = scsi_target(sdev); mptsas_slave_alloc()
1861 vdevice->vtarget = starget->hostdata; mptsas_slave_alloc()
4220 mptsas_reprobe_target(struct scsi_target *starget, int uld_attach) mptsas_reprobe_target() argument
4222 starget_for_each_device(starget, uld_attach ? (void *)1 : NULL, mptsas_reprobe_target()
4310 struct scsi_target * starget; mptsas_hotplug_work() local
4437 starget = mptsas_get_starget(phy_info); mptsas_hotplug_work()
4438 if (!starget) { mptsas_hotplug_work()
4445 vtarget = starget->hostdata; mptsas_hotplug_work()
4455 starget_printk(KERN_INFO, starget, MYIOC_s_FMT "RAID Hidding: " mptsas_hotplug_work()
4464 mptsas_reprobe_target(starget, 1); mptsas_hotplug_work()
4496 starget = mptsas_get_starget(phy_info); mptsas_hotplug_work()
4497 if (!starget) { mptsas_hotplug_work()
4504 vtarget = starget->hostdata; mptsas_hotplug_work()
4521 starget_printk(KERN_INFO, starget, MYIOC_s_FMT "RAID Exposing:" mptsas_hotplug_work()
4530 mptsas_reprobe_target(starget, 0); mptsas_hotplug_work()
537 mptsas_set_starget(struct mptsas_phyinfo *phy_info, struct scsi_target * starget) mptsas_set_starget() argument
651 mptsas_add_device_component_starget_ir(MPT_ADAPTER *ioc, struct scsi_target *starget) mptsas_add_device_component_starget_ir() argument
755 mptsas_add_device_component_starget(MPT_ADAPTER *ioc, struct scsi_target *starget) mptsas_add_device_component_starget() argument
H A Dmptsas.h154 struct scsi_target *starget; member in struct:mptsas_portinfo_details
H A Dmptscsih.c2294 struct scsi_target *starget; mptscsih_slave_destroy() local
2296 starget = scsi_target(sdev); mptscsih_slave_destroy()
2297 vtarget = starget->hostdata; mptscsih_slave_destroy()
2322 struct scsi_target *starget; mptscsih_change_queue_depth() local
2326 starget = scsi_target(sdev); mptscsih_change_queue_depth()
2327 vtarget = starget->hostdata; mptscsih_change_queue_depth()
2361 struct scsi_target *starget; mptscsih_slave_configure() local
2365 starget = scsi_target(sdev); mptscsih_slave_configure()
2366 vtarget = starget->hostdata; mptscsih_slave_configure()
H A Dmptbase.h388 struct scsi_target *starget; member in struct:_VirtTarget
553 struct scsi_target *starget; member in struct:mptfc_rport_info
H A Dmptctl.c1994 struct scsi_target *starget = scsi_target(sdev); mptctl_do_mpt_command() local
1995 VirtTarget *vtarget = starget->hostdata; mptctl_do_mpt_command()
/linux-4.4.14/drivers/scsi/
H A Dscsi_transport_spi.c227 struct scsi_target *starget = sdev->sdev_target; spi_device_configure() local
235 spi_support_sync(starget) = scsi_device_sync(sdev); spi_device_configure()
236 spi_support_wide(starget) = scsi_device_wide(sdev); spi_device_configure()
237 spi_support_dt(starget) = scsi_device_dt(sdev); spi_device_configure()
238 spi_support_dt_only(starget) = scsi_device_dt_only(sdev); spi_device_configure()
239 spi_support_ius(starget) = scsi_device_ius(sdev); spi_device_configure()
242 spi_support_ius(starget) = 0; spi_device_configure()
244 spi_support_qas(starget) = scsi_device_qas(sdev); spi_device_configure()
253 struct scsi_target *starget = to_scsi_target(dev); spi_setup_transport_attrs() local
255 spi_period(starget) = -1; /* illegal value */ spi_setup_transport_attrs()
256 spi_min_period(starget) = 0; spi_setup_transport_attrs()
257 spi_offset(starget) = 0; /* async */ spi_setup_transport_attrs()
258 spi_max_offset(starget) = 255; spi_setup_transport_attrs()
259 spi_width(starget) = 0; /* narrow */ spi_setup_transport_attrs()
260 spi_max_width(starget) = 1; spi_setup_transport_attrs()
261 spi_iu(starget) = 0; /* no IU */ spi_setup_transport_attrs()
262 spi_max_iu(starget) = 1; spi_setup_transport_attrs()
263 spi_dt(starget) = 0; /* ST */ spi_setup_transport_attrs()
264 spi_qas(starget) = 0; spi_setup_transport_attrs()
265 spi_max_qas(starget) = 1; spi_setup_transport_attrs()
266 spi_wr_flow(starget) = 0; spi_setup_transport_attrs()
267 spi_rd_strm(starget) = 0; spi_setup_transport_attrs()
268 spi_rti(starget) = 0; spi_setup_transport_attrs()
269 spi_pcomp_en(starget) = 0; spi_setup_transport_attrs()
270 spi_hold_mcs(starget) = 0; spi_setup_transport_attrs()
271 spi_dv_pending(starget) = 0; spi_setup_transport_attrs()
272 spi_dv_in_progress(starget) = 0; spi_setup_transport_attrs()
273 spi_initial_dv(starget) = 0; spi_setup_transport_attrs()
274 mutex_init(&spi_dv_mutex(starget)); spi_setup_transport_attrs()
285 struct scsi_target *starget = transport_class_to_starget(dev); \
288 tp = (struct spi_transport_attrs *)&starget->starget_data; \
300 struct scsi_target *starget = transport_class_to_starget(dev); \
303 tp = (struct spi_transport_attrs *)&starget->starget_data; \
315 struct scsi_target *starget = transport_class_to_starget(dev); \
316 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); \
319 tp = (struct spi_transport_attrs *)&starget->starget_data; \
321 i->f->get_##field(starget); \
332 struct scsi_target *starget = transport_class_to_starget(dev); \
333 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); \
339 i->f->set_##field(starget, val); \
350 struct scsi_target *starget = transport_class_to_starget(dev); \
351 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); \
354 = (struct spi_transport_attrs *)&starget->starget_data; \
361 i->f->set_##field(starget, val); \
414 struct scsi_target *starget = transport_class_to_starget(dev); store_spi_revalidate() local
416 device_for_each_child(&starget->dev, NULL, child_iter); store_spi_revalidate()
494 struct scsi_target *starget = transport_class_to_starget(dev); show_spi_transport_period() local
495 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); show_spi_transport_period()
498 (struct spi_transport_attrs *)&starget->starget_data; show_spi_transport_period()
501 i->f->get_period(starget); show_spi_transport_period()
510 struct scsi_target *starget = transport_class_to_starget(cdev); store_spi_transport_period() local
511 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); store_spi_transport_period()
514 (struct spi_transport_attrs *)&starget->starget_data; store_spi_transport_period()
525 i->f->set_period(starget, period); store_spi_transport_period()
538 struct scsi_target *starget = transport_class_to_starget(cdev); show_spi_transport_min_period() local
539 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); show_spi_transport_min_period()
542 (struct spi_transport_attrs *)&starget->starget_data; show_spi_transport_min_period()
555 struct scsi_target *starget = transport_class_to_starget(cdev); store_spi_transport_min_period() local
557 (struct spi_transport_attrs *)&starget->starget_data; store_spi_transport_min_period()
764 struct scsi_target *starget = sdev->sdev_target; spi_dv_retrain() local
779 i->f->get_iu(starget); spi_dv_retrain()
781 i->f->get_qas(starget); spi_dv_retrain()
788 if (i->f->set_iu && spi_iu(starget)) { spi_dv_retrain()
789 starget_printk(KERN_ERR, starget, "Domain Validation Disabling Information Units\n"); spi_dv_retrain()
791 } else if (i->f->set_qas && spi_qas(starget)) { spi_dv_retrain()
792 starget_printk(KERN_ERR, starget, "Domain Validation Disabling Quick Arbitration and Selection\n"); spi_dv_retrain()
795 newperiod = spi_period(starget); spi_dv_retrain()
804 starget_printk(KERN_ERR, starget, "Domain Validation Failure, dropping back to Asynchronous\n"); spi_dv_retrain()
808 starget_printk(KERN_ERR, starget, "Domain Validation detected failure, dropping back\n"); spi_dv_retrain()
867 struct scsi_target *starget = sdev->sdev_target; spi_dv_device_internal() local
870 int min_period = spi_min_period(starget); spi_dv_device_internal()
871 int max_width = spi_max_width(starget); spi_dv_device_internal()
878 starget_printk(KERN_ERR, starget, "Domain Validation Initial Inquiry Failed\n"); spi_dv_device_internal()
883 if (!spi_support_wide(starget)) { spi_dv_device_internal()
884 spi_max_width(starget) = 0; spi_dv_device_internal()
890 i->f->set_width(starget, 1); spi_dv_device_internal()
896 starget_printk(KERN_ERR, starget, "Wide Transfers Fail\n"); spi_dv_device_internal()
897 i->f->set_width(starget, 0); spi_dv_device_internal()
910 if (!spi_support_sync(starget) && !spi_support_dt(starget)) spi_dv_device_internal()
921 DV_SET(offset, spi_max_offset(starget)); spi_dv_device_internal()
926 if (spi_support_qas(starget) && spi_max_qas(starget)) { spi_dv_device_internal()
932 if (spi_support_ius(starget) && spi_max_iu(starget) && spi_dv_device_internal()
953 !spi_support_dt(starget)) { spi_dv_device_internal()
967 i->f->get_dt(starget); spi_dv_device_internal()
974 if (len == -1 && spi_dt(starget)) spi_dv_device_internal()
978 starget_printk(KERN_INFO, starget, "Domain Validation skipping write tests\n"); spi_dv_device_internal()
983 starget_printk(KERN_WARNING, starget, "Echo buffer size %d is too big, trimming to %d\n", len, SPI_MAX_ECHO_BUFFER_SIZE); spi_dv_device_internal()
1010 struct scsi_target *starget = sdev->sdev_target; spi_dv_device() local
1014 if (unlikely(spi_dv_in_progress(starget))) spi_dv_device()
1019 spi_dv_in_progress(starget) = 1; spi_dv_device()
1031 scsi_target_quiesce(starget); spi_dv_device()
1033 spi_dv_pending(starget) = 1; spi_dv_device()
1034 mutex_lock(&spi_dv_mutex(starget)); spi_dv_device()
1036 starget_printk(KERN_INFO, starget, "Beginning Domain Validation\n"); spi_dv_device()
1040 starget_printk(KERN_INFO, starget, "Ending Domain Validation\n"); spi_dv_device()
1042 mutex_unlock(&spi_dv_mutex(starget)); spi_dv_device()
1043 spi_dv_pending(starget) = 0; spi_dv_device()
1045 scsi_target_resume(starget); spi_dv_device()
1047 spi_initial_dv(starget) = 1; spi_dv_device()
1052 spi_dv_in_progress(starget) = 0; spi_dv_device()
1115 * @starget: The target for which to display the agreement
1121 void spi_display_xfer_agreement(struct scsi_target *starget) spi_display_xfer_agreement() argument
1124 tp = (struct spi_transport_attrs *)&starget->starget_data; spi_display_xfer_agreement()
1156 dev_info(&starget->dev, spi_display_xfer_agreement()
1169 dev_info(&starget->dev, "%sasynchronous\n", spi_display_xfer_agreement()
1396 struct scsi_target *starget; spi_target_match() local
1408 starget = to_scsi_target(dev); spi_target_match()
1410 if (i->f->deny_binding && i->f->deny_binding(starget)) spi_target_match()
1464 struct scsi_target *starget = transport_class_to_starget(cdev); target_attribute_is_visible() local
1469 spi_support_sync(starget)) target_attribute_is_visible()
1472 spi_support_sync(starget)) target_attribute_is_visible()
1475 spi_support_sync(starget)) target_attribute_is_visible()
1478 spi_support_sync(starget)) target_attribute_is_visible()
1481 spi_support_wide(starget)) target_attribute_is_visible()
1484 spi_support_wide(starget)) target_attribute_is_visible()
1487 spi_support_ius(starget)) target_attribute_is_visible()
1490 spi_support_ius(starget)) target_attribute_is_visible()
1493 spi_support_dt(starget)) target_attribute_is_visible()
1496 spi_support_qas(starget)) target_attribute_is_visible()
1499 spi_support_qas(starget)) target_attribute_is_visible()
1502 spi_support_ius(starget)) target_attribute_is_visible()
1505 spi_support_ius(starget)) target_attribute_is_visible()
1508 spi_support_ius(starget)) target_attribute_is_visible()
1511 spi_support_ius(starget)) target_attribute_is_visible()
1514 spi_support_ius(starget)) target_attribute_is_visible()
H A Dscsi_scan.c198 * @starget: which target to allocate a &scsi_device for
210 static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, scsi_alloc_sdev() argument
215 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); scsi_alloc_sdev()
229 sdev->id = starget->id; scsi_alloc_sdev()
231 sdev->channel = starget->channel; scsi_alloc_sdev()
242 sdev->sdev_gendev.parent = get_device(&starget->dev); scsi_alloc_sdev()
243 sdev->sdev_target = starget; scsi_alloc_sdev()
271 put_device(&starget->dev); scsi_alloc_sdev()
311 static void scsi_target_destroy(struct scsi_target *starget) scsi_target_destroy() argument
313 struct device *dev = &starget->dev; scsi_target_destroy()
317 BUG_ON(starget->state == STARGET_DEL); scsi_target_destroy()
318 starget->state = STARGET_DEL; scsi_target_destroy()
322 shost->hostt->target_destroy(starget); scsi_target_destroy()
323 list_del_init(&starget->siblings); scsi_target_destroy()
331 struct scsi_target *starget = to_scsi_target(dev); scsi_target_dev_release() local
333 kfree(starget); scsi_target_dev_release()
351 struct scsi_target *starget, *found_starget = NULL; __scsi_find_target() local
356 list_for_each_entry(starget, &shost->__targets, siblings) { __scsi_find_target()
357 if (starget->id == id && __scsi_find_target()
358 starget->channel == channel) { __scsi_find_target()
359 found_starget = starget; __scsi_find_target()
380 struct scsi_target *starget scsi_target_reap_ref_release() local
388 if (starget->state != STARGET_CREATED) { scsi_target_reap_ref_release()
389 transport_remove_device(&starget->dev); scsi_target_reap_ref_release()
390 device_del(&starget->dev); scsi_target_reap_ref_release()
392 scsi_target_destroy(starget); scsi_target_reap_ref_release()
395 static void scsi_target_reap_ref_put(struct scsi_target *starget) scsi_target_reap_ref_put() argument
397 kref_put(&starget->reap_ref, scsi_target_reap_ref_release); scsi_target_reap_ref_put()
420 struct scsi_target *starget; scsi_alloc_target() local
424 starget = kzalloc(size, GFP_KERNEL); scsi_alloc_target()
425 if (!starget) { scsi_alloc_target()
429 dev = &starget->dev; scsi_alloc_target()
431 kref_init(&starget->reap_ref); scsi_alloc_target()
436 starget->id = id; scsi_alloc_target()
437 starget->channel = channel; scsi_alloc_target()
438 starget->can_queue = 0; scsi_alloc_target()
439 INIT_LIST_HEAD(&starget->siblings); scsi_alloc_target()
440 INIT_LIST_HEAD(&starget->devices); scsi_alloc_target()
441 starget->state = STARGET_CREATED; scsi_alloc_target()
442 starget->scsi_level = SCSI_2; scsi_alloc_target()
443 starget->max_target_blocked = SCSI_DEFAULT_TARGET_BLOCKED; scsi_alloc_target()
451 list_add_tail(&starget->siblings, &shost->__targets); scsi_alloc_target()
456 error = shost->hostt->target_alloc(starget); scsi_alloc_target()
462 scsi_target_destroy(starget); scsi_alloc_target()
468 return starget; scsi_alloc_target()
503 * @starget: target to be checked
509 void scsi_target_reap(struct scsi_target *starget) scsi_target_reap() argument
516 BUG_ON(starget->state == STARGET_DEL); scsi_target_reap()
517 scsi_target_reap_ref_put(starget); scsi_target_reap()
1033 * @starget: pointer to target device structure
1050 static int scsi_probe_and_add_lun(struct scsi_target *starget, scsi_probe_and_add_lun() argument
1058 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); scsi_probe_and_add_lun()
1064 sdev = scsi_device_lookup_by_target(starget, lun); scsi_probe_and_add_lun()
1083 sdev = scsi_alloc_sdev(starget, lun, hostdata); scsi_probe_and_add_lun()
1151 if (((result[0] >> 5) == 1 || starget->pdt_1f_for_no_lun) && scsi_probe_and_add_lun()
1189 * @starget: pointer to target structure to scan
1201 static void scsi_sequential_lun_scan(struct scsi_target *starget, scsi_sequential_lun_scan() argument
1206 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); scsi_sequential_lun_scan()
1208 SCSI_LOG_SCAN_BUS(3, starget_printk(KERN_INFO, starget, scsi_sequential_lun_scan()
1270 if ((scsi_probe_and_add_lun(starget, lun, NULL, NULL, rescan, scsi_sequential_lun_scan()
1278 * @starget: which target
1290 * If starget->no_report_luns is set, return 1 always.
1296 static int scsi_report_lun_scan(struct scsi_target *starget, int bflags, scsi_report_lun_scan() argument
1309 struct Scsi_Host *shost = dev_to_shost(&starget->dev); scsi_report_lun_scan()
1320 if (starget->scsi_level < SCSI_2 && scsi_report_lun_scan()
1321 starget->scsi_level != SCSI_UNKNOWN) scsi_report_lun_scan()
1323 if (starget->scsi_level < SCSI_3 && scsi_report_lun_scan()
1328 if (starget->no_report_luns) scsi_report_lun_scan()
1331 if (!(sdev = scsi_device_lookup_by_target(starget, 0))) { scsi_report_lun_scan()
1332 sdev = scsi_alloc_sdev(starget, 0, NULL); scsi_report_lun_scan()
1444 res = scsi_probe_and_add_lun(starget, scsi_report_lun_scan()
1476 struct scsi_target *starget; __scsi_add_device() local
1481 starget = scsi_alloc_target(parent, channel, id); __scsi_add_device()
1482 if (!starget) __scsi_add_device()
1484 scsi_autopm_get_target(starget); __scsi_add_device()
1491 scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, hostdata); __scsi_add_device()
1495 scsi_autopm_put_target(starget); __scsi_add_device()
1500 scsi_target_reap(starget); __scsi_add_device()
1501 put_device(&starget->dev); __scsi_add_device()
1540 struct scsi_target *starget; __scsi_scan_target() local
1548 starget = scsi_alloc_target(parent, channel, id); __scsi_scan_target()
1549 if (!starget) __scsi_scan_target()
1551 scsi_autopm_get_target(starget); __scsi_scan_target()
1557 scsi_probe_and_add_lun(starget, lun, NULL, NULL, rescan, NULL); __scsi_scan_target()
1565 res = scsi_probe_and_add_lun(starget, 0, &bflags, NULL, rescan, NULL); __scsi_scan_target()
1567 if (scsi_report_lun_scan(starget, bflags, rescan) != 0) __scsi_scan_target()
1572 scsi_sequential_lun_scan(starget, bflags, __scsi_scan_target()
1573 starget->scsi_level, rescan); __scsi_scan_target()
1577 scsi_autopm_put_target(starget); __scsi_scan_target()
1582 scsi_target_reap(starget); __scsi_scan_target()
1584 put_device(&starget->dev); __scsi_scan_target()
1891 struct scsi_target *starget; scsi_get_host_dev() local
1896 starget = scsi_alloc_target(&shost->shost_gendev, 0, shost->this_id); scsi_get_host_dev()
1897 if (!starget) scsi_get_host_dev()
1900 sdev = scsi_alloc_sdev(starget, 0, NULL); scsi_get_host_dev()
1904 scsi_target_reap(starget); scsi_get_host_dev()
1905 put_device(&starget->dev); scsi_get_host_dev()
H A Dscsi_sysfs.c999 static int scsi_target_add(struct scsi_target *starget) scsi_target_add() argument
1003 if (starget->state != STARGET_CREATED) scsi_target_add()
1006 error = device_add(&starget->dev); scsi_target_add()
1008 dev_err(&starget->dev, "target device_add failed, error %d\n", error); scsi_target_add()
1011 transport_add_device(&starget->dev); scsi_target_add()
1012 starget->state = STARGET_RUNNING; scsi_target_add()
1014 pm_runtime_set_active(&starget->dev); scsi_target_add()
1015 pm_runtime_enable(&starget->dev); scsi_target_add()
1016 device_enable_async_suspend(&starget->dev); scsi_target_add()
1032 struct scsi_target *starget = sdev->sdev_target; scsi_sysfs_add_sdev() local
1038 error = scsi_target_add(starget); scsi_sysfs_add_sdev()
1042 transport_configure_device(&starget->dev); scsi_sysfs_add_sdev()
1045 scsi_autopm_get_target(starget); scsi_sysfs_add_sdev()
1049 scsi_autopm_put_target(starget); scsi_sysfs_add_sdev()
1162 static void __scsi_remove_target(struct scsi_target *starget) __scsi_remove_target() argument
1164 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); __scsi_remove_target()
1171 if (sdev->channel != starget->channel || __scsi_remove_target()
1172 sdev->id != starget->id || __scsi_remove_target()
1186 * @dev: generic starget or parent of generic stargets to be removed
1195 struct scsi_target *starget; scsi_remove_target() local
1200 list_for_each_entry(starget, &shost->__targets, siblings) { scsi_remove_target()
1201 if (starget->state == STARGET_DEL || scsi_remove_target()
1202 starget->state == STARGET_REMOVE) scsi_remove_target()
1204 if (starget->dev.parent == dev || &starget->dev == dev) { scsi_remove_target()
1205 kref_get(&starget->reap_ref); scsi_remove_target()
1206 starget->state = STARGET_REMOVE; scsi_remove_target()
1208 __scsi_remove_target(starget); scsi_remove_target()
1209 scsi_target_reap(starget); scsi_remove_target()
1266 struct scsi_target *starget = sdev->sdev_target; scsi_sysfs_device_initialize() local
1286 sdev->scsi_level = starget->scsi_level; scsi_sysfs_device_initialize()
1294 list_add_tail(&sdev->same_target_siblings, &starget->devices); scsi_sysfs_device_initialize()
1302 kref_get(&starget->reap_ref); scsi_sysfs_device_initialize()
H A Dscsi.c563 struct scsi_target *starget = scsi_target(sdev); scsi_finish_command() local
576 if (atomic_read(&starget->target_blocked)) scsi_finish_command()
577 atomic_set(&starget->target_blocked, 0); scsi_finish_command()
971 * @starget: target whose devices we want to iterate over.
975 * This traverses over each device of @starget. The devices have
979 void starget_for_each_device(struct scsi_target *starget, void *data, starget_for_each_device() argument
982 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); starget_for_each_device()
986 if ((sdev->channel == starget->channel) && shost_for_each_device()
987 (sdev->id == starget->id)) shost_for_each_device()
995 * @starget: target whose devices we want to iterate over.
999 * This traverses over each device of @starget. It does _not_
1007 void __starget_for_each_device(struct scsi_target *starget, void *data, __starget_for_each_device() argument
1010 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); __starget_for_each_device()
1014 if ((sdev->channel == starget->channel) && __shost_for_each_device()
1015 (sdev->id == starget->id)) __shost_for_each_device()
1023 * @starget: SCSI target pointer
1027 * @starget. The returned scsi_device does not have an additional
1036 struct scsi_device *__scsi_device_lookup_by_target(struct scsi_target *starget, __scsi_device_lookup_by_target() argument
1041 list_for_each_entry(sdev, &starget->devices, same_target_siblings) { __scsi_device_lookup_by_target()
1054 * @starget: SCSI target pointer
1058 * @starget. The returned scsi_device has an additional reference that
1061 struct scsi_device *scsi_device_lookup_by_target(struct scsi_target *starget, scsi_device_lookup_by_target() argument
1065 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); scsi_device_lookup_by_target()
1069 sdev = __scsi_device_lookup_by_target(starget, lun); scsi_device_lookup_by_target()
H A Dscsi_pm.c306 void scsi_autopm_get_target(struct scsi_target *starget) scsi_autopm_get_target() argument
308 pm_runtime_get_sync(&starget->dev); scsi_autopm_get_target()
311 void scsi_autopm_put_target(struct scsi_target *starget) scsi_autopm_put_target() argument
313 pm_runtime_put_sync(&starget->dev); scsi_autopm_put_target()
H A Dscsi_lib.c89 struct scsi_target *starget = scsi_target(device); scsi_set_blocked() local
114 atomic_set(&starget->target_blocked, scsi_set_blocked()
115 starget->max_target_blocked); scsi_set_blocked()
312 struct scsi_target *starget = scsi_target(sdev); scsi_device_unbusy() local
316 if (starget->can_queue > 0) scsi_device_unbusy()
317 atomic_dec(&starget->target_busy); scsi_device_unbusy()
348 struct scsi_target *starget = scsi_target(current_sdev); scsi_single_lun_run() local
352 starget->starget_sdev_user = NULL; scsi_single_lun_run()
364 if (starget->starget_sdev_user) scsi_single_lun_run()
366 list_for_each_entry_safe(sdev, tmp, &starget->devices, scsi_single_lun_run()
392 static inline bool scsi_target_is_busy(struct scsi_target *starget) scsi_target_is_busy() argument
394 if (starget->can_queue > 0) { scsi_target_is_busy()
395 if (atomic_read(&starget->target_busy) >= starget->can_queue) scsi_target_is_busy()
397 if (atomic_read(&starget->target_blocked) > 0) scsi_target_is_busy()
1443 * @sdev: scsi device on starget to check.
1448 struct scsi_target *starget = scsi_target(sdev); scsi_target_queue_ready() local
1451 if (starget->single_lun) { scsi_target_queue_ready()
1453 if (starget->starget_sdev_user && scsi_target_queue_ready()
1454 starget->starget_sdev_user != sdev) { scsi_target_queue_ready()
1458 starget->starget_sdev_user = sdev; scsi_target_queue_ready()
1462 if (starget->can_queue <= 0) scsi_target_queue_ready()
1465 busy = atomic_inc_return(&starget->target_busy) - 1; scsi_target_queue_ready()
1466 if (atomic_read(&starget->target_blocked) > 0) { scsi_target_queue_ready()
1473 if (atomic_dec_return(&starget->target_blocked) > 0) scsi_target_queue_ready()
1476 SCSI_LOG_MLQUEUE(3, starget_printk(KERN_INFO, starget, scsi_target_queue_ready()
1480 if (busy >= starget->can_queue) scsi_target_queue_ready()
1490 if (starget->can_queue > 0) scsi_target_queue_ready()
1491 atomic_dec(&starget->target_busy); scsi_target_queue_ready()
1554 * shost/starget/sdev, since the returned value is not guaranteed and
1573 * Ignore host/starget busy state. scsi_lld_busy()
1575 * multiple queues, congestion of host/starget needs to be handled scsi_lld_busy()
1591 struct scsi_target *starget; scsi_kill_request() local
1599 starget = scsi_target(sdev); scsi_kill_request()
1612 if (starget->can_queue > 0) scsi_kill_request()
1613 atomic_inc(&starget->target_busy); scsi_kill_request()
2916 scsi_target_quiesce(struct scsi_target *starget) scsi_target_quiesce() argument
2918 starget_for_each_device(starget, NULL, device_quiesce_fn); scsi_target_quiesce()
2929 scsi_target_resume(struct scsi_target *starget) scsi_target_resume() argument
2931 starget_for_each_device(starget, NULL, device_resume_fn); scsi_target_resume()
H A Desp_scsi.c551 struct scsi_target *target = tp->starget; esp_need_to_nego_wide()
558 struct scsi_target *target = tp->starget; esp_need_to_nego_sync()
775 if (spi_width(tp->starget) == tp->nego_goal_width && esp_maybe_execute_command()
776 spi_period(tp->starget) == tp->nego_goal_period && esp_maybe_execute_command()
777 spi_offset(tp->starget) == tp->nego_goal_offset) { esp_maybe_execute_command()
1195 dev = __scsi_device_lookup_by_target(tp->starget, lun); esp_reconnect()
1428 spi_period(tp->starget) = scsi_period; esp_setsync()
1429 spi_offset(tp->starget) = scsi_offset; esp_setsync()
1430 spi_width(tp->starget) = (tp->flags & ESP_TGT_WIDE) ? 1 : 0; esp_setsync()
1460 spi_display_xfer_agreement(tp->starget); esp_setsync()
1583 spi_period(tp->starget) = 0; esp_msgin_wdtr()
1584 spi_offset(tp->starget) = 0; esp_msgin_wdtr()
2102 if (tp->starget) esp_reset_cleanup()
2103 __starget_for_each_device(tp->starget, NULL, esp_reset_cleanup()
2441 static int esp_target_alloc(struct scsi_target *starget) esp_target_alloc() argument
2443 struct esp *esp = shost_priv(dev_to_shost(&starget->dev)); esp_target_alloc()
2444 struct esp_target_data *tp = &esp->target[starget->id]; esp_target_alloc()
2446 tp->starget = starget; esp_target_alloc()
2451 static void esp_target_destroy(struct scsi_target *starget) esp_target_destroy() argument
2453 struct esp *esp = shost_priv(dev_to_shost(&starget->dev)); esp_target_destroy()
2454 struct esp_target_data *tp = &esp->target[starget->id]; esp_target_destroy()
2456 tp->starget = NULL; esp_target_destroy()
2470 spi_min_period(tp->starget) = esp->min_period; esp_slave_alloc()
2471 spi_max_offset(tp->starget) = 15; esp_slave_alloc()
2474 spi_max_width(tp->starget) = 1; esp_slave_alloc()
2476 spi_max_width(tp->starget) = 0; esp_slave_alloc()
H A Dscsi_transport_fc.c74 * sdev/starget/host objects.
332 * The attribute containers for the starget and host are are
357 struct scsi_target *starget = to_scsi_target(dev); fc_target_setup() local
358 struct fc_rport *rport = starget_to_rport(starget); fc_target_setup()
366 fc_starget_node_name(starget) = rport->node_name; fc_target_setup()
367 fc_starget_port_name(starget) = rport->port_name; fc_target_setup()
368 fc_starget_port_id(starget) = rport->port_id; fc_target_setup()
370 fc_starget_node_name(starget) = -1; fc_target_setup()
371 fc_starget_port_name(starget) = -1; fc_target_setup()
372 fc_starget_port_id(starget) = -1; fc_target_setup()
1019 struct scsi_target *starget = transport_class_to_starget(dev); \
1020 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); \
1022 struct fc_rport *rport = starget_to_rport(starget); \
1024 fc_starget_##field(starget) = rport->field; \
1026 i->f->get_starget_##field(starget); \
1028 cast fc_starget_##field(starget)); \
1033 static FC_DEVICE_ATTR(starget, field, S_IRUGO, \
1038 static FC_DEVICE_ATTR(starget, field, S_IRUGO, \
3138 " a FCP target, removing starget\n"); fc_timeout_deleted_rport()
3151 (rport->scsi_target_id != -1) ? " and starget" : ""); fc_timeout_deleted_rport()
3162 (rport->scsi_target_id != -1) ? " and starget" : ""); fc_timeout_deleted_rport()
3191 * item to teardown the starget. (FCOE libFC folks prefer this fc_timeout_deleted_rport()
H A Dncr53c8xx.c1246 struct scsi_target *starget; member in struct:tcb
4065 struct scsi_target *starget = tp->starget; ncr_prepare_nego() local
4069 if (spi_support_wide(starget)) { ncr_prepare_nego()
4077 if (spi_support_sync(starget)) { ncr_prepare_nego()
4081 dev_info(&starget->dev, "target did not report SYNC.\n"); ncr_prepare_nego()
5568 spi_display_xfer_agreement(tp->starget); ncr_setsync()
6701 struct scsi_target *starget = tp->starget; ncr_int_sir() local
6859 spi_period(starget) = 0; ncr_int_sir()
6860 spi_offset(starget) = 0; ncr_int_sir()
6865 spi_width(starget) = 0; ncr_int_sir()
6890 if (ofs && starget) ncr_int_sir()
6891 spi_support_sync(starget) = 1; ncr_int_sir()
6936 spi_period(starget) = 0; ncr_int_sir()
6937 spi_offset(starget) = 0; ncr_int_sir()
6942 spi_period(starget) = per; ncr_int_sir()
6943 spi_offset(starget) = ofs; ncr_int_sir()
6950 spi_width(starget) = 0; ncr_int_sir()
6961 spi_period(starget) = per; ncr_int_sir()
6962 spi_offset(starget) = ofs; ncr_int_sir()
7000 if (wide && starget) ncr_int_sir()
7001 spi_support_wide(starget) = 1; ncr_int_sir()
7025 spi_width(starget) = 0; ncr_int_sir()
7030 spi_width(starget) = wide; ncr_int_sir()
7037 spi_period(starget) = 0; ncr_int_sir()
7038 spi_offset(starget) = 0; ncr_int_sir()
7049 spi_width(starget) = wide; ncr_int_sir()
7968 tp->starget = device->sdev_target; ncr53c8xx_slave_alloc()
8538 static void ncr53c8xx_set_period(struct scsi_target *starget, int period) ncr53c8xx_set_period() argument
8540 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ncr53c8xx_set_period()
8542 struct tcb *tp = &np->target[starget->id]; ncr53c8xx_set_period()
8554 static void ncr53c8xx_set_offset(struct scsi_target *starget, int offset) ncr53c8xx_set_offset() argument
8556 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ncr53c8xx_set_offset()
8558 struct tcb *tp = &np->target[starget->id]; ncr53c8xx_set_offset()
8570 static void ncr53c8xx_set_width(struct scsi_target *starget, int width) ncr53c8xx_set_width() argument
8572 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ncr53c8xx_set_width()
8574 struct tcb *tp = &np->target[starget->id]; ncr53c8xx_set_width()
H A Dvirtio_scsi.c735 static int virtscsi_target_alloc(struct scsi_target *starget) virtscsi_target_alloc() argument
737 struct Scsi_Host *sh = dev_to_shost(starget->dev.parent); virtscsi_target_alloc()
749 starget->hostdata = tgt; virtscsi_target_alloc()
753 static void virtscsi_target_destroy(struct scsi_target *starget) virtscsi_target_destroy() argument
755 struct virtio_scsi_target_state *tgt = starget->hostdata; virtscsi_target_destroy()
H A Dipr.c4631 * @starget: scsi target struct
4636 static struct ipr_resource_entry *ipr_find_starget(struct scsi_target *starget) ipr_find_starget() argument
4638 struct Scsi_Host *shost = dev_to_shost(&starget->dev); ipr_find_starget()
4643 if ((res->bus == starget->channel) && ipr_find_starget()
4644 (res->target == starget->id)) { ipr_find_starget()
4656 * @starget: scsi target struct
4664 static int ipr_target_alloc(struct scsi_target *starget) ipr_target_alloc() argument
4666 struct Scsi_Host *shost = dev_to_shost(&starget->dev); ipr_target_alloc()
4674 res = ipr_find_starget(starget); ipr_target_alloc()
4675 starget->hostdata = NULL; ipr_target_alloc()
4692 starget->hostdata = sata_port; ipr_target_alloc()
4705 * @starget: scsi target struct
4711 static void ipr_target_destroy(struct scsi_target *starget) ipr_target_destroy() argument
4713 struct ipr_sata_port *sata_port = starget->hostdata; ipr_target_destroy()
4714 struct Scsi_Host *shost = dev_to_shost(&starget->dev); ipr_target_destroy()
4718 if (!ipr_find_starget(starget)) { ipr_target_destroy()
4719 if (starget->channel == IPR_ARRAY_VIRTUAL_BUS) ipr_target_destroy()
4720 clear_bit(starget->id, ioa_cfg->array_ids); ipr_target_destroy()
4721 else if (starget->channel == IPR_VSET_VIRTUAL_BUS) ipr_target_destroy()
4722 clear_bit(starget->id, ioa_cfg->vset_ids); ipr_target_destroy()
4723 else if (starget->channel == 0) ipr_target_destroy()
4724 clear_bit(starget->id, ioa_cfg->target_ids); ipr_target_destroy()
4729 starget->hostdata = NULL; ipr_target_destroy()
H A Desp_scsi.h317 * protocol values are maintained in spi_{offset,period,wide}(starget).
339 struct scsi_target *starget; member in struct:esp_target_data
H A D53c700.c794 struct scsi_target *starget = SCp->device->sdev_target; process_extended_message() local
803 spi_offset(starget) = offset; process_extended_message()
804 spi_period(starget) = period; process_extended_message()
807 spi_display_xfer_agreement(starget); process_extended_message()
H A Dlibiscsi.c1774 int iscsi_target_alloc(struct scsi_target *starget) iscsi_target_alloc() argument
1776 struct iscsi_cls_session *cls_session = starget_to_session(starget); iscsi_target_alloc()
1779 starget->can_queue = session->scsi_cmds_max; iscsi_target_alloc()
H A Dhpsa.c1938 struct scsi_target *starget; hpsa_slave_alloc() local
1941 starget = scsi_target(sdev); hpsa_slave_alloc()
1942 rphy = target_to_rphy(starget); hpsa_slave_alloc()
/linux-4.4.14/drivers/scsi/aic7xxx/
H A Daic79xx_osm.c594 ahd_linux_target_in_softc(struct scsi_target *starget) ahd_linux_target_in_softc() argument
597 *((struct ahd_softc **)dev_to_shost(&starget->dev)->hostdata); ahd_linux_target_in_softc()
600 target_offset = starget->id; ahd_linux_target_in_softc()
601 if (starget->channel != 0) ahd_linux_target_in_softc()
604 return &ahd->platform_data->starget[target_offset]; ahd_linux_target_in_softc()
608 ahd_linux_target_alloc(struct scsi_target *starget) ahd_linux_target_alloc() argument
611 *((struct ahd_softc **)dev_to_shost(&starget->dev)->hostdata); ahd_linux_target_alloc()
614 struct scsi_target **ahd_targp = ahd_linux_target_in_softc(starget); ahd_linux_target_alloc()
618 char channel = starget->channel + 'A'; ahd_linux_target_alloc()
624 *ahd_targp = starget; ahd_linux_target_alloc()
627 int flags = sc->device_flags[starget->id]; ahd_linux_target_alloc()
630 starget->id, &tstate); ahd_linux_target_alloc()
634 spi_max_iu(starget) = 0; ahd_linux_target_alloc()
637 spi_rti(starget) = 0; ahd_linux_target_alloc()
641 spi_max_qas(starget) = 0; ahd_linux_target_alloc()
644 spi_max_width(starget) = (flags & CFWIDEB) ? 1 : 0; ahd_linux_target_alloc()
645 spi_min_period(starget) = tinfo->user.period; ahd_linux_target_alloc()
646 spi_max_offset(starget) = tinfo->user.offset; ahd_linux_target_alloc()
650 starget->id, &tstate); ahd_linux_target_alloc()
651 ahd_compile_devinfo(&devinfo, ahd->our_id, starget->id, ahd_linux_target_alloc()
664 ahd_linux_target_destroy(struct scsi_target *starget) ahd_linux_target_destroy() argument
666 struct scsi_target **ahd_targp = ahd_linux_target_in_softc(starget); ahd_linux_target_destroy()
1340 struct scsi_target *starget; ahd_platform_free() local
1346 starget = ahd->platform_data->starget[i]; ahd_platform_free()
1347 if (starget != NULL) { ahd_platform_free()
1348 ahd->platform_data->starget[i] = NULL; ahd_platform_free()
1693 struct scsi_target *starget; ahd_send_async() local
1718 starget = ahd->platform_data->starget[target]; ahd_send_async()
1719 if (starget == NULL) ahd_send_async()
1723 (spi_dt(starget) ? MSG_EXT_PPR_DT_REQ : 0) ahd_send_async()
1724 + (spi_qas(starget) ? MSG_EXT_PPR_QAS_REQ : 0) ahd_send_async()
1725 + (spi_iu(starget) ? MSG_EXT_PPR_IU_REQ : 0) ahd_send_async()
1726 + (spi_rd_strm(starget) ? MSG_EXT_PPR_RD_STRM : 0) ahd_send_async()
1727 + (spi_pcomp_en(starget) ? MSG_EXT_PPR_PCOMP_EN : 0) ahd_send_async()
1728 + (spi_rti(starget) ? MSG_EXT_PPR_RTI : 0) ahd_send_async()
1729 + (spi_wr_flow(starget) ? MSG_EXT_PPR_WR_FLOW : 0) ahd_send_async()
1730 + (spi_hold_mcs(starget) ? MSG_EXT_PPR_HOLD_MCS : 0); ahd_send_async()
1732 if (tinfo->curr.period == spi_period(starget) ahd_send_async()
1733 && tinfo->curr.width == spi_width(starget) ahd_send_async()
1734 && tinfo->curr.offset == spi_offset(starget) ahd_send_async()
1739 spi_period(starget) = tinfo->curr.period; ahd_send_async()
1740 spi_width(starget) = tinfo->curr.width; ahd_send_async()
1741 spi_offset(starget) = tinfo->curr.offset; ahd_send_async()
1742 spi_dt(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_DT_REQ ? 1 : 0; ahd_send_async()
1743 spi_qas(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_QAS_REQ ? 1 : 0; ahd_send_async()
1744 spi_iu(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_IU_REQ ? 1 : 0; ahd_send_async()
1745 spi_rd_strm(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_RD_STRM ? 1 : 0; ahd_send_async()
1746 spi_pcomp_en(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_PCOMP_EN ? 1 : 0; ahd_send_async()
1747 spi_rti(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_RTI ? 1 : 0; ahd_send_async()
1748 spi_wr_flow(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_WR_FLOW ? 1 : 0; ahd_send_async()
1749 spi_hold_mcs(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_HOLD_MCS ? 1 : 0; ahd_send_async()
1750 spi_display_xfer_agreement(starget); ahd_send_async()
2387 static void ahd_linux_set_width(struct scsi_target *starget, int width) ahd_linux_set_width() argument
2389 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ahd_linux_set_width()
2394 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, ahd_linux_set_width()
2395 starget->channel + 'A', ROLE_INITIATOR); ahd_linux_set_width()
2401 static void ahd_linux_set_period(struct scsi_target *starget, int period) ahd_linux_set_period() argument
2403 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ahd_linux_set_period()
2408 starget->channel + 'A', ahd_linux_set_period()
2409 shost->this_id, starget->id, &tstate); ahd_linux_set_period()
2426 if (spi_max_width(starget)) { ahd_linux_set_period()
2436 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, ahd_linux_set_period()
2437 starget->channel + 'A', ROLE_INITIATOR); ahd_linux_set_period()
2441 if (spi_width(starget) == 0) ahd_linux_set_period()
2454 static void ahd_linux_set_offset(struct scsi_target *starget, int offset) ahd_linux_set_offset() argument
2456 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ahd_linux_set_offset()
2461 starget->channel + 'A', ahd_linux_set_offset()
2462 shost->this_id, starget->id, &tstate); ahd_linux_set_offset()
2474 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, ahd_linux_set_offset()
2475 starget->channel + 'A', ROLE_INITIATOR); ahd_linux_set_offset()
2489 static void ahd_linux_set_dt(struct scsi_target *starget, int dt) ahd_linux_set_dt() argument
2491 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ahd_linux_set_dt()
2496 starget->channel + 'A', ahd_linux_set_dt()
2497 shost->this_id, starget->id, &tstate); ahd_linux_set_dt()
2510 if (dt && spi_max_width(starget)) { ahd_linux_set_dt()
2513 ahd_linux_set_width(starget, 1); ahd_linux_set_dt()
2520 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, ahd_linux_set_dt()
2521 starget->channel + 'A', ROLE_INITIATOR); ahd_linux_set_dt()
2531 static void ahd_linux_set_qas(struct scsi_target *starget, int qas) ahd_linux_set_qas() argument
2533 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ahd_linux_set_qas()
2538 starget->channel + 'A', ahd_linux_set_qas()
2539 shost->this_id, starget->id, &tstate); ahd_linux_set_qas()
2559 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, ahd_linux_set_qas()
2560 starget->channel + 'A', ROLE_INITIATOR); ahd_linux_set_qas()
2570 static void ahd_linux_set_iu(struct scsi_target *starget, int iu) ahd_linux_set_iu() argument
2572 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ahd_linux_set_iu()
2577 starget->channel + 'A', ahd_linux_set_iu()
2578 shost->this_id, starget->id, &tstate); ahd_linux_set_iu()
2592 if (iu && spi_max_width(starget)) { ahd_linux_set_iu()
2599 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, ahd_linux_set_iu()
2600 starget->channel + 'A', ROLE_INITIATOR); ahd_linux_set_iu()
2610 static void ahd_linux_set_rd_strm(struct scsi_target *starget, int rdstrm) ahd_linux_set_rd_strm() argument
2612 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ahd_linux_set_rd_strm()
2617 starget->channel + 'A', ahd_linux_set_rd_strm()
2618 shost->this_id, starget->id, &tstate); ahd_linux_set_rd_strm()
2632 if (rdstrm && spi_max_width(starget)) ahd_linux_set_rd_strm()
2635 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, ahd_linux_set_rd_strm()
2636 starget->channel + 'A', ROLE_INITIATOR); ahd_linux_set_rd_strm()
2646 static void ahd_linux_set_wr_flow(struct scsi_target *starget, int wrflow) ahd_linux_set_wr_flow() argument
2648 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ahd_linux_set_wr_flow()
2653 starget->channel + 'A', ahd_linux_set_wr_flow()
2654 shost->this_id, starget->id, &tstate); ahd_linux_set_wr_flow()
2668 if (wrflow && spi_max_width(starget)) ahd_linux_set_wr_flow()
2671 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, ahd_linux_set_wr_flow()
2672 starget->channel + 'A', ROLE_INITIATOR); ahd_linux_set_wr_flow()
2682 static void ahd_linux_set_rti(struct scsi_target *starget, int rti) ahd_linux_set_rti() argument
2684 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ahd_linux_set_rti()
2689 starget->channel + 'A', ahd_linux_set_rti()
2690 shost->this_id, starget->id, &tstate); ahd_linux_set_rti()
2712 if (rti && spi_max_width(starget)) ahd_linux_set_rti()
2715 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, ahd_linux_set_rti()
2716 starget->channel + 'A', ROLE_INITIATOR); ahd_linux_set_rti()
2726 static void ahd_linux_set_pcomp_en(struct scsi_target *starget, int pcomp) ahd_linux_set_pcomp_en() argument
2728 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ahd_linux_set_pcomp_en()
2733 starget->channel + 'A', ahd_linux_set_pcomp_en()
2734 shost->this_id, starget->id, &tstate); ahd_linux_set_pcomp_en()
2748 if (pcomp && spi_max_width(starget)) { ahd_linux_set_pcomp_en()
2765 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, ahd_linux_set_pcomp_en()
2766 starget->channel + 'A', ROLE_INITIATOR); ahd_linux_set_pcomp_en()
2776 static void ahd_linux_set_hold_mcs(struct scsi_target *starget, int hold) ahd_linux_set_hold_mcs() argument
2778 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ahd_linux_set_hold_mcs()
2783 starget->channel + 'A', ahd_linux_set_hold_mcs()
2784 shost->this_id, starget->id, &tstate); ahd_linux_set_hold_mcs()
2792 if (hold && spi_max_width(starget)) ahd_linux_set_hold_mcs()
2795 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, ahd_linux_set_hold_mcs()
2796 starget->channel + 'A', ROLE_INITIATOR); ahd_linux_set_hold_mcs()
H A Daic7xxx_osm.c544 ahc_linux_target_in_softc(struct scsi_target *starget) ahc_linux_target_in_softc() argument
547 *((struct ahc_softc **)dev_to_shost(&starget->dev)->hostdata); ahc_linux_target_in_softc()
550 target_offset = starget->id; ahc_linux_target_in_softc()
551 if (starget->channel != 0) ahc_linux_target_in_softc()
554 return &ahc->platform_data->starget[target_offset]; ahc_linux_target_in_softc()
558 ahc_linux_target_alloc(struct scsi_target *starget) ahc_linux_target_alloc() argument
561 *((struct ahc_softc **)dev_to_shost(&starget->dev)->hostdata); ahc_linux_target_alloc()
564 struct scsi_target **ahc_targp = ahc_linux_target_in_softc(starget); ahc_linux_target_alloc()
569 char channel = starget->channel + 'A'; ahc_linux_target_alloc()
573 target_offset = starget->id; ahc_linux_target_alloc()
574 if (starget->channel != 0) ahc_linux_target_alloc()
577 if (starget->channel) ahc_linux_target_alloc()
584 *ahc_targp = starget; ahc_linux_target_alloc()
610 spi_max_width(starget) = (flags & CFWIDEB) ? 1 : 0; ahc_linux_target_alloc()
612 spi_max_offset(starget) = 0; ahc_linux_target_alloc()
613 spi_min_period(starget) = ahc_linux_target_alloc()
617 starget->id, &tstate); ahc_linux_target_alloc()
619 ahc_compile_devinfo(&devinfo, our_id, starget->id, ahc_linux_target_alloc()
632 ahc_linux_target_destroy(struct scsi_target *starget) ahc_linux_target_destroy() argument
634 struct scsi_target **ahc_targp = ahc_linux_target_in_softc(starget); ahc_linux_target_destroy()
644 struct scsi_target *starget = sdev->sdev_target; ahc_linux_slave_alloc() local
666 spi_period(starget) = 0; ahc_linux_slave_alloc()
1232 struct scsi_target *starget; ahc_platform_free() local
1238 starget = ahc->platform_data->starget[i]; ahc_platform_free()
1239 if (starget != NULL) { ahc_platform_free()
1240 ahc->platform_data->starget[i] = NULL; ahc_platform_free()
1613 struct scsi_target *starget; ahc_send_async() local
1645 starget = ahc->platform_data->starget[target_offset]; ahc_send_async()
1646 if (starget == NULL) ahc_send_async()
1648 targ = scsi_transport_target_data(starget); ahc_send_async()
1651 (spi_dt(starget) ? MSG_EXT_PPR_DT_REQ : 0) ahc_send_async()
1652 + (spi_qas(starget) ? MSG_EXT_PPR_QAS_REQ : 0) ahc_send_async()
1653 + (spi_iu(starget) ? MSG_EXT_PPR_IU_REQ : 0); ahc_send_async()
1655 if (tinfo->curr.period == spi_period(starget) ahc_send_async()
1656 && tinfo->curr.width == spi_width(starget) ahc_send_async()
1657 && tinfo->curr.offset == spi_offset(starget) ahc_send_async()
1662 spi_period(starget) = tinfo->curr.period; ahc_send_async()
1663 spi_width(starget) = tinfo->curr.width; ahc_send_async()
1664 spi_offset(starget) = tinfo->curr.offset; ahc_send_async()
1665 spi_dt(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_DT_REQ ? 1 : 0; ahc_send_async()
1666 spi_qas(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_QAS_REQ ? 1 : 0; ahc_send_async()
1667 spi_iu(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_IU_REQ ? 1 : 0; ahc_send_async()
1668 spi_display_xfer_agreement(starget); ahc_send_async()
2337 static void ahc_linux_set_width(struct scsi_target *starget, int width) ahc_linux_set_width() argument
2339 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ahc_linux_set_width()
2344 ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, ahc_linux_set_width()
2345 starget->channel + 'A', ROLE_INITIATOR); ahc_linux_set_width()
2351 static void ahc_linux_set_period(struct scsi_target *starget, int period) ahc_linux_set_period() argument
2353 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ahc_linux_set_period()
2358 starget->channel + 'A', ahc_linux_set_period()
2359 shost->this_id, starget->id, &tstate); ahc_linux_set_period()
2372 if (spi_max_width(starget)) ahc_linux_set_period()
2379 ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, ahc_linux_set_period()
2380 starget->channel + 'A', ROLE_INITIATOR); ahc_linux_set_period()
2384 if (spi_width(starget) == 0) ahc_linux_set_period()
2395 static void ahc_linux_set_offset(struct scsi_target *starget, int offset) ahc_linux_set_offset() argument
2397 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ahc_linux_set_offset()
2402 starget->channel + 'A', ahc_linux_set_offset()
2403 shost->this_id, starget->id, &tstate); ahc_linux_set_offset()
2410 ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, ahc_linux_set_offset()
2411 starget->channel + 'A', ROLE_INITIATOR); ahc_linux_set_offset()
2423 static void ahc_linux_set_dt(struct scsi_target *starget, int dt) ahc_linux_set_dt() argument
2425 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ahc_linux_set_dt()
2430 starget->channel + 'A', ahc_linux_set_dt()
2431 shost->this_id, starget->id, &tstate); ahc_linux_set_dt()
2440 if (dt && spi_max_width(starget)) { ahc_linux_set_dt()
2443 ahc_linux_set_width(starget, 1); ahc_linux_set_dt()
2447 ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, ahc_linux_set_dt()
2448 starget->channel + 'A', ROLE_INITIATOR); ahc_linux_set_dt()
2461 static void ahc_linux_set_qas(struct scsi_target *starget, int qas)
2463 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
2468 starget->channel + 'A',
2469 shost->this_id, starget->id, &tstate);
2480 ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
2481 starget->channel + 'A', ROLE_INITIATOR);
2489 static void ahc_linux_set_iu(struct scsi_target *starget, int iu)
2491 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
2496 starget->channel + 'A',
2497 shost->this_id, starget->id, &tstate);
2508 ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
2509 starget->channel + 'A', ROLE_INITIATOR);
H A Daic79xx_proc.c160 struct scsi_target *starget; ahd_dump_target_state() local
170 starget = ahd->platform_data->starget[target_id]; ahd_dump_target_state()
171 if (starget == NULL) ahd_dump_target_state()
182 dev = scsi_device_lookup_by_target(starget, lun); ahd_dump_target_state()
H A Daic7xxx_proc.c138 struct scsi_target *starget; ahc_dump_target_state() local
150 starget = ahc->platform_data->starget[target_offset]; ahc_dump_target_state()
151 if (!starget) ahc_dump_target_state()
162 sdev = scsi_device_lookup_by_target(starget, lun); ahc_dump_target_state()
H A Daic79xx_osm.h355 struct scsi_target *starget[AHD_NUM_TARGETS]; member in struct:ahd_platform_data
H A Daic7xxx_osm.h359 struct scsi_target *starget[AHC_NUM_TARGETS]; member in struct:ahc_platform_data
/linux-4.4.14/include/scsi/
H A Dscsi_transport.h107 scsi_transport_target_data(struct scsi_target *starget) scsi_transport_target_data() argument
109 struct Scsi_Host *shost = dev_to_shost(&starget->dev); scsi_transport_target_data()
110 return (u8 *)starget->starget_data scsi_transport_target_data()
H A Dlibsas.h431 starget_to_domain_dev(struct scsi_target *starget) { starget_to_domain_dev() argument
432 return starget->hostdata; starget_to_domain_dev()
H A Dscsi_device.h298 #define starget_printk(prefix, starget, fmt, a...) \
299 dev_printk(prefix, &(starget)->dev, fmt, ##a)
H A Dlibiscsi.h404 extern int iscsi_target_alloc(struct scsi_target *starget);
/linux-4.4.14/drivers/scsi/mpt3sas/
H A Dmpt3sas_scsih.c796 } else if (!sas_device->starget) { _scsih_sas_device_add()
1244 * @starget: scsi target struct
1250 scsih_target_alloc(struct scsi_target *starget) scsih_target_alloc() argument
1252 struct Scsi_Host *shost = dev_to_shost(&starget->dev); scsih_target_alloc()
1265 starget->hostdata = sas_target_priv_data; scsih_target_alloc()
1266 sas_target_priv_data->starget = starget; scsih_target_alloc()
1270 if (starget->channel == RAID_CHANNEL) { scsih_target_alloc()
1272 raid_device = _scsih_raid_device_find_by_id(ioc, starget->id, scsih_target_alloc()
1273 starget->channel); scsih_target_alloc()
1280 raid_device->starget = starget; scsih_target_alloc()
1288 rphy = dev_to_rphy(starget->dev.parent); scsih_target_alloc()
1296 sas_device->starget = starget; scsih_target_alloc()
1297 sas_device->id = starget->id; scsih_target_alloc()
1298 sas_device->channel = starget->channel; scsih_target_alloc()
1312 * @starget: scsi target struct
1317 scsih_target_destroy(struct scsi_target *starget) scsih_target_destroy() argument
1319 struct Scsi_Host *shost = dev_to_shost(&starget->dev); scsih_target_destroy()
1327 sas_target_priv_data = starget->hostdata; scsih_target_destroy()
1331 if (starget->channel == RAID_CHANNEL) { scsih_target_destroy()
1333 raid_device = _scsih_raid_device_find_by_id(ioc, starget->id, scsih_target_destroy()
1334 starget->channel); scsih_target_destroy()
1336 raid_device->starget = NULL; scsih_target_destroy()
1344 rphy = dev_to_rphy(starget->dev.parent); scsih_target_destroy()
1346 if (sas_device && (sas_device->starget == starget) && scsih_target_destroy()
1347 (sas_device->id == starget->id) && scsih_target_destroy()
1348 (sas_device->channel == starget->channel)) scsih_target_destroy()
1349 sas_device->starget = NULL; scsih_target_destroy()
1364 starget->hostdata = NULL; scsih_target_destroy()
1381 struct scsi_target *starget; scsih_slave_alloc() local
1394 starget = scsi_target(sdev); scsih_slave_alloc()
1395 sas_target_priv_data = starget->hostdata; scsih_slave_alloc()
1402 shost = dev_to_shost(&starget->dev); scsih_slave_alloc()
1404 if (starget->channel == RAID_CHANNEL) { scsih_slave_alloc()
1407 starget->id, starget->channel); scsih_slave_alloc()
1417 if (sas_device && (sas_device->starget == NULL)) { scsih_slave_alloc()
1419 "%s : sas_device->starget set to starget @ %d\n", scsih_slave_alloc()
1421 sas_device->starget = starget; scsih_slave_alloc()
1443 struct scsi_target *starget; scsih_slave_destroy() local
1452 starget = scsi_target(sdev); scsih_slave_destroy()
1453 sas_target_priv_data = starget->hostdata; scsih_slave_destroy()
1456 shost = dev_to_shost(&starget->dev); scsih_slave_destroy()
1464 sas_device->starget = NULL; scsih_slave_destroy()
2344 struct scsi_target *starget = scmd->device->sdev_target; _scsih_tm_display_info() local
2345 struct MPT3SAS_TARGET *priv_target = starget->hostdata; _scsih_tm_display_info()
2359 starget_printk(KERN_INFO, starget, _scsih_tm_display_info()
2369 starget_printk(KERN_INFO, starget, _scsih_tm_display_info()
2375 starget_printk(KERN_INFO, starget, _scsih_tm_display_info()
2381 starget_printk(KERN_INFO, starget, _scsih_tm_display_info()
2387 starget_printk(KERN_INFO, starget, _scsih_tm_display_info()
2472 struct scsi_target *starget = scmd->device->sdev_target; scsih_dev_reset() local
2473 struct MPT3SAS_TARGET *target_priv_data = starget->hostdata; scsih_dev_reset()
2534 struct scsi_target *starget = scmd->device->sdev_target; scsih_target_reset() local
2535 struct MPT3SAS_TARGET *target_priv_data = starget->hostdata; scsih_target_reset()
2537 starget_printk(KERN_INFO, starget, "attempting target reset! scmd(%p)\n", scsih_target_reset()
2543 starget_printk(KERN_INFO, starget, "target been deleted! scmd(%p)\n", scsih_target_reset()
2573 starget_printk(KERN_INFO, starget, "target reset: %s scmd(%p)\n", scsih_target_reset()
3102 if (sas_device && sas_device->starget && _scsih_tm_tr_send()
3103 sas_device->starget->hostdata) { _scsih_tm_tr_send()
3104 sas_target_priv_data = sas_device->starget->hostdata; _scsih_tm_tr_send()
3530 if (raid_device && raid_device->starget && _scsih_set_volume_delete_flag()
3531 raid_device->starget->hostdata) { _scsih_set_volume_delete_flag()
3533 raid_device->starget->hostdata; _scsih_set_volume_delete_flag()
4021 struct scsi_target *starget = scmd->device->sdev_target; _scsih_scsi_ioc_info() local
4022 struct MPT3SAS_TARGET *priv_target = starget->hostdata; _scsih_scsi_ioc_info()
4326 struct scsi_target *starget; _scsih_smart_predicted_fault() local
4340 starget = sas_device->starget; _scsih_smart_predicted_fault()
4341 sas_target_priv_data = starget->hostdata; _scsih_smart_predicted_fault()
4348 starget_printk(KERN_INFO, starget, "predicted fault, " _scsih_smart_predicted_fault()
4353 starget_printk(KERN_WARNING, starget, "predicted fault, " _scsih_smart_predicted_fault()
5139 struct scsi_target *starget; _scsih_check_device() local
5172 starget = sas_device->starget; _scsih_check_device()
5173 sas_target_priv_data = starget->hostdata; _scsih_check_device()
5174 starget_printk(KERN_INFO, starget, _scsih_check_device()
5372 if (sas_device->starget && sas_device->starget->hostdata) { _scsih_remove_device()
5373 sas_target_priv_data = sas_device->starget->hostdata; _scsih_remove_device()
5736 if (!sas_device || !sas_device->starget) _scsih_sas_device_status_change_event()
5739 target_priv_data = sas_device->starget->hostdata; _scsih_sas_device_status_change_event()
6193 struct scsi_target *starget = NULL; _scsih_sas_volume_delete() local
6198 if (raid_device->starget) { _scsih_sas_volume_delete()
6199 starget = raid_device->starget; _scsih_sas_volume_delete()
6200 sas_target_priv_data = starget->hostdata; _scsih_sas_volume_delete()
6210 if (starget) _scsih_sas_volume_delete()
6211 scsi_remove_target(&starget->dev); _scsih_sas_volume_delete()
6227 struct scsi_target *starget = NULL; _scsih_sas_pd_expose() local
6238 if (sas_device->starget && sas_device->starget->hostdata) { _scsih_sas_pd_expose()
6239 starget = sas_device->starget; _scsih_sas_pd_expose()
6240 sas_target_priv_data = starget->hostdata; _scsih_sas_pd_expose()
6250 if (starget) _scsih_sas_pd_expose()
6251 starget_for_each_device(starget, NULL, _scsih_reprobe_lun); _scsih_sas_pd_expose()
6269 struct scsi_target *starget = NULL; _scsih_sas_pd_hide() local
6285 if (sas_device->starget && sas_device->starget->hostdata) { _scsih_sas_pd_hide()
6286 starget = sas_device->starget; _scsih_sas_pd_hide()
6287 sas_target_priv_data = starget->hostdata; _scsih_sas_pd_hide()
6301 if (starget) _scsih_sas_pd_hide()
6302 starget_for_each_device(starget, (void *)1, _scsih_reprobe_lun); _scsih_sas_pd_hide()
6813 struct scsi_target *starget; _scsih_mark_responding_sas_device() local
6822 starget = sas_device->starget; _scsih_mark_responding_sas_device()
6823 if (starget && starget->hostdata) { _scsih_mark_responding_sas_device()
6824 sas_target_priv_data = starget->hostdata; _scsih_mark_responding_sas_device()
6829 if (starget) { _scsih_mark_responding_sas_device()
6830 starget_printk(KERN_INFO, starget, _scsih_mark_responding_sas_device()
6837 starget_printk(KERN_INFO, starget, _scsih_mark_responding_sas_device()
6933 struct scsi_target *starget; _scsih_mark_responding_raid_device() local
6939 if (raid_device->wwid == wwid && raid_device->starget) { _scsih_mark_responding_raid_device()
6940 starget = raid_device->starget; _scsih_mark_responding_raid_device()
6941 if (starget && starget->hostdata) { _scsih_mark_responding_raid_device()
6942 sas_target_priv_data = starget->hostdata; _scsih_mark_responding_raid_device()
6948 starget_printk(KERN_INFO, raid_device->starget, _scsih_mark_responding_raid_device()
7950 if (raid_device->starget) { scsih_remove()
7952 raid_device->starget->hostdata; scsih_remove()
7954 scsi_remove_target(&raid_device->starget->dev); scsih_remove()
8083 } else if (!sas_device->starget) { _scsih_probe_boot_devices()
8108 if (raid_device->starget) _scsih_probe_raid()
8179 } else if (!sas_device->starget) { _scsih_probe_sas()
H A Dmpt3sas_base.h347 * struct MPT3SAS_TARGET - starget private hostdata
348 * @starget: starget object
359 struct scsi_target *starget; member in struct:MPT3SAS_TARGET
384 * @sas_target: starget private hostdata
432 * @starget: starget object
454 struct scsi_target *starget; member in struct:_sas_device
495 * @starget: starget object
518 struct scsi_target *starget; member in struct:_raid_device
/linux-4.4.14/drivers/scsi/sym53c8xx_2/
H A Dsym_glue.c731 dev_info(&tp->starget->dev, sym_tune_dev_queuing()
782 tp->starget = sdev->sdev_target; sym53c8xx_slave_alloc()
784 spi_min_period(tp->starget) = tp->usr_period; sym53c8xx_slave_alloc()
785 spi_max_width(tp->starget) = tp->usr_width; sym53c8xx_slave_alloc()
851 starget_printk(KERN_WARNING, tp->starget, sym53c8xx_slave_destroy()
864 tp->starget = NULL; sym53c8xx_slave_destroy()
1903 static void sym2_set_offset(struct scsi_target *starget, int offset) sym2_set_offset() argument
1905 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); sym2_set_offset()
1907 struct sym_tcb *tp = &np->target[starget->id]; sym2_set_offset()
1913 static void sym2_set_period(struct scsi_target *starget, int period) sym2_set_period() argument
1915 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); sym2_set_period()
1917 struct sym_tcb *tp = &np->target[starget->id]; sym2_set_period()
1921 if (period <= np->minsync && spi_width(starget)) sym2_set_period()
1928 static void sym2_set_width(struct scsi_target *starget, int width) sym2_set_width() argument
1930 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); sym2_set_width()
1932 struct sym_tcb *tp = &np->target[starget->id]; sym2_set_width()
1943 static void sym2_set_dt(struct scsi_target *starget, int dt) sym2_set_dt() argument
1945 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); sym2_set_dt()
1947 struct sym_tcb *tp = &np->target[starget->id]; sym2_set_dt()
1958 static void sym2_set_iu(struct scsi_target *starget, int iu)
1960 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
1962 struct sym_tcb *tp = &np->target[starget->id];
1971 static void sym2_set_qas(struct scsi_target *starget, int qas)
1973 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
1975 struct sym_tcb *tp = &np->target[starget->id];
H A Dsym_hipd.c84 dev_info(&tp->starget->dev, "%s: ", label); sym_print_nego_msg()
1364 static void sym_check_goals(struct sym_hcb *np, struct scsi_target *starget, sym_check_goals() argument
1367 if (!spi_support_wide(starget)) sym_check_goals()
1370 if (!spi_support_sync(starget)) { sym_check_goals()
1378 if (spi_support_dt(starget)) { sym_check_goals()
1379 if (spi_support_dt_only(starget)) sym_check_goals()
1422 struct scsi_target *starget = tp->starget; sym_prepare_nego() local
1427 sym_check_goals(np, starget, goal); sym_prepare_nego()
2050 struct scsi_target *starget = tp->starget; sym_announce_transfer_rate() local
2052 if (tp->tprint.period != spi_period(starget) || sym_announce_transfer_rate()
2053 tp->tprint.offset != spi_offset(starget) || sym_announce_transfer_rate()
2054 tp->tprint.width != spi_width(starget) || sym_announce_transfer_rate()
2055 tp->tprint.iu != spi_iu(starget) || sym_announce_transfer_rate()
2056 tp->tprint.dt != spi_dt(starget) || sym_announce_transfer_rate()
2057 tp->tprint.qas != spi_qas(starget) || sym_announce_transfer_rate()
2059 tp->tprint.period = spi_period(starget); sym_announce_transfer_rate()
2060 tp->tprint.offset = spi_offset(starget); sym_announce_transfer_rate()
2061 tp->tprint.width = spi_width(starget); sym_announce_transfer_rate()
2062 tp->tprint.iu = spi_iu(starget); sym_announce_transfer_rate()
2063 tp->tprint.dt = spi_dt(starget); sym_announce_transfer_rate()
2064 tp->tprint.qas = spi_qas(starget); sym_announce_transfer_rate()
2067 spi_display_xfer_agreement(starget); sym_announce_transfer_rate()
2078 struct scsi_target *starget = tp->starget; sym_setwide() local
2088 spi_offset(starget) = 0; sym_setwide()
2089 spi_period(starget) = 0; sym_setwide()
2090 spi_width(starget) = wide; sym_setwide()
2091 spi_iu(starget) = 0; sym_setwide()
2092 spi_dt(starget) = 0; sym_setwide()
2093 spi_qas(starget) = 0; sym_setwide()
2108 struct scsi_target *starget = tp->starget; sym_setsync() local
2119 spi_period(starget) = per; sym_setsync()
2120 spi_offset(starget) = ofs; sym_setsync()
2121 spi_iu(starget) = spi_dt(starget) = spi_qas(starget) = 0; sym_setsync()
2141 struct scsi_target *starget = tp->starget; sym_setpprot() local
2149 spi_width(starget) = tp->tgoal.width = wide; sym_setpprot()
2150 spi_period(starget) = tp->tgoal.period = per; sym_setpprot()
2151 spi_offset(starget) = tp->tgoal.offset = ofs; sym_setpprot()
2152 spi_iu(starget) = tp->tgoal.iu = !!(opts & PPR_OPT_IU); sym_setpprot()
2153 spi_dt(starget) = tp->tgoal.dt = !!(opts & PPR_OPT_DT); sym_setpprot()
2154 spi_qas(starget) = tp->tgoal.qas = !!(opts & PPR_OPT_QAS); sym_setpprot()
3286 struct scsi_target *starget; sym_sir_task_recovery() local
3535 starget = tp->starget; sym_sir_task_recovery()
3557 spi_period(starget) = 0; sym_sir_task_recovery()
3558 spi_offset(starget) = 0; sym_sir_task_recovery()
3559 spi_width(starget) = 0; sym_sir_task_recovery()
3560 spi_iu(starget) = 0; sym_sir_task_recovery()
3561 spi_dt(starget) = 0; sym_sir_task_recovery()
3562 spi_qas(starget) = 0; sym_sir_task_recovery()
3592 starget_printk(KERN_NOTICE, starget, sym_sir_task_recovery()
3601 dev_info(&tp->starget->dev, "control msgout:"); sym_sir_task_recovery()
H A Dsym_hipd.h446 struct scsi_target *starget; member in struct:sym_tcb
/linux-4.4.14/drivers/scsi/bfa/
H A Dbfad_attr.c29 bfad_im_get_starget_port_id(struct scsi_target *starget) bfad_im_get_starget_port_id() argument
38 shost = dev_to_shost(starget->dev.parent); bfad_im_get_starget_port_id()
43 itnim = bfad_get_itnim(im_port, starget->id); bfad_im_get_starget_port_id()
47 fc_starget_port_id(starget) = fc_id; bfad_im_get_starget_port_id()
55 bfad_im_get_starget_node_name(struct scsi_target *starget) bfad_im_get_starget_node_name() argument
64 shost = dev_to_shost(starget->dev.parent); bfad_im_get_starget_node_name()
69 itnim = bfad_get_itnim(im_port, starget->id); bfad_im_get_starget_node_name()
73 fc_starget_node_name(starget) = cpu_to_be64(node_name); bfad_im_get_starget_node_name()
81 bfad_im_get_starget_port_name(struct scsi_target *starget) bfad_im_get_starget_port_name() argument
90 shost = dev_to_shost(starget->dev.parent); bfad_im_get_starget_port_name()
95 itnim = bfad_get_itnim(im_port, starget->id); bfad_im_get_starget_port_name()
99 fc_starget_port_name(starget) = cpu_to_be64(port_name); bfad_im_get_starget_port_name()
/linux-4.4.14/drivers/scsi/ibmvscsi/
H A Dibmvfc.c906 * @starget: scsi target struct
911 static struct ibmvfc_target *__ibmvfc_get_target(struct scsi_target *starget) __ibmvfc_get_target() argument
913 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); __ibmvfc_get_target()
918 if (tgt->target_id == starget->id) { __ibmvfc_get_target()
927 * @starget: scsi target struct
932 static struct ibmvfc_target *ibmvfc_get_target(struct scsi_target *starget) ibmvfc_get_target() argument
934 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ibmvfc_get_target()
939 tgt = __ibmvfc_get_target(starget); ibmvfc_get_target()
1056 * @starget: scsi target struct
1061 static void ibmvfc_get_starget_node_name(struct scsi_target *starget) ibmvfc_get_starget_node_name() argument
1063 struct ibmvfc_target *tgt = ibmvfc_get_target(starget); ibmvfc_get_starget_node_name()
1064 fc_starget_port_name(starget) = tgt ? tgt->ids.node_name : 0; ibmvfc_get_starget_node_name()
1071 * @starget: scsi target struct
1076 static void ibmvfc_get_starget_port_name(struct scsi_target *starget) ibmvfc_get_starget_port_name() argument
1078 struct ibmvfc_target *tgt = ibmvfc_get_target(starget); ibmvfc_get_starget_port_name()
1079 fc_starget_port_name(starget) = tgt ? tgt->ids.port_name : 0; ibmvfc_get_starget_port_name()
1086 * @starget: scsi target struct
1091 static void ibmvfc_get_starget_port_id(struct scsi_target *starget) ibmvfc_get_starget_port_id() argument
1093 struct ibmvfc_target *tgt = ibmvfc_get_target(starget); ibmvfc_get_starget_port_id()
1094 fc_starget_port_id(starget) = tgt ? tgt->scsi_id : -1; ibmvfc_get_starget_port_id()
2051 * @device: device to match (starget)
2054 * 1 if event matches starget / 0 if event does not match starget
2081 * @device: device to match (starget or sdev)
2147 struct scsi_target *starget = scsi_target(sdev); ibmvfc_cancel_all() local
2148 struct fc_rport *rport = starget_to_rport(starget); ibmvfc_cancel_all()
2191 tmf->my_cancel_key = cpu_to_be32((unsigned long)starget->hostdata); ibmvfc_cancel_all()
2489 struct scsi_target *starget = scsi_target(sdev); ibmvfc_eh_target_reset_handler() local
2499 starget_for_each_device(starget, &cancel_rc, ibmvfc_dev_cancel_all_reset); ibmvfc_eh_target_reset_handler()
2502 starget_for_each_device(starget, &cancel_rc, ibmvfc_dev_cancel_all_noreset); ibmvfc_eh_target_reset_handler()
2505 rc = ibmvfc_wait_for_ops(vhost, starget, ibmvfc_match_target); ibmvfc_eh_target_reset_handler()
2851 * @starget: struct scsi_target
2859 static int ibmvfc_target_alloc(struct scsi_target *starget) ibmvfc_target_alloc() argument
2861 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ibmvfc_target_alloc()
2866 starget->hostdata = (void *)(unsigned long)vhost->task_set++; ibmvfc_target_alloc()
/linux-4.4.14/drivers/scsi/qla2xxx/
H A Dqla_attr.c1711 qla2x00_get_starget_node_name(struct scsi_target *starget) qla2x00_get_starget_node_name() argument
1713 struct Scsi_Host *host = dev_to_shost(starget->dev.parent); qla2x00_get_starget_node_name()
1720 starget->id == fcport->rport->scsi_target_id) { qla2x00_get_starget_node_name()
1726 fc_starget_node_name(starget) = node_name; qla2x00_get_starget_node_name()
1730 qla2x00_get_starget_port_name(struct scsi_target *starget) qla2x00_get_starget_port_name() argument
1732 struct Scsi_Host *host = dev_to_shost(starget->dev.parent); qla2x00_get_starget_port_name()
1739 starget->id == fcport->rport->scsi_target_id) { qla2x00_get_starget_port_name()
1745 fc_starget_port_name(starget) = port_name; qla2x00_get_starget_port_name()
1749 qla2x00_get_starget_port_id(struct scsi_target *starget) qla2x00_get_starget_port_id() argument
1751 struct Scsi_Host *host = dev_to_shost(starget->dev.parent); qla2x00_get_starget_port_id()
1758 starget->id == fcport->rport->scsi_target_id) { qla2x00_get_starget_port_id()
1765 fc_starget_port_id(starget) = port_id; qla2x00_get_starget_port_id()
/linux-4.4.14/drivers/usb/storage/
H A Dscsiglue.c295 static int target_alloc(struct scsi_target *starget) target_alloc() argument
297 struct us_data *us = host_to_us(dev_to_shost(starget->dev.parent)); target_alloc()
305 starget->no_report_luns = 1; target_alloc()
317 starget->pdt_1f_for_no_lun = 1; target_alloc()
H A Duas.c760 static int uas_target_alloc(struct scsi_target *starget) uas_target_alloc() argument
763 dev_to_shost(starget->dev.parent)->hostdata; uas_target_alloc()
766 starget->no_report_luns = 1; uas_target_alloc()
/linux-4.4.14/drivers/scsi/libsas/
H A Dsas_scsi_host.c852 int sas_target_alloc(struct scsi_target *starget) sas_target_alloc() argument
854 struct sas_rphy *rphy = dev_to_rphy(starget->dev.parent); sas_target_alloc()
861 starget->hostdata = found_dev; sas_target_alloc()
953 void sas_target_destroy(struct scsi_target *starget) sas_target_destroy() argument
955 struct domain_device *found_dev = starget->hostdata; sas_target_destroy()
960 starget->hostdata = NULL; sas_target_destroy()
/linux-4.4.14/drivers/scsi/lpfc/
H A Dlpfc_attr.c5531 * @starget: kernel scsi target pointer.
5538 lpfc_get_node_by_target(struct scsi_target *starget) lpfc_get_node_by_target() argument
5540 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); lpfc_get_node_by_target()
5549 starget->id == ndlp->nlp_sid) { lpfc_get_node_by_target()
5560 * @starget: kernel scsi target pointer.
5563 lpfc_get_starget_port_id(struct scsi_target *starget) lpfc_get_starget_port_id() argument
5565 struct lpfc_nodelist *ndlp = lpfc_get_node_by_target(starget); lpfc_get_starget_port_id()
5567 fc_starget_port_id(starget) = ndlp ? ndlp->nlp_DID : -1; lpfc_get_starget_port_id()
5572 * @starget: kernel scsi target pointer.
5577 lpfc_get_starget_node_name(struct scsi_target *starget) lpfc_get_starget_node_name() argument
5579 struct lpfc_nodelist *ndlp = lpfc_get_node_by_target(starget); lpfc_get_starget_node_name()
5581 fc_starget_node_name(starget) = lpfc_get_starget_node_name()
5587 * @starget: kernel scsi target pointer.
5592 lpfc_get_starget_port_name(struct scsi_target *starget) lpfc_get_starget_port_name() argument
5594 struct lpfc_nodelist *ndlp = lpfc_get_node_by_target(starget); lpfc_get_starget_port_name()
5596 fc_starget_port_name(starget) = lpfc_get_starget_port_name()

Completed in 2201 milliseconds