Lines Matching refs:devip
912 static void clear_luns_changed_on_target(struct sdebug_dev_info *devip) in clear_luns_changed_on_target() argument
920 if ((devip->sdbg_host == dp->sdbg_host) && in clear_luns_changed_on_target()
921 (devip->target == dp->target)) in clear_luns_changed_on_target()
928 static int make_ua(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in make_ua() argument
932 k = find_first_bit(devip->uas_bm, SDEBUG_NUM_UAS); in make_ua()
985 clear_luns_changed_on_target(devip); in make_ua()
998 clear_bit(k, devip->uas_bm); in make_ua()
1395 static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_inquiry() argument
1411 else if (sdebug_no_lun_0 && (devip->lun == SDEBUG_LUN_0_VAL)) in resp_inquiry()
1423 int host_no = devip->sdbg_host->shost->host_no; in resp_inquiry()
1426 (devip->channel & 0x7f); in resp_inquiry()
1430 (devip->target * 1000) + devip->lun); in resp_inquiry()
1432 (devip->target * 1000) - 3; in resp_inquiry()
1461 &devip->lu_name); in resp_inquiry()
1550 struct sdebug_dev_info *devip) in resp_requests() argument
1611 struct sdebug_dev_info *devip) in resp_start_stop() argument
1623 changing = atomic_read(&devip->stopped) == !stop; in resp_start_stop()
1624 atomic_xchg(&devip->stopped, stop); in resp_start_stop()
1644 struct sdebug_dev_info *devip) in resp_readcap() argument
1663 struct sdebug_dev_info *devip) in resp_readcap16() argument
1702 struct sdebug_dev_info *devip) in resp_report_tgtpgs() argument
1706 int host_no = devip->sdbg_host->shost->host_no; in resp_report_tgtpgs()
1723 (devip->channel & 0x7f); in resp_report_tgtpgs()
1725 (devip->channel & 0x7f) + 0x80; in resp_report_tgtpgs()
1778 struct sdebug_dev_info *devip) in resp_rsup_opcodes() argument
1929 struct sdebug_dev_info *devip) in resp_rsup_tmfs() argument
2118 struct sdebug_dev_info *devip) in resp_mode_sense() argument
2146 target_dev_id = ((devip->sdbg_host->shost->host_no + 1) * 2000) + in resp_mode_sense()
2147 (devip->target * 1000) - 3; in resp_mode_sense()
2278 struct sdebug_dev_info *devip) in resp_mode_select() argument
2351 set_bit(SDEBUG_UA_MODE_CHANGED, devip->uas_bm); in resp_mode_select()
2381 struct sdebug_dev_info *devip) in resp_log_sense() argument
2659 static int resp_read_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_read_dt0() argument
2973 static int resp_write_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_write_dt0() argument
3099 struct sdebug_dev_info *devip) in resp_write_scat() argument
3313 struct sdebug_dev_info *devip) in resp_write_same_10() argument
3338 struct sdebug_dev_info *devip) in resp_write_same_16() argument
3369 struct sdebug_dev_info *devip) in resp_write_buffer() argument
3380 set_bit(SDEBUG_UA_BUS_RESET, devip->uas_bm); in resp_write_buffer()
3381 set_bit(SDEBUG_UA_MICROCODE_CHANGED, devip->uas_bm); in resp_write_buffer()
3384 set_bit(SDEBUG_UA_MICROCODE_CHANGED_WO_RESET, devip->uas_bm); in resp_write_buffer()
3389 &devip->sdbg_host->dev_info_list, in resp_write_buffer()
3393 if (devip != dp) in resp_write_buffer()
3401 &devip->sdbg_host->dev_info_list, in resp_write_buffer()
3415 struct sdebug_dev_info *devip) in resp_comp_write() argument
3496 static int resp_unmap(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_unmap() argument
3555 struct sdebug_dev_info *devip) in resp_get_lba_status() argument
3595 struct sdebug_dev_info *devip) in resp_sync_cache() argument
3631 struct sdebug_dev_info *devip) in resp_report_luns() argument
3647 clear_luns_changed_on_target(devip); in resp_report_luns()
3722 unsigned int num, struct sdebug_dev_info *devip) in resp_xdwriteread() argument
3758 struct sdebug_dev_info *devip) in resp_xdwriteread_10() argument
3770 errsts = resp_read_dt0(scp, devip); in resp_xdwriteread_10()
3774 errsts = resp_write_dt0(scp, devip); in resp_xdwriteread_10()
3780 return resp_xdwriteread(scp, lba, num, devip); in resp_xdwriteread_10()
3804 struct sdebug_dev_info *devip; in sdebug_q_cmd_complete() local
3829 devip = (struct sdebug_dev_info *)scp->device->hostdata; in sdebug_q_cmd_complete()
3830 if (likely(devip)) in sdebug_q_cmd_complete()
3831 atomic_dec(&devip->num_in_q); in sdebug_q_cmd_complete()
3891 struct sdebug_dev_info *devip; in sdebug_device_create() local
3893 devip = kzalloc(sizeof(*devip), flags); in sdebug_device_create()
3894 if (devip) { in sdebug_device_create()
3896 uuid_gen(&devip->lu_name); in sdebug_device_create()
3899 devip->lu_name = shared_uuid; in sdebug_device_create()
3903 devip->lu_name = shared_uuid; in sdebug_device_create()
3906 devip->sdbg_host = sdbg_host; in sdebug_device_create()
3907 list_add_tail(&devip->dev_list, &sdbg_host->dev_info_list); in sdebug_device_create()
3909 return devip; in sdebug_device_create()
3916 struct sdebug_dev_info *devip; in find_build_dev_info() local
3923 list_for_each_entry(devip, &sdbg_host->dev_info_list, dev_list) { in find_build_dev_info()
3924 if ((devip->used) && (devip->channel == sdev->channel) && in find_build_dev_info()
3925 (devip->target == sdev->id) && in find_build_dev_info()
3926 (devip->lun == sdev->lun)) in find_build_dev_info()
3927 return devip; in find_build_dev_info()
3929 if ((!devip->used) && (!open_devip)) in find_build_dev_info()
3930 open_devip = devip; in find_build_dev_info()
3962 struct sdebug_dev_info *devip = in scsi_debug_slave_configure() local
3970 if (devip == NULL) { in scsi_debug_slave_configure()
3971 devip = find_build_dev_info(sdp); in scsi_debug_slave_configure()
3972 if (devip == NULL) in scsi_debug_slave_configure()
3975 sdp->hostdata = devip; in scsi_debug_slave_configure()
3985 struct sdebug_dev_info *devip = in scsi_debug_slave_destroy() local
3991 if (devip) { in scsi_debug_slave_destroy()
3993 devip->used = false; in scsi_debug_slave_destroy()
4018 struct sdebug_dev_info *devip; in stop_queued_cmnd() local
4033 devip = (struct sdebug_dev_info *) in stop_queued_cmnd()
4035 if (devip) in stop_queued_cmnd()
4036 atomic_dec(&devip->num_in_q); in stop_queued_cmnd()
4063 struct sdebug_dev_info *devip; in stop_all_queued() local
4073 devip = (struct sdebug_dev_info *) in stop_all_queued()
4075 if (devip) in stop_all_queued()
4076 atomic_dec(&devip->num_in_q); in stop_all_queued()
4130 struct sdebug_dev_info *devip = in scsi_debug_device_reset() local
4135 if (devip) in scsi_debug_device_reset()
4136 set_bit(SDEBUG_UA_POR, devip->uas_bm); in scsi_debug_device_reset()
4144 struct sdebug_dev_info *devip; in scsi_debug_target_reset() local
4162 list_for_each_entry(devip, in scsi_debug_target_reset()
4165 if (devip->target == sdp->id) { in scsi_debug_target_reset()
4166 set_bit(SDEBUG_UA_BUS_RESET, devip->uas_bm); in scsi_debug_target_reset()
4180 struct sdebug_dev_info *devip; in scsi_debug_bus_reset() local
4195 list_for_each_entry(devip, in scsi_debug_bus_reset()
4198 set_bit(SDEBUG_UA_BUS_RESET, devip->uas_bm); in scsi_debug_bus_reset()
4213 struct sdebug_dev_info *devip; in scsi_debug_host_reset() local
4221 list_for_each_entry(devip, &sdbg_host->dev_info_list, in scsi_debug_host_reset()
4223 set_bit(SDEBUG_UA_BUS_RESET, devip->uas_bm); in scsi_debug_host_reset()
4343 static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, in schedule_resp() argument
4356 if (unlikely(devip == NULL)) { in schedule_resp()
4373 num_in_q = atomic_read(&devip->num_in_q); in schedule_resp()
4413 atomic_inc(&devip->num_in_q); in schedule_resp()
4427 cmnd->result = pfp != NULL ? pfp(cmnd, devip) : 0; in schedule_resp()
4491 cmnd->result = pfp != NULL ? pfp(cmnd, devip) : 0; in schedule_resp()
5626 struct sdebug_dev_info *devip; in sdebug_change_qdepth() local
5629 devip = (struct sdebug_dev_info *)sdev->hostdata; in sdebug_change_qdepth()
5630 if (NULL == devip) { in sdebug_change_qdepth()
5634 num_in_q = atomic_read(&devip->num_in_q); in sdebug_change_qdepth()
5678 struct sdebug_dev_info *devip; in scsi_debug_queuecommand() local
5717 devip = (struct sdebug_dev_info *)sdp->hostdata; in scsi_debug_queuecommand()
5718 if (unlikely(!devip)) { in scsi_debug_queuecommand()
5719 devip = find_build_dev_info(sdp); in scsi_debug_queuecommand()
5720 if (NULL == devip) in scsi_debug_queuecommand()
5781 find_first_bit(devip->uas_bm, in scsi_debug_queuecommand()
5783 errsts = make_ua(scp, devip); in scsi_debug_queuecommand()
5787 if (unlikely((F_M_ACCESS & flags) && atomic_read(&devip->stopped))) { in scsi_debug_queuecommand()
5809 return schedule_resp(scp, devip, errsts, pfp, 0, 0); in scsi_debug_queuecommand()
5822 return schedule_resp(scp, devip, errsts, pfp, jdelay, 0); in scsi_debug_queuecommand()
5824 return schedule_resp(scp, devip, errsts, pfp, sdebug_jdelay, in scsi_debug_queuecommand()
5827 return schedule_resp(scp, devip, check_condition_result, NULL, 0, 0); in scsi_debug_queuecommand()