• Home
  • Raw
  • Download

Lines Matching refs:sdev

562 	struct scsi_device *sdev = cmd->device;  in scsi_finish_command()  local
563 struct scsi_target *starget = scsi_target(sdev); in scsi_finish_command()
564 struct Scsi_Host *shost = sdev->host; in scsi_finish_command()
568 scsi_device_unbusy(sdev); in scsi_finish_command()
578 if (atomic_read(&sdev->device_blocked)) in scsi_finish_command()
579 atomic_set(&sdev->device_blocked, 0); in scsi_finish_command()
588 SCSI_LOG_MLCOMPLETE(4, sdev_printk(KERN_INFO, sdev, in scsi_finish_command()
617 int scsi_change_queue_depth(struct scsi_device *sdev, int depth) in scsi_change_queue_depth() argument
620 sdev->queue_depth = depth; in scsi_change_queue_depth()
624 return sdev->queue_depth; in scsi_change_queue_depth()
647 int scsi_track_queue_full(struct scsi_device *sdev, int depth) in scsi_track_queue_full() argument
655 if ((jiffies >> 4) == (sdev->last_queue_full_time >> 4)) in scsi_track_queue_full()
658 sdev->last_queue_full_time = jiffies; in scsi_track_queue_full()
659 if (sdev->last_queue_full_depth != depth) { in scsi_track_queue_full()
660 sdev->last_queue_full_count = 1; in scsi_track_queue_full()
661 sdev->last_queue_full_depth = depth; in scsi_track_queue_full()
663 sdev->last_queue_full_count++; in scsi_track_queue_full()
666 if (sdev->last_queue_full_count <= 10) in scsi_track_queue_full()
669 return scsi_change_queue_depth(sdev, depth); in scsi_track_queue_full()
685 static int scsi_vpd_inquiry(struct scsi_device *sdev, unsigned char *buffer, in scsi_vpd_inquiry() argument
705 result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, in scsi_vpd_inquiry()
731 int scsi_get_vpd_page(struct scsi_device *sdev, u8 page, unsigned char *buf, in scsi_get_vpd_page() argument
736 if (sdev->skip_vpd_pages) in scsi_get_vpd_page()
740 result = scsi_vpd_inquiry(sdev, buf, 0, buf_len); in scsi_get_vpd_page()
759 result = scsi_vpd_inquiry(sdev, buf, page, buf_len); in scsi_get_vpd_page()
779 void scsi_attach_vpd(struct scsi_device *sdev) in scsi_attach_vpd() argument
787 if (!scsi_device_supports_vpd(sdev)) in scsi_attach_vpd()
796 result = scsi_vpd_inquiry(sdev, vpd_buf, 0, vpd_len); in scsi_attach_vpd()
822 result = scsi_vpd_inquiry(sdev, vpd_buf, 0x80, vpd_len); in scsi_attach_vpd()
832 mutex_lock(&sdev->inquiry_mutex); in scsi_attach_vpd()
833 orig_vpd_buf = sdev->vpd_pg80; in scsi_attach_vpd()
834 sdev->vpd_pg80_len = result; in scsi_attach_vpd()
835 rcu_assign_pointer(sdev->vpd_pg80, vpd_buf); in scsi_attach_vpd()
836 mutex_unlock(&sdev->inquiry_mutex); in scsi_attach_vpd()
851 result = scsi_vpd_inquiry(sdev, vpd_buf, 0x83, vpd_len); in scsi_attach_vpd()
861 mutex_lock(&sdev->inquiry_mutex); in scsi_attach_vpd()
862 orig_vpd_buf = sdev->vpd_pg83; in scsi_attach_vpd()
863 sdev->vpd_pg83_len = result; in scsi_attach_vpd()
864 rcu_assign_pointer(sdev->vpd_pg83, vpd_buf); in scsi_attach_vpd()
865 mutex_unlock(&sdev->inquiry_mutex); in scsi_attach_vpd()
883 int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, in scsi_report_opcode() argument
890 if (sdev->no_report_opcodes || sdev->scsi_level < SCSI_SPC_3) in scsi_report_opcode()
901 result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, len, in scsi_report_opcode()
927 int scsi_device_get(struct scsi_device *sdev) in scsi_device_get() argument
929 if (sdev->sdev_state == SDEV_DEL || sdev->sdev_state == SDEV_CANCEL) in scsi_device_get()
931 if (!get_device(&sdev->sdev_gendev)) in scsi_device_get()
933 if (!try_module_get(sdev->host->hostt->module)) in scsi_device_get()
938 put_device(&sdev->sdev_gendev); in scsi_device_get()
952 void scsi_device_put(struct scsi_device *sdev) in scsi_device_put() argument
954 module_put(sdev->host->hostt->module); in scsi_device_put()
955 put_device(&sdev->sdev_gendev); in scsi_device_put()
998 struct scsi_device *sdev; in starget_for_each_device() local
1000 shost_for_each_device(sdev, shost) { in starget_for_each_device()
1001 if ((sdev->channel == starget->channel) && in starget_for_each_device()
1002 (sdev->id == starget->id)) in starget_for_each_device()
1003 fn(sdev, data); in starget_for_each_device()
1026 struct scsi_device *sdev; in __starget_for_each_device() local
1028 __shost_for_each_device(sdev, shost) { in __starget_for_each_device()
1029 if ((sdev->channel == starget->channel) && in __starget_for_each_device()
1030 (sdev->id == starget->id)) in __starget_for_each_device()
1031 fn(sdev, data); in __starget_for_each_device()
1054 struct scsi_device *sdev; in __scsi_device_lookup_by_target() local
1056 list_for_each_entry(sdev, &starget->devices, same_target_siblings) { in __scsi_device_lookup_by_target()
1057 if (sdev->sdev_state == SDEV_DEL) in __scsi_device_lookup_by_target()
1059 if (sdev->lun ==lun) in __scsi_device_lookup_by_target()
1060 return sdev; in __scsi_device_lookup_by_target()
1079 struct scsi_device *sdev; in scsi_device_lookup_by_target() local
1084 sdev = __scsi_device_lookup_by_target(starget, lun); in scsi_device_lookup_by_target()
1085 if (sdev && scsi_device_get(sdev)) in scsi_device_lookup_by_target()
1086 sdev = NULL; in scsi_device_lookup_by_target()
1089 return sdev; in scsi_device_lookup_by_target()
1112 struct scsi_device *sdev; in __scsi_device_lookup() local
1114 list_for_each_entry(sdev, &shost->__devices, siblings) { in __scsi_device_lookup()
1115 if (sdev->channel == channel && sdev->id == id && in __scsi_device_lookup()
1116 sdev->lun ==lun) in __scsi_device_lookup()
1117 return sdev; in __scsi_device_lookup()
1138 struct scsi_device *sdev; in scsi_device_lookup() local
1142 sdev = __scsi_device_lookup(shost, channel, id, lun); in scsi_device_lookup()
1143 if (sdev && scsi_device_get(sdev)) in scsi_device_lookup()
1144 sdev = NULL; in scsi_device_lookup()
1147 return sdev; in scsi_device_lookup()